NetBeans IDE maven项目无法解决依赖关系 [英] NetBeans IDE maven project unable to solve dependencies

查看:973
本文介绍了NetBeans IDE maven项目无法解决依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用eclipse之后,我将自己移植到NetBeans IDE。我正在打开我现有的maven项目,一切似乎都可以,但是当我正在尝试构建项目时,尽管JAR文件存在于我的.m2目录中,但是它抛出错误说无法解析项目的依赖项。



我正在使用ubuntu 12.10和netbeans版本7.3.1



非常感谢任何对此的建议。 >

解决方案


对此同样的任何建议都非常感激。


这可能无法解决您当前的问题,但这是对未来的建议,或者即使您想为当前项目执行此操作。 / p>



首先,您需要确保您的项目作为maven项目正确导入。如图所示,所有的maven项目,在项目标志的左上角都有一点点 m 。第一个项目是一个maven网络应用程序,第二个是常规的maven应用程序,最后一个是常规的java应用程序。如果您将项目视为maven应用程序,那么您需要做的就是右键单击依赖关系,然后选择添加依赖。您可以从打开的对话框中搜索您的本地repo。一旦您选择将自动插入到您的pom中,您将在 Dependencies 文件夹中看到te jar。



如果没有看到depencies文件夹,那么您的项目不会导入为maven项目。


After using eclipse for ages I am porting myself to NetBeans IDE. I am opening my existing maven project and all seems ok, but when I am trying to build the project it is throwing error saying "Could not resolve dependencies for project" though the JAR files are present in my .m2 directory.

I am using a ubuntu 12.10 and netbeans version 7.3.1

Any suggestions on the same are highly appreciated.

解决方案

"Any suggestions on the same are highly appreciated."

This may not solve your current problem, but is a suggestion for the future, or even if you want to do it for your current projects.

First thing is you need to make sure your project was imported correctly as a maven project. As you can see in the image, all maven projects, have a little m in the top left of the project logo. The first project is a maven web app, the second a regular maven app, and the last a regular java app. If you see your projects as maven apps, then all you need to do is right-click on the Dependencies and select add dependeny. You can search your local repo from the dialog that opens. The once you select will get automatically inserted into you pom, and you will see teh jar in the Dependencies folder.

If you don't see the depencies folder, then your projects were not imported as maven projects.

这篇关于NetBeans IDE maven项目无法解决依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆