Maven clean install失败[索引处路径中的非法字符]

时间:2014-07-18 16:04:50

标签: java eclipse maven windows-8.1 artifactory

我在Jfrog Artifactory中使用windows 8.1。我部署了hibernate jarsArtifactory deploy选项。但是当我尝试使用maven clean install选项时,我最终出现了以下错误。

    [ERROR] Failed to execute goal on project hibernate: Could not resolve dependencies for project com.bala.exercises.hibernate:hibernate:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [junit:junit:jar:3.8.1 (test), com.fasterxml:classmate:jar:1.0.0 (compile), dom4j:dom4j:jar:1.6.1 (compile), hibernate-core:hibernate-core:jar:4.3.5.Final (compile), hibernate-commons-annotations:hibernate-commons-annotations:jar:4.0.4.Final (compile), hibernate-jpa:hibernate-jpa:jar:1.0.0.Final:2.1-api (compile), org.jboss:jandex:jar:1.1.0.Final (compile), org.javassist:javassist:jar:3.18.1-GA (compile), org.jboss.logging:jboss-logging:jar:3.1.3.GA (compile), mysql-connector-java:mysql-connector-java:jar:bin:5.1.31 (compile)]: Failed to read artifact descriptor for hibernate-core:hibernate-core:jar:4.3.5.Final: Could not transfer artifact hibernate-core:hibernate-core:pom:4.3.5.Final from/to balahome server (http://localhost:8080/artifactory/ bala-libs-mandatories): Illegal character in path at index 34: http://localhost:8080/artifactory/ bala-libs-mandatories/hibernate-core/hibernate-core/4.3.5.Final/hibernate-core-4.3.5.Final.pom -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project hibernate: Could not resolve dependencies for project com.bala.exercises.hibernate:hibernate:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [junit:junit:jar:3.8.1 (test), com.fasterxml:classmate:jar:1.0.0 (compile), dom4j:dom4j:jar:1.6.1 (compile), hibernate-core:hibernate-core:jar:4.3.5.Final (compile), hibernate-commons-annotations:hibernate-commons-annotations:jar:4.0.4.Final (compile), hibernate-jpa:hibernate-jpa:jar:1.0.0.Final:2.1-api (compile), org.jboss:jandex:jar:1.1.0.Final (compile), org.javassist:javassist:jar:3.18.1-GA (compile), org.jboss.logging:jboss-logging:jar:3.1.3.GA (compile), mysql-connector-java:mysql-connector-java:jar:bin:5.1.31 (compile)]
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:210)
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:117)
    at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:258)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:201)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.bala.exercises.hibernate:hibernate:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [junit:junit:jar:3.8.1 (test), com.fasterxml:classmate:jar:1.0.0 (compile), dom4j:dom4j:jar:1.6.1 (compile), hibernate-core:hibernate-core:jar:4.3.5.Final (compile), hibernate-commons-annotations:hibernate-commons-annotations:jar:4.0.4.Final (compile), hibernate-jpa:hibernate-jpa:jar:1.0.0.Final:2.1-api (compile), org.jboss:jandex:jar:1.1.0.Final (compile), org.javassist:javassist:jar:3.18.1-GA (compile), org.jboss.logging:jboss-logging:jar:3.1.3.GA (compile), mysql-connector-java:mysql-connector-java:jar:bin:5.1.31 (compile)]
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:158)
    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:185)
    ... 22 more
Caused by: org.sonatype.aether.collection.DependencyCollectionException: Failed to collect dependencies for [junit:junit:jar:3.8.1 (test), com.fasterxml:classmate:jar:1.0.0 (compile), dom4j:dom4j:jar:1.6.1 (compile), hibernate-core:hibernate-core:jar:4.3.5.Final (compile), hibernate-commons-annotations:hibernate-commons-annotations:jar:4.0.4.Final (compile), hibernate-jpa:hibernate-jpa:jar:1.0.0.Final:2.1-api (compile), org.jboss:jandex:jar:1.1.0.Final (compile), org.javassist:javassist:jar:3.18.1-GA (compile), org.jboss.logging:jboss-logging:jar:3.1.3.GA (compile), mysql-connector-java:mysql-connector-java:jar:bin:5.1.31 (compile)]
    at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:258)
    at org.sonatype.aether.impl.internal.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:308)
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:150)
    ... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for hibernate-core:hibernate-core:jar:4.3.5.Final
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:296)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
    at org.sonatype.aether.impl.internal.DefaultDependencyCollector.process(DefaultDependencyCollector.java:412)
    at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:240)
    ... 25 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not transfer artifact hibernate-core:hibernate-core:pom:4.3.5.Final from/to balahome server (http://localhost:8080/artifactory/ bala-libs-mandatories): Illegal character in path at index 34: http://localhost:8080/artifactory/ bachan-libs-mandatories/hibernate-core/hibernate-core/4.3.5.Final/hibernate-core-4.3.5.Final.pom
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:281)
    ... 28 more
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact hibernate-core:hibernate-core:pom:4.3.5.Final from/to balahome server (http://localhost:8080/artifactory/ bala-libs-mandatories): Illegal character in path at index 34: http://localhost:8080/artifactory/ bachan-libs-mandatories/hibernate-core/hibernate-core/4.3.5.Final/hibernate-core-4.3.5.Final.pom
    at org.sonatype.aether.connector.async.AsyncRepositoryConnector$3.wrap(AsyncRepositoryConnector.java:1546)
    at org.sonatype.aether.connector.async.AsyncRepositoryConnector$3.wrap(AsyncRepositoryConnector.java:1537)
    at org.sonatype.aether.connector.async.AsyncRepositoryConnector$GetTask.flush(AsyncRepositoryConnector.java:1035)
    at org.sonatype.aether.connector.async.AsyncRepositoryConnector.get(AsyncRepositoryConnector.java:409)
    at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:457)
    ... 31 more
Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 34: http://localhost:8080/artifactory/ bachan-libs-mandatories/hibernate-core/hibernate-core/4.3.5.Final/hibernate-core-4.3.5.Final.pom
    at java.net.URI.create(Unknown Source)
    at com.ning.http.client.RequestBuilderBase.buildUrl(RequestBuilderBase.java:299)
    at com.ning.http.client.RequestBuilderBase.setUrl(RequestBuilderBase.java:294)
    at com.ning.http.client.AsyncHttpClient$BoundRequestBuilder.setUrl(AsyncHttpClient.java:333)
    at com.ning.http.client.AsyncHttpClient.requestBuilder(AsyncHttpClient.java:560)
    at com.ning.http.client.AsyncHttpClient.prepareGet(AsyncHttpClient.java:405)
    at org.sonatype.aether.connector.async.AsyncRepositoryConnector$GetTask.run(AsyncRepositoryConnector.java:596)
    at org.sonatype.aether.connector.async.AsyncRepositoryConnector.get(AsyncRepositoryConnector.java:402)
    ... 32 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 34: http://localhost:8080/artifactory/ bachan-libs-mandatories/hibernate-core/hibernate-core/4.3.5.Final/hibernate-core-4.3.5.Final.pom
    at java.net.URI$Parser.fail(Unknown Source)
    at java.net.URI$Parser.checkChars(Unknown Source)
    at java.net.URI$Parser.parseHierarchical(Unknown Source)
    at java.net.URI$Parser.parse(Unknown Source)
    at java.net.URI.<init>(Unknown Source)
    ... 40 more

我下载并部署了各自的pom文件,但没有运气。除非我退出eclipse,否则我无法清除.m2中的windows 8.1存储库。

感谢。

1 个答案:

答案 0 :(得分:6)

当你有一个像这样重叠的堆栈跟踪时,记住原始原因位于底部是有帮助的(其余的是在某些情况下可能有用的上下文)。在这种情况下,它是

java.net.URISyntaxException: Illegal character in path at index 34: http://localhost:8080/artifactory/ bachan-libs-mandatories/hibernate-core/hibernate-core/4.3.5.Final/hibernate-core-4.3.5.Final.pom

然后很容易看到路径http://localhost:8080/artifactory/ bala-libs-mandatories中有空格。如果是拼写错误,请删除它,否则将其编码为%20。