pranay
pranay

Reputation: 2369

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.

Upvotes: 0

Views: 377

Answers (2)

John Watts
John Watts

Reputation: 8865

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>

Upvotes: 0

bmargulies
bmargulies

Reputation: 100003

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

Upvotes: 1

Related Questions