Maven: exclude version from module jars inside war file -
i have multi module project. each module built .jar file takes name corresponding ${project.artifactid}
. 1 module built .war file. , here run @ issues. web-inf folder contains lib folder contains result .jars other modules. , these jars have name like: project.artifactid+project.version.jar
, when need project.artifactid.jar
.
i tried configure maven-war-plugin , maven-jar-plugin, result still same.
here pom.xml files build results:
jar module
<groupid>com.mymodule.mysubmodule</groupid> <artifactid>sub-module</artifactid> <version>1.1-snapshot</version> <build> <finalname>${project.artifactid}</finalname> ...
result: sub-module.jar
war module
<groupid>com.mymodule.warmodule</groupid> <artifactid>war-module</artifactid> <version>1.1-snapshot</version> <packaging>war</packaging> <dependency> <groupid>com.mymodule.mysubmodule</groupid> <artifactid>sub-module</artifactid> <version>1.1-snapshot</version> </dependency> <build> <finalname>root</finalname> ... <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-jar-plugin</artifactid> <executions> <execution> <id>default-jar</id> <goals> <goal>jar</goal> </goals> <configuration> <finalname>${project.artifactid}</finalname> </configuration> </execution> </executions> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-war-plugin</artifactid> <executions> <execution> <id>default-war</id> <configuration> <warsourceexcludes>**</warsourceexcludes> <webxml>${project.build.directory}/${project.build.finalname}/web-inf/web.xml</webxml> </configuration> </execution> </executions> </plugin> ...
result: /target/war-module.jar, root/web-inf/lib/war-module-1.1-snapshot.jar, root/web-inf/lib/sub-module-1.1-snapshot.jar
outputfilenamemapping
of war-maven-plugin doesn't suit me because erases versions of dependencies, not modules.
how build .war file specific jars without versions in web-inf/lib folder?
Comments
Post a Comment