how to ask maven war plugin to copy particular jar file into warfile/web-inf/lib

13,165

I believe this will work for you. I'm not 100% sure the C:\\JAR is correct though. You might have to fiddle with this syntax.

<build> 
 <plugins> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-war-plugin</artifactId> 
        <version>2.0.2</version> 
        <configuration> 
          <webResources> 
            <resource> 
              <directory>C:\\JAR</directory> 
              <targetPath>WEB-INF/lib</targetPath> 
            </resource> 
          </webResources> 
        </configuration> 
      </plugin> 
 </plugins> 
</build> 
Share:
13,165
David
Author by

David

Updated on July 07, 2022

Comments

  • David
    David almost 2 years

    I have a simple.jar file that stay in c:/JAR. When i used maven war plugin to create a war file, it will copy all the dependencies into lib folder.

    How can i ask maven to copy simple.jar into lib folder as well.