Announcement Announcement Module
No announcement yet.
How do I prevent Maven -> Update Project... from adding the Spring project nature? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I prevent Maven -> Update Project... from adding the Spring project nature?

    We have a Maven multi-module project with a very bulky spring configuration. We should refactor the spring config in the foreseeable future, but until we get around to do that, having the Spring project nature enabled on the projects results in an unacceptably slow build.

    We have the projects completely in version control (including working .project and .classpath files that only include the java and maven project natures). When importing the projects from SVN or performing Maven -> Update Project, m2e insists on adding the Spring project nature to the .project files. Is there any way we can prevent this from happening?

    We are using STS 3.1 with m2e 1.2.0.

    Thanks in advance to any who can help!

  • #2
    Hmm... Something you shouldn't do is put .project and .classpath files (or whatever files your ide uses in version control)... But alas...

    Did you use a Spring Template to configurer/create the projects? If so there is something in your pom that adds these natures.


    • #3
      I don't know how the projects were initially set up; they are a few years old by now. I'm not sure what you mean by "something in the pom" - the only thing Spring-related in the poms are the Spring dependencies. Btw, this does not happen when using m2e to import the projects in plain Eclipse 4.2, only in STS.

      I did find a different workaround, however: I now enabled the Spring project nature, but removed most of the config files from the Spring Beans support.


      • #4
        that something is the m2e plugin in the pom...

        When importing something in plain eclipse adding a nature that doesn't exists doesn't do anything so that is more or less logic that that doesn't happen...


        • #5
          Yes, we do have the m2e plugin configured in the pom, but that configuration does not include anything spring-related. If I understand you correctly, the m2e plugin tries to determine from its environment what natures to add to a project? I.e. if the environment does not support the Spring nature, it does not add it? Can this somehow be configured, e.g. in the m2e plugin configuration in the pom? I could not find anything in the documentation.


          • #6
            Looking at the STS Maven integration, it does appear that the Spring Project Configurator will automatically add the Spring nature if it finds the Spring Framework dependency declared in the pom. Maybe that should be user configurable?

            It sounds like you have two issues: 1.) STS is automatically adding the Spring nature to your Maven-ized Spring projects and 2.) STS build is too slow when you have many Spring config files enabled for Spring tooling support.