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

Asked

Viewed 4,154 times

4

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

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

inserir a descrição da imagem aqui

The problem is that after project conversion the source folder continues "src". I’d like to leave it as the Maven default, just like when we created an Empty Maven project. Example:

src/main/java
src/main/test
  • Managed to solve?

1 answer

3


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

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.