But enough about that. Something of immediate practical value: real skinny WARs. Until now the maven-war-plugin left you with two choices: no jars, or most jars. Sure, you could manually exclude all but a set, but it was a PITA and unpractical. Behold my surprise to find the newest WAR config addition to 2.1-beta-1:
packagingIncludes.Use case:
I want a mostly skinny WAR that filters out all JARs except for struts.
Solution:
<project>Thanks WAR plugin guys! Now just fix the EAR problem and I'll be set.
...
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1-beta-1</version>
<configuration>
<packagingIncludes>WEB-INF/lib/struts*.jar</packagingIncludes>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
2 comments:
I'm one of the many also facing this problem, and I was very excited to try packagingIncludes. GOOD NEWS:, it looks like it worked to include my jar. BAD NEWS: the war had almost no other contents, it looks like the plugin is serioulsy broken (or I am missing something fundamental I need to change), but my pom works fine in the alpha realease...
It appears that <packagingIncludes> and <packagingExcludes> cannot be used together which is very unfortunate. If you want to use <packagingIncludes>, it appears you have to list a set of wildcard parameters for every file that you need in your war, icluding jsp's, images, style sheets, tag files, etc... What a pain.
Post a Comment