I have a maven web project that has packaging as a "war". the package generates a war file that confirms the format of the war. But I like to pack the project as a "jar", as well as the default "military" format. So, I'm trying to use the "maven jar" plugin to achieve this. 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 creates a jar file that contains the classes, and the contents of the resources folder and the war file create the correct war file.
But the contents of "src / main / webapp" is not included in the jar file. How to include src / main / webapp contents in jar using jar plugin?
Nambi source share