Maven:在构建过程中将jar中的资源添加到WEB-INF [英] Maven: add resource from jar to WEB-INF during build
本文介绍了Maven:在构建过程中将jar中的资源添加到WEB-INF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要从驻留在其中的依赖项jar添加资源 在执行mvn软件包目标期间,将 myjar.jar:META_INF/public-resource/myresource.sk 到我的 webapp/WEB-INF/myfolder .有人可以提供建议吗,怎么做?
I want to add resource from dependency jar, which resides in myjar.jar:META_INF/public-resource/myresource.sk to my webapp/WEB-INF/myfolder during mvn package goal. Does anybody can give advice, how to do this?
推荐答案
如果myjar位于mvn存储库中,应该是这样,
If myjar is in mvn repository, like it should be, something like
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>mygroupid</groupId>
<artifactId>myjar</artifactId>
<outputDirectory>src/main/webapp/WEB-INF/myfolder</outputDirectory>
<includes>META_INF/public-resource/myresource.sk</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
这篇关于Maven:在构建过程中将jar中的资源添加到WEB-INF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文