首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从Jenkins运行时"latest.integration“的常春藤解析失败

从Jenkins运行时"latest.integration“的常春藤解析失败
EN

Stack Overflow用户
提问于 2014-02-28 12:28:33
回答 1查看 1.2K关注 0票数 0

因此,我有一个现有的ant构建,我想使用Ivy来解决它的依赖关系。我有一个ivy.xml和ivysettings.xml文件,这两个文件都可以在Eclipse中使用IvyDE,也可以在命令行对ivy-2.3.0.jar运行时工作。(它们的工作方式与常春藤报告中下载的依赖项一样)。

我遇到的问题是,当'rev‘属性被列为'latest.integration’时,它们在从任何构建脚本运行时都不能工作。如果我指定了一个版本,那么依赖项就会被解析。要明确的是,这种特定的依赖关系是由Artifactory托管的内部库。

对于我能改变什么或试图找出问题,我感到相当困惑。当我运行常春藤时,我也会遇到同样的失败。

请注意,Jenkins正在mac上运行,但我可以使用Ivy jar直接使用该机器上相同的常春藤文件来解决依赖关系,这个问题只有在通过Jenkins解析时才会出现。

我意识到,这不太可能是一个人可以直接观察和指出问题的东西,尤其是考虑到在看似所有其他情况下,即使是通过eclipse从ant构建中运行代码片段,解决方案也是正确的。但是,如果有人有任何建议,他们将非常欢迎!

不管怎样,我的ivy.xml

代码语言:javascript
复制
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
    <info
        organisation="MyOrg"
        module="MyModule"
        status="integration">
    </info>

    <dependencies>
        <dependency org="MyOrg" name="DEP" rev="latest.integration">
            <artifact name="DEP" type="jar" ext="jar" />
        </dependency>
        <dependency org="junit" name="junit" rev="4.8.1" />
    </dependencies>
</ivy-module>

和我的ivysettings.xml (依赖项命名为DEP-0.1-SNAPSHOT.jar)

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<ivy-settings>
  <settings defaultResolver="snapshot" />
  <!--Authentication required for publishing (deployment). 'Artifactory Realm' is the realm used by Artifactory so don't change it.-->
  <credentials host="HOST" realm="Artifactory Realm" username="USR" passwd="PASS" />
  <resolvers>
    <chain name="main">
      <!-- <ibiblio name="release" m2compatible="true" root="http://HOST/artifactory/libs-release" /> -->
      <chain name="snapshot" changingPattern="0.*" checkmodified="true">
        <ibiblio name="public" m2compatible="true" root="http://HOST/artifactory/libs-snapshot" />
      </chain>
    </chain>
  </resolvers>
</ivy-settings>

最后,我的构建脚本看起来就像

代码语言:javascript
复制
<project name="MyModule Continuous Integration" xmlns:ivy="antlib:org.apache.ivy.ant">
....
<target name = "resolveDependencies" >
    <ivy:configure file="/MyModule/ivysettings.xml" />
    <ivy:findrevision organisation="MyOrg" module="DEP" revision="latest.integration" property="found.revision" />
    <echo message="Found revision: ${found.revision}" />
    <ivy:resolve file="/MyModule/ivy.xml" refresh="true" type="jar" />
    <ivy:cachepath pathid="ivy.dependencies" />
</target>
....
</project>

为了完成,我从Jenkins构建中获得的输出是:

代码语言:javascript
复制
[ivy:findrevision] snapshot: Checking cache for: dependency: MyOrg#DEP;latest.integration {}
[ivy:findrevision] don't use cache for MyOrg#DEP;latest.integration: checkModified=true
[ivy:findrevision] default-cache: no cached resolved revision for MyOrg#DEP;latest.integration
[ivy:findrevision]      tried http://HOST/artifactory/libs-snapshot/MyOrg/DEP/[revision]/DEP-[revision].pom
[ivy:findrevision] CLIENT ERROR: Not Found url=http://HOST/artifactory/libs-snapshot/MyOrg/DEP/maven-metadata.xml
[ivy:findrevision]  maven-metadata not available: http://HOST/artifactory/libs-snapshot/MyOrg/DEP/maven-metadata.xml
[ivy:findrevision] WARN: problem while listing resources in http://HOST/artifactory/libs-snapshot/MyOrg/DEP/ with public:
[ivy:findrevision] WARN:   java.lang.NullPointerException null
[ivy:findrevision]      tried http://HOST/artifactory/libs-snapshot/MyOrg/DEP/[revision]/DEP-[revision].jar
[ivy:findrevision]  maven-metadata not available: http://HOST/artifactory/libs-snapshot/MyOrg/DEP/maven-metadata.xml
[ivy:findrevision] WARN: problem while listing resources in http://HOST/artifactory/libs-snapshot/MyOrg/DEP/ with public:
[ivy:findrevision] WARN:   java.lang.NullPointerException null
[ivy:findrevision]  public: no ivy file nor artifact found for MyOrg#DEP;latest.integration
Property "found.revision" has not been set
     [echo] Found revision: ${found.revision}

再次感谢你的建议,

丹。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-03-14 16:47:58

作为将来的参考,我已经设法通过交换到最新的Ivy 2.4 alpha构建来解决这个问题。看来这一定是2.3.0的问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22095258

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档