2010-03-04 56 views
1

我是新來的maven,而使用mvn安裝我有這個錯誤,任何想法?Maven無效的URI

在此先感謝

 
    java.lang.IllegalArgumentException: Invalid uri 'http://maven.mysite.com:9999/repository/npg/data-recovery/${applicationVersion}/data-recovery-${applicationVersion}.pom': escaped absolute path not valid 
     at hidden.org.apache.commons.httpclient.HttpMethodBase.(HttpMethodBase.java:222) 
     at hidden.org.apache.commons.httpclient.methods.GetMethod.(GetMethod.java:89) 
     at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:547) 
     at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116) 
     at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88) 
     at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61) 
     at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:491) 
     at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:372) 
     at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:327) 
     at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:216) 
     at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90) 
     at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:558) 
     at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1392) 
     at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:823) 
     at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:255) 
     at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocatedProject(MavenMetadataSource.java:163) 
     at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocatedArtifact(MavenMetadataSource.java:94) 
     at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(DefaultArtifactCollector.java:388) 
     at org.apache.maven.artifact.resolver.DefaultArtifactCollector.collect(DefaultArtifactCollector.java:74) 
     at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:316) 
     at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:304) 
     at org.apache.maven.plugin.DefaultPluginManager.resolveTransitiveDependencies(DefaultPluginManager.java:1492) 
     at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:435) 
     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678) 
     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540) 
     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519) 
     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371) 
     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332) 
     at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181) 
     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356) 
     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137) 
     at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) 
     at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41) 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
     at java.lang.reflect.Method.invoke(Method.java:597) 
     at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) 
     at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) 
     at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) 
     at org.codehaus.classworlds.Launcher.main(Launcher.java:375) 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 6 seconds 
[INFO] Finished at: Thu Mar 04 15:12:56 EET 2010 
[INFO] Final Memory: 19M/35M 

回答

1

您在某處使用<version>${applicationVersion}</version>(可能在此POM中,或者如果版本被繼承,可能是在父POM中),但此屬性未得到解決。您需要定義是這樣的:

<project> 
    <properties> 
    <applicationVersion>x.y.z</applicationVersion> 
    </properties> 
    ... 
</project> 

注意,我真的沒有看到使用這種性質的角度來看,有一個內置在指項目的版本(你可以${project.version}財產例如在依賴中使用)。查看MavenPropertiesGuide瞭解更多關於可用屬性的詳細信息。

1

酒店${applicationVersion}不解決所示的URI路徑:

'http://maven.mysite.com:9999/repository/npg/data-recovery/${applicationVersion}/data-recovery-${applicationVersion}.pom' 

我想這是在你的POM配置的依賴。你應該在pom.xml的依賴關係中找到「數據恢復」 - 我的賭注是它的<version>屬性設置爲${applicationVersion}。如果是這樣,你應該爲它設置具體的版本。

0

我在使用屬性在我的子模塊中設置父pom版本時遇到同樣的問題。

你可以使用maven release插件來實現這一點。只需在您的父pom文件中更新版本並運行以下命令即可從父文件夾更新子模塊中的版本:

mvn -N versions:update-child-modules