Results 1 to 6 of 6

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

Hybrid View

  1. #1
    Join Date
    Oct 2012
    Posts
    3

    Default 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. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Oct 2012
    Posts
    3

    Default

    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. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    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...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Oct 2012
    Posts
    3

    Default

    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. #6

    Default

    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.
    Leo Dos Santos
    Committer, SpringSource Tool Suite

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •