ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zharvey <zachary.har...@gmail.com>
Subject Re: ivy:publish build error
Date Thu, 15 Sep 2011 13:29:33 GMT

Hi Kirby,

Thanks for getting back to me so quickly.

Here's my settings file (ivy-settings.xml):
===============================
<ivysettings>  
	<properties file="ivy-settings.properties"/>
    <settings defaultResolver="defResolver"/>
    <latest-strategies>
    	<latest-lexico/>
    </latest-strategies>
    <resolvers>  
        <chain name="defResolver" returnFirst="true">
         	<url name="jarServer">
				<ivy
pattern="http://my-server.net/module_descriptors/[organisation]/[module]-[revision]-ivy.xml"/>
				<artifact
pattern="http://my-server.net/artifacts/[organisation]/[artifact]-[revision].[ext]"/>
         	</url>
        </chain>  
    </resolvers>  
    <modules>
    	<module organisation="myOrg" name="*" resolver="defResolver"/>
    </modules>
</ivysettings>

And my ivy file (ivy.xml):
==================
<?xml version="1.0" encoding="UTF-8"?>  
<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" />  
    <configurations>
        <conf name="compile" description="used for building" />  
        <conf name="publish" description="used for publishing" />  
    </configurations>  
    <publications defaultconf="publish">
		<artifact name="MyModule" />
	</publications>
    <dependencies>  
        <dependency org="apache" name="commons-cli" rev="1.2"
conf="compile->default"/> 
    </dependencies>
</ivy-module>

And the ivy portions of my buildscript (build.xml - way too long to put the
whole thing in here):
=======================================================================
<project name="LoaderServiceLoadTester" default="dist" basedir="."
	xmlns:ivy="antlib:org.apache.ivy.ant">
	<!-- Ivy task definitions --> 
	<taskdef name="ivy-configure" classname="org.apache.ivy.ant.IvyConfigure"/>
	<taskdef name="ivy-resolve" classname="org.apache.ivy.ant.IvyResolve"/>
	<taskdef name="ivy-retrieve" classname="org.apache.ivy.ant.IvyRetrieve"/>
	<taskdef name="ivy-cleancache"
classname="org.apache.ivy.ant.IvyCleanCache"/>
	<taskdef name="ivy-publish" classname="org.apache.ivy.ant.IvyPublish"/>
	
	<!-- Identify the Ivy settings file to use -->
	<ivy:settings
url="http://my-server.net/ivyrepo/settings/ivy-settings.xml"/>

	<!-- Ivy "resolve" task; resolve all project dependencies and cache them
--> 
	<target name="resolve">
		<ivy:configure host="http://my-server.net"
			realm="IvyTestProject"
			username="fizz"
			passwd="buzz"
			override="false"/>
		<ivy:resolve file="ivy.xml" conf="compile"/>
		<ivy:retrieve pattern="dist/[artifact]-[revision].[ext]" conf=compile"/>
	</target>
	
	<!-- Ivy "cleancache" task; to be used with caution. Flushes local cache
completely -->
	<target name="clean-ivy-cache">
		<ivy:cleancache/>
	</target>
		
	<!-- Ivy "publish" task; publish the distribution to SVN for downstream
projects --> 
	<target name="publish">
		<ivy:publish organisation="myOrg" module="MyModule" resolver="defResolver"
revision="1.0">
			<artifacts pattern="dist/[artifact]-[revision].[ext]"/>
		</ivy:publish>
	</target>
</project>


Hope this helps with a diagnosis...and thanks again for taking the time to
look at my problem!


Kirby Files wrote:
> 
> zharvey wrote on 09/15/2011 09:07 AM:
>>
>> I'm trying to get a project up and running using Ivy for the first time
>> ever.
>> I'm working on ivy:publish and getting an IllegalStateException stating:
>>
>> ivy file not found in cache for myOrg#myModule;1.0: please resolve
>> dependencies before delivering
>> (C:\Users\MyUser\.ivy2\cache\resolved-myOrg-myModule-1.0.xml)
> 
> It sounds like you aren't doing the resolve in the same ant run as the 
> publish, perhaps. Generally, a publish task should be preceded by an 
> ivy:settings and an ivy:resolve call.
> 
>> Essentially, I want that JAR to get published to a "pubRepo" repository
>> that
>> I define in my settings file. I'm just so overwhelmed by so many
>> variables,
>> I don't even know where to start the debugging process.
>>
>> Does anybody have any ideas as to what is happening here?
> 
> The best thing to do when you have specific troubleshooting questions 
> is to attach your ivy-settings.xml, ivy.xml, build.xml, and any logs.
> 
> Thanks,
> ---
> Kirby Files
> Software Architect
> Masergy Communications
> kfiles@masergy.com
> 
> 

-- 
View this message in context: http://old.nabble.com/ivy%3Apublish-build-error-tp32471426p32471596.html
Sent from the ivy-user mailing list archive at Nabble.com.


Mime
View raw message