Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8278315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:58:04+00:00 2026-06-08T08:58:04+00:00

I use SpringSource Tool Suite (STS) with Maven + m2eclipse. On my latest project,

  • 0

I use SpringSource Tool Suite (STS) with Maven + m2eclipse. On my latest project, I am facing an issue importing an existing Maven project correctly from SVN into STS. When I use import -> Maven -> 'existing Maven project', the project will import but will have the following issues:

  • The src/main/java and src/test/java are not picked up as source folders. STS will configure src as the source folder and main/test are added to the package names.
  • The Maven dependencies library is not added to the java build path.

I can manually correct the source folders, but when I try to add the ‘Maven managed dependencies’ library to the build path I get the message ‘Use Maven Project Settings to configure Maven dependency resolution’ and the library is not added. The only Maven project settings I seem to be able to set are the active profile and ‘resolve dependencies from workspace projects’ (checked), neither of which seem to make any difference.

Add Maven Managed Dependencies
Maven Project Settings

If I run mvn install from the command line the project builds successfully. If I run mvn eclipse:eclipse and then import into STS, then everything works as expected, but then of course you have to re-run this every time you update the pom, which is undesirable.

I worked around it by running mvn eclipse:eclipse and then manually updating .classpath to eliminate the M2_REPO dependencies added by eclipse:eclipse and adding the m2eclipse dependency entry:

<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
  <attributes>
    <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
  </attributes>
</classpathentry>

Then I imported existing Maven project and it worked as expected. However, this is a hack and I’m not sure what other consequences running eclipse:ecplise has when working with m2eclipse.

I have worked on other maven projects and I faced no issues importing them correctly.

Possibly relevant information:

  • This is a webapp project.
  • The subversion repo contains only the pom.xml and the src folder.
  • I use an external maven installation and it is version 3.0.3
  • We use an onsite Artifactory repo for artifact download

Things I have tried:

  • Download from SVN to local disk then import to STS using import existing Maven project
  • Import project into STS from SVN, configuration -> enable Maven nature
  • Run mvn eclipse:eclipse then import (works but requires manual classpath edits for m2e)
  • Search stackoverflow, found this question which is very similar but the answers do not seem to solve my issue.

pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.company.group</groupId>
    <artifactId>artifact</artifactId>
    <version>1.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>My Project</name>
    <description>My Project</description>

    <properties>
        <java-version>1.6</java-version>
        <org.springframework-version>3.1.0.RELEASE</org.springframework-version>
        <!-- Lots of other versions omitted -->
    </properties>

    <repositories>
        <repository>
            <id>repoId</id>
            <name>repoName</name>
            <url>http://fake.company.com/artifactory/repo</url>
            <layout>default</layout>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>repoId</id>
            <name>repoName</name>
            <url>http://fake.company.com/artifactory/repo</url>
        </pluginRepository>
    </pluginRepositories>

    <!-- Configurations required for deploy plugin. Artifacts are deployed to 
        artifactory -->
    <distributionManagement>
        <repository>
            <id>repoId</id>
            <name>repoName-releases</name>
            <url>http://fake.company.com/artifactory/apps-releases-local</url>
        </repository>
        <snapshotRepository>
            <id>repoId</id>
            <name>repoName-snapshots</name>
            <url>http://fake.company.com/artifactory/apps-snapshots-local</url>
        </snapshotRepository>
    </distributionManagement>

    <scm>
        <connection>scm:svn:https://fake.company.com/svn/fake-repo/trunk</connection>
        <developerConnection>scm:svn:https://fake.company.com/svn/fake-repo/trunk</developerConnection>
        <url>https://fake.company.com/svn/fake-repo/trunk</url>
    </scm>

    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>
        <!-- Lots of other dependencies omitted -->
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/TestUtil.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <verbose>true</verbose>
                    <source>${java-version}</source>
                    <target>${java-version}</target>
                    <compilerVersion>${java-version}</compilerVersion>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <warName>war-name</warName>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>install</id>
                        <phase>install</phase>
                        <goals>
                            <goal>sources</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <formats>
                        <format>html</format>
                    </formats>
                    <instrumentation>
                        <ignores>
                            <ignore>path/**/*Test.class</ignore>
                        </ignores>
                        <excludes>
                            <exclude>path/Constants.class</exclude>
                            <exclude>path/*.class</exclude>
                        </excludes>
                    </instrumentation>
                    <check>
                        <haltOnFailure>false</haltOnFailure>
                        <totalBranchRate>25</totalBranchRate>
                        <totalLineRate>41</totalLineRate>
                        <packageLineRate>25</packageLineRate>
                        <packageBranchRate>15</packageBranchRate>
                    </check>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>cobertura</goal>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin</artifactId>
                <version>${org.apache.cxf-version}</version>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
                            <wsdlOptions>
                                <wsdlOption>
                                    <wsdl>${basedir}/src/main/resources/wsdl/automation.wsdl</wsdl>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>target/generated/cxf</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <additionalProjectnatures>
                        <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
                        <projectnature>org.eclipse.jdt.groovy.core.groovyNature</projectnature>
                    </additionalProjectnatures>
                    <additionalBuildcommands>
                        <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
                    </additionalBuildcommands>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings 
                    only. It has no influence on the Maven build itself. -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.cxf</groupId>
                                        <artifactId>
                                            cxf-codegen-plugin
                                        </artifactId>
                                        <versionRange>
                                            [${org.apache.cxf-version},)
                                        </versionRange>
                                        <goals>
                                            <goal>wsdl2java</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-compiler-plugin</artifactId>
                                        <versionRange>[2.3.2,)</versionRange>
                                        <goals>
                                            <goal>compile</goal>
                                            <goal>testCompile</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <profiles>
        <!-- Deployment profiles omitted -->
    </profiles>
</project>

Does anyone have any ideas on how to:

  1. get the m2eclipse import to work correctly? OR
  2. configure STS to allow me to add maven managed dependecies to the build path after project creation / conversion?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:58:06+00:00Added an answer on June 8, 2026 at 8:58 am

    The following section:

                               <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-compiler-plugin</artifactId>
                                        <versionRange>[2.3.2,)</versionRange>
                                        <goals>
                                            <goal>compile</goal>
                                            <goal>testCompile</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
    

    has the unfortunate consequence of disabling the java compiler in your build. Remove it and I would imagine that things work.

    I also see this:

                       <projectnature>org.eclipse.jdt.groovy.core.groovyNature</projectnature>
    

    Is this a groovy project? If so are you using gmaven or groovy-eclipse-compiler?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use SpringSource Tool Suite 3.0.1, Tomcat server 7.0.21, maven-2.2.1. I successfully built my
I'm learning to use Springsource Tool Suite (STS) and the Spring framework for development.
I tried to use Springsource Tool Suite (STS) but I had so many compile
How to use springsource tool suite for spring web service development? quick start of
I'm trying to install SpringSource Tool Suite into an existing Eclipse install (3.7 Indigo).
I am working with grails, in springsource tool suite, and I am facing a
I installed SpringSource Tool Suite 2.8.0. I'm trying to include a JS file in
I am using the current version of SpringSource Tool Suite with the Groovy/Grails plugin
I have installed Springsource Tool Suite v2.7.2 with Groovy and Grails support on Ubuntu.
since I use SpringSource ToolSuite 2.7.1 and installed the latest Subclipse Plugin (1.6.x), this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.