0
votes

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.

2

2 Answers

1
votes

Use the maven-dependency-plugin to independently put it where you want it.

0
votes

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>