The problem I'm experiencing is that eclipse can't resolve any of the dependencies of my project. This causes problems because even though the dependencies seem to work alright when coding (I get autocompletion) I still get a huge list of errors referring to missing artifacts.
When filtering these, I found the following:
The container 'Maven Dependencies' references non existing library '/home/[...]/.m2/repository/com/sun/tools/1.5.0/tools-1.5.0.jar'
It seems that this dependency was introduced by struts2, who have a profile set up as follows in their pom:
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
That systemPath resolves and so I don't see a reason why this would be causing trouble. In any case, is there a way to tell eclipse that this m2eclipse dependency is a system dependency that is not found in the local repository?
My problem solved by right click on project -> Maven -> Update project. Then the Maven Dependencies appear on the project explore. Save this answer.
You can find this in Window > Preferences > Maven > User Settings , and then point Global Settings to your external maven settings. xml . Then i removed the broken projects and re-added them, and the Maven Dependencies library appeared again. Save this answer.
Try to update your Maven configuration : In the Project Explorer, right-click on the project, Maven -> Update project. If the problem still remains, try to clean your project: right-click on your pom. xml, Run as -> Maven build (the second one). Enter "clean package" in the Goals fields.
I was facing the same problem and needed to do the following things
It worked for me seamlessly.
Its worth to add that, in my eclipse.ini
file I had to add the -vm ... lines at the top of the file. like
-vm
C:\Program Files\Java\jdk1.6.0_27\bin
... ... ...
Make sure that, -vm option is placed before -vmargs as everything after -vmargs is passed directely to vm and selecting a particular is depend on -vm option.
I had this issue, but I have fixed by using the steps below:
Case1:
Eclipse by default pointing to JRE but eclipse maven plugin required JDK so point to JDK
Window -> Preperences -> Java -> Installed JREs
change it to JDK
Follow the steps to change to JDK from JRE
Now I can build my project without any issue. Is this the correct way to solve this issue?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With