You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Daniel Uribe (JIRA)" <ji...@codehaus.org> on 2008/11/07 17:40:14 UTC

[jira] Created: (MRESOURCES-77) Filters for copy-resources goal in plugin configuration section are ignored

Filters for copy-resources goal in plugin configuration section are ignored
---------------------------------------------------------------------------

                 Key: MRESOURCES-77
                 URL: http://jira.codehaus.org/browse/MRESOURCES-77
             Project: Maven 2.x Resources Plugin
          Issue Type: Bug
    Affects Versions: 2.3
            Reporter: Daniel Uribe


I need to have a project where I can create multiple versions of resource files using different filters, I am trying to use the copy-resources goal for this purpose by making it part of the generate-resource phase and specifying the filters and resources under the plugin section of the POM.

<plugins>
	<plugin>
		<artifactId>maven-resources-plugin</artifactId>
		<executions>
			<execution>
				<id>config-a</id>
				<phase>generate-resources</phase>
				<goals>
					<goal>copy-resources</goal>
				</goals>
				<configuration>
					<outputDirectory>
						${basedir}/target/generated-resources/a
					</outputDirectory>
					<filters>
						<filter>a.properties</filter>
					</filters>
					<resources>
						<resource>
							<directory>etc/build</directory>
							<filtering>true</filtering>
							<includes>
								<include>jndi.properties</include>
							</includes>
						</resource>
					</resources>
				</configuration>
			</execution>
			<execution>
				<id>config-b</id>
				<phase>generate-resources</phase>
				<goals>
					<goal>copy-resources</goal>
				</goals>
				<configuration>
					<outputDirectory>
						${basedir}/target/generated-resources/b
					</outputDirectory>
					<filters>
						<filter>b.properties</filter>
					</filters>
					<resources>
						<resource>
							<directory>etc/build</directory>
							<filtering>true</filtering>
							<includes>
								<include>jndi.properties</include>
							</includes>
						</resource>
					</resources>
				</configuration>
			</execution>
		</executions>
	</plugin>
	<!-- Other plugin entries -->
</plugins>

After doing some debugging, the problem seems to be caused by a combination of things:

- The CopyResourcesMojo doesn't define its own filters field, so it inherits the configuration from the ResourcesMojo. That configuration specifies that it uses ${project.build.filters} by default. This is part of the plugin.xml in the repository as
      <filters implementation="java.util.List">${project.build.filters}</filters>
- When the merging of the plugin.xml configuration from the repository with the configuration from the POM is done, it includes the filters that were specified in the POM, but also includes the default value and implementation attribute. Hence, when the plugin fields are populated (in DefaultPluginManager.populatePluginFields), it gets the value ${project.build.filters} instead of using the <filter> children from the POM configuration.

I am not really sure what could be a good solution. Removing the default of ${project.build.filters} for the CopyResourcesMojo would make this scenario work, but it would make the filters required when the plugin is declared in the plugins section.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MRESOURCES-77) Filters for copy-resources goal in plugin configuration section are ignored

Posted by "Lars Beuster (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MRESOURCES-77?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=156767#action_156767 ] 

Lars Beuster commented on MRESOURCES-77:
----------------------------------------

I have the same problem: nested filter elements are ignored by copy-resources. 

A test-project comes as an attachment.

Thanks 
Lars

> Filters for copy-resources goal in plugin configuration section are ignored
> ---------------------------------------------------------------------------
>
>                 Key: MRESOURCES-77
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-77
>             Project: Maven 2.x Resources Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3
>            Reporter: Daniel Uribe
>
> I need to have a project where I can create multiple versions of resource files using different filters, I am trying to use the copy-resources goal for this purpose by making it part of the generate-resource phase and specifying the filters and resources under the plugin section of the POM.
> <plugins>
> 	<plugin>
> 		<artifactId>maven-resources-plugin</artifactId>
> 		<executions>
> 			<execution>
> 				<id>config-a</id>
> 				<phase>generate-resources</phase>
> 				<goals>
> 					<goal>copy-resources</goal>
> 				</goals>
> 				<configuration>
> 					<outputDirectory>
> 						${basedir}/target/generated-resources/a
> 					</outputDirectory>
> 					<filters>
> 						<filter>a.properties</filter>
> 					</filters>
> 					<resources>
> 						<resource>
> 							<directory>etc/build</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>jndi.properties</include>
> 							</includes>
> 						</resource>
> 					</resources>
> 				</configuration>
> 			</execution>
> 			<execution>
> 				<id>config-b</id>
> 				<phase>generate-resources</phase>
> 				<goals>
> 					<goal>copy-resources</goal>
> 				</goals>
> 				<configuration>
> 					<outputDirectory>
> 						${basedir}/target/generated-resources/b
> 					</outputDirectory>
> 					<filters>
> 						<filter>b.properties</filter>
> 					</filters>
> 					<resources>
> 						<resource>
> 							<directory>etc/build</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>jndi.properties</include>
> 							</includes>
> 						</resource>
> 					</resources>
> 				</configuration>
> 			</execution>
> 		</executions>
> 	</plugin>
> 	<!-- Other plugin entries -->
> </plugins>
> After doing some debugging, the problem seems to be caused by a combination of things:
> - The CopyResourcesMojo doesn't define its own filters field, so it inherits the configuration from the ResourcesMojo. That configuration specifies that it uses ${project.build.filters} by default. This is part of the plugin.xml in the repository as
>       <filters implementation="java.util.List">${project.build.filters}</filters>
> - When the merging of the plugin.xml configuration from the repository with the configuration from the POM is done, it includes the filters that were specified in the POM, but also includes the default value and implementation attribute. Hence, when the plugin fields are populated (in DefaultPluginManager.populatePluginFields), it gets the value ${project.build.filters} instead of using the <filter> children from the POM configuration.
> I am not really sure what could be a good solution. Removing the default of ${project.build.filters} for the CopyResourcesMojo would make this scenario work, but it would make the filters required when the plugin is declared in the plugins section.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MRESOURCES-77) Filters for copy-resources goal in plugin configuration section are ignored

Posted by "Fabian Bauschulte (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MRESOURCES-77?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fabian Bauschulte updated MRESOURCES-77:
----------------------------------------

    Attachment: MRESOURCES-77.patch

> Filters for copy-resources goal in plugin configuration section are ignored
> ---------------------------------------------------------------------------
>
>                 Key: MRESOURCES-77
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-77
>             Project: Maven 2.x Resources Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3
>            Reporter: Daniel Uribe
>         Attachments: filter-test.zip, MRESOURCES-77.patch
>
>
> I need to have a project where I can create multiple versions of resource files using different filters, I am trying to use the copy-resources goal for this purpose by making it part of the generate-resource phase and specifying the filters and resources under the plugin section of the POM.
> <plugins>
> 	<plugin>
> 		<artifactId>maven-resources-plugin</artifactId>
> 		<executions>
> 			<execution>
> 				<id>config-a</id>
> 				<phase>generate-resources</phase>
> 				<goals>
> 					<goal>copy-resources</goal>
> 				</goals>
> 				<configuration>
> 					<outputDirectory>
> 						${basedir}/target/generated-resources/a
> 					</outputDirectory>
> 					<filters>
> 						<filter>a.properties</filter>
> 					</filters>
> 					<resources>
> 						<resource>
> 							<directory>etc/build</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>jndi.properties</include>
> 							</includes>
> 						</resource>
> 					</resources>
> 				</configuration>
> 			</execution>
> 			<execution>
> 				<id>config-b</id>
> 				<phase>generate-resources</phase>
> 				<goals>
> 					<goal>copy-resources</goal>
> 				</goals>
> 				<configuration>
> 					<outputDirectory>
> 						${basedir}/target/generated-resources/b
> 					</outputDirectory>
> 					<filters>
> 						<filter>b.properties</filter>
> 					</filters>
> 					<resources>
> 						<resource>
> 							<directory>etc/build</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>jndi.properties</include>
> 							</includes>
> 						</resource>
> 					</resources>
> 				</configuration>
> 			</execution>
> 		</executions>
> 	</plugin>
> 	<!-- Other plugin entries -->
> </plugins>
> After doing some debugging, the problem seems to be caused by a combination of things:
> - The CopyResourcesMojo doesn't define its own filters field, so it inherits the configuration from the ResourcesMojo. That configuration specifies that it uses ${project.build.filters} by default. This is part of the plugin.xml in the repository as
>       <filters implementation="java.util.List">${project.build.filters}</filters>
> - When the merging of the plugin.xml configuration from the repository with the configuration from the POM is done, it includes the filters that were specified in the POM, but also includes the default value and implementation attribute. Hence, when the plugin fields are populated (in DefaultPluginManager.populatePluginFields), it gets the value ${project.build.filters} instead of using the <filter> children from the POM configuration.
> I am not really sure what could be a good solution. Removing the default of ${project.build.filters} for the CopyResourcesMojo would make this scenario work, but it would make the filters required when the plugin is declared in the plugins section.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MRESOURCES-77) Filters for copy-resources goal in plugin configuration section are ignored

Posted by "David Matejcek (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MRESOURCES-77?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=158697#action_158697 ] 

David Matejcek commented on MRESOURCES-77:
------------------------------------------

This is blocker issue for me :-(

> Filters for copy-resources goal in plugin configuration section are ignored
> ---------------------------------------------------------------------------
>
>                 Key: MRESOURCES-77
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-77
>             Project: Maven 2.x Resources Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3
>            Reporter: Daniel Uribe
>         Attachments: filter-test.zip
>
>
> I need to have a project where I can create multiple versions of resource files using different filters, I am trying to use the copy-resources goal for this purpose by making it part of the generate-resource phase and specifying the filters and resources under the plugin section of the POM.
> <plugins>
> 	<plugin>
> 		<artifactId>maven-resources-plugin</artifactId>
> 		<executions>
> 			<execution>
> 				<id>config-a</id>
> 				<phase>generate-resources</phase>
> 				<goals>
> 					<goal>copy-resources</goal>
> 				</goals>
> 				<configuration>
> 					<outputDirectory>
> 						${basedir}/target/generated-resources/a
> 					</outputDirectory>
> 					<filters>
> 						<filter>a.properties</filter>
> 					</filters>
> 					<resources>
> 						<resource>
> 							<directory>etc/build</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>jndi.properties</include>
> 							</includes>
> 						</resource>
> 					</resources>
> 				</configuration>
> 			</execution>
> 			<execution>
> 				<id>config-b</id>
> 				<phase>generate-resources</phase>
> 				<goals>
> 					<goal>copy-resources</goal>
> 				</goals>
> 				<configuration>
> 					<outputDirectory>
> 						${basedir}/target/generated-resources/b
> 					</outputDirectory>
> 					<filters>
> 						<filter>b.properties</filter>
> 					</filters>
> 					<resources>
> 						<resource>
> 							<directory>etc/build</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>jndi.properties</include>
> 							</includes>
> 						</resource>
> 					</resources>
> 				</configuration>
> 			</execution>
> 		</executions>
> 	</plugin>
> 	<!-- Other plugin entries -->
> </plugins>
> After doing some debugging, the problem seems to be caused by a combination of things:
> - The CopyResourcesMojo doesn't define its own filters field, so it inherits the configuration from the ResourcesMojo. That configuration specifies that it uses ${project.build.filters} by default. This is part of the plugin.xml in the repository as
>       <filters implementation="java.util.List">${project.build.filters}</filters>
> - When the merging of the plugin.xml configuration from the repository with the configuration from the POM is done, it includes the filters that were specified in the POM, but also includes the default value and implementation attribute. Hence, when the plugin fields are populated (in DefaultPluginManager.populatePluginFields), it gets the value ${project.build.filters} instead of using the <filter> children from the POM configuration.
> I am not really sure what could be a good solution. Removing the default of ${project.build.filters} for the CopyResourcesMojo would make this scenario work, but it would make the filters required when the plugin is declared in the plugins section.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MRESOURCES-77) Filters for copy-resources goal in plugin configuration section are ignored

Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MRESOURCES-77?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=153528#action_153528 ] 

Olivier Lamy commented on MRESOURCES-77:
----------------------------------------

Can you provide a project test case ?
Thanks

> Filters for copy-resources goal in plugin configuration section are ignored
> ---------------------------------------------------------------------------
>
>                 Key: MRESOURCES-77
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-77
>             Project: Maven 2.x Resources Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3
>            Reporter: Daniel Uribe
>
> I need to have a project where I can create multiple versions of resource files using different filters, I am trying to use the copy-resources goal for this purpose by making it part of the generate-resource phase and specifying the filters and resources under the plugin section of the POM.
> <plugins>
> 	<plugin>
> 		<artifactId>maven-resources-plugin</artifactId>
> 		<executions>
> 			<execution>
> 				<id>config-a</id>
> 				<phase>generate-resources</phase>
> 				<goals>
> 					<goal>copy-resources</goal>
> 				</goals>
> 				<configuration>
> 					<outputDirectory>
> 						${basedir}/target/generated-resources/a
> 					</outputDirectory>
> 					<filters>
> 						<filter>a.properties</filter>
> 					</filters>
> 					<resources>
> 						<resource>
> 							<directory>etc/build</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>jndi.properties</include>
> 							</includes>
> 						</resource>
> 					</resources>
> 				</configuration>
> 			</execution>
> 			<execution>
> 				<id>config-b</id>
> 				<phase>generate-resources</phase>
> 				<goals>
> 					<goal>copy-resources</goal>
> 				</goals>
> 				<configuration>
> 					<outputDirectory>
> 						${basedir}/target/generated-resources/b
> 					</outputDirectory>
> 					<filters>
> 						<filter>b.properties</filter>
> 					</filters>
> 					<resources>
> 						<resource>
> 							<directory>etc/build</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>jndi.properties</include>
> 							</includes>
> 						</resource>
> 					</resources>
> 				</configuration>
> 			</execution>
> 		</executions>
> 	</plugin>
> 	<!-- Other plugin entries -->
> </plugins>
> After doing some debugging, the problem seems to be caused by a combination of things:
> - The CopyResourcesMojo doesn't define its own filters field, so it inherits the configuration from the ResourcesMojo. That configuration specifies that it uses ${project.build.filters} by default. This is part of the plugin.xml in the repository as
>       <filters implementation="java.util.List">${project.build.filters}</filters>
> - When the merging of the plugin.xml configuration from the repository with the configuration from the POM is done, it includes the filters that were specified in the POM, but also includes the default value and implementation attribute. Hence, when the plugin fields are populated (in DefaultPluginManager.populatePluginFields), it gets the value ${project.build.filters} instead of using the <filter> children from the POM configuration.
> I am not really sure what could be a good solution. Removing the default of ${project.build.filters} for the CopyResourcesMojo would make this scenario work, but it would make the filters required when the plugin is declared in the plugins section.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MRESOURCES-77) Filters for copy-resources goal in plugin configuration section are ignored

Posted by "Peter Janes (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MRESOURCES-77?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Janes updated MRESOURCES-77:
----------------------------------

    Attachment: MRESOURCES-77.patch

This is a new patch (with test cases, basically combining the configurations from src/it/filter and src/it/copy-resources-it) that doesn't remove the default filters in ResourcesMojo.  Any locally-configured filters will replace the POM's filters, otherwise they'll be inherited.

> Filters for copy-resources goal in plugin configuration section are ignored
> ---------------------------------------------------------------------------
>
>                 Key: MRESOURCES-77
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-77
>             Project: Maven 2.x Resources Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3
>            Reporter: Daniel Uribe
>         Attachments: filter-test.zip, MRESOURCES-77.patch, MRESOURCES-77.patch
>
>
> I need to have a project where I can create multiple versions of resource files using different filters, I am trying to use the copy-resources goal for this purpose by making it part of the generate-resource phase and specifying the filters and resources under the plugin section of the POM.
> <plugins>
> 	<plugin>
> 		<artifactId>maven-resources-plugin</artifactId>
> 		<executions>
> 			<execution>
> 				<id>config-a</id>
> 				<phase>generate-resources</phase>
> 				<goals>
> 					<goal>copy-resources</goal>
> 				</goals>
> 				<configuration>
> 					<outputDirectory>
> 						${basedir}/target/generated-resources/a
> 					</outputDirectory>
> 					<filters>
> 						<filter>a.properties</filter>
> 					</filters>
> 					<resources>
> 						<resource>
> 							<directory>etc/build</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>jndi.properties</include>
> 							</includes>
> 						</resource>
> 					</resources>
> 				</configuration>
> 			</execution>
> 			<execution>
> 				<id>config-b</id>
> 				<phase>generate-resources</phase>
> 				<goals>
> 					<goal>copy-resources</goal>
> 				</goals>
> 				<configuration>
> 					<outputDirectory>
> 						${basedir}/target/generated-resources/b
> 					</outputDirectory>
> 					<filters>
> 						<filter>b.properties</filter>
> 					</filters>
> 					<resources>
> 						<resource>
> 							<directory>etc/build</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>jndi.properties</include>
> 							</includes>
> 						</resource>
> 					</resources>
> 				</configuration>
> 			</execution>
> 		</executions>
> 	</plugin>
> 	<!-- Other plugin entries -->
> </plugins>
> After doing some debugging, the problem seems to be caused by a combination of things:
> - The CopyResourcesMojo doesn't define its own filters field, so it inherits the configuration from the ResourcesMojo. That configuration specifies that it uses ${project.build.filters} by default. This is part of the plugin.xml in the repository as
>       <filters implementation="java.util.List">${project.build.filters}</filters>
> - When the merging of the plugin.xml configuration from the repository with the configuration from the POM is done, it includes the filters that were specified in the POM, but also includes the default value and implementation attribute. Hence, when the plugin fields are populated (in DefaultPluginManager.populatePluginFields), it gets the value ${project.build.filters} instead of using the <filter> children from the POM configuration.
> I am not really sure what could be a good solution. Removing the default of ${project.build.filters} for the CopyResourcesMojo would make this scenario work, but it would make the filters required when the plugin is declared in the plugins section.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MRESOURCES-77) Filters for copy-resources goal in plugin configuration section are ignored

Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MRESOURCES-77?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Casey closed MRESOURCES-77.
--------------------------------

      Assignee: John Casey
    Resolution: Fixed

> Filters for copy-resources goal in plugin configuration section are ignored
> ---------------------------------------------------------------------------
>
>                 Key: MRESOURCES-77
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-77
>             Project: Maven 2.x Resources Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3
>            Reporter: Daniel Uribe
>            Assignee: John Casey
>             Fix For: 2.4
>
>         Attachments: filter-test.zip, MRESOURCES-77.patch, MRESOURCES-77.patch
>
>
> I need to have a project where I can create multiple versions of resource files using different filters, I am trying to use the copy-resources goal for this purpose by making it part of the generate-resource phase and specifying the filters and resources under the plugin section of the POM.
> <plugins>
> 	<plugin>
> 		<artifactId>maven-resources-plugin</artifactId>
> 		<executions>
> 			<execution>
> 				<id>config-a</id>
> 				<phase>generate-resources</phase>
> 				<goals>
> 					<goal>copy-resources</goal>
> 				</goals>
> 				<configuration>
> 					<outputDirectory>
> 						${basedir}/target/generated-resources/a
> 					</outputDirectory>
> 					<filters>
> 						<filter>a.properties</filter>
> 					</filters>
> 					<resources>
> 						<resource>
> 							<directory>etc/build</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>jndi.properties</include>
> 							</includes>
> 						</resource>
> 					</resources>
> 				</configuration>
> 			</execution>
> 			<execution>
> 				<id>config-b</id>
> 				<phase>generate-resources</phase>
> 				<goals>
> 					<goal>copy-resources</goal>
> 				</goals>
> 				<configuration>
> 					<outputDirectory>
> 						${basedir}/target/generated-resources/b
> 					</outputDirectory>
> 					<filters>
> 						<filter>b.properties</filter>
> 					</filters>
> 					<resources>
> 						<resource>
> 							<directory>etc/build</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>jndi.properties</include>
> 							</includes>
> 						</resource>
> 					</resources>
> 				</configuration>
> 			</execution>
> 		</executions>
> 	</plugin>
> 	<!-- Other plugin entries -->
> </plugins>
> After doing some debugging, the problem seems to be caused by a combination of things:
> - The CopyResourcesMojo doesn't define its own filters field, so it inherits the configuration from the ResourcesMojo. That configuration specifies that it uses ${project.build.filters} by default. This is part of the plugin.xml in the repository as
>       <filters implementation="java.util.List">${project.build.filters}</filters>
> - When the merging of the plugin.xml configuration from the repository with the configuration from the POM is done, it includes the filters that were specified in the POM, but also includes the default value and implementation attribute. Hence, when the plugin fields are populated (in DefaultPluginManager.populatePluginFields), it gets the value ${project.build.filters} instead of using the <filter> children from the POM configuration.
> I am not really sure what could be a good solution. Removing the default of ${project.build.filters} for the CopyResourcesMojo would make this scenario work, but it would make the filters required when the plugin is declared in the plugins section.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MRESOURCES-77) Filters for copy-resources goal in plugin configuration section are ignored

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MRESOURCES-77?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Herve Boutemy updated MRESOURCES-77:
------------------------------------

    Description: 
I need to have a project where I can create multiple versions of resource files using different filters, I am trying to use the copy-resources goal for this purpose by making it part of the generate-resource phase and specifying the filters and resources under the plugin section of the POM.

{code:xml}<plugins>
	<plugin>
		<artifactId>maven-resources-plugin</artifactId>
		<executions>
			<execution>
				<id>config-a</id>
				<phase>generate-resources</phase>
				<goals>
					<goal>copy-resources</goal>
				</goals>
				<configuration>
					<outputDirectory>
						${basedir}/target/generated-resources/a
					</outputDirectory>
					<filters>
						<filter>a.properties</filter>
					</filters>
					<resources>
						<resource>
							<directory>etc/build</directory>
							<filtering>true</filtering>
							<includes>
								<include>jndi.properties</include>
							</includes>
						</resource>
					</resources>
				</configuration>
			</execution>
			<execution>
				<id>config-b</id>
				<phase>generate-resources</phase>
				<goals>
					<goal>copy-resources</goal>
				</goals>
				<configuration>
					<outputDirectory>
						${basedir}/target/generated-resources/b
					</outputDirectory>
					<filters>
						<filter>b.properties</filter>
					</filters>
					<resources>
						<resource>
							<directory>etc/build</directory>
							<filtering>true</filtering>
							<includes>
								<include>jndi.properties</include>
							</includes>
						</resource>
					</resources>
				</configuration>
			</execution>
		</executions>
	</plugin>
	<!-- Other plugin entries -->
</plugins>{code}

After doing some debugging, the problem seems to be caused by a combination of things:

- The CopyResourcesMojo doesn't define its own filters field, so it inherits the configuration from the ResourcesMojo. That configuration specifies that it uses ${project.build.filters} by default. This is part of the plugin.xml in the repository as
      <filters implementation="java.util.List">${project.build.filters}</filters>
- When the merging of the plugin.xml configuration from the repository with the configuration from the POM is done, it includes the filters that were specified in the POM, but also includes the default value and implementation attribute. Hence, when the plugin fields are populated (in DefaultPluginManager.populatePluginFields), it gets the value ${project.build.filters} instead of using the <filter> children from the POM configuration.

I am not really sure what could be a good solution. Removing the default of ${project.build.filters} for the CopyResourcesMojo would make this scenario work, but it would make the filters required when the plugin is declared in the plugins section.

  was:
I need to have a project where I can create multiple versions of resource files using different filters, I am trying to use the copy-resources goal for this purpose by making it part of the generate-resource phase and specifying the filters and resources under the plugin section of the POM.

<plugins>
	<plugin>
		<artifactId>maven-resources-plugin</artifactId>
		<executions>
			<execution>
				<id>config-a</id>
				<phase>generate-resources</phase>
				<goals>
					<goal>copy-resources</goal>
				</goals>
				<configuration>
					<outputDirectory>
						${basedir}/target/generated-resources/a
					</outputDirectory>
					<filters>
						<filter>a.properties</filter>
					</filters>
					<resources>
						<resource>
							<directory>etc/build</directory>
							<filtering>true</filtering>
							<includes>
								<include>jndi.properties</include>
							</includes>
						</resource>
					</resources>
				</configuration>
			</execution>
			<execution>
				<id>config-b</id>
				<phase>generate-resources</phase>
				<goals>
					<goal>copy-resources</goal>
				</goals>
				<configuration>
					<outputDirectory>
						${basedir}/target/generated-resources/b
					</outputDirectory>
					<filters>
						<filter>b.properties</filter>
					</filters>
					<resources>
						<resource>
							<directory>etc/build</directory>
							<filtering>true</filtering>
							<includes>
								<include>jndi.properties</include>
							</includes>
						</resource>
					</resources>
				</configuration>
			</execution>
		</executions>
	</plugin>
	<!-- Other plugin entries -->
</plugins>

After doing some debugging, the problem seems to be caused by a combination of things:

- The CopyResourcesMojo doesn't define its own filters field, so it inherits the configuration from the ResourcesMojo. That configuration specifies that it uses ${project.build.filters} by default. This is part of the plugin.xml in the repository as
      <filters implementation="java.util.List">${project.build.filters}</filters>
- When the merging of the plugin.xml configuration from the repository with the configuration from the POM is done, it includes the filters that were specified in the POM, but also includes the default value and implementation attribute. Hence, when the plugin fields are populated (in DefaultPluginManager.populatePluginFields), it gets the value ${project.build.filters} instead of using the <filter> children from the POM configuration.

I am not really sure what could be a good solution. Removing the default of ${project.build.filters} for the CopyResourcesMojo would make this scenario work, but it would make the filters required when the plugin is declared in the plugins section.


> Filters for copy-resources goal in plugin configuration section are ignored
> ---------------------------------------------------------------------------
>
>                 Key: MRESOURCES-77
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-77
>             Project: Maven 2.x Resources Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3
>            Reporter: Daniel Uribe
>            Assignee: John Casey
>             Fix For: 2.4
>
>         Attachments: filter-test.zip, MRESOURCES-77.patch, MRESOURCES-77.patch
>
>
> I need to have a project where I can create multiple versions of resource files using different filters, I am trying to use the copy-resources goal for this purpose by making it part of the generate-resource phase and specifying the filters and resources under the plugin section of the POM.
> {code:xml}<plugins>
> 	<plugin>
> 		<artifactId>maven-resources-plugin</artifactId>
> 		<executions>
> 			<execution>
> 				<id>config-a</id>
> 				<phase>generate-resources</phase>
> 				<goals>
> 					<goal>copy-resources</goal>
> 				</goals>
> 				<configuration>
> 					<outputDirectory>
> 						${basedir}/target/generated-resources/a
> 					</outputDirectory>
> 					<filters>
> 						<filter>a.properties</filter>
> 					</filters>
> 					<resources>
> 						<resource>
> 							<directory>etc/build</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>jndi.properties</include>
> 							</includes>
> 						</resource>
> 					</resources>
> 				</configuration>
> 			</execution>
> 			<execution>
> 				<id>config-b</id>
> 				<phase>generate-resources</phase>
> 				<goals>
> 					<goal>copy-resources</goal>
> 				</goals>
> 				<configuration>
> 					<outputDirectory>
> 						${basedir}/target/generated-resources/b
> 					</outputDirectory>
> 					<filters>
> 						<filter>b.properties</filter>
> 					</filters>
> 					<resources>
> 						<resource>
> 							<directory>etc/build</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>jndi.properties</include>
> 							</includes>
> 						</resource>
> 					</resources>
> 				</configuration>
> 			</execution>
> 		</executions>
> 	</plugin>
> 	<!-- Other plugin entries -->
> </plugins>{code}
> After doing some debugging, the problem seems to be caused by a combination of things:
> - The CopyResourcesMojo doesn't define its own filters field, so it inherits the configuration from the ResourcesMojo. That configuration specifies that it uses ${project.build.filters} by default. This is part of the plugin.xml in the repository as
>       <filters implementation="java.util.List">${project.build.filters}</filters>
> - When the merging of the plugin.xml configuration from the repository with the configuration from the POM is done, it includes the filters that were specified in the POM, but also includes the default value and implementation attribute. Hence, when the plugin fields are populated (in DefaultPluginManager.populatePluginFields), it gets the value ${project.build.filters} instead of using the <filter> children from the POM configuration.
> I am not really sure what could be a good solution. Removing the default of ${project.build.filters} for the CopyResourcesMojo would make this scenario work, but it would make the filters required when the plugin is declared in the plugins section.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MRESOURCES-77) Filters for copy-resources goal in plugin configuration section are ignored

Posted by "Lars Beuster (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MRESOURCES-77?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lars Beuster updated MRESOURCES-77:
-----------------------------------

    Attachment: filter-test.zip

> Filters for copy-resources goal in plugin configuration section are ignored
> ---------------------------------------------------------------------------
>
>                 Key: MRESOURCES-77
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-77
>             Project: Maven 2.x Resources Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3
>            Reporter: Daniel Uribe
>         Attachments: filter-test.zip
>
>
> I need to have a project where I can create multiple versions of resource files using different filters, I am trying to use the copy-resources goal for this purpose by making it part of the generate-resource phase and specifying the filters and resources under the plugin section of the POM.
> <plugins>
> 	<plugin>
> 		<artifactId>maven-resources-plugin</artifactId>
> 		<executions>
> 			<execution>
> 				<id>config-a</id>
> 				<phase>generate-resources</phase>
> 				<goals>
> 					<goal>copy-resources</goal>
> 				</goals>
> 				<configuration>
> 					<outputDirectory>
> 						${basedir}/target/generated-resources/a
> 					</outputDirectory>
> 					<filters>
> 						<filter>a.properties</filter>
> 					</filters>
> 					<resources>
> 						<resource>
> 							<directory>etc/build</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>jndi.properties</include>
> 							</includes>
> 						</resource>
> 					</resources>
> 				</configuration>
> 			</execution>
> 			<execution>
> 				<id>config-b</id>
> 				<phase>generate-resources</phase>
> 				<goals>
> 					<goal>copy-resources</goal>
> 				</goals>
> 				<configuration>
> 					<outputDirectory>
> 						${basedir}/target/generated-resources/b
> 					</outputDirectory>
> 					<filters>
> 						<filter>b.properties</filter>
> 					</filters>
> 					<resources>
> 						<resource>
> 							<directory>etc/build</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>jndi.properties</include>
> 							</includes>
> 						</resource>
> 					</resources>
> 				</configuration>
> 			</execution>
> 		</executions>
> 	</plugin>
> 	<!-- Other plugin entries -->
> </plugins>
> After doing some debugging, the problem seems to be caused by a combination of things:
> - The CopyResourcesMojo doesn't define its own filters field, so it inherits the configuration from the ResourcesMojo. That configuration specifies that it uses ${project.build.filters} by default. This is part of the plugin.xml in the repository as
>       <filters implementation="java.util.List">${project.build.filters}</filters>
> - When the merging of the plugin.xml configuration from the repository with the configuration from the POM is done, it includes the filters that were specified in the POM, but also includes the default value and implementation attribute. Hence, when the plugin fields are populated (in DefaultPluginManager.populatePluginFields), it gets the value ${project.build.filters} instead of using the <filter> children from the POM configuration.
> I am not really sure what could be a good solution. Removing the default of ${project.build.filters} for the CopyResourcesMojo would make this scenario work, but it would make the filters required when the plugin is declared in the plugins section.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira