maven missing artifact 但是 jar 存在 repository

今天打开Eclipse发现POM文件出现了好多问题。

10/12/17 9:50:46 AM SGT: Missing artifact org.antlr:antlr-runtime:jar:3.1.1:compile
10/12/17 9:50:46 AM SGT: Missing artifact org.eclipse.jdt:core:jar:3.4.2.v_883_R34x:compile
10/12/17 9:50:46 AM SGT: Missing artifact janino:janino:jar:2.5.15:compile
10/12/17 9:50:46 AM SGT: Missing artifact org.drools:drools-decisiontables:jar:5.0.1:compile
10/12/17 9:50:46 AM SGT: Missing artifact org.drools:drools-templates:jar:5.0.1:compile
10/12/17 9:50:46 AM SGT: Missing artifact org.jboss.resteasy:resteasy-jaxrs:jar:2.3.10.Final-redhat-1:provided
10/12/17 9:50:46 AM SGT: Missing artifact org.jboss.resteasy:jaxrs-api:jar:2.3.10.Final-redhat-1:provided
10/12/17 9:50:46 AM SGT: Missing artifact junit:junit:jar:4.11:test
10/12/17 9:50:46 AM SGT: Missing artifact org.hamcrest:hamcrest-core:jar:1.3:test
10/12/17 9:50:46 AM SGT: Missing artifact org.scannotation:scannotation:jar:1.0.3.redhat-4:provided
10/12/17 9:50:46 AM SGT: Missing artifact org.javassist:javassist:jar:3.18.1.GA-redhat-1:provided
10/12/17 9:50:46 AM SGT: Missing artifact javax.annotation:jsr250-api:jar:1.0:provided
10/12/17 9:50:46 AM SGT: Missing artifact javax.activation:activation:jar:1.1.1:provided
10/12/17 9:50:46 AM SGT: Missing artifact org.apache.httpcomponents:httpclient:jar:4.3.6.redhat-1:provided
10/12/17 9:50:46 AM SGT: Missing artifact org.apache.httpcomponents:httpcore:jar:4.3.3.redhat-1:provided
10/12/17 9:50:46 AM SGT: Missing artifact net.jcip:jcip-annotations:jar:1.0.0.redhat-7:provided
10/12/17 9:50:46 AM SGT: Missing artifact org.jboss.logging:jboss-logging:jar:3.1.4.GA-redhat-2:provided
10/12/17 9:50:46 AM SGT: Missing artifact org.jboss.resteasy:resteasy-jaxb-provider:jar:2.3.10.Final-redhat-1:provided
10/12/17 9:50:46 AM SGT: Missing artifact com.sun.xml.bind:jaxb-impl:jar:2.2.5.redhat-9:provided
10/12/17 9:50:46 AM SGT: Missing artifact org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.2_spec:jar:1.0.4.Final:provided
10/12/17 9:50:46 AM SGT: Missing artifact com.sun.istack:istack-commons-runtime:jar:2.6.1.redhat-3:provided
10/12/17 9:50:46 AM SGT: Missing artifact com.sun.xml.txw2:txw2:jar:20110809.0.0.redhat-5:provided
10/12/17 9:50:46 AM SGT: Missing artifact org.jboss.resteasy:resteasy-atom-provider:jar:2.3.10.Final-redhat-1:provided
10/12/17 9:50:46 AM SGT: Missing artifact org.jboss.cache:jbosscache-core:jar:3.2.11.GA:compile
10/12/17 9:50:46 AM SGT: Missing artifact org.jboss:jboss-common-core:jar:2.2.17.GA-redhat-3:compile
10/12/17 9:50:46 AM SGT: Missing artifact org.jgroups:jgroups:jar:2.6.17.GA:compile
10/12/17 9:50:46 AM SGT: Missing artifact org.josql:josql:jar:2.1:compile
10/12/17 9:50:46 AM SGT: Missing artifact net.sf.json-lib:json-lib:jar:jdk15:2.3:compile
10/12/17 9:50:46 AM SGT: Missing artifact net.sf.ezmorph:ezmorph:jar:1.0.6:compile
10/12/17 9:50:46 AM SGT: Missing artifact org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:jar:1.0.2.Final:provided
10/12/17 9:50:46 AM SGT: Missing artifact org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:jar:1.0.2.Final:provided
10/12/17 9:50:46 AM SGT: Missing artifact javax.transaction:jta:jar:1.1:provided
10/12/17 9:50:46 AM SGT: Missing artifact commons-codec:commons-codec:jar:1.7:compile
10/12/17 9:50:46 AM SGT: Missing artifact org.apache.commons:commons-compress:jar:1.0:compile
10/12/17 9:50:46 AM SGT: Missing artifact commons-discovery:commons-discovery:jar:0.2:compile
10/12/17 9:50:46 AM SGT: Missing artifact commons-httpclient:commons-httpclient:jar:3.1:compile

常见的几种方法如下:

  • Eclipse的menu下的Project -> Clean
  • 选择项目右键 Maven->Update Project Configuration
  • 选择项目右键 Maven->Disable Dependency Management;然后,选择项目右键Maven->Enable Dependency Management
  • 检查proxy的设置

然而发现都不管用,最后切换到命令行下,执行了:

mvn dependency:resolve //发现没有问题
mvn clean

然后再在Eclipse里面update dependence,恢复正常。

你可能感兴趣的:(闲杂信息)