How to convert a Java project in Eclipse to a Maven project?

4

I have a Java project in Eclipse that I want to convert to a Maven project.

For the conversion, I right-click and select the "Convert to Maven Project" as indicated in the figure below.

Theproblemisthataftertheprojectconversionthesourcefoldercontinues"src" . I'd like to leave it as the default for Maven, just like when we created an empty Maven project. Example:

src/main/java
src/main/test
    
asked by anonymous 10.03.2015 / 14:12

1 answer

3

The "Convert to Maven project" action in Eclipse only creates initial Project Object Model (pom.xml). Eclipse does not change the folder structure of your project. To create a test folder just create a Folder and then right-click Build path > Use as source folder .

The process of dependencies and plugins (exclusion of test classes from the build for example) needs to be done manually.

    
10.03.2015 / 14:37