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

吃可爱长大的小学妹 提交于 2019-12-07 09:59:15

问题


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.


回答1:


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> 


来源:https://stackoverflow.com/questions/3578662/how-to-ask-maven-war-plugin-to-copy-particular-jar-file-into-warfile-web-inf-lib

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!