2012-10-13 41 views
1

我对Maven非常非常陌生。我收到以下错误Maven未解决Netbeans 7.2

The following artifacts could not be resolved: stax:stax:jar:1.0, stax:stax-ri:jar:1.0, clover:clover:jar:1.3-rc4: Failure to find stax:stax:jar:1.0 in http://repo.maven.apache.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] 

To see the full stack trace of the errors, re-run Maven with the -e switch. 
Re-run Maven using the -X switch to enable full debug logging. 

一些研究(例如NetBeans: Re-run Maven with the -e switch on/PluginResolutionException)后,它说我需要编辑我~/.m2/settings.xml文件。

我看着这个文件,我看不出要改变什么。所以,我包括它下面的输入:

的settings.xml

<?xml version="1.0" encoding="UTF-8"?> 
<!-- 
User-specific configuration for maven. Includes things that should not 
be distributed with the pom.xml file, such as developer identity, along with 
local settings, like proxy information. The default location for the 
settings file is ~/.m2/settings.xml 
--> 
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> 
<!--proxies> 
    <proxy> 
     <host>my.proxy.host</host> 
    </proxy> 
</proxies--> 

<!--pluginGroups> 
    <pluginGroup>org.codehaus.mojo</pluginGroup> 
</pluginGroups--> 

的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>com.schoolsupplies.v5</groupId> 
<artifactId>com.schoolsupplies.v5.test</artifactId> 
<version>1.0-SNAPSHOT</version> 
<packaging>jar</packaging> 

<name>com.schoolsupplies.v5.test</name> 

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
</properties> 

<dependencies> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.10</version> 
     <scope>test</scope> 
     <type>jar</type> 
    </dependency> 
    <dependency> 
     <groupId>com.sun.jersey</groupId> 
     <artifactId>jersey-client</artifactId> 
     <version>1.14</version> 
     <scope>test</scope> 
     <type>jar</type> 
    </dependency> 
    <dependency> 
     <groupId>org.codehaus.jettison</groupId> 
     <artifactId>jettison</artifactId> 
     <version>1.1</version> 
     <scope>test</scope> 
     <type>jar</type> 
    </dependency> 
    <dependency> 
    <groupId>dom4j</groupId> 
    <artifactId>dom4j</artifactId> 
    <version>20040902.021138</version> 
    <type>jar</type> 
    </dependency> 
</dependencies> 

回答

0

我打开依赖目录,并删除所有那些制造麻烦的罐子 - 特别是因为它们在中没有明确要求文件。做完之后,一切正常。

看来,maven决定我的一些明确导入的依赖需要这些文件。在我的情况下:stax:stax-ri:jar:1.0,clover:clover:jar:1.3-rc4

0

我也有同样的错误。我将存储库添加到了pom.xml中,并且一切正常。

像这个例子:

<repositories> 
    <repository> 
    <id>bukkit-repo</id> 
    <url>http://repo.bukkit.org/content/groups/public/</url> 
    </repository> 
<repositories>