- to prevent inclusion of the original jar file, I would use go for approach suggested on: https://www.mail-archive.com/users@maven.apache.org/msg38537.html
Use
<scope>provided</scope>
for this dependency to keep it out of the lib directory. to include the repackaged one, I'd follow suggestion from: How to make Maven copy resource file into WEB-INF/lib directory?
Try changing the configuration of the maven war plugin to include a webResource:
<configuration> <webResources> <resource> <directory>pathtorepackagedjar</directory> <includes> <include>**/abc.jar</include> <includes> <targetPath>WEB-INF/lib</targetPath> </resource> </webResources> </configuration>
Maven update jar before packaging in WAR
-
08-10-2022 - |
質問
I have a project where I am packaging a WAR using simple maven-war-plugin. Along with all other dependencies one of the dependency say 'abc.jar' which is getting packaged in war contains a default spring configurations which I would like to update with the custom one before packaging. I have maven profile configured to be activated if following build command applied;
mvn clean install -DframeworkPacakging=XYZ
I am trying to use 'truezip-maven-plugin' to overwrite my custom spring configurations inside in 'abc.jar' present in 'target/aretfacts-id/WEB-INF/lib' but when maven-war-plugin finishes I loose my changes because war plugin takes the file from dependency definition. How can I solve this issue and what are my options?
P.S. Distributing configuration is not desirable as this setup would be used for Embedded Jetty Server running within Eclipse
正しい解決策はありません
他のヒント