You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Mattox (JIRA)" <ji...@codehaus.org> on 2008/04/22 12:04:55 UTC

[jira] Created: (MJAR-106) Excludes do not work as described on the Usage page

Excludes do not work as described on the Usage page
---------------------------------------------------

                 Key: MJAR-106
                 URL: http://jira.codehaus.org/browse/MJAR-106
             Project: Maven 2.x Jar Plugin
          Issue Type: Bug
    Affects Versions: 2.2
            Reporter: Michael Mattox


The jar plugin usage page gives an example:

{code:xml}
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <includes>
            <include>**/service/*</include>
          </includes>
        </configuration>
      </plugin>
{code}

If I use excludes, such as this:

{code:xml}
						<configuration>
							<excludes>
								<exclude>**/*.properties</exclude>
							</excludes>
						</configuration>
{code}

It doesn't work.  I get the properties in both my jar and my -tests.jar.  However, if I add executions to the plugin configuration, like this:

{code:xml}
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
							<excludes>
								<exclude>**/*.properties</exclude>
							</excludes>
						</configuration>
 					</execution>
				</executions>
 			</plugin>
{code}

Then the properties are excluded form my test jar but NOT from my regular jar.  Here is some debug output:

{noformat}
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
[DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
[DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
[DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
[DEBUG]   (f) forceCreation = false
[DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
[DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
[DEBUG]   (f) useDefaultManifestFile = false
[DEBUG] -- end configuration --
[INFO] [jar:jar]
[DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar not found.)
[INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar
[DEBUG] adding directory META-INF/
[DEBUG] adding entry META-INF/MANIFEST.MF
[DEBUG] adding directory commons/
[DEBUG] adding entry commons/applicationContext.xml
[DEBUG] adding entry database.properties
[DEBUG] adding entry log4j.xml
[DEBUG] adding entry messages-exceptions-commons.properties
[DEBUG] adding entry messages-warnings-commons.properties
[DEBUG] adding entry mm2-rmi.properties
[DEBUG] adding directory META-INF/maven/
[DEBUG] adding directory META-INF/maven/company/
[DEBUG] adding directory META-INF/maven/company/mm-config/
[DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
[DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
[DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
[DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
[DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
[DEBUG]   (f) excludes = [Ljava.lang.String;@24dd07a
[DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
[DEBUG]   (f) forceCreation = false
[DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
[DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
[DEBUG]   (f) useDefaultManifestFile = false
[DEBUG] -- end configuration --
[INFO] [jar:jar {execution: default}]
[DEBUG] isUp2date: true
[DEBUG] Archive C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar is uptodate.
[DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:test-jar' -->
[DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
[DEBUG]   (f) excludes = [Ljava.lang.String;@24e7541
[DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
[DEBUG]   (f) forceCreation = false
[DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
[DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
[DEBUG]   (f) testClassesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\test-classes
[DEBUG]   (f) useDefaultManifestFile = false
[DEBUG] -- end configuration --
[INFO] [jar:test-jar {execution: default}]
[DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar not found.)
[INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar
[DEBUG] adding directory META-INF/
[DEBUG] adding entry META-INF/MANIFEST.MF
[DEBUG] adding directory commons/
[DEBUG] adding entry commons/applicationContext.xml
[DEBUG] adding entry log4j.xml
[DEBUG] adding directory META-INF/maven/
[DEBUG] adding directory META-INF/maven/company/
[DEBUG] adding directory META-INF/maven/company/mm-config/
[DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
[DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
{noformat}

The other thing I don't understand with this approach is that the jar plugin is configured twice.  First without excludes and the second time with excludes.  The second time the plugin says the jar is up to date.  Why is jar:jar being invoked twice?  I assume it's because I defined the execution goal jar.  

And why aren't the excludes used for the first jar:jar call??




-- 
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: (MJAR-106) Excludes do not work as described on the Usage page

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MJAR-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=131858#action_131858 ] 

Benjamin Bentmann commented on MJAR-106:
----------------------------------------

I exluded a log4j.properties from src/main/resources.

> Excludes do not work as described on the Usage page
> ---------------------------------------------------
>
>                 Key: MJAR-106
>                 URL: http://jira.codehaus.org/browse/MJAR-106
>             Project: Maven 2.x Jar Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: Michael Mattox
>
> The jar plugin usage page gives an example:
> {code:xml}
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-jar-plugin</artifactId>
>         <configuration>
>           <includes>
>             <include>**/service/*</include>
>           </includes>
>         </configuration>
>       </plugin>
> {code}
> If I use excludes, such as this:
> {code:xml}
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
> {code}
> It doesn't work.  I get the properties in both my jar and my -tests.jar.  However, if I add executions to the plugin configuration, like this:
> {code:xml}
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<executions>
> 					<execution>
> 						<goals>
> 							<goal>jar</goal>
> 						</goals>
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
>  					</execution>
> 				</executions>
>  			</plugin>
> {code}
> Then the properties are excluded form my test jar but NOT from my regular jar.  Here is some debug output:
> {noformat}
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry database.properties
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding entry messages-exceptions-commons.properties
> [DEBUG] adding entry messages-warnings-commons.properties
> [DEBUG] adding entry mm2-rmi.properties
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24dd07a
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar {execution: default}]
> [DEBUG] isUp2date: true
> [DEBUG] Archive C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar is uptodate.
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:test-jar' -->
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24e7541
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) testClassesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\test-classes
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:test-jar {execution: default}]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> {noformat}
> The other thing I don't understand with this approach is that the jar plugin is configured twice.  First without excludes and the second time with excludes.  The second time the plugin says the jar is up to date.  Why is jar:jar being invoked twice?  I assume it's because I defined the execution goal jar.  
> And why aren't the excludes used for the first jar:jar call??

-- 
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: (MJAR-106) Excludes do not work as described on the Usage page

Posted by "Michael Mattox (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MJAR-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=131857#action_131857 ] 

Michael Mattox commented on MJAR-106:
-------------------------------------

You say it works for you, have you tried excluding resources or just classes?  Maybe it works for classes but not for resources??

If you confirm it works for resources I will make a test project and submit it.  Thanks.



> Excludes do not work as described on the Usage page
> ---------------------------------------------------
>
>                 Key: MJAR-106
>                 URL: http://jira.codehaus.org/browse/MJAR-106
>             Project: Maven 2.x Jar Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: Michael Mattox
>
> The jar plugin usage page gives an example:
> {code:xml}
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-jar-plugin</artifactId>
>         <configuration>
>           <includes>
>             <include>**/service/*</include>
>           </includes>
>         </configuration>
>       </plugin>
> {code}
> If I use excludes, such as this:
> {code:xml}
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
> {code}
> It doesn't work.  I get the properties in both my jar and my -tests.jar.  However, if I add executions to the plugin configuration, like this:
> {code:xml}
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<executions>
> 					<execution>
> 						<goals>
> 							<goal>jar</goal>
> 						</goals>
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
>  					</execution>
> 				</executions>
>  			</plugin>
> {code}
> Then the properties are excluded form my test jar but NOT from my regular jar.  Here is some debug output:
> {noformat}
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry database.properties
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding entry messages-exceptions-commons.properties
> [DEBUG] adding entry messages-warnings-commons.properties
> [DEBUG] adding entry mm2-rmi.properties
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24dd07a
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar {execution: default}]
> [DEBUG] isUp2date: true
> [DEBUG] Archive C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar is uptodate.
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:test-jar' -->
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24e7541
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) testClassesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\test-classes
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:test-jar {execution: default}]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> {noformat}
> The other thing I don't understand with this approach is that the jar plugin is configured twice.  First without excludes and the second time with excludes.  The second time the plugin says the jar is up to date.  Why is jar:jar being invoked twice?  I assume it's because I defined the execution goal jar.  
> And why aren't the excludes used for the first jar:jar call??

-- 
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: (MJAR-106) Excludes do not work as described on the Usage page

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MJAR-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=196445#action_196445 ] 

Dennis Lundberg commented on MJAR-106:
--------------------------------------

Does anybody have a sample project that highlights this issue?

> Excludes do not work as described on the Usage page
> ---------------------------------------------------
>
>                 Key: MJAR-106
>                 URL: http://jira.codehaus.org/browse/MJAR-106
>             Project: Maven 2.x Jar Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: Michael Mattox
>
> The jar plugin usage page gives an example:
> {code:xml}
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-jar-plugin</artifactId>
>         <configuration>
>           <includes>
>             <include>**/service/*</include>
>           </includes>
>         </configuration>
>       </plugin>
> {code}
> If I use excludes, such as this:
> {code:xml}
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
> {code}
> It doesn't work.  I get the properties in both my jar and my -tests.jar.  However, if I add executions to the plugin configuration, like this:
> {code:xml}
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<executions>
> 					<execution>
> 						<goals>
> 							<goal>jar</goal>
> 						</goals>
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
>  					</execution>
> 				</executions>
>  			</plugin>
> {code}
> Then the properties are excluded form my test jar but NOT from my regular jar.  Here is some debug output:
> {noformat}
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry database.properties
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding entry messages-exceptions-commons.properties
> [DEBUG] adding entry messages-warnings-commons.properties
> [DEBUG] adding entry mm2-rmi.properties
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24dd07a
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar {execution: default}]
> [DEBUG] isUp2date: true
> [DEBUG] Archive C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar is uptodate.
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:test-jar' -->
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24e7541
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) testClassesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\test-classes
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:test-jar {execution: default}]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> {noformat}
> The other thing I don't understand with this approach is that the jar plugin is configured twice.  First without excludes and the second time with excludes.  The second time the plugin says the jar is up to date.  Why is jar:jar being invoked twice?  I assume it's because I defined the execution goal jar.  
> And why aren't the excludes used for the first jar:jar call??

-- 
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] Issue Comment Edited: (MJAR-106) Excludes do not work as described on the Usage page

Posted by "Ryan Lea (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MJAR-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=191804#action_191804 ] 

Ryan Lea edited comment on MJAR-106 at 9/22/09 1:22 AM:
--------------------------------------------------------

Hi Michael,

Not sure if you got around this problem but I was having the exact same issue.  I ran mvn help:effective-pom and the output indicated that it would use version 2.2.

However, once I explicitly added the version to the maven-jar-plugin in my pom, it started behaving completely differently.  Not really sure why this would be the case.  Here's my snippet of my plugins section:
{code:xml}
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
                <version>2.2</version>
				<configuration>
					<archive>
                        <addMavenDescriptor>false</addMavenDescriptor>
						<manifest>
							<addClasspath>true</addClasspath>
						</manifest>
					</archive>
                    <excludes>
                        <exclude>**/users.xml</exclude>
                    </excludes>
				</configuration>
			</plugin>	
{code}

      was (Author: ryan.lea):
    Hi Michael,

Not sure if you got around this problem but I was having the exact same issue.  I ran mvn help:effective-pom and the output indicated that it would use version 2.2.

However, once I explicitly added the version to the maven-jar-plugin in my pom, it started behaving completely differently.  Not really sure why this would be the case.  Here's my snippet of my plugins section:
[code]
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
                <version>2.2</version>
				<configuration>
					<archive>
                        <addMavenDescriptor>false</addMavenDescriptor>
						<manifest>
							<addClasspath>true</addClasspath>
						</manifest>
					</archive>
                    <excludes>
                        <exclude>**/users.xml</exclude>
                    </excludes>
				</configuration>
			</plugin>	
[/code]
  
> Excludes do not work as described on the Usage page
> ---------------------------------------------------
>
>                 Key: MJAR-106
>                 URL: http://jira.codehaus.org/browse/MJAR-106
>             Project: Maven 2.x Jar Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: Michael Mattox
>
> The jar plugin usage page gives an example:
> {code:xml}
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-jar-plugin</artifactId>
>         <configuration>
>           <includes>
>             <include>**/service/*</include>
>           </includes>
>         </configuration>
>       </plugin>
> {code}
> If I use excludes, such as this:
> {code:xml}
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
> {code}
> It doesn't work.  I get the properties in both my jar and my -tests.jar.  However, if I add executions to the plugin configuration, like this:
> {code:xml}
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<executions>
> 					<execution>
> 						<goals>
> 							<goal>jar</goal>
> 						</goals>
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
>  					</execution>
> 				</executions>
>  			</plugin>
> {code}
> Then the properties are excluded form my test jar but NOT from my regular jar.  Here is some debug output:
> {noformat}
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry database.properties
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding entry messages-exceptions-commons.properties
> [DEBUG] adding entry messages-warnings-commons.properties
> [DEBUG] adding entry mm2-rmi.properties
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24dd07a
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar {execution: default}]
> [DEBUG] isUp2date: true
> [DEBUG] Archive C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar is uptodate.
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:test-jar' -->
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24e7541
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) testClassesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\test-classes
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:test-jar {execution: default}]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> {noformat}
> The other thing I don't understand with this approach is that the jar plugin is configured twice.  First without excludes and the second time with excludes.  The second time the plugin says the jar is up to date.  Why is jar:jar being invoked twice?  I assume it's because I defined the execution goal jar.  
> And why aren't the excludes used for the first jar:jar call??

-- 
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] Issue Comment Edited: (MJAR-106) Excludes do not work as described on the Usage page

Posted by "Ryan Lea (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MJAR-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=191804#action_191804 ] 

Ryan Lea edited comment on MJAR-106 at 9/22/09 1:23 AM:
--------------------------------------------------------

Hi Michael,

Not sure if you got around this problem but I was having the exact same issue.  I ran mvn help:effective-pom and the output indicated that it would use version 2.2.

However, once I explicitly added the version to the maven-jar-plugin in my pom, it started behaving completely differently.  Not really sure why this would be the case.  Here's my snippet of my plugins section:
{code:xml}
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <version>2.2</version>
    <configuration>
        <archive>
            <addMavenDescriptor>false</addMavenDescriptor>
            <manifest>
                <addClasspath>true</addClasspath>
            </manifest>
        </archive>
        <excludes>
            <exclude>**/users.xml</exclude>
        </excludes>
    </configuration>
</plugin>	
{code}

      was (Author: ryan.lea):
    Hi Michael,

Not sure if you got around this problem but I was having the exact same issue.  I ran mvn help:effective-pom and the output indicated that it would use version 2.2.

However, once I explicitly added the version to the maven-jar-plugin in my pom, it started behaving completely differently.  Not really sure why this would be the case.  Here's my snippet of my plugins section:
{code:xml}
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
                <version>2.2</version>
				<configuration>
					<archive>
                        <addMavenDescriptor>false</addMavenDescriptor>
						<manifest>
							<addClasspath>true</addClasspath>
						</manifest>
					</archive>
                    <excludes>
                        <exclude>**/users.xml</exclude>
                    </excludes>
				</configuration>
			</plugin>	
{code}
  
> Excludes do not work as described on the Usage page
> ---------------------------------------------------
>
>                 Key: MJAR-106
>                 URL: http://jira.codehaus.org/browse/MJAR-106
>             Project: Maven 2.x Jar Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: Michael Mattox
>
> The jar plugin usage page gives an example:
> {code:xml}
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-jar-plugin</artifactId>
>         <configuration>
>           <includes>
>             <include>**/service/*</include>
>           </includes>
>         </configuration>
>       </plugin>
> {code}
> If I use excludes, such as this:
> {code:xml}
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
> {code}
> It doesn't work.  I get the properties in both my jar and my -tests.jar.  However, if I add executions to the plugin configuration, like this:
> {code:xml}
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<executions>
> 					<execution>
> 						<goals>
> 							<goal>jar</goal>
> 						</goals>
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
>  					</execution>
> 				</executions>
>  			</plugin>
> {code}
> Then the properties are excluded form my test jar but NOT from my regular jar.  Here is some debug output:
> {noformat}
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry database.properties
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding entry messages-exceptions-commons.properties
> [DEBUG] adding entry messages-warnings-commons.properties
> [DEBUG] adding entry mm2-rmi.properties
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24dd07a
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar {execution: default}]
> [DEBUG] isUp2date: true
> [DEBUG] Archive C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar is uptodate.
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:test-jar' -->
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24e7541
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) testClassesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\test-classes
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:test-jar {execution: default}]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> {noformat}
> The other thing I don't understand with this approach is that the jar plugin is configured twice.  First without excludes and the second time with excludes.  The second time the plugin says the jar is up to date.  Why is jar:jar being invoked twice?  I assume it's because I defined the execution goal jar.  
> And why aren't the excludes used for the first jar:jar call??

-- 
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: (MJAR-106) Excludes do not work as described on the Usage page

Posted by "Vincent Ricard (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MJAR-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=139808#action_139808 ] 

Vincent Ricard commented on MJAR-106:
-------------------------------------

Hi Michael Mattox,

I had the same problem, i used 2.1, since the 2.2 version all is fine for me. Check your version with mvn help:effective-pom (look at the pluginManagement section).

Hope this help.

> Excludes do not work as described on the Usage page
> ---------------------------------------------------
>
>                 Key: MJAR-106
>                 URL: http://jira.codehaus.org/browse/MJAR-106
>             Project: Maven 2.x Jar Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: Michael Mattox
>
> The jar plugin usage page gives an example:
> {code:xml}
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-jar-plugin</artifactId>
>         <configuration>
>           <includes>
>             <include>**/service/*</include>
>           </includes>
>         </configuration>
>       </plugin>
> {code}
> If I use excludes, such as this:
> {code:xml}
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
> {code}
> It doesn't work.  I get the properties in both my jar and my -tests.jar.  However, if I add executions to the plugin configuration, like this:
> {code:xml}
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<executions>
> 					<execution>
> 						<goals>
> 							<goal>jar</goal>
> 						</goals>
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
>  					</execution>
> 				</executions>
>  			</plugin>
> {code}
> Then the properties are excluded form my test jar but NOT from my regular jar.  Here is some debug output:
> {noformat}
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry database.properties
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding entry messages-exceptions-commons.properties
> [DEBUG] adding entry messages-warnings-commons.properties
> [DEBUG] adding entry mm2-rmi.properties
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24dd07a
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar {execution: default}]
> [DEBUG] isUp2date: true
> [DEBUG] Archive C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar is uptodate.
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:test-jar' -->
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24e7541
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) testClassesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\test-classes
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:test-jar {execution: default}]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> {noformat}
> The other thing I don't understand with this approach is that the jar plugin is configured twice.  First without excludes and the second time with excludes.  The second time the plugin says the jar is up to date.  Why is jar:jar being invoked twice?  I assume it's because I defined the execution goal jar.  
> And why aren't the excludes used for the first jar:jar call??

-- 
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] Issue Comment Edited: (MJAR-106) Excludes do not work as described on the Usage page

Posted by "Ryan Lea (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MJAR-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=191804#action_191804 ] 

Ryan Lea edited comment on MJAR-106 at 9/22/09 1:20 AM:
--------------------------------------------------------

Hi Michael,

Not sure if you got around this problem but I was having the exact same issue.  I ran mvn help:effective-pom and the output indicated that it would use version 2.2.

However, once I explicitly added the version to the maven-jar-plugin in my pom, it started behaving completely differently.  Not really sure why this would be the case.  Here's my snippet of my plugins section:
[code]
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
                <version>2.2</version>
				<configuration>
					<archive>
                        <addMavenDescriptor>false</addMavenDescriptor>
						<manifest>
							<addClasspath>true</addClasspath>
						</manifest>
					</archive>
                    <excludes>
                        <exclude>**/users.xml</exclude>
                    </excludes>
				</configuration>
			</plugin>	
[/code]

      was (Author: ryan.lea):
    Hi Michael,

Not sure if you got around this problem but I was having the exact same issue.  I ran mvn help:effective-pom and the output indicated that it would use version 2.2.

However, once I explicitly added the version to the maven-jar-plugin in my pom, it started behaving completely differently.  Not really sure why this would be the case.  Here's my snippet of my plugins section:

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
                <version>2.2</version>
				<configuration>
					<archive>
                        <addMavenDescriptor>false</addMavenDescriptor>
						<manifest>
							<addClasspath>true</addClasspath>
						</manifest>
					</archive>
                    <excludes>
                        <exclude>**/users.xml</exclude>
                    </excludes>
				</configuration>
			</plugin>	
  
> Excludes do not work as described on the Usage page
> ---------------------------------------------------
>
>                 Key: MJAR-106
>                 URL: http://jira.codehaus.org/browse/MJAR-106
>             Project: Maven 2.x Jar Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: Michael Mattox
>
> The jar plugin usage page gives an example:
> {code:xml}
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-jar-plugin</artifactId>
>         <configuration>
>           <includes>
>             <include>**/service/*</include>
>           </includes>
>         </configuration>
>       </plugin>
> {code}
> If I use excludes, such as this:
> {code:xml}
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
> {code}
> It doesn't work.  I get the properties in both my jar and my -tests.jar.  However, if I add executions to the plugin configuration, like this:
> {code:xml}
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<executions>
> 					<execution>
> 						<goals>
> 							<goal>jar</goal>
> 						</goals>
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
>  					</execution>
> 				</executions>
>  			</plugin>
> {code}
> Then the properties are excluded form my test jar but NOT from my regular jar.  Here is some debug output:
> {noformat}
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry database.properties
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding entry messages-exceptions-commons.properties
> [DEBUG] adding entry messages-warnings-commons.properties
> [DEBUG] adding entry mm2-rmi.properties
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24dd07a
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar {execution: default}]
> [DEBUG] isUp2date: true
> [DEBUG] Archive C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar is uptodate.
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:test-jar' -->
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24e7541
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) testClassesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\test-classes
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:test-jar {execution: default}]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> {noformat}
> The other thing I don't understand with this approach is that the jar plugin is configured twice.  First without excludes and the second time with excludes.  The second time the plugin says the jar is up to date.  Why is jar:jar being invoked twice?  I assume it's because I defined the execution goal jar.  
> And why aren't the excludes used for the first jar:jar call??

-- 
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: (MJAR-106) Excludes do not work as described on the Usage page

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MJAR-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=131688#action_131688 ] 

Benjamin Bentmann commented on MJAR-106:
----------------------------------------

bq. It doesn't work.
But it works for me so there must be something about your configuration. Could you please attach a demo project and the command lines to invoke to allow to reproduce your problem?

bq. Why is jar:jar being invoked twice? I assume it's because I defined the execution goal jar.
Right, you added an additional {{<execution>}} for the {{jar}} goal. The first execution is the default execution defined by the [lifecycle for packaging "jar"|http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Built-in_Lifecycle_Bindings].

bq. And why aren't the excludes used for the first jar:jar call??
The {{<configuration>}} element inside an {{<execution>}} element applies only to this particular execution. However as stated above, the first invocation of the goal does not originate from the {{<execution>}} element. Compare the section [Using executions tag|http://maven.apache.org/guides/mini/guide-configuring-plugins.html].

> Excludes do not work as described on the Usage page
> ---------------------------------------------------
>
>                 Key: MJAR-106
>                 URL: http://jira.codehaus.org/browse/MJAR-106
>             Project: Maven 2.x Jar Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: Michael Mattox
>
> The jar plugin usage page gives an example:
> {code:xml}
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-jar-plugin</artifactId>
>         <configuration>
>           <includes>
>             <include>**/service/*</include>
>           </includes>
>         </configuration>
>       </plugin>
> {code}
> If I use excludes, such as this:
> {code:xml}
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
> {code}
> It doesn't work.  I get the properties in both my jar and my -tests.jar.  However, if I add executions to the plugin configuration, like this:
> {code:xml}
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<executions>
> 					<execution>
> 						<goals>
> 							<goal>jar</goal>
> 						</goals>
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
>  					</execution>
> 				</executions>
>  			</plugin>
> {code}
> Then the properties are excluded form my test jar but NOT from my regular jar.  Here is some debug output:
> {noformat}
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry database.properties
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding entry messages-exceptions-commons.properties
> [DEBUG] adding entry messages-warnings-commons.properties
> [DEBUG] adding entry mm2-rmi.properties
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24dd07a
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar {execution: default}]
> [DEBUG] isUp2date: true
> [DEBUG] Archive C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar is uptodate.
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:test-jar' -->
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24e7541
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) testClassesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\test-classes
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:test-jar {execution: default}]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> {noformat}
> The other thing I don't understand with this approach is that the jar plugin is configured twice.  First without excludes and the second time with excludes.  The second time the plugin says the jar is up to date.  Why is jar:jar being invoked twice?  I assume it's because I defined the execution goal jar.  
> And why aren't the excludes used for the first jar:jar call??

-- 
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: (MJAR-106) Excludes do not work as described on the Usage page

Posted by "Ryan Lea (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MJAR-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=191804#action_191804 ] 

Ryan Lea commented on MJAR-106:
-------------------------------

Hi Michael,

Not sure if you got around this problem but I was having the exact same issue.  I ran mvn help:effective-pom and the output indicated that it would use version 2.2.

However, once I explicitly added the version to the maven-jar-plugin in my pom, it started behaving completely differently.  Not really sure why this would be the case.  Here's my snippet of my plugins section:

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
                <version>2.2</version>
				<configuration>
					<archive>
                        <addMavenDescriptor>false</addMavenDescriptor>
						<manifest>
							<addClasspath>true</addClasspath>
						</manifest>
					</archive>
                    <excludes>
                        <exclude>**/users.xml</exclude>
                    </excludes>
				</configuration>
			</plugin>	

> Excludes do not work as described on the Usage page
> ---------------------------------------------------
>
>                 Key: MJAR-106
>                 URL: http://jira.codehaus.org/browse/MJAR-106
>             Project: Maven 2.x Jar Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: Michael Mattox
>
> The jar plugin usage page gives an example:
> {code:xml}
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-jar-plugin</artifactId>
>         <configuration>
>           <includes>
>             <include>**/service/*</include>
>           </includes>
>         </configuration>
>       </plugin>
> {code}
> If I use excludes, such as this:
> {code:xml}
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
> {code}
> It doesn't work.  I get the properties in both my jar and my -tests.jar.  However, if I add executions to the plugin configuration, like this:
> {code:xml}
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-jar-plugin</artifactId>
> 				<executions>
> 					<execution>
> 						<goals>
> 							<goal>jar</goal>
> 						</goals>
> 						<configuration>
> 							<excludes>
> 								<exclude>**/*.properties</exclude>
> 							</excludes>
> 						</configuration>
>  					</execution>
> 				</executions>
>  			</plugin>
> {code}
> Then the properties are excluded form my test jar but NOT from my regular jar.  Here is some debug output:
> {noformat}
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry database.properties
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding entry messages-exceptions-commons.properties
> [DEBUG] adding entry messages-warnings-commons.properties
> [DEBUG] adding entry mm2-rmi.properties
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:jar' -->
> [DEBUG]   (f) classesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\classes
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24dd07a
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:jar {execution: default}]
> [DEBUG] isUp2date: true
> [DEBUG] Archive C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT.jar is uptodate.
> [DEBUG] company:mm-config:jar:1.0-SNAPSHOT (selected for null)
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.2:test-jar' -->
> [DEBUG]   (f) defaultManifestFile = C:\projects\company\projects\pam\workspace\mm-config\target\classes\META-INF\MANIFEST.MF
> [DEBUG]   (f) excludes = [Ljava.lang.String;@24e7541
> [DEBUG]   (f) finalName = mm-config-1.0-SNAPSHOT
> [DEBUG]   (f) forceCreation = false
> [DEBUG]   (f) outputDirectory = C:\projects\company\projects\pam\workspace\mm-config\target
> [DEBUG]   (f) project = MavenProject: company:mm-config:1.0-SNAPSHOT @ C:\projects\company\projects\pam\workspace\mm-config\pom.xml
> [DEBUG]   (f) testClassesDirectory = C:\projects\company\projects\pam\workspace\mm-config\target\test-classes
> [DEBUG]   (f) useDefaultManifestFile = false
> [DEBUG] -- end configuration --
> [INFO] [jar:test-jar {execution: default}]
> [DEBUG] isUp2date: false (Destination C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar not found.)
> [INFO] Building jar: C:\projects\company\projects\pam\workspace\mm-config\target\mm-config-1.0-SNAPSHOT-tests.jar
> [DEBUG] adding directory META-INF/
> [DEBUG] adding entry META-INF/MANIFEST.MF
> [DEBUG] adding directory commons/
> [DEBUG] adding entry commons/applicationContext.xml
> [DEBUG] adding entry log4j.xml
> [DEBUG] adding directory META-INF/maven/
> [DEBUG] adding directory META-INF/maven/company/
> [DEBUG] adding directory META-INF/maven/company/mm-config/
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.xml
> [DEBUG] adding entry META-INF/maven/company/mm-config/pom.properties
> {noformat}
> The other thing I don't understand with this approach is that the jar plugin is configured twice.  First without excludes and the second time with excludes.  The second time the plugin says the jar is up to date.  Why is jar:jar being invoked twice?  I assume it's because I defined the execution goal jar.  
> And why aren't the excludes used for the first jar:jar call??

-- 
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