Ant ivy:buildnumber在文件扩展名/类型不是.jar的情况下对Artifactory失败

Ant ivy:buildnumber在文件扩展名/类型不是.jar的情况下对Artifactory失败,ant,ivy,artifactory,Ant,Ivy,Artifactory,我正在用Ivy2.3.0、Artifactory3.0.3和Ant进行实验。问题是,如果我使用的文件扩展名不是.jar,我就无法将ivy:buildnumber设置为针对Artifactory repo工作。它和我当地的一个很相配。当我对Artifactory进行尝试时,如果设置buildnumber失败。使用-debug运行Ant时,我会得到以下输出: Setting project property: ivy.version -> 2.3.0 [ivy:buildnumber]

我正在用Ivy2.3.0、Artifactory3.0.3和Ant进行实验。问题是,如果我使用的文件扩展名不是.jar,我就无法将ivy:buildnumber设置为针对Artifactory repo工作。它和我当地的一个很相配。当我对Artifactory进行尝试时,如果设置buildnumber失败。使用-debug运行Ant时,我会得到以下输出:

Setting project property: ivy.version -> 2.3.0
[ivy:buildnumber]       using oe to list all in ${http://localhost:8081/artifactory/repo/com/testorg/testmod
[ivy:buildnumber]       using oe to list all in http://localhost:8081/artifactory/repo/com/testorg/testmod/
[ivy:buildnumber] ApacheURLLister found URL=[http://localhost:8081/artifactory/repo/com/testorg/testmod/20130814190841/].
[ivy:buildnumber] ApacheURLLister found URL=[http://localhost:8081/artifactory/repo/com/testorg/testmod/ivy-20130814190841.xml].
[ivy:buildnumber] ApacheURLLister found URL=[http://localhost:8081/artifactory/repo/com/testorg/testmod/ivy-20130814190841.xml.md5].
[ivy:buildnumber] ApacheURLLister found URL=[http://localhost:8081/artifactory/repo/com/testorg/testmod/ivy-20130814190841.xml.sha1].
[ivy:buildnumber]               found 4 resources
[ivy:buildnumber]       using oe to list all in http://localhost:8081/artifactory/repo/com/testorg/testmod/20130814190841
[ivy:buildnumber] ApacheURLLister found URL=[http://localhost:8081/artifactory/repo/com/testorg/testmod/20130814190841/testmod-20130814190841.pl].
[ivy:buildnumber] ApacheURLLister found URL=[http://localhost:8081/artifactory/repo/com/testorg/testmod/20130814190841/testmod-20130814190841.pl.md5].
[ivy:buildnumber] ApacheURLLister found URL=[http://localhost:8081/artifactory/repo/com/testorg/testmod/20130814190841/testmod-20130814190841.pl.sha1].
[ivy:buildnumber]               found 3 urls
[ivy:buildnumber]               0 matched http://localhost:8081/artifactory/repo/com/testorg/testmod/20130814190841/[artifact]-20130814190841.jar
[ivy:buildnumber]       using oe to list all in http://localhost:8081/artifactory/repo/com/testorg/testmod/ivy-20130814190841.xml
[ivy:buildnumber] HTTP response status: 404 url=http://localhost:8081/artifactory/repo/com/testorg/testmod/ivy-20130814190841.xml/
[ivy:buildnumber] CLIENT ERROR: Not Found url=http://localhost:8081/artifactory/repo/com/testorg/testmod/ivy-20130814190841.xml/
[ivy:buildnumber] problem while listing resources in http://localhost:8081/artifactory/repo/com/testorg/testmod/ivy-20130814190841.xml with oe:
[ivy:buildnumber]   java.io.IOException The HTTP response code for http://localhost:8081/artifactory/repo/com/testorg/testmod/ivy-20130814190841.xml/ did not indicate a success. See log for more detail.
[ivy:buildnumber]       using oe to list all in http://localhost:8081/artifactory/repo/com/testorg/testmod/ivy-20130814190841.xml.md5
[ivy:buildnumber]               found 0 urls
[ivy:buildnumber]               0 matched http://localhost:8081/artifactory/repo/com/testorg/testmod/ivy-20130814190841.xml.md5/[artifact]-ivy-20130814190841.xml.md5.jar
[ivy:buildnumber]       using oe to list all in http://localhost:8081/artifactory/repo/com/testorg/testmod/ivy-20130814190841.xml.sha1
[ivy:buildnumber]               found 0 urls
[ivy:buildnumber]               0 matched http://localhost:8081/artifactory/repo/com/testorg/testmod/ivy-20130814190841.xml.sha1/[artifact]-ivy-20130814190841.xml.sha1.jar
Setting project property: ivy.new.revision -> 0
Setting project property: ivy.new.build.number -> 0
Property "ivy.build.number" has not been set
  [echo] new.rev: working@Win7Dev 0 ${ivy.build.number} 0
关键线似乎是:

[ivy:buildnumber]               0 matched http://localhost:8081/artifactory/repo/com/testorg/testmod/20130814190841/[artifact]-20130814190841.jar
如果文件是.jar文件,则会显示“1匹配…”,并设置buildnumber。另一方面,如果它是其他东西,比如.zip,它就会失败,如上所示

ivy.xml文件中项目的定义为:

<publications>
  <artifact name="testmod" ext="zip" type="zip"/>
</publications> 

似乎artifactory没有选择具有2个字符的扩展,它必须至少具有3个字符。。。。我也不明白为什么。

谢谢你发这个帖子。我被困在同一个问题上。看起来我将为非jar工件使用单独的常春藤设置,这样我就可以硬编码扩展。这似乎奏效了。
<ivy:info/>

<ivy:buildnumber resolver="oe" organisation="${ivy.organisation}" module="${ivy.module}"/>

<echo>new.rev: ${ivy.revision} ${ivy.new.revision} ${ivy.build.number} ${ivy.new.build.number}</echo>
<url name="oe" m2compatible="true" >
  <ivy pattern="${http://localhost:8081/artifactory/repo/[organisation]/[module]/ivy-[revision].xml"/>
  <artifact pattern="http://localhost:8081/artifactory/repo/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>      
</url> 
<ibiblio name="oe1" m2compatible="true" root="http://localhost:8081/artifactory/repo" useMavenMetadata="false"/> 
Ivy pattern: [organisation]/[module]/ivy-[revision].xml 
Artifact pattern: [organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]