You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by "hkaiserl@googlemail.com" <hk...@gmail.com> on 2014/06/18 07:26:08 UTC
IVY deps and transitive deps and filtering some javs in ivy:cachepath
Hello Ivy-Users,
I like Ivy, and I thank the developers for the great job!
Right now I have a multi project setup which is working fine. I have one
issue, maybe because of my setup.
My structure looks like:
<configurations>
<conf name="myConf" />
</configurations>
ProjA
<publications>
<artifact name="core-entities" type="jar"/>
</publications>
<dependency org="org.apache.commons" name="commons-lang3"
rev="${lib.version.commons.lang}" conf="compile->default, sources,
javadoc" />
and so on
ProjB
<publications>
<artifact name="myModuleB" type="jar"/>
</publications>
<dependencies>
<!-- eclipse project deps -->
<dependency org="myOrg" name="core-entities"
rev="latest.integration" conf="myConf->default" />
<!-- commons deps -->
<dependency org="commons-io" name="commons-io"
rev="${lib.version.commons.io}" conf="compile->default, sources, javadoc" />
So if I do a lookup ivy:cachepath or a ivy:retrieve on ProjB I get all
direct dependencies of ProjA.
E.g in this case the core-entities.jar. Sometimes, e.g. building the
complete runtime classpath I need all transitive dependencies of the
ProjA if I do a retrieve on ProjB
Here my ANT calls: file.ivy.xml is the ivy.xml of ProjB
<ivy:resolve conf="compile,myConf" file="${file.ivy.xml}"
log="quiet" />
<ivy:cachepath pathid="curr.project.classpath"
file="${file.ivy.xml}" conf="compile,myConf" log="quiet" />
I have no clue what I have to change to get the wished results with all
transitive dependencies of ProjA.
Is there also a option to filter some jars in the ivy:cachepath?
Sometimes I need to be able to filter specific named jars out of the
cachepath to avoid duplicate tool setups like proguard, there I have to
tell the specific input-jar-file to obfuscate and also to provide a
classpath, but not containing input-jar-file.
Hope someone can help me out.
best wishes,
Hans
Re: IVY deps and transitive deps and filtering some javs in ivy:cachepath
Posted by Marc De Boeck <md...@gmail.com>.
First of all, I would remove "log=quiet" when calling ivy:resolve and
ivy:cachepath.
This may give you some feedback (because resolving transitive dependencies
normally works fine).
Check that your core-entities are published correctly to the right
ivy-repository. And that your ProjB resolves artifacts from that
ivy-repository.
To filter jar-files from your cachepath, you have to filter them out in the
ivy:resolve task preceeding the ivy:cachepath task (using <exclude>
elements).
Alternatively, you could play with the standard ant-tasks for manipulating
path-like structures (after you have run ivy:classpath).
Regards,
Marc
2014-06-18 7:26 GMT+02:00 hkaiserl@googlemail.com <hk...@gmail.com>:
> Hello Ivy-Users,
>
> I like Ivy, and I thank the developers for the great job!
>
> Right now I have a multi project setup which is working fine. I have one
> issue, maybe because of my setup.
> My structure looks like:
> <configurations>
> <conf name="myConf" />
> </configurations>
>
> ProjA
> <publications>
> <artifact name="core-entities" type="jar"/>
> </publications>
> <dependency org="org.apache.commons" name="commons-lang3"
> rev="${lib.version.commons.lang}" conf="compile->default, sources,
> javadoc" />
> and so on
>
> ProjB
> <publications>
> <artifact name="myModuleB" type="jar"/>
> </publications>
> <dependencies>
> <!-- eclipse project deps -->
> <dependency org="myOrg" name="core-entities"
> rev="latest.integration" conf="myConf->default" />
> <!-- commons deps -->
> <dependency org="commons-io" name="commons-io" rev="${
> lib.version.commons.io}" conf="compile->default, sources, javadoc" />
>
>
> So if I do a lookup ivy:cachepath or a ivy:retrieve on ProjB I get all
> direct dependencies of ProjA.
> E.g in this case the core-entities.jar. Sometimes, e.g. building the
> complete runtime classpath I need all transitive dependencies of the ProjA
> if I do a retrieve on ProjB
> Here my ANT calls: file.ivy.xml is the ivy.xml of ProjB
> <ivy:resolve conf="compile,myConf" file="${file.ivy.xml}"
> log="quiet" />
> <ivy:cachepath pathid="curr.project.classpath"
> file="${file.ivy.xml}" conf="compile,myConf" log="quiet" />
>
> I have no clue what I have to change to get the wished results with all
> transitive dependencies of ProjA.
>
> Is there also a option to filter some jars in the ivy:cachepath? Sometimes
> I need to be able to filter specific named jars out of the cachepath to
> avoid duplicate tool setups like proguard, there I have to tell the
> specific input-jar-file to obfuscate and also to provide a classpath, but
> not containing input-jar-file.
>
> Hope someone can help me out.
>
> best wishes,
> Hans
>