Return-Path: Delivered-To: apmail-incubator-ivy-user-archive@locus.apache.org Received: (qmail 76138 invoked from network); 28 Nov 2007 12:25:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Nov 2007 12:25:37 -0000 Received: (qmail 33091 invoked by uid 500); 28 Nov 2007 12:25:25 -0000 Delivered-To: apmail-incubator-ivy-user-archive@incubator.apache.org Received: (qmail 33057 invoked by uid 500); 28 Nov 2007 12:25:25 -0000 Mailing-List: contact ivy-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ivy-user@incubator.apache.org Delivered-To: mailing list ivy-user@incubator.apache.org Received: (qmail 33046 invoked by uid 99); 28 Nov 2007 12:25:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Nov 2007 04:25:24 -0800 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=FORGED_YAHOO_RCVD,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gcaii-ivy-user@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Nov 2007 12:25:04 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IxLyP-0000LF-Gv for ivy-user@incubator.apache.org; Wed, 28 Nov 2007 12:25:02 +0000 Received: from 83-244-179-210.cust-83.exponential-e.net ([83.244.179.210]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Nov 2007 12:25:01 +0000 Received: from teknokrat by 83-244-179-210.cust-83.exponential-e.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 28 Nov 2007 12:25:01 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: ivy-user@incubator.apache.org From: teknokrat Subject: Re: How to publish file? Date: Wed, 28 Nov 2007 12:24:54 +0000 Lines: 90 Message-ID: References: <635a05060711261656j58c9fe7lfba8df50a2ae7dfa@mail.gmail.com> <635a05060711271709x784eeb72l5b3ac9ce5a33e798@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 83-244-179-210.cust-83.exponential-e.net User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) In-Reply-To: <635a05060711271709x784eeb72l5b3ac9ce5a33e798@mail.gmail.com> Sender: news X-Virus-Checked: Checked by ClamAV on apache.org Xavier Hanin wrote: > If you only have a jar the easiest is to do a mere file copy instead of > using Ivy publish. If you have an ivy file, use publish, for the deliver > first problem you should use the update = true in the publish options. If > you don't see the method with PublishOptions, maybe it's because you don't > use Ivy 2; I suggest using the trunk, it will soon be released as a beta and > is pretty stable. I am using ivy 1.4. Are you saying that i can just copy the jar into the repository and things will work? Aren't there any config files that need creating or something? > Xavier > > On Nov 27, 2007 5:32 PM, teknokrat wrote: > >> teknokrat wrote: >>> 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. >>> >> Ok, now I get some errors telling me I need to deliver the file first. >> Here is my situation, I have uploaded the jar file via a servlet to >> c:\temp on the repository machine. What is the simplest way for me to >> tell ivy to add this to the local repository? The only parameters I am >> using are the organisation, module and revision. >> >> >> >> >>>> Xavier >>>> >>>> On Nov 26, 2007 2:19 PM, teknokrat >>>> 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 >>>>> >>>>> >>>> >>> >> > >