ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From teknokrat <teknok...@yahoo.com>
Subject Re: How to publish file?
Date Tue, 27 Nov 2007 14:54:55 GMT
Xavier Hanin wrote:
> The deliver task does not publish, it only updates the ivy file for
> delivery, replacing some metadata information. To publish I suggest having a
> look at the publish task code, which does something like this:
> ivy.publish(mrid, artifactspattern, publishResolverName,
>   new PublishOptions()
>       .setPubrevision(getPubrevision())
>       .setCache(CacheManager.getInstance(settings, cache))
>       .setSrcIvyPattern(publishivy ? srcivypattern : null)
>       .setStatus(getStatus())
>       .setPubdate(pubdate)
>       .setExtraArtifacts((Artifact[]) artifacts.toArray(new Artifact[
> artifacts.size()]))
>       .setValidate(doValidate(settings))
>       .setOverwrite(overwrite)
>       .setUpdate(update)
>       .setConfs(splitConfs(conf)));
> 
> This should give you a pretty good idea of the options you have to call
> publish yourself.
> 

The only Ivy.publish method i found was

publish(ModuleRevisionId, String, File, String, String, String, boolean)

But I have no idea what the parameters should be.


> Xavier
> 
> On Nov 26, 2007 2:19 PM, teknokrat <teknokrat@yahoo.com> wrote:
> 
>> I am writing some code to publish jars using a filesystem resolver for a
>> plugin. So far I have tried
>>
>> String path = IvyPatternHelper.substitute("", organisation, module,
>> revision, "ivy", "ivy", "xml");
>> File ivyFile = new File(path);
>> if (!ivyFile.exists()) {
>>                 IvyDeliver deliver = new IvyDeliver();
>>                 deliver.setModule(module);
>>                 deliver.setOrganisation(organisation);
>>                 deliver.setRevision(revision);
>>                 deliver.execute();
>>             }
>>
>> This throws NPEs. How can I use the Ivy API to publish a jar file from a
>> java program? What fields are mandatory and how do i add the
>> configuration details? There does not appear to be any javadoc link on
>> the main site.
>>
>> cheers
>>
>>
> 
> 


Mime
View raw message