ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhatia <Bha...@OFAC.CH>
Subject Re: problem resolving/retrieving using a chain resolver
Date Tue, 28 Aug 2007 13:30:44 GMT

Hello,

When I use my ant target "retrieve-compile", no problems and its able to
fetch the ad-CURRENT artifacts from the local resolver. 

But when I do a resolve from IvyDE container, it cant resolve. my ant target
and IvyDE have the same ivyconf so I dont know why something would work from
the ant target but not from the IvyDE container.

thanks

**************************************************************************3
	<target name="retrieve-compile" depends="init" description="-> retrieve
compile-time dependencies of this project">
		<fail>
			Il n'y a pas de fichier ivy.xml dans ce projet
			<condition>
				<not>
					<available file="${basedir}/ivy.xml" type="file" />
				</not>
			</condition>
		</fail>
		<mkdir dir="${compile.conf.dir}" />
		<ivy:retrieve pattern="${compile.conf.dir}/[artifact](-[revision]).[ext]"
type="jar,war" conf="compile"/>
	</target>

********************************************************************

<ivyconf>

	<conf defaultResolver="chainresolver" />
	<!-- this is the shared repository using ivy configurations -->
	<property name="cellier" value="I:/shared" />
	<!-- do not generated checksums -->
	<property name="ivy.checksums" value="" />
	<!-- define property for local ivy repository -->
	<!--<property name="ivy.default.ivy.user.dir" value="c:/myrep"/>-->
	
  <!-- define properties for the local developer repository --> 
  <!-- artifacts found here will be taken first even if a more recent
version is found in the cellar -->
  <!-- this is necessary to resolve delta artifacts in the local filesystem
-->
	<property name="ivy.local.default.root"
value="${ivy.default.ivy.user.dir}/local" override="false"/>
  <property name="ivy.local.default.ivy.pattern"
value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
override="false"/>
  <property name="ivy.local.default.artifact.pattern"
value="[organisation]/[module]/[revision]/[type]s/[artifact](-[revision]).[ext]"
override="false"/>
	
	<resolvers checksums="false">
	 <chain name="chainresolver" returnFirst="true">
	  <!-- resolver for local artifacts in local filesystem -->
		<filesystem name="local">
      <ivy
pattern="${ivy.local.default.root}/${ivy.local.default.ivy.pattern}" />
      <artifact
pattern="${ivy.local.default.root}/${ivy.local.default.artifact.pattern}" />
    </filesystem>
	  <!-- resolver for OFAC internal artifacts in the cellar -->
		<filesystem name="internal">
			<ivy
pattern="${cellier}/[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
/>
			<artifact
pattern="${cellier}/[organisation]/[module]/[revision]/[type]s/[artifact](-[revision]).[ext]"
/>
		</filesystem>
		<!-- resolver for external third party artifacts in the cellar -->
		<filesystem name="thirdparty">
			<ivy
pattern="${cellier}/[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
/>
			<artifact
pattern="${cellier}/[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
/>
		</filesystem>		    
    </chain>
	</resolvers>

  <!-- module resolver mappings -->
	<modules>
		<module organisation="ofac" name="*"	resolver="chainresolver" />		
		<module organisation="apache" name="*"	resolver="thirdparty" />
		<module organisation="dbunit" name="*"	resolver="thirdparty" />
		<module organisation="easymock" name="*"	resolver="thirdparty" />
		<module organisation="eclipse" name="*"	resolver="thirdparty" />
		<module organisation="electric" name="*"	resolver="thirdparty" />
		<module organisation="exolab" name="*"	resolver="thirdparty" />
		<module organisation="gnu" name="*"	resolver="thirdparty" />
		<module organisation="ibm" name="*"	resolver="thirdparty" />		
		<module organisation="jayasoft" name="*"	resolver="thirdparty" />
		<module organisation="jcraft" name="*"	resolver="thirdparty" />
		<module organisation="jpedal" name="*"	resolver="thirdparty" />
		<module organisation="jrefinery" name="*"	resolver="thirdparty" />		
		<module organisation="junit" name="*"	resolver="thirdparty" />
		<module organisation="lowagie" name="*"	resolver="thirdparty" />
		<module organisation="meterware" name="*"	resolver="thirdparty" />
		<module organisation="mirrorworlds" name="*"	resolver="thirdparty" />				
		<module organisation="mousepushers" name="*"	resolver="thirdparty" />
		<module organisation="mozilla" name="*"	resolver="thirdparty" />
		<module organisation="omg" name="*"	resolver="thirdparty" />
		<module organisation="opensymphony" name="*"	resolver="thirdparty" />				
		<module organisation="oroinc" name="*"	resolver="thirdparty" />
		<module organisation="sourceforge" name="*"	resolver="thirdparty" />
		<module organisation="sqlj" name="*"	resolver="thirdparty" />
		<module organisation="sun" name="*"	resolver="thirdparty" />		
		<module organisation="tyrex" name="*"	resolver="thirdparty" />				
		<module organisation="w3c" name="*"	resolver="thirdparty" />
		<module organisation="sqlj" name="*"	resolver="thirdparty" />
		<module organisation="wutka" name="*"	resolver="thirdparty" />		
		<module organisation="xmlparser" name="*"	resolver="thirdparty" />
	</modules>

	 <!-- points to my local livraisons -->
	 <classpath	file="C:/ivylivraison/24082007/OFACDependencies-CURRENT.jar" />
	 <!-- points to server repository used by all OFAC
	 <classpath
file="I:/shared/ivyconf/ivylivraison/23082007/OFACDependencies-CURRENT.jar"
/>
	 -->

	<!-- strategie qui considere que CURRENT est plus recent que HEAD qui est
plus recent que prod etc...
		OfacLatestStrategyTest donne une bonne idee de son comportement. -->
	<typedef name="ofac-latest-strategy"
		classname="ch.ofac.ivy.latest.OfacLatestStrategy" />
	<latest-strategies>
		<ofac-latest-strategy name="ofac-latest" />
	</latest-strategies>

	<!-- Conflict manager qui utilise la strategie definie plus haut -->
	<conflict-managers>
		<latest-cm name="ofac-cm" latest="ofac-latest" />
		<latest-revision name="latest-revision" />
	</conflict-managers>

</ivyconf>
***************************************************************



bhatia wrote:
> 
> Hello,
> 
> Problem scenario:
> 
> Step 1) Project "nr" has a dependency on Project "ad".
> 
> Step 2) I check out my working copy of both project "nr" and project "ad"
> in Eclipse workspace.
> 
> Step 3) I make my changes to project "ad" in my workspace and publish it
> using a local resolver into my local filesystem using a "local" resolver
> like this:
> 
> In ivy.xml of project "ad", I declare revision="CURRENT" like this:
> 
> <info organisation="ofac" module="ad" revision="CURRENT"/>
> 
> In my common.xml, I publish to the local repository like this:
> 
> <target name="publish-war-en-locale" depends="make-war-en-locale"
> description="-> publish this project's war and its sources in the local
> user repository">		
> 		<ivy:publish resolver="local"
> artifactspattern="[type]/[artifact](-[revision]).[ext]"
> pubrevision="${revision}"/>
> 	</target>
> 
> After publishing of "ad" is successful in my "local" repository, I get the
> following:
> 
> publish-war-en-locale:
> [ivy:publish] :: delivering :: [ ofac | ad | CURRENT ] :: CURRENT ::
> integration :: Tue Aug 28 13:15:17 CEST 2007
> [ivy:publish] delivering ivy file to ivy/ivy-CURRENT.xml
> [ivy:publish] :: publishing :: [ ofac | ad ]
> [ivy:publish] published ad to
> c:\myrep/local/ofac/ad/CURRENT/sources/ad-CURRENT.src.jar
> [ivy:publish] published ad to
> c:\myrep/local/ofac/ad/CURRENT/wars/ad-CURRENT.war
> [ivy:publish] published ivy to c:\myrep/local/ofac/ad/CURRENT/ivys/ivy.xml
> BUILD SUCCESSFUL
> 
> step 4) Resolve/retrieve project "ad" which I recently published to my
> "local" repository (revision="CURRENT") from project "nr" like this:
> 
> project "nr" ivy.xml:
> 
> <ivy-module version="1.0">
>  <info organisation="ofac" module="nr" revision="prod"/>
> <configurations>
> 	<conf name="compile" description="compile-time deps only"
> transitive="true" visibility="public"/>
> 	<conf name="run" description="run-time deps only, also used for creating
> and publishing an artifact" transitive="false" visibility="public"/>
> </configurations>
> <publications>
> 	<artifact name="nr" type="war"/>
> 	<artifact name="nr" type="source" ext="src.jar"/>
> </publications>
>  <dependencies>    
>     <dependency org="ofac" name="ad" rev="CURRENT" conf="compile">
>         <artifact name="ad" type="war"/>
>     </dependency>   
>  </dependencies>
>  <conflicts>
>     <manager name="ofac-cm" org="ofac"/>
>     <manager name="latest-revision" org="(?!ofac).*"/>
>  </conflicts>
> </ivy-module>
> 
> In common.xml, when I launch "retrieve-compile" like this:
> 
> <target name="retrieve-compile" depends="init" description="-> retrieve
> compile-time dependencies in the lib folder of this project, if it doesnt
> exist, create it">
> 		<fail>
> 			Il n'y a pas de fichier ivy.xml dans ce projet
> 			<condition>
> 				<not>
> 					<available file="${basedir}/ivy.xml" type="file" />
> 				</not>
> 			</condition>
> 		</fail>
> 		<mkdir dir="${compile.conf.dir}" />
> 		<ivy:retrieve
> pattern="${compile.conf.dir}/[artifact](-[revision]).[ext]" type="jar,war"
> conf="compile"/>
> 	</target>
> 
> I get the following error on the console:
> 
> [ivy:retrieve] :: evicted modules:
> [ivy:retrieve] [ ofac | ad | prod ] by [[ ofac | ad | CURRENT ]] in
> [compile]
> ---------------------------------------------------------------------
> |                  |            modules            ||   artifacts   |
> |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
> ---------------------------------------------------------------------
> |      compile     |  159  |   0   |   0   |   1   ||  208  |   0   |
> ---------------------------------------------------------------------
> 
> [ivy:retrieve] module not found: [ ofac | ad | CURRENT ]
> [ivy:retrieve] internal: tried I:/shared/ofac/ad/CURRENT/ivys/ivy.xml
> [ivy:retrieve] internal: tried artifact [ ofac | ad | CURRENT
> ]/ad.war[war]:
> [ivy:retrieve] I:/shared/ofac/ad/CURRENT/wars/ad-CURRENT.war
> 
> [ivy:retrieve] ::::::::::::::::::::::::::::::::::::::::::::::
> [ivy:retrieve] ::          UNRESOLVED DEPENDENCIES         ::
> [ivy:retrieve] ::::::::::::::::::::::::::::::::::::::::::::::
> [ivy:retrieve] :: [ ofac | ad | CURRENT ]: not found
> [ivy:retrieve] ::::::::::::::::::::::::::::::::::::::::::::::
> [ivy:retrieve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
> 
> BUILD FAILED
> C:\ivylivraison\24082007\common.xml:88: impossible to resolve
> dependencies: resolve failed - see output for details
> 
> I have defined a chain like this in my ivyconf.xml:
> 
> <resolvers checksums="false">
> 	 <chain name="chainresolver" returnFirst="true">
> 	  <!-- resolver for local artifacts in local filesystem -->
> 		<filesystem name="local">
>       <ivy
> pattern="${ivy.local.default.root}/${ivy.local.default.ivy.pattern}" />
>       <artifact
> pattern="${ivy.local.default.root}/${ivy.local.default.artifact.pattern}"
> />
>     </filesystem>
> 	  <!-- resolver for OFAC internal artifacts in the cellar -->
> 		<filesystem name="internal">
> 			<ivy
> pattern="${cellier}/[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
> />
> 			<artifact
> pattern="${cellier}/[organisation]/[module]/[revision]/[type]s/[artifact](-[revision]).[ext]"
> />
> 		</filesystem>
> 		<!-- resolver for external third party artifacts in the cellar -->
> 		<filesystem name="thirdparty">
> 			<ivy
> pattern="${cellier}/[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
> />
> 			<artifact
> pattern="${cellier}/[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
> />
> 		</filesystem>		    
>     </chain>
> 	</resolvers>
> 
> I am not referencing "chainresolver" specified here in my common.xml in
> any of the targets. Is this the right way to do it ? 
> 
> I dont know why Ivy doesnt find my ad-CURRENT artifacts in the "local"
> repository. It seems to be searching in thirdparty and/or shared
> repository only.
> 
> Any help would be welcome.
> 
> thanks
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/problem-resolving-retrieving-using-a-chain-resolver-tf4341279.html#a12368006
Sent from the ivy-user mailing list archive at Nabble.com.


Mime
View raw message