user1950349
user1950349

Reputation: 5146

build error after importing maven projects

I cloned one of the open source git repositories and was trying to import it as maven project in eclipse. After I imported everything as a maven project, whole package is getting messed up. See the below error:

enter image description here

How can I fix this issue so that I can build it on my local box? I cloned the same git repository locally on my desktop.

I am using eclipse version:

Eclipse IDE for Java Developers

Version: Luna Service Release 1a (4.4.1)
Build id: 20150109-0600

Steps I have tried already:

Can anyone help me with this? If needed, you can also clone it and try importing it to see whether it works for you or not.

Upvotes: 0

Views: 2895

Answers (1)

1337joe
1337joe

Reputation: 2377

The root of your problem is that the build section of the pom.xml for that project specifies:

<sourceDirectory>./src</sourceDirectory>

Eclipse uses the sourceDirectory tag to tell it where the root of the main sources are. If you change that to ./src/main/java, then right-click on the project > Maven > Update Project... and click Ok (I had to do this twice) it will fix the Eclipse classpath so Eclipse can build the project. You can then revert the pom back to the head revision and so long as you don't run Update Project again it should continue to build.

I'm unclear on why that project specifies a non-standard source directory but uses the standard Maven layout, but this should at least get you into a working state within Eclipse.

Upvotes: 1

Related Questions