How to change Eclipse project folder structure to Maven/Gradle structure
You can actually do all of this manually with minimal fuss.
- In the Package Explorer view, right-click on your
src
folder and choose "Build Path" -> "Remove from Build Path" - Underneath the
src
folder, create amain/java
folder - Right-click on the
main/java
folder and choose "Build Path" -> "Use as Source Folder" - Repeat steps 2 and 3 for
test/java
- Using the Eclipse refactoring tools (right-click on a folder or file and choose "Refactor" -> "Move…", move your Java files to the new folders
Once you're done with the refactoring, your project will be structured in the Maven way. This will make things much simpler when you decide to actually start using Gradle and Maven for your project.
Note that Java will still display your src/main
folder separately in the project viewer. This is normal. Eclipse shows your source folder at top and then all other folders in the project view, which include the source folder parents.