当我右键单击我的 Maven 项目并选择“添加依赖项”选项并在查询中键入我的外部 jar 名称时,找不到它。如何将外部 jar 添加到 Maven 项目?
最佳答案
您可以按照本教程进行操作:
http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
例子:
将 jar 安装到本地 Maven 存储库:
mvn install:install-file -Dfile=cxf-2.7.3.jar -DgroupId=org.apache.cxf -DartifactId=cxf-bundle -Dversion=2.7.3 -Dpackaging=jar
编辑项目中的 pom.xml 文件以包含新添加的依赖项:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle</artifactId>
<version>2.7.3</version>
</dependency>
无论您使用什么 IDE,这都应该有效。
关于maven - 将外部 JAR 添加到 NetBeans 中的 Maven 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17693040/