简体   繁体   English

我如何在使用Maven为Linux上的Jenkins编译cobertura-plugin时解决丢失的工件

[英]How do i resolve missing artifact while using maven to compile cobertura-plugin for Jenkins on linux

Following is a stdout trace: 以下是标准输出跟踪:

cobertura-plugin$ mvn clean package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) com.sun:tools:jar:1.5

  Try downloading the file manually from the project website.

  Then, install it using the command: 
      mvn install:install-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.5 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there: 
      mvn deploy:deploy-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.5 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency: 
    1) org.jenkins-ci.tools:maven-hpi-plugin:maven-plugin:1.67
    2) org.kohsuke.stapler:maven-stapler-plugin:jar:1.15
    3) com.sun:tools:jar:1.5

----------
1 required artifact is missing.

for artifact: 
  org.jenkins-ci.tools:maven-hpi-plugin:maven-plugin:1.67

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  m.g.o-public (http://maven.glassfish.org/content/groups/public/)



[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Mon Jun 20 22:25:17 EDT 2011
[INFO] Final Memory: 9M/21M
[INFO] ------------------------------------------------------------------------

You may be facing the problem discussed here . 您可能正面临此处讨论的问题。 Your JAVA_HOME maybe pointing to the JRE instead of JDK. 您的JAVA_HOME可能指向JRE而不是JDK。

It seems to me like a bug, not sure whether it's in the JDK or in the Cobertura plugin. 在我看来,这似乎是一个错误,不确定是在JDK中还是在Cobertura插件中。 I get the error only on Mac OS, and only if I use the Cobertura plugin. 仅在Mac OS上并且仅在使用Cobertura插件时才出现错误。 A workaround that works for me is to add this to pom.xml: 一个对我有用的解决方法是将其添加到pom.xml中:

<profiles>
  <profile>
    <id>osx_profile</id>
    <activation>
     <os>
       <family>mac</family>
     </os>
    </activation>
    <dependencies>
     <dependency>
       <groupId>com.sun</groupId>
       <artifactId>tools</artifactId>
       <version>1.6</version>
       <scope>system</scope>
       <systemPath>${java.home}/../Classes/classes.jar</systemPath>
     </dependency>
    </dependencies>
  </profile>
</profiles>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Artifactory插件和Credentials插件将Jenven的Maven工件部署到Artifactory时解决401失败? - How can I resolve a 401 failure when deploying a Maven artifact from Jenkins to Artifactory using the Artifactory Plugin and the Credentials Plugin? 我如何正确整合Maven,Jenkins,Sonar和Cobertura? - How do I correctly integrate Maven, Jenkins, Sonar and Cobertura? 使用Maven为Jenkins构建git插件时,如何解决依赖关系? - How do I resolve the dependencies when using Maven to build git plugin for Jenkins? 如何在maven-cobertura-plugin中运行cobertura测试? - How do I configure when cobertura tests run in maven-cobertura-plugin? 使用cobertura maven插件时,如何设置cobertura数据文件的位置? - How can I set the location for the cobertura data file when using the cobertura maven plugin? 如何在不使用依赖项的情况下在命令行下载 Maven 工件:get 或 maven-download-plugin? - How do I download a Maven artifact at the command line without using dependency:get or maven-download-plugin? 常春藤无法解决Maven-cobertura-plugin - Ivy cannot resolve maven-cobertura-plugin 如何在pom插件中将pom设置为默认工件? - How do I set the pom as the default artifact in a maven plugin? 如何配置Maven-cobertura-plugin来检测依赖项jar - How do I configure maven-cobertura-plugin to instrument a dependency jar 缺少github Maven插件工件 - Missing github maven plugin artifact
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM