[
http://jira.codehaus.org/browse/MJAR-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_106350
]
William Ferguson edited comment on MJAR-83 at 9/3/07 10:29 PM:
---------------------------------------------------------------
The patch adds @requiresDependencyResolution tags of *runtime* to
* JarMojo
* JarSignMojo
* JarSignVerifyMojo
And a @requiresDependencyResolution tag of *test* to
* TestJarMojo
I tried to put together a test case, but the existing test cases were not
particualrly helpful as a starting point. To test you need to ensure that with
the dependency list shown below, only commons-code and commons-io appear in
the manifest classpath for jar:jar etc.
{code}
<dependencies>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<scope>compile</scope>
<version>1.3</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>runtime</scope>
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<scope>provided</scope>
<version>2.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<scope>test</scope>
<version>1.0.4</version>
</dependency>
</dependencies>
{code}
was:
The patch adds @requiresDependencyResolution tags of *runtime* to
* JarMojo
* JarSignMojo
* JarSignVerifyMojo
And a @requiresDependencyResolution tag of *test* to
* TestJarMojo
I tried to put together a test case, but the existing test cases were not
particualrly helpful as a starting point. To test you need to ensure that with
the dependency list shown below, only commons-code and commons-io appear in
the manifest classpath for jar:jar etc.
{code}
<dependencies>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<scope>compile</scope>
<version>1.3</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>runtime</scope>
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<scope>provided</scope>
<version>2.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<scope>test</scope>
<version>1.0.4</version>
</dependency>
</dependencies>
{code}
> addClasspath is not respected for runtime dependencies
> ------------------------------------------------------
>
> Key: MJAR-83
> URL: http://jira.codehaus.org/browse/MJAR-83
> Project: Maven 2.x Jar Plugin
> Issue Type: Bug
> Affects Versions: 2.1, 2.2
> Reporter: William Ferguson
> Attachments: patch.txt, pom.xml
>
>
> maven-jar-plugin does not resolve dependencies itself, so specifying
> {code}
> <configuration>
> <archive>
> <manifest>
> <addClasspath>true</addClasspath>
> </manifest>
> </archive>
> </configuration>
> {code}
> will add no dependencies for
> {noformat}
> mvn jar:jar
> {noformat}
> And even
> {noformat}
> mvn compiler:compile jar:jar
> {noformat}
> will only add compile time dependencies, not runtime dependencies, presumably
> because the maven-compiler-plugin causes resolution of the compile time
> dependencies.
> See the attached POM.
> There is *no* manifest classpath generated by
> {noformat}
> mvn jar:jar
> {noformat}
> The manifest classpath generated by
> {noformat}
> mvn compiler:compile jar:jar
> {noformat}
> only contains commons-codec which is the compile time dependency.
> There needs to be a way to add runtime dependences to the manifest classpath
> of the jar.
> And preferably not requiring some other plugin to resolve the dependencies
> first.
--
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