ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maarten Coene <maarten_co...@yahoo.com>
Subject Re: Problem getting a publish to local filesystem working
Date Thu, 21 Oct 2010 21:29:45 GMT
The specified revision is used for calling the ivy:deliver task.
If you set the revision to 1.0.1, the ivy:deliver task will look in your cache 
for a previous resolved job of your the "my-module-1.0.1" module.
However, you will get an error because Ivy won't find this because you did never 
resolve that module before, because your ivy.xml probably doesn't contain a 
revision attribute.

To solve your problem maybe you could create your jars without a version in the 
filename, so you don't need to include the [revision] any longer in your 
artifacts pattern?

regards,
Maarten



----- Original Message ----
From: "Bailey, Darragh" <dbailey@hp.com>
To: "ivy-user@ant.apache.org" <ivy-user@ant.apache.org>
Sent: Mon, October 18, 2010 6:52:39 PM
Subject: Problem getting a publish to local filesystem working


I'm running into a problem with performing a local publish:

Currently using Ivy 2.2.x-local-20100609212354

Resolver used for local publishing.
    <filesystem name="local" local="true">
      <ivy 
pattern="${dest.repo.dir}/[organisation]/[module]/[revision]/ivy-[revision].xml" 
/>
      <artifact 
pattern="${dest.repo.dir}/[organisation]/[module]/[revision]/[type]s/[artifact]-[revision].[ext]"
 />
      <!-- <artifact 
pattern="${dest.repo.dir}/[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
 /> -->
    </filesystem>


This works:
    <ivy:publish artifactspattern="${dist.dir}/[artifact]-[revision].[ext]"
      conf="*(public)"
      pubrevision="${project.version.main}"
      resolver="local"
      status="integration"
      forcedeliver="true"
      />

:: delivering :: org.my#my-module#trunk;working@my-build-machine :: 1.0.1 :: 
integration :: Mon Oct 18 17:14:11 IST 2010
        delivering ivy file to 
/build/user/me/my/module/dir/trunk/dist/ivy-1.0.1.xml
:: publishing :: org.my#my-module
        published my-module to 
/home/me/.ivyrepo/org.my/my-module/1.0.1.part/jars/my-module-1.0.1.jar
        published ivy to 
/home/me/.ivyrepo/org.my/my-module/1.0.1.part/ivy-1.0.1.xml
        publish commited: moved /home/me/.ivyrepo/org.my/my-module/1.0.1.part
                to /home/me/.ivyrepo/org.my/my-module/1.0.1

This doesn't:
    <ivy:publish artifactspattern="${dist.dir}/[artifact]-[revision].[ext]"
      conf="*(public)"
      revision="${project.version.main}"
      pubrevision="${project.version.full}"
      resolver="local"
      status="integration"
      forcedeliver="true"
      />

BUILD FAILED
[ivy:publish] :: delivering :: org.my#my-module#trunk;1.0.1 :: 1.0.1-1 :: 
integration :: Mon Oct 18 17:48:14 IST 2010

/build/user/me/my/module/dir/trunk/build.xml:162: org.my#my-module#trunk;1.0.1: 
java.lang.IllegalStateException: ivy file not found in cache for 
org.my#my-module#trunk;1.0.1: please resolve dependencies before delivering 
(/home/me/.ivy2/cache/resolved-org.my-my-module-1.0.1.xml)
        at 
org.apache.ivy.core.deliver.DeliverEngine.deliver(DeliverEngine.java:112)
        at org.apache.ivy.Ivy.deliver(Ivy.java:586)

Property values used for versions:
project.version.main = 1.0.1
project.version.full = 1.0.1-1

The jar file built looks like ${dist.dir}/my-module-1.0.1.jar but I would like 
the ability to publish it as my-module-1.0.1-1.jar in certain cases.

For local publishes I don't care so much about being able to add extra version 
information to identify minor changes i.e. the "-1" part. But it will be useful 
once I add publishing to a shared repo for automated builds, so I'd like to 
understand whether it is possible. I assumed from reading the doc reference with 
the different options revision & pubrevision it would be, but not so sure now.


Tested with the latest 2.2.0 release version as well and same problem exists. 
I'm sure I'm missing something, I just don't know what.

--
Regards,
Darragh Bailey


      

Mime
View raw message