我正在尝试在我的 Maven 项目上运行mvn clean package并失败并显示以下消息:
工件 net.ezswitch:ResourcesComponent:jar:0.0.14 的“所需工件丢失”
我已经配置了我的settings.xml以包含我的远程存储库,如果我在浏览器上导航,我实际上可以在我的存储库中找到这个 Jar,但 Maven 不知何故不能。
我检查了我正在运行的 Maven 版本是我编辑的 settings.xml 文件生效的版本,因为如果我禁用我在那里配置的配置文件,Maven 会失败并显示不同的消息。
我在 MAC OS X Lion 上使用 Maven 2.2.1。
这是我的settings.xml:
<localRepository>/Users/hordine/.m2/repository</localRepository>
<servers>
<server>
<id>LiquixRepository</id>
<username>henrique</username>
<password>xxxxx</password>
<configuration>
<httpConfiguration>
<put>
<params>
<param>
<name>http.authentication.preemptive</name>
<value>%b,true</value>
</param>
</params>
</put>
</httpConfiguration>
</configuration>
</server>
<server>
<id>dev.liquix.eu</id>
<username>henrique</username>
<password>xxxxx</password>
</server>
<server>
<id>ezpay-dev.liquix.eu</id>
<username>henrique</username>
<password>xxxxx</password>
</server>
</servers>
<profiles>
<profile>
<id>ezswitch</id>
<properties>
<tomcat.home>/System/Library/tomcat</tomcat.home>
<subversion.user>henrique</subversion.user>
<subversion.password>xxxxx</subversion.password>
</properties>
<activation>
<jdk>1.6</jdk>
</activation>
<repositories>
<repository>
<id>central</id>
<name>EzSwitch Cache</name>
<layout>default</layout>
<url>http://ezpay-dev.liquix.eu:9998/repository</url>
</repository>
<repository>
<id>central_maven1</id>
<name>EzSwitch Cache2</name>
<layout>legacy</layout>
<url>http://ezpay-dev.liquix.eu:9998/repository</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>EZswitch</name>
<url>http://ezpay-dev.liquix.eu:9998/repository</url>
<snapshots>
</snapshots>
<releases>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>ezswitch</activeProfile>
</activeProfiles>
我得到的整个错误消息是:
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Missing:
----------
1) net.ezswitch:ResourcesComponent:jar:0.0.14
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=net.ezswitch -DartifactId=ResourcesComponent -Dversion=0.0.14 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=net.ezswitch -DartifactId=ResourcesComponent -Dversion=0.0.14 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) eu.liquix:RegistrationSolution:war:0.4.60-SNAPSHOT
2) net.ezswitch:ResourcesComponent:jar:0.0.14
----------
1 required artifact is missing.
for artifact:
eu.liquix:RegistrationSolution:war:0.4.60-SNAPSHOT
from the specified remote repositories:
central (http://ezpay-dev.liquix.eu:9998/repository),
central_maven1 (http://ezpay-dev.liquix.eu:9998/repository)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:711)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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)
但是,如果我通过浏览器导航到该位置,我可以在以下位置看到工件:
我会很感激任何帮助。提前致谢。
恩里克·奥尔丁