本文介绍了在NetBeans中将外部JAR添加到Maven项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我右键单击我的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?
推荐答案您可以按照本教程: maven.apache/guides/mini/guide-3rd- party-jars-local.html
示例:
将jar安装到您当地的maven repository:
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.
更多推荐
在NetBeans中将外部JAR添加到Maven项目
发布评论