Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.1, 2.2
-
Fix Version/s: 2.2
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
maven-jar-plugin does not resolve dependencies itself, so specifying
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
will add no dependencies for
mvn jar:jar
And even
mvn compiler:compile jar:jar
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
mvn jar:jar
The manifest classpath generated by
mvn compiler:compile jar:jar
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.
The workaround for this is to
Neither of is nice and both of which is required.
NB I forgot to say why we need to create a Jar with no content other than a manifest classpath.
Its because the Windows line length limit precludes classpaths that are too long, so we generate a Jar with a manifest classpath that includes all the target libraries and just include it.
But its seems like a problem in the general sense in any case.