Search code examples
eclipsemavenmaven-eclipse-plugin

Maven Eclipse Plugin automatically creates maven folder under META-INF


I have a Dynamic Web Project that we need to convert to Maven Project. I am using Eclipse 2021-03 with Maven Integration for Eclipse v1.17.2

I used a "normal" procedure to convert the project:

  1. Right click on the project
  2. Selected Configure -> Convert to Maven Project
  3. Filled all the needed fields in the new pom.xml
  4. Created source folders for maven (src/main/java, src/main/resources, src/main/webapp)
  5. Moved all the files in the correct folder
  6. Added all the needed Maven dependencies
  7. Checked if in the Deployment Assembly all the source folders were deployed in the correct path
  8. Finally, in the Build Path changed the Default Output Folder to /target/classes

Once finished, Maven plugin creates automatically a folder under src/main/webapp/META-INF/maven/{groupId}/{artifactId}/ inside this folder there are two files, specifically pom.properties and pom.xml

If I try to delete them, Maven plugin recreates them, same story if I try to delete the entire folder structure from /maven.

This is a screenshot of the folder structure, with the "unwanted" folders and files highlighted.

enter image description here

And this is my pom.xml:

enter image description here

Is it correct this behaviour? Why are those folders and files created and why can't I make my Eclipse stop to generate them?

Any help would be highly apreciated!


Solution

  • I had the same problem, I solved it by checking the following option under Window -> Preferences -> Maven -> Java EE Integration

    Maven build folder solution