I'm using Apache Maven3 and since two or three days some dependencies can't be resolved any more, which first have not had a problem. To be more specific its:
我使用的是Apache Maven3,两三天以后,一些依赖关系就不能再解决了,这是第一个没有问题的问题。更具体地说:
maven-findbgs-plugin:plugin:1.3.1
- maven-findbgs-plugin:插件:1.3.1
maven-cobertura-plugin:plugin:1.3
- maven-cobertura-plugin:插件:1.3
Shouldn't they be included by maven itself?
它们不应该被maven所包含吗?
My pom.xml
file:
我砰的一声。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>
<artifactId>xyz</artifactId>
<name>xyz</name>
<description>xyz</description>
<repositories>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-faces</artifactId>
<version>${springwebflow-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${springsecurity-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${springsecurity-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${springsecurity-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Communication to PowerTAC Server -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.1</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.jms</groupId>
<artifactId>jms-api</artifactId>
<version>1.1-rev-1</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.5.1</version>
</dependency>
<dependency>
<groupId>activecluster</groupId>
<artifactId>activecluster</artifactId>
<version>20040423.075722</version>
</dependency>
<dependency>
<groupId>xmlbeans</groupId>
<artifactId>xbean</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>javacc</groupId>
<artifactId>javacc</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>3.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_1.1_spec</artifactId>
<version>1.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>1.1.2</version>
</dependency>
<!-- Sun Mojarra JSF 2 runtime -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.0.2.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.2.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>3.3.0.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.4.0.GA</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>ejb-api</artifactId>
<version>3.0</version>
</dependency>
<!-- PrimeFaces component library -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.powertac</groupId>
<artifactId>server-interface</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<packaging>war</packaging>
<properties>
<java-version>1.5</java-version>
<springframework-version>3.0.5.RELEASE</springframework-version>
<springwebflow-version>2.3.0.RELEASE</springwebflow-version>
<springsecurity-version>3.0.3.RELEASE</springsecurity-version>
<org.slf4j-version>1.5.10</org.slf4j-version>
</properties>
<groupId>org.powertac</groupId>
<version>0.0.1-SNAPSHOT</version>
</project>
Within my IDE (Springsource Tool Suite) I'm getting the following warning
在我的IDE (Springsource工具套件)中,我得到了以下警告。
When I do something like "mvn compile" in my shell the following error occurs:
当我在shell中执行类似“mvn编译”的操作时,会出现以下错误:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xcz 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact javacc:javacc:jar:4.0 has been relocated to net.java.dev.
javacc:javacc:jar:4.0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.193s
[INFO] Finished at: Sun Dec 04 10:11:47 CET 2011
[INFO] Final Memory: 9M/160M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project xyz: Could not resolve depend
encies for project xyz:war:0.0.1-SNAPSHOT: The following a
rtifacts could not be resolved: maven-plugins:maven-cobertura-plugin:plugin:1.3,
maven-plugins:maven-findbugs-plugin:plugin:1.3.1, Failure to find maven-plugins:maven-cobertura-plugin:plugin
:1.3 in http://repository.primefaces.org was cached in the local repository, res
olution will not be reattempted until the update interval of prime-repo has elap
sed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso
lutionException
When I insert the below mentioned plugins and do mvn site
the following error message occurs:
当我插入下面提到的插件和mvn站点时,会出现以下错误消息:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xyz 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/org/primefaces/primefaces/2.2.1/prime
faces-2.2.1.pom
[WARNING] The POM for org.primefaces:primefaces:jar:2.2.1 is missing, no depende
ncy information available
[WARNING] The artifact javacc:javacc:jar:4.0 has been relocated to net.java.dev.
javacc:javacc:jar:4.0
Downloading: http://repo1.maven.org/maven2/org/primefaces/primefaces/2.2.1/prime
faces-2.2.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.609s
[INFO] Finished at: Sun Dec 04 10:35:51 CET 2011
[INFO] Final Memory: 9M/160M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project xyz: Could not resolve depend
encies for project xyz:war:0.0.1-SNAPSHOT: The following a
rtifacts could not be resolved: maven-plugins:maven-cobertura-plugin:plugin:1.3,
maven-plugins:maven-findbugs-plugin:plugin:1.3.1, org.primefaces:primefaces:jar
:2.2.1: Failure to find maven-plugins:maven-cobertura-plugin:plugin:1.3 in http:
//repo1.maven.org/maven2 was cached in the local repository, resolution will not
be reattempted until the update interval of central has elapsed or updates are
forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso
Any help is highly apprechiated.
任何帮助都是高度赞赏的。
4 个解决方案
#1
24
You should add those two plugins to your pom.
您应该将这两个插件添加到您的pom中。
For cobertura, see this page.
对于cobertura来说,请看这一页。
For findbugs, see this page.
对于findbugs,请参见此页。
----- UPDATED -----
- - - - - - - - - - - -更新
OK, I found the problem. It appears that you depend on jdom 1.1.2, which depends on jaxen 1.1.3 of which artifact is broken.
好吧,我发现问题了。看起来您依赖于jdom 1.1.2,它依赖于jaxen 1.1.3的工件被破坏。
You can either try another jdom version or add to your pom the snapshot described in this site. Worked for me when I ran your pom on my PC. I copied the snapshot:
您可以尝试另一个jdom版本或添加到您的pom中描述的快照。当我在我的电脑上运行你的pom时为我工作。我复制快照:
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1.3</version>
<!-- http://jira.codehaus.org/browse/JAXEN-217 -->
<exclusions>
<exclusion>
<groupId>maven-plugins</groupId>
<artifactId>maven-cobertura-plugin</artifactId>
</exclusion>
<exclusion>
<groupId>maven-plugins</groupId>
<artifactId>maven-findbugs-plugin</artifactId>
</exclusion>
</exclusions>
</dependency>
#2
3
For those who try to fix it with Ivy. This one worked for me:
对于那些试图用常春藤来修复它的人。这个方法对我有效:
<dependency org="jaxen" name="jaxen" rev="1.1.4"/>
<dependency org="net.sourceforge.cobertura" name="cobertura" rev="1.9.4.1"/>
<dependency org="com.google.code.findbugs" name="findbugs" rev="2.0.1"/>
<dependency org="org.jdom" name="jdom" rev="2.0.2">
<exclude module="jaxen"/>
<exclude name="maven-cobertura-plugin"/>
<exclude name="maven-findbugs-plugin"/>
</dependency>
#3
0
Look in your local repository (normaly in <home>/.m2
), where the artifacts should be. You'll find <artifactname>.lastUpdated
files there. delete those and try again.
查看本地存储库(在
Possibly the artifacts failed to load due to network problems and now aren't even checked.
可能由于网络问题,工件无法加载,现在甚至没有检查。
#4
0
You can use the POM editor in Eclipse to see the dependency graph. It quickly showed my that jaxen-1.1.3 includes old maven1 dependencies. Eclipse even offers excluding them on the spot. Nice.
您可以在Eclipse中使用POM编辑器查看依赖关系图。它很快显示了我的jaxen-1.1.3包含了老的maven1依赖项。Eclipse甚至提供排除它们的服务。好了。
#1
24
You should add those two plugins to your pom.
您应该将这两个插件添加到您的pom中。
For cobertura, see this page.
对于cobertura来说,请看这一页。
For findbugs, see this page.
对于findbugs,请参见此页。
----- UPDATED -----
- - - - - - - - - - - -更新
OK, I found the problem. It appears that you depend on jdom 1.1.2, which depends on jaxen 1.1.3 of which artifact is broken.
好吧,我发现问题了。看起来您依赖于jdom 1.1.2,它依赖于jaxen 1.1.3的工件被破坏。
You can either try another jdom version or add to your pom the snapshot described in this site. Worked for me when I ran your pom on my PC. I copied the snapshot:
您可以尝试另一个jdom版本或添加到您的pom中描述的快照。当我在我的电脑上运行你的pom时为我工作。我复制快照:
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1.3</version>
<!-- http://jira.codehaus.org/browse/JAXEN-217 -->
<exclusions>
<exclusion>
<groupId>maven-plugins</groupId>
<artifactId>maven-cobertura-plugin</artifactId>
</exclusion>
<exclusion>
<groupId>maven-plugins</groupId>
<artifactId>maven-findbugs-plugin</artifactId>
</exclusion>
</exclusions>
</dependency>
#2
3
For those who try to fix it with Ivy. This one worked for me:
对于那些试图用常春藤来修复它的人。这个方法对我有效:
<dependency org="jaxen" name="jaxen" rev="1.1.4"/>
<dependency org="net.sourceforge.cobertura" name="cobertura" rev="1.9.4.1"/>
<dependency org="com.google.code.findbugs" name="findbugs" rev="2.0.1"/>
<dependency org="org.jdom" name="jdom" rev="2.0.2">
<exclude module="jaxen"/>
<exclude name="maven-cobertura-plugin"/>
<exclude name="maven-findbugs-plugin"/>
</dependency>
#3
0
Look in your local repository (normaly in <home>/.m2
), where the artifacts should be. You'll find <artifactname>.lastUpdated
files there. delete those and try again.
查看本地存储库(在
Possibly the artifacts failed to load due to network problems and now aren't even checked.
可能由于网络问题,工件无法加载,现在甚至没有检查。
#4
0
You can use the POM editor in Eclipse to see the dependency graph. It quickly showed my that jaxen-1.1.3 includes old maven1 dependencies. Eclipse even offers excluding them on the spot. Nice.
您可以在Eclipse中使用POM编辑器查看依赖关系图。它很快显示了我的jaxen-1.1.3包含了老的maven1依赖项。Eclipse甚至提供排除它们的服务。好了。