Maven非法争论异常

时间:2014-05-13 22:49:49

标签: java maven

我是Maven的新手,并希望得到一些我曾经遇到的问题的帮助。由于其中一个依赖关系URL存在非法参数异常,我无法编译我的一个项目。这是我的pom:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="https://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>
    <name>MDM-Map-Reduce</name>
    <groupId>com.cardinalhealth</groupId>
    <artifactId>MDM-Map-Reduce</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <repositories>
        <repository>
            <id>hortonworks</id>
            <url>
                http://repo.hortonworks.com/content/repositories/releases/
            </url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-core</artifactId>
            <version>1.1.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.hcatalog</groupId>
            <artifactId>hcatalog-core</artifactId>
            <version>0.5.0.21</version>
        </dependency>
    </dependencies>
</project>

这是mvn clean install输出的最后几行:

Downloading: http://repo.hortonworks.com/content/repositories/releases/org/apache/hcatalog/hcatalog-core/0.5.0.21/hcatalog-core-0.5.0.21.pom
4/4 KB        

Downloaded: http://repo.hortonworks.com/content/repositories/releases/org/apache/hcatalog/hcatalog-core/0.5.0.21/hcatalog-core-0.5.0.21.pom (4 KB at 28.4 KB/sec)
Downloading: http://repo.hortonworks.com/content/repositories/releases/org/apache/hcatalog/hcatalog/${hcatalog.version}/hcatalog-${hcatalog.version}.pom

Downloading: http://repo.maven.apache.org/maven2/org/apache/hcatalog/hcatalog/${hcatalog.version}/hcatalog-${hcatalog.version}.pom

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.895 s
[INFO] Finished at: 2014-05-13T17:52:15-05:00
[INFO] Final Memory: 5M/12M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project MDM-Map-Reduce: Could not resolve dependencies for project com.cardinalhealth:MDM-Map-Reduce:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.apache.hcatalog:hcatalog-core:jar:0.5.0.21: Failed to read artifact descriptor for org.apache.hcatalog:hcatalog-core:jar:0.5.0.21: Could not transfer artifact org.apache.hcatalog:hcatalog:pom:${hcatalog.version} from/to hortonworks (http://repo.hortonworks.com/content/repositories/releases/): IllegalArgumentException: Illegal character in path at index 88: http://repo.hortonworks.com/content/repositories/releases/org/apache/hcatalog/hcatalog/${hcatalog.version}/hcatalog-${hcatalog.version}.pom -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

(我必须在http://之后打破网址,并为SO留出空间以允许我发帖)

如果您注意到它似乎试图将相同的依赖关系拉两次,我就不知道为什么会这样做,或者为什么它无法正确解析参数。

我在这里附加了相关文件,我是一个完整的Maven新手所以我已经包含了目录布局(列表中),pom和mvn clean install的输出,包括标准和扩展(即使用-e进行堆栈跟踪) )。

https://drive.google.com/folderview?id=0B_G2bKn27T9raFVoMkl0LUQyT28&usp=sharing

1 个答案:

答案 0 :(得分:0)

使用pluginrepo代替存储库

e.g。

<pluginRepositories>
    <pluginRepository>
      <id>apache.snapshots</id>
      <url>http://repository.apache.org/snapshots/</url>
    </pluginRepository>
  </pluginRepositories>