ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nik <apa...@babel.homelinux.net>
Subject Which conf to publish to?
Date Tue, 28 Apr 2009 04:14:42 GMT
Hi all,

I am happily adding Ivy to all my existing Java projects. This is my 
first attempt at configuring Ivy, so my config files are a mix of 
cut-n-paste from the tutorials, and changes to get things working.
My apologies for the newbie question.

Here is an example ivy.xml files for one of my base packages:

<ivy-module version="1.0">
    <info organisation="${project.owner}" module="${ant.project.name}" 
status="${project.status}">
    </info>
    <configurations>
        <conf name="build" visibility="private" />
        <conf name="default" />
    </configurations>
    <publications>
        <artifact name="${ant.project.name}" type="jar" conf="*" />
    </publications>

    <dependencies>
        <!--  testing is only a part of the build configuration -->
        <dependency org="apache" name="junit" rev="4.5" conf="build->*" />
    </dependencies>
</ivy-module>

and here is the publish Ant task:

    <!-- publish the latest version of the project to the team 
repository -->
    <target name="publish" depends="clean, build, input-resolver" 
if="ivy.present"
        description="--> publish JAR(s) to a shared repo and remove any 
version lock" >

        <!-- create the next revision of the specified version of the 
project -->
        <ivy:buildnumber resolver="${target.resolver}" 
organisation="${project.owner}" module="${ant.project.name}" 
revision="${project.version}" />
       
        <!-- publish the artifacts -->
        <ivy:publish resolver="${target.resolver}" 
pubrevision="${ivy.new.revision}" update="true" />
       
        <antcall target="unlock-version" />
    </target>

My questions relate to the conf="xyz" in the <artifact ...> element in 
the ivy.xml file.

I've found that if I set it to conf="build", then even though a JAR is 
published to the repository,
other projects don't use it in their resolve process. Changing the value 
to conf="default" or conf="*" fixes this.

So, my *guess* is that my other projects are building a "default" 
config, and so ignore anything published to the "build" config only.

Q: Should I stick with conf="build" here, and then make my calling build 
use the "build" conf in their resolve?
Q: Should I just stick with conf="default" in the <artifacts> element of 
the depended-on package?
Q: Is it better (and more correct even) to use conf="*" in the 
<artifacts> element?
Q: Or should I enumerate the valid configs as in: conf="build, default"?

Any guidance, advice or suggestions would be greatly appreciated.

Cheers!
Nik

Mime
View raw message