Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse maven project package disorder

Tags:

eclipse

maven

Maven project is usually organized as src/main/java/somepackage, but from time to time my eclipse would recognize src/main/java as part of package too. How to fix this? In the following picture, common and helloworld are both maven projects, where common is organized correctly but helloworld is not.

enter image description here

enter image description here

like image 967
Tiina Avatar asked Jan 26 '26 10:01

Tiina


1 Answers

The src directory is the default directory where Eclipse stores the source code, while in Maven is src/main/java. Better check if the .classpath file has not been corrupted or externally modified. It should contain something like this:

<classpathentry kind="src" output="target/classes" path="src/main/java">
like image 106
Little Santi Avatar answered Jan 28 '26 12:01

Little Santi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!