[英]how to copy jars from WEB-INF/lib to another folder in war in maven
i generate a WAR file which has a jar named xyz.jar inside its WEB-INF/lib folder . 我生成一个WAR文件,该文件的WEB-INF / lib文件夹中有一个名为xyz.jar的jar。 This jar is generated during build as a dependency. 此jar在生成期间作为依赖项生成。 Now i need to copy this jar into a folder say abc inside the war . 现在我需要将这个罐子复制到战争中一个名为abc的文件夹中。 How can i achieve this? 我怎样才能做到这一点? I tried using copy-resources of maven-resources-plugin but it doesn't seem to work as the copying will be done before war is built . 我尝试使用maven-resources-plugin的copy-resources,但是它似乎不起作用,因为复制将在建立战争之前完成。 but this jar is generated only during build process. 但是此jar仅在构建过程中生成。 Thanks. 谢谢。
使用maven-dependency-plugin将其独立放置在所需的位置。
You might also be able to change when the plugin executes by binding the plugin execution to a different lifecycle phase . 通过将插件执行绑定到不同的生命周期阶段,您还可以更改插件执行的时间。 Here is a snippet to give you the idea. 这是一个片段,可以为您提供想法。
<plugin>
<artifactId>maven-resource-plugin</artifactId>
...
<executions>
<execution>
<id>copy</id>
<phase>phaseName</phase>
</execution>
</executions>
</plugin>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.