从范围提供的Maven Web项目中获取jar [英] Getting jars from scope provided maven web project
本文介绍了从范围提供的Maven Web项目中获取jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前正在使用maven开发Java Java应用程序(尚不具备mvn的经验).对于我的情况,应用程序需要提供的范围. 现在,我将如何提取" pom文件中定义的jar,以便将其复制到我的Tomcat lib文件夹中?
I'm currently developing a Java webapp using maven for building (I'm not to experienced with mvn yet). For my scenario the application requires the provided scope. Now how would I 'extract' the jars defined in the pom file so that I could copy them to my Tomcat lib folder?
推荐答案
您可以使用maven-dependency-plugin
的copy-dependencies
目标将具有provided
范围的依赖项jar复制到特定目录
You can use the maven-dependency-plugin
's copy-dependencies
goal to copy the dependency jars with provided
scope to a specific directory
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>provided</includeScope>
<outputDirectory>${project.build.directory}/providedDependencies</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
这篇关于从范围提供的Maven Web项目中获取jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文