I'm using eclipse luna and I have 2 maven projects : a web application and a java library which is a dependency of the web application.
library pom.xml :
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.test</groupId>
<artifactId>library</artifactId>
<verson>0.0.1-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<archive>
<manifestEntries>
<Dependencies>just a test</Dependencies>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
webApp pom.xml :
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.test</groupId>
<artifactId>webapp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>org.test</groupId>
<artifactId>library</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Now when I deploy my war on a webserver (jboss) as 'Run as...',the war file is generated and it embed the library's jar under WEB-INF/lib.
So everything seems fine except it's not :
the generated jar was not generated by maven and it misses whatever configuration was set on the maven-jar-plugin
(on this case the Dependencies: just a test
line).
May be obvious but if I use 'Run as Maven build' on the library project both jar:jar
and package
goals builds a jar with the expected manifest.
I have managed to archive this using the maven configurator.
If this didn't work, check that the jar:jar goal is not ignored in the Eclipse lifecycle mappings.
To remove jar:jar it from the ignored list for your workspace:
The mapping may be ignored in the pom.xml file instead, in which case you will find a section on the library pom file under pluginManagement that ignores the plugin execution.