Flame_Phoenix
Flame_Phoenix

Reputation: 17574

Failed to collect dependencies in Maven project

When I try to build or compile my Maven project I get the following error message:

[ERROR] Failed to execute goal on project dss-services: Could not resolve dependencies for project net.jnd.thesis:dss-services:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [log4j:log4j:jar:1.2.16 (compile), org.slf4j:slf4j-api:jar:1.6.4 (compile), org.slf4j:jcl-over-slf4j:jar:1.6.4 (compile), org.slf4j:slf4j-log4j12:jar:1.6.4 (compile), net.sf.flexjson:flexjson:jar:2.1 (compile), commons-beanutils:commons-beanutils:jar:1.8.3 (compile), org.apache.commons:commons-lang3:jar:3.1 (compile), org.eclipse.jetty:jetty-websocket:jar:8.1.4.v20120524 (compile), net.jnd.thesis:dss-common:jar:0.0.1-SNAPSHOT (compile)]: Failed to read artifact descriptor for net.jnd.thesis:dss-common:jar:0.0.1-SNAPSHOT: Could not find artifact net.jnd.thesis:dss:pom:0.0.1-SNAPSHOT -> [Help 1]

During my research I found two possible solutions:

However, the answers provided do not apply because I already re-created the project from zero (and I do not see how changing the name of the directory will help) and because my error message differs from the error messages presented in those specific cases.

I think that my m2e plugin in Eclipse must have some sort of configurations issue and therefore it cannot download nor find the needed Maven artifacts, but I have no idea on how to solve the problem :S

Upvotes: 16

Views: 110439

Answers (6)

user22544463
user22544463

Reputation: 1

Some times we will be having repo credentials in settings.xml file. Need to update latest credentials

Upvotes: 0

Sapan Sharma
Sapan Sharma

Reputation: 1

I was also facing similar issue for a different dependency. So first check whether all the paths like JAVA_HOME , M2_HOME etc are properly set or not. Than check if you see similar dependency in maven repository or not. In my case , it was not present , so check if you find the jars somewhere and manually put them in your repository folder in .m2 folder. This worked for me .

Upvotes: 0

Jaaz
Jaaz

Reputation: 1

Try to update the path for settings.xml file in your IDE. Windows--> Preferences -->Maven--> user settings--> navigate to settings file. It worked for me

Upvotes: 0

prashant.kr.mod
prashant.kr.mod

Reputation: 1682

Looks like you are missing some Maven repos. Ask for your friend's .m2/settings.xml, and you'll probably want to update the POM to include the repositories there.

Upvotes: 1

Ignasi
Ignasi

Reputation: 6185

Could you try use only console ?

"mvn clean compile" should be enough to check if problem is with eclipse or not.

Sometimes I had problem with dependencies in some maven project, and usually was because i didn't add a specific repository for them. Some dependencies are not installed in maven central repo, so you must check if your dependencies ara available in this repo. If not, you can add more repositories in your pom in order to tell maven "hey look for my dependencies in this other repo too".

Upvotes: 10

Flame_Phoenix
Flame_Phoenix

Reputation: 17574

After a lot of headaches and time I simply realized that there is a huge problem with the m2e plugin and its versions. Thus I solved my problem by making entering the project and making mvn clean compile followed by mvn install.

Thanks for the help anyway!

Upvotes: 6

Related Questions