You might think about building the jar as a project first and then
making the war project depend on the jar project.
This will give you the jar that you want and the war as well.
Ron
On 19/03/2013 4:38 PM, Sankaran, Nambi wrote:
Hi All
I have a maven web project that has packaging as "war". the package generates war file that confirms to war
format. But, i like to package the project as a "jar" as well along with the default "war" format.
So, I am trying to use "maven jar" plugin to achieve that. I am using the following jar plugin configuration.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>make-a-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
<includes>
<include>../../src/main/webapp/**</include>
<include>**/*</include>
</includes>
</configuration>
</plugin>
The "package" command produces a jar file that contains the classes and the
contents of 'resources' folder and war file produces a proper 'war' file. But the
contents of 'src/main/webapp' are not included in the jar file. How to include the
contents of src/main/webapp in the jar using the jar plugin?
Stack Overflow Question
http://stackoverflow.com/questions/15509893/how-to-create-a-war-and-jar-from-a-web-project
--
Ron Wheeler
President
Artifact Software Inc
email: rwhee...@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org