gpt4 book ai didi

maven - 即使 mvn 包存在于我的远程存储库中,它也因缺少必需的 Artifact 而失败

转载 作者:行者123 更新时间:2023-12-04 18:47:57 29 4
gpt4 key购买 nike

我正在尝试在我的 Maven 项目上运行 mvn clean package 并且它失败并显示以下消息:

Artifact net.ezswitch:ResourcesComponent:jar:0.0.14 的“缺少必需 Artifact ”

我已经配置了我的 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)

但是,如果我通过浏览器导航到该位置,则可以在以下位置看到 Artifact:

http://ezpay-dev.liquix.eu:9998/repository/net/ezswitch/ResourcesComponent/0.0.14/ResourcesComponent-0.0.14.jar

我会很感激任何帮助。提前致谢。

恩里克·奥丁

最佳答案

显然,错误消息“缺少所需的 Artifact ”隐藏了实际的根本原因,这在消息中不可见。运行带有调试消息(-X 选项)的 Maven 将打印出额外的信息,这些信息提供了关于问题所在的更详细的见解。

为了将来引用,这次的错误是

[WARNING] Unable to get resource 'net.ezswitch:ResourcesComponent:pom:0.0.14' from repository central (ezpay-dev.liquix.eu:9998/repository):
Specified destination directory cannot be created: /Users/hordine/.m2/repository/net/ezswitch/ResourcesComponent/0.0.14

如果没有调试标志,这是不可见的。

关于maven - 即使 mvn 包存在于我的远程存储库中,它也因缺少必需的 Artifact 而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11031171/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com