我正在尝试在Maven项目中使用xom,但我收到错误
Description Resource Path Location Type
ArtifactDescriptorException: Failed to read artifact descriptor for xom:xom:jar:1.2.5: ArtifactResolutionException: Failure to transfer xom:xom:pom:1.2.5 from http://repo2.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of repo2_maven_org has elapsed or updates are forced. Original error: Could not transfer artifact xom:xom:pom:1.2.5 from/to repo2_maven_org (http://repo2.maven.org/maven2): null to http://repo2.maven.org/maven2/xom/xom/1.2.5/xom-1.2.5.pom pom.xml /tahrir line 1 Maven Dependency Problem
我的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>tahrirproject</groupId>
<artifactId>tahrir</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<project.build.mainClass>tahrir.TrMain</project.build.mainClass>
<!-- I need to explicitly specify encoding to avoid non-standard, like was GBK or GB18030. Because I live in China. -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<pluginRepositories>
<pluginRepository>
<id>codehaus-snapshots</id>
<url>http://nexus.codehaus.org/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>tahrir.TrMain</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Proguard setup, see http://blog.boxofrats.com/2009/08/07/setting-up-maven-for-scala-and-proguard/ -->
<plugin>
<groupId>com.pyx4me</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.0.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<options>
<option>-allowaccessmodification</option>
<option>-keep public class ${project.build.mainClass} { public
static void main(java.lang.String[]);}</option>
<option>-dontwarn</option>
<option>-dontskipnonpubliclibraryclasses</option>
<option>-dontskipnonpubliclibraryclassmembers</option>
</options>
<includeDependency>false</includeDependency>
<injar>${project.build.finalName}-jar-with-dependencies.jar</injar>
<outjar>${project.build.finalName}-shrunk.jar</outjar>
<libs>
<!-- WARNING: This is required on OSX, will need to be adjusted for
other platforms because these jar files are in a different location -->
<lib>${java.home}/../Classes/classes.jar</lib>
<lib>${java.home}/../Classes/jce.jar</lib>
</libs>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>repo2_maven_org</id>
<url>http://repo2.maven.org/maven2</url>
</repository>
<repository>
<id>doodleproject-repo</id>
<name>DoodleProject Maven 2 Repository</name>
<url>http://doodleproject.sourceforge.net/maven2/release</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.sf.doodleproject</groupId>
<artifactId>numerics4j</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>1.4</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>args4j</groupId>
<artifactId>args4j</artifactId>
<version>2.0.9</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>5.14</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
<version>140</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>13.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>0.9.28</version>
</dependency>
<dependency>
<groupId>com.miglayout</groupId>
<artifactId>miglayout</artifactId>
<version>3.7.4</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-db4o</artifactId>
<version>3.0.0-m3</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>1.6.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.seaglasslookandfeel</groupId>
<artifactId>seaglasslookandfeel</artifactId>
<version>0.2</version>
</dependency>
<dependency>
<groupId>xom</groupId>
<artifactId>xom</artifactId>
<version>1.2.5</version>
</dependency>
</dependencies>
答案 0 :(得分:0)
通过清除.m2/rerepository
文件夹并从头开始重新构建项目来管理以解决问题。