oddly
oddly

Reputation: 260

Build path entry is missing: /src/test/java

While running my java project on Eclipse Luna, I have some errors due to which I suppose related to this problem.I right click on the project, choose properties --> java build path --> source, I see a warning at the top:

enter image description here

And it seems that I have forgotten to add this package at the beginning of my project.I want to add it now, but I cannot do it via "Add Folder" button.When I press "Add Folder" button, a window appears like this one:

enter image description here

However, I believe I should add it under "Java Resources" on the tree:

enter image description here

How can I modify this? Thanks for any help..

Upvotes: 7

Views: 31618

Answers (3)

This worked for me:

mvn clean install

Upvotes: 3

free
free

Reputation: 21

How to add missing src/test/java folder to the maven project in Eclipse

1) Create a folder test/java under src folder 2) Right click on the project and choose Maven --> Update Project --> choose for Force update of Snapshot/Releases and click ok. Now test folder should appear as src/test/java in Eclipse project explorer

Upvotes: 0

Marvin
Marvin

Reputation: 14345

src/test/java is just maven's default entry for any test classes. If you have (or plan to have) test classes, you can create a new folder structure test/java below your src folder and afterwards select it in the dialog you've shown. If you don't plan to have any test classes, you can safely remove the entry from the build path.

Upvotes: 7

Related Questions