A module defines one or more configurations, which will be used to meet different needs. For example, the logging framework slf4j defines a "core" configuration, which includes only the API jar. It then has a configs for each implementation choice a user might want, "log4j", "jul", "jcl", etc.

That actually makes sense. :-) So it is a qualifier, though up by the developer. Is there some central place where one can find these qualifiers? Like the pom.xml in the Maven repositories?


If you wanted to use slf4j and log4j in your runtime deployment, you'd map your runtime configuration to slf4j's core and log4j configurations:

<dependency name="slf4j" conf="runtime->core,log4j"/>

My runtime requires slf4j's core and log4j. Understood. However, what happens when slf4j then cascades onto log4j itself which theoretically may have a different set of configurations? Let's assume log4j uses "main" instead of "core"? Hmmmm... Slf4j-core does have it own dependency information which knows about what configurations it dependency supports. Ok. It really makes sense.

So what would be the appropriate way to split-up the set. As said: I want to split between between what is required at compiletime, test and runtime. The leading example would be that junit should not be present in lib but lib-test.


Curious. Have you tried identifying the set of jars which differs between your two ivy.xml files, and looking in your resolution output to see which dependencies they derive from?

Appearantly I did something wrong. Running "ivy:retrieve" now downloads 94 jars. Ok. However, if I I now want to split up like this:

<ivy:retrieve conf="runtime" pattern="lib/[artifact]-[revision].[ext]"/> <ivy:retrieve conf="test" pattern="lib-test/[artifact]-[revision].[ext]"/> <ivy:retrieve conf="build" pattern="lib-ext/[artifact]-[revision].[ext]"/>

Then I get an error

/BUILD FAILED
C:\Documents and Settings\User\My Documents\kpprofiler2\components\service\build.xml:39: impossible to ivy retrieve: java.lang.RuntimeException: problem during retrieve of nl.knowledgeplaza#kpprofiler-service: java.lang.RuntimeException: Multiple artifacts of the module org.codehaus.enunciate#enunciate-rt;1.10 are ret
ieved to the same file! Update the retrieve pattern  to fix this error.
/

For easy reproducing I have attached my ivy.xml and ivysettings.xml

Tom

<?xml version="1.0"?>
<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="nl.knowledgeplaza" module="kpprofiler-service" revision="0.1"/>	

	<configurations>
		<conf name="runtime" description="runtime"/>
		<conf name="build" description="for building"/>
		<conf name="test" description="for testing our framework"/>
	</configurations>
	
	<dependencies>
		<dependency org="org.codehaus.enunciate" name="enunciate-rt" rev="1.10" conf="runtime->*"/>		
		<dependency org="org.codehaus.enunciate" name="enunciate-core" rev="1.10" conf="build->*"/>
		<dependency org="junit" name="junit" rev="4.5" conf="test->*"/>	
		<dependency org="org.liquibase" name="liquibase-core" rev="1.9.2" conf="test->*"/>	
 	</dependencies>
</ivy-module>
<?xml version="1.0"?>
<ivysettings>
	<settings defaultResolver="this"/>
	
	<include url="${ivy.default.settings.dir}/ivysettings.xml"/>
	
	<ivysettings>  
		<resolvers>		
			<chain name="this">
				<resolver ref="default"/> <!--  local, shared, public -->      
				<ibiblio name="dev-java-net-maven" root="https://maven-repository.dev.java.net/nonav/repository"; m2compatible="false"/>	
				<ibiblio name="java-net-maven2" root="http://download.java.net/maven/2"; m2compatible="true" />
				<ibiblio name="codehaus" root="http://dist.codehaus.org/mule/dependencies/maven2"; m2compatible="true" />
			</chain>
		</resolvers>		
	</ivysettings>
	
</ivysettings>

Reply via email to