将外部 JAR 添加到 NetBeans 中的 Maven 项目 [英] Adding external JAR to Maven project in NetBeans
问题描述
当我右键单击我的 Maven 项目并选择 添加依赖项 选项并在查询中输入我的外部 jar 名称时,没有找到它.如何将外部 jar 添加到 Maven 项目中?
When I right click on my Maven project and choose the Add dependency option and I type my external jar's name in query, it is not found. How to add external jar to a Maven project?
推荐答案
您可以按照本教程进行操作:http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
You can follow this tutorial: http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
示例:
将 jar 安装到本地 Maven 存储库:
Install the jar to your local maven repository:
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 文件以包含新添加的依赖项:
Edit the pom.xml file in your project to include the newly added dependency:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle</artifactId>
<version>2.7.3</version>
</dependency>
无论您使用哪种 IDE,这都应该可以工作.
This should work regardless of the IDE you are using.
这篇关于将外部 JAR 添加到 NetBeans 中的 Maven 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!