导入到eclipse时,Maven不会将依赖jar文件添加到项目中

时间:2013-03-19 17:03:47

标签: java eclipse maven

将所有内容加载到maven存储库中。我的案例位于C:\opt\m2\repository。我在eclipse中设置M2_REPO变量指向C:\opt\m2\repository,在命令行中设置mvn clean install

然后我等了10分钟才能下载所有依赖项并去检查repo。 Everthing被下载到那里。

然后我mvn eclipse:eclipse并将项目导入eclipse。

除了所有maven依赖项之外,似乎都会导入所有内容。我的项目有9409个错误,因为它缺少那些jar文件。

Project -> Clean没有帮助。

我在项目名称上做了F5,没有帮助。

我确实删除并再次导入,没有帮助。

仅供参考,我也试过m2e插件,没有帮助。

我错过了什么吗?

这是.classpath文件的内容:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="ks-common-util/target/classes" path="ks-common-util/src/main/java"/>
<classpathentry kind="src" output="ks-common-util/target/classes" path="ks-common-util/src/main/resources"/>
<classpathentry kind="src" output="ks-common-util/target/test-classes" path="ks-common-util/src/test/java"/>
<classpathentry kind="src" output="ks-common-util/target/test-classes" path="ks-common-util/src/test/resources"/>
<classpathentry kind="src" output="ks-common-test/target/classes" path="ks-common-test/src/main/java"/>
<classpathentry kind="src" output="ks-common-test/target/classes" path="ks-common-test/src/main/resources"/>
<classpathentry kind="src" output="ks-common-test/target/test-classes" path="ks-common-test/src/test/java"/>
<classpathentry kind="src" output="ks-common-test/target/test-classes" path="ks-common-test/src/test/resources"/>
<classpathentry kind="src" output="ks-common-api/target/classes" path="ks-common-api/src/main/java"/>
<classpathentry kind="src" output="ks-common-api/target/classes" path="ks-common-api/src/main/resources"/>
<classpathentry kind="src" output="ks-common-impl/target/classes" path="ks-common-impl/src/main/java"/>
<classpathentry kind="src" output="ks-common-impl/target/classes" path="ks-common-impl/src/main/resources"/>
<classpathentry kind="src" output="ks-common-impl/target/test-classes" path="ks-common-impl/src/test/java"/>
<classpathentry kind="src" output="ks-common-impl/target/test-classes" path="ks-common-impl/src/test/resources"/>
<classpathentry kind="src" output="ks-common-ui/target/classes" path="ks-common-ui/src/main/java"/>
<classpathentry kind="src" output="ks-common-ui/target/classes" path="ks-common-ui/src/main/resources"/>
<classpathentry kind="src" output="ks-common-ui/target/test-classes" path="ks-common-ui/src/test/java"/>
<classpathentry kind="src" output="ks-common-ui/target/test-classes" path="ks-common-ui/src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry exported="true" kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>

该项目的结构为父母 - 儿童项目。一个父项目和8个儿童项目。他们每个人都有一个pom.xml文件。

父项目很好,我可以编译它。但是,子项目都不起作用,因为没有任何依赖项被加载到项目中。

这是父pom.xml

的依赖项
  <dependencyManagement>
<dependencies>
  <!-- Test Framework Dependencies -->
  <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>${junit.version}</version>
    <scope>test</scope>
  </dependency>
  <dependency>
    <groupId>org.apache.derby</groupId>
    <artifactId>derby</artifactId>
    <version>${derby.version}</version>
    <scope>test</scope>
  </dependency>
  <dependency>
    <groupId>org.apache.derby</groupId>
    <artifactId>derbynet</artifactId>
    <version>${derby.version}</version>
  </dependency>
  <dependency>
    <groupId>org.apache.derby</groupId>
    <artifactId>derbyclient</artifactId>
    <version>${derby.version}</version>
  </dependency>
  <dependency>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>jetty</artifactId>
    <version>${jetty.version}</version>
    <scope>test</scope>
  </dependency>
  <dependency>
    <artifactId>servlet-api</artifactId>
    <groupId>javax.servlet</groupId>
    <version>2.5</version>
    <scope>provided</scope>
  </dependency>
  <dependency>
    <groupId>javax.persistence</groupId>
    <artifactId>persistence-api</artifactId>
    <version>1.0</version>
  </dependency>
  <dependency>
    <groupId>javax.transaction</groupId>
    <artifactId>jta</artifactId>
    <version>1.1</version>
  </dependency>
  <dependency>
    <groupId>cglib</groupId>
    <artifactId>cglib-nodep</artifactId>
    <version>2.1_3</version>
  </dependency>
  <dependency>
    <groupId>org.eclipse.persistence</groupId>
    <artifactId>eclipselink</artifactId>
    <version>${eclipselink.version}</version>
  </dependency>
  <dependency>
    <groupId>org.apache.openjpa</groupId>
    <artifactId>openjpa</artifactId>
    <version>1.2.1</version>
  </dependency>

  <!-- Hibernate -->
  <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-annotations</artifactId>
    <version>3.4.0.GA</version>
  </dependency>
  <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>3.4.0.GA</version>
  </dependency>

  <!-- Hibernate Transitive Dependencies -->
  <dependency>
    <groupId>dom4j</groupId>
    <artifactId>dom4j</artifactId>
    <version>1.6.1</version>
  </dependency>
  <dependency>
    <groupId>commons-collections</groupId>
    <artifactId>commons-collections</artifactId>
    <version>3.2</version>
  </dependency>
  <dependency>
    <groupId>antlr</groupId>
    <artifactId>antlr</artifactId>
    <version>2.7.7</version>
  </dependency>

  <!-- Spring Dependencies -->
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-aop</artifactId>
    <version>${spring.version}</version>
  </dependency>
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-aspects</artifactId>
    <version>${spring.version}</version>
  </dependency>
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-beans</artifactId>
    <version>${spring.version}</version>
  </dependency>
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>${spring.version}</version>
  </dependency>
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>${spring.version}</version>
  </dependency>
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jdbc</artifactId>
    <version>${spring.version}</version>
  </dependency>
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-orm</artifactId>
    <version>${spring.version}</version>
  </dependency>
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-test</artifactId>
    <version>${spring.version}</version>
    <scope>test</scope>
  </dependency>
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>${spring.version}</version>
  </dependency>
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>${spring.version}</version>
  </dependency>
  <dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-core</artifactId>
    <version>${spring.security.version}</version>
    <exclusions>
      <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring-support</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-security-core</artifactId>
    <version>${spring.security.version}</version>
    <exclusions>
      <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring-support</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-security-cas-client</artifactId>
    <version>${spring.security.version}</version>
  </dependency>

  <!-- This jar is only needed if you are using CAS with Spring Security -->
  <dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-cas-client</artifactId>
    <version>${spring.security.version}</version>
    <exclusions>
      <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring-dao</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
  <dependency>
    <groupId>org.opensaml</groupId>
    <artifactId>opensaml</artifactId>
    <version>1.1</version>
    <!-- <version>2.2.2</version> -->
  </dependency>
  <dependency>
    <groupId>xerces</groupId>
    <artifactId>xercesImpl</artifactId>
    <version>${xercesImpl.version}</version>
  </dependency>

  <!-- Metro Dependencies -->
  <dependency>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>webservices-rt</artifactId>
    <version>${metro.version}</version>
  </dependency>
  <dependency>
    <groupId>org.jvnet.jax-ws-commons.spring</groupId>
    <artifactId>jaxws-spring</artifactId>
    <version>1.8</version>
    <exclusions>
      <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring</artifactId>
      </exclusion>
      <!-- These must be excluded for WSIT to work -->
      <exclusion>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-rt</artifactId>
      </exclusion>
      <exclusion>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
      </exclusion>
      <exclusion>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
      </exclusion>
      <exclusion>
        <groupId>javax.xml.soap</groupId>
        <artifactId>saaj-api</artifactId>
      </exclusion>
      <exclusion>
        <groupId>com.sun.xml.messaging.saaj</groupId>
        <artifactId>saaj-impl</artifactId>
      </exclusion>
      <exclusion>
        <groupId>com.sun.xml.stream.buffer</groupId>
        <artifactId>streambuffer</artifactId>
      </exclusion>
      <exclusion>
        <groupId>com.sun.xml.stream</groupId>
        <artifactId>sjsxp</artifactId>
      </exclusion>
      <exclusion>
        <groupId>com.sun.org.apache.xml.internal</groupId>
        <artifactId>resolver</artifactId>
      </exclusion>
    </exclusions>
  </dependency>

  <!-- stax-ex 1.0 pom making a disaster so trying 1.2 -->
  <dependency>
    <groupId>org.jvnet.staxex</groupId>
    <artifactId>stax-ex</artifactId>
    <version>1.2</version>
  </dependency>

  <!-- CXF Dependencies -->
  <!-- Libraries not required for Java 1.6_04+ are being excluding (based cxf WHICH_JARS file) -->
  <dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-api</artifactId>
    <version>${cxf.version}</version>
    <exclusions>
      <exclusion>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-javamail_1.4_spec</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-activation_1.1_spec</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
  <dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-core</artifactId>
    <version>${cxf.version}</version>
    <exclusions>
      <exclusion>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-javamail_1.4_spec</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
  <dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-frontend-jaxws</artifactId>
    <version>${cxf.version}</version>
    <exclusions>
      <exclusion>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-javamail_1.4_spec</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-jaxws_2.1_spec</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-activation_1.1_spec</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-annotation_1.0_spec</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
      </exclusion>
      <exclusion>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
      </exclusion>
      <exclusion>
        <groupId>javax.xml.soap</groupId>
        <artifactId>saaj-api</artifactId>
      </exclusion>
      <exclusion>
        <groupId>com.sun.xml.messaging.saaj</groupId>
        <artifactId>saaj-impl</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.codehaus.woodstox</groupId>
        <artifactId>wstx-asl</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
  <dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-frontend-simple</artifactId>
    <version>${cxf.version}</version>
    <exclusions>
      <exclusion>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-jaxws_2.1_spec</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
  <dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-common-utilities</artifactId>
    <version>${cxf.version}</version>
    <exclusions>
      <exclusion>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
  <dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-tools-common</artifactId>
    <version>${cxf.version}</version>
    <exclusions>
      <exclusion>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
      </exclusion>
      <exclusion>
        <groupId>javax.xml.soap</groupId>
        <artifactId>saaj-api</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.apache.velocity</groupId>
        <artifactId>velocity</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
  <dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-transports-http</artifactId>
    <version>${cxf.version}</version>
  </dependency>
  <dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-transports-http-jetty</artifactId>
    <version>${cxf.version}</version>
  </dependency>
  <dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-ws-security</artifactId>
    <version>${cxf.version}</version>
    <exclusions>
      <exclusion>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-annotation_1.0_spec</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-stax-api_1.0_spec</artifactId>
      </exclusion>
      <exclusion>
        <groupId>javax.xml.soap</groupId>
        <artifactId>saaj-api</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
  <dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-bindings-soap</artifactId>
    <version>${cxf.version}</version>
    <exclusions>
      <exclusion>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-javamail_1.4_spec</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-activation_1.1_spec</artifactId>
      </exclusion>
      <exclusion>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
      </exclusion>
      <!-- GWT hosted not working if this is excluded -->
      <!--
        <exclusion>
        <groupId>org.codehaus.woodstox</groupId>
        <artifactId>wstx-asl</artifactId>
        </exclusion>
      -->
    </exclusions>
  </dependency>
  // deleted to fit in SO POST

  <!-- Logging -->
  <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.6.0</version>
  </dependency>
  <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>1.6.0</version>
  </dependency>
  <dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>${log4j.version}</version>
  </dependency>
  <dependency>
    <groupId>commons-logging</groupId>
    <artifactId>commons-logging</artifactId>
    <version>1.1.1</version>
  </dependency>

  <!-- Velocity (used by cxf & statements) -->
  <dependency>
    <groupId>velocity</groupId>
    <artifactId>velocity</artifactId>
    <version>${velocity.version}</version>
  </dependency>
  <dependency>
    <groupId>org.apache.velocity</groupId>
    <artifactId>velocity</artifactId>
    <version>${velocity.version}</version>
  </dependency>
  <dependency>
    <groupId>org.apache.velocity</groupId>
    <artifactId>velocity-tools</artifactId>
    <version>${velocity.tools.version}</version>
  </dependency>
  <dependency>
    <groupId>commons-lang</groupId>
    <artifactId>commons-lang</artifactId>
    <version>2.3</version>
  </dependency>

  <!-- Pom dependencies for impl specific jars -->
  <dependency>
    <groupId>org.kuali.student.common</groupId>
    <artifactId>ks-jta</artifactId>
    <version>${project.version}</version>
    <type>pom</type>
  </dependency>
  <dependency>
    <groupId>org.kuali.student.common</groupId>
    <artifactId>ks-cxf</artifactId>
    <version>${project.version}</version>
    <type>pom</type>
  </dependency>
  <dependency>
    <groupId>org.kuali.student.common</groupId>
    <artifactId>ks-metro</artifactId>
    <version>${project.version}</version>
    <type>pom</type>
  </dependency>
  <dependency>
    <groupId>org.kuali.student.common</groupId>
    <artifactId>ks-eclipselink</artifactId>
    <version>${project.version}</version>
    <type>pom</type>
  </dependency>
  <dependency>
    <groupId>org.kuali.student.common</groupId>
    <artifactId>ks-hibernate</artifactId>
    <version>${project.version}</version>
    <type>pom</type>
  </dependency>

  <!-- GWT Dependencies -->
  // deleted in order to fit in SO post
  <dependency>
    <groupId>org.kuali.rice</groupId>
    <artifactId>rice-impl</artifactId>
    <version>${kuali.rice.version}</version>
    <exclusions>
      <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring-dao</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jpa</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring-remoting</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring-support</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jmx</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring-mock</artifactId>
      </exclusion>
      <exclusion>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
      </exclusion>
      <exclusion>
        <groupId>htmlunit</groupId>
        <artifactId>htmlunit</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty</artifactId>
      </exclusion>
      <!--
        <exclusion>
        <groupId>org.springmodules</groupId>
        <artifactId>spring-modules-ojb</artifactId>
        </exclusion>
      -->
      <!--
        <exclusion>
        <groupId>ojb</groupId>
        <artifactId>db-ojb</artifactId>
        </exclusion>
      -->
      <exclusion>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc14</artifactId>
      </exclusion>
      <exclusion>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-activation_1.1_spec</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-javamail_1.4_spec</artifactId>
      </exclusion>
      <!--
        These dependencies conflict with gwt-dev for running hosted mode via eclipse
        launch file.
      -->
      <exclusion>
        <groupId>tomcat</groupId>
        <artifactId>jasper-compiler-jdt</artifactId>
      </exclusion>
      <exclusion>
        <groupId>tomcat</groupId>
        <artifactId>jasper-compiler</artifactId>
      </exclusion>
      <exclusion>
        <groupId>tomcat</groupId>
        <artifactId>jasper-runtime</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.eclipse.jdt</groupId>
        <artifactId>core</artifactId>
      </exclusion>

      <!-- JOTM - uncomment out to switch to Bitronix -->        
      <!-- 
      <exclusion>                                 
        <groupId>xapool</groupId>                 
        <artifactId>xapool</artifactId>           
      </exclusion>                                
      <exclusion>                                 
        <groupId>jotm</groupId>                   
        <artifactId>jotm</artifactId>             
      </exclusion>
       -->

      <!-- itext -->
      <exclusion>
        <groupId>itext</groupId>
        <artifactId>itext</artifactId>
      </exclusion>
    </exclusions>
  </dependency>
  <dependency>
    <groupId>commons-beanutils</groupId>
    <artifactId>commons-beanutils</artifactId>
    <version>1.7.0</version>
  </dependency>
  // deleted some because SO only allow 30000 characters

  <dependencies>
<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
</dependency>

这是孩子们的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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.kuali.student</groupId>
        <artifactId>student</artifactId>
        <version>1.2</version>
    </parent>
    <groupId>org.kuali.student.common</groupId>
    <artifactId>ks-common</artifactId>
    <packaging>pom</packaging>
    <name>KS Common</name>
    <description>Kuali Student Common</description>
    <issueManagement>
        <system>Jira</system>
        <url>https://test.kuali.org/jira/browse/KSCOR</url>
    </issueManagement>
    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <modules>
                <module>ks-cxf</module>
                <module>ks-metro</module>
                <module>ks-eclipselink</module>
                <module>ks-hibernate</module>
                <module>ks-jta</module>
                <module>ks-rice-lessdep</module>
                <module>ks-common-util</module>
                <module>ks-common-test</module>
                <module>ks-common-api</module>
                <module>ks-common-impl</module>
                <module>ks-common-ui</module>
            </modules>
        </profile>
        <profile>
            <id>skip-ui</id>
            <modules>
                <module>ks-cxf</module>
                <module>ks-metro</module>
                <module>ks-eclipselink</module>
                <module>ks-hibernate</module>
                <module>ks-jta</module>
                <module>ks-rice-lessdep</module>
                <module>ks-common-util</module>
                <module>ks-common-test</module>
                <module>ks-common-api</module>
                <module>ks-common-impl</module>
            </modules>
        </profile>
    </profiles>
    <repositories>
        <repository>
            <id>kuali.nexus</id>
            <name>Nexus Repository Manager</name>
            <url>http://nexus.kuali.org/content/groups/public</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
</project>

6 个答案:

答案 0 :(得分:7)

使用m2e插件,您无需执行任何手动kludging。从工作区中删除项目,然后转到File->Import->Maven->Existing Maven Projects。浏览对话框以导入项目,然后就完成了。

Maven Import - Part 1

Maven Import - Part 2

请注意,如果您的Maven项目或其任何子模块中有任何.classpath.settings.project资源,则需要在执行导入之前将其删除( mvn eclipse:clean 足以删除它们。这是因为它们与m2e设置产生冲突。

答案 1 :(得分:4)

按顺序尝试:

mvn eclipse:eclipse -Dwtpversion=2.0

mvn package

mvn eclipse:clean

答案 2 :(得分:0)

以这种方式尝试:

  1. 你需要的第一件事就是M2Eclipse。这有点儿马车但是有效。(http://m2eclipse.sonatype.org/sites/m2e
  2. 通过eclipse(M2Eclipse)导入maven项目
  3. 做一个mvn elipse:清理eclipse:项目上的eclipse
  4. 在eclipse中刷新项目
  5. 它应该以这种方式工作

答案 3 :(得分:0)

我尝试添加pom.xml,更新,清理项目没有用。但是,这工作

1 - 右键单击​​Maven项目。

2 - Maven - &gt;添加依赖

3 - 输入GroupID,工件,版本。

4 - 提交

瞧,瞧,它! 希望有所帮助。

答案 4 :(得分:0)

尝试关闭您的IDE并重新启动它..在关闭时,您可能会注意到某些依赖项jar文件的下载。

答案 5 :(得分:-1)

我有同样的问题,我以这种方式解决它(在我使用Maven,Spring,hibernate的项目中):

  1. 帮助
  2. 检查更新
  3. 我不得不升级:Spring IDE(抱歉,我不记得所有的名字)。 在这个操作之后一切都很好(在这个操作之前,我尝试了很多解决方案而没有任何帮助)。