mvn程序包由于缺少必需工件而失败,即使它存在于我的远程存储库中 [英] mvn package fails with Required Artifact Missing even though it exists in my Remote Repository

查看:54
本文介绍了mvn程序包由于缺少必需工件而失败,即使它存在于我的远程存储库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的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)

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

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

我将不胜感激.预先感谢.

Henrique Ordine

解决方案

显然,错误消息缺少所需的工件"隐藏了根本的根本原因,该原因在消息中不可见.在调试消息打开的情况下(-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

没有调试标志就看不到.

I'm trying to run mvn clean package on my Maven project and it fails with the message:

"required artifact is missing" for the artifact net.ezswitch:ResourcesComponent:jar:0.0.14

I've configured my settings.xml to include my Remote Repository and if I navigate, on my browser, I can actually find this Jar in my repository, but Maven can't, somehow.

I've checked that the Maven version that I'm running is the one for which the settings.xml file that I've edited takes effect, because if I disable the Profile that I configured there, Maven fails with a different message.

I'm using Maven 2.2.1 on MAC OS X Lion.

Here's my 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>

And the entire error message that I get is:

[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)

But if I navigate, via my browser, to that Location, I can see the Artifact at the following location:

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

I'd be grateful for any help. Thanks in advance.

Henrique Ordine

解决方案

Apparently error message "required artifact is missing" was hiding the actual root cause, which was not visible in the message(s). Running Maven with debug messages on (-X option) will print out additional information that gives more detailed insight as to what would be the problem.

For future reference, this time the error was

[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

Which wasn't visible without the debug flag.

这篇关于mvn程序包由于缺少必需工件而失败,即使它存在于我的远程存储库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆