Why should I always “add a Spring project“ Project nature ”after Maven“ Update project configuration ”in Eclipse?

I use Eclipse to work on a Spring project that is managed through Maven (well, the m2e plugin in Eclipse).

Whenever I make changes to the Maven pom.xml file, the interface complains and says that I subsequently need to run the "Update project configuration" from the Maven element that appears in the context menu when you right-click the top-level project.

When this is completed, then the project always lost its "Spring" project, which I need to add again from the Spring element in the same context menu. This is pretty annoying.

Why is he doing this?

Is there a way to keep a Spring project project forever by adding something to pom.xml?

+3
source share
1 answer

I use STS and don't have this problem, but I also have this plugin in my pom.

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <version>2.7</version> <configuration> <downloadSources>true</downloadSources> <downloadJavadocs>false</downloadJavadocs> <wtpversion>2.0</wtpversion> <additionalBuildcommands> <buildCommand> <name>org.springframework.ide.eclipse.core.springbuilder</name> </buildCommand> </additionalBuildcommands> <additionalProjectnatures> <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature> </additionalProjectnatures> </configuration> </plugin> 
+9
source

All Articles