简体   繁体   中英

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 . This jar is generated during build as a dependency. Now i need to copy this jar into a folder say abc inside the war . 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 . but this jar is generated only during build process. 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM