检查你的pom.xml 文件 然后 重新install

解决方案 »

  1.   

    <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.certus</groupId>
      <artifactId>appframe</artifactId>
      <version>02.01</version>
      <packaging>jar</packaging>  <name>appframe</name>
      <url>http://maven.apache.org</url>  <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>  <dependencies>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>3.8.1</version>
          <scope>test</scope>
        </dependency>
        <dependency>
         <groupId>redis.clients</groupId>
         <artifactId>jedis</artifactId>
         <version>2.0.0</version>
        </dependency>
        <dependency>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-digester3</artifactId>
         <version>3.0</version>
        </dependency>
        <dependency>
         <groupId>org.hibernate.javax.persistence</groupId>
         <artifactId>hibernate-jpa-2.0-api</artifactId>
         <version>1.0.1.Final</version>
        </dependency>
        <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-core</artifactId>
         <version>3.6.0.Final</version>
        </dependency>
        <dependency>
         <groupId>org.jboss.spec.javax.ejb</groupId>
         <artifactId>jboss-ejb-api_3.1_spec</artifactId>
         <version>1.0.1.Final</version>
        </dependency>
        <dependency>
         <groupId>commons-lang</groupId>
         <artifactId>commons-lang</artifactId>
         <version>2.2</version>
        </dependency>
        <dependency>
         <groupId>ant</groupId>
         <artifactId>ant</artifactId>
         <version>1.7.0</version>
        </dependency>
      </dependencies>
    </project>pom文件是这样子的,这些jar在本地仓库都有的
      

  2.   

    setting.xml是用的原来默认的,本地仓库也是默认的,这些都没有问题
      

  3.   

    local repository   你填的目录可有这些东西?
      

  4.   

    运行 maven install的时候没有报错,但是build path的时候还是没有相应的依赖jar包
      

  5.   

    那可能是你的工程没变成maven工程
    看看你工程下面的.classpath,有没有
    <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
    或者类似的东西。
    .project里面有没有 <buildCommand>
    <name>org.maven.ide.eclipse.maven2Builder</name>
    <arguments>
    </arguments>
    </buildCommand>
    ...
    ... <nature>org.maven.ide.eclipse.maven2Nature</nature>
      

  6.   

    我看了看<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
    没有,我把这个加到.project里面了,但还是没有解决到
      

  7.   

    重新用ecplise建个maven工程,然后把你的代码导入新工程,运行ok。
      

  8.   

    解决了,我的工程不是maven工程,把他改成maven工程就好了
      

  9.   

    果然,是maven项目就行了。折腾了很久,感谢。
      

  10.   

    project上右键,configure->convert to Maven Project