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 GERARD JULIEN <JG...@groupama-cibama.fr> on 2007/10/17 16:55:35 UTC

Custom retrieve pattern.

Hello,
 
first of all, congratulations to the team for the graduation!
 
So, now my question :p
 
I use Ivy 1.4.1. I have an ivy.xml for a top level project as
 
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="[path]/ivy-doc.xsl"?>
<ivy-module version="1.0">
    <info organisation="DDD" module="Diademe" status="release"
revision="1.0"/>  
 <configurations>
       <include file="${fichier.configurations}"/>
    </configurations>
    <dependencies>
  <dependency org="DDD" name="DDDCommun" rev="1.0" conf="prj->lib" />
  <dependency org="DDD" name="DDDService" rev="1.0" conf="prj->lib" />
 </dependencies>
 
</ivy-module>
 
 
The dependencies DDDCommun and DDDService have somme dependencies
defined with conf=lib like this :
 
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="[path]/ivy-doc.xsl"?>
<ivy-module version="1.0">
    <info organisation="DDD" module="DDDCommun" status="release"
revision="1.0"/>  
 <configurations>
       <include file="${fichier.configurations}"/>
    </configurations>
    <dependencies>
      <dependency org="commons-lib" name="commons-lib" rev="1.5.2"
conf="lib->*,!dev,!bea" />
 </dependencies>
 
</ivy-module>
 
(n.b : the artifact with conf="prj" are stored in the repository without
version number)
 
When I use the task retrieve : <ivy:retrieve useOrigin="true"
pattern="${ivy.application.dir}/[artifact]-[revision].[ext]"
conf="prj,lib" />
 
The task copy all jars with revision number. 
But we must have the artifacts with conf 'prj' without revision number
and the others with revision number (production constraint :) ). 
 
I tried to use two retrieve task to do this :
<ivy:retrieve useOrigin="true"
pattern="${ivy.application.dir}/[artifact]-[revision].[ext]" conf="lib"
/>
<ivy:retrieve useOrigin="true"
pattern="${ivy.application.dir}/[artifact].[ext]" conf="prj" />
and I modified the first ivy.xml to have the conf="prj->default" instead
of conf="prj->lib"
 
But in this case, only first level dependencies are retrieve?? I don't
understand why the transitive dependencies with 'lib' conf are not
retrieve?
 
So, there are any solutions to have the revision number for a conf and
no revision number for another conf when I use the retrieve task? 
May be a custom pattern like <ivy:retrieve useOrigin="true"
pattern="${ivy.application.dir}/[originname]" conf="prj" /> and in this
case copy the jar with the originals names in the repository?
 
Thx, I hope my poor english is understandable.
 
Julien.
 
 
 
 



________________________________________________________________________________________
Les informations ou pieces jointes contenues dans ce message sont etablies a l'intention exclusive de ses destinataires.
Le CIBAMA decline toute responsabilite au titre de ce message s'il a ete modifie ou falsifie.
Si vous n'etes pas destinataire de ce message, merci de le detruire et d'en avertir l'expediteur.

Ce message a ete analyse par l'antivirus F-Secure.
________________________________________________________________________________________

Re: Custom retrieve pattern.

Posted by Xavier Hanin <xa...@gmail.com>.
On 10/17/07, GERARD JULIEN <JG...@groupama-cibama.fr> wrote:
>
> Hello,
>
> first of all, congratulations to the team for the graduation!
>
> So, now my question :p
>
> I use Ivy 1.4.1. I have an ivy.xml for a top level project as
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <?xml-stylesheet type="text/xsl" href="[path]/ivy-doc.xsl"?>
> <ivy-module version="1.0">
>     <info organisation="DDD" module="Diademe" status="release"
> revision="1.0"/>
> <configurations>
>        <include file="${fichier.configurations}"/>
>     </configurations>
>     <dependencies>
>   <dependency org="DDD" name="DDDCommun" rev="1.0" conf="prj->lib" />
>   <dependency org="DDD" name="DDDService" rev="1.0" conf="prj->lib" />
> </dependencies>
>
> </ivy-module>
>
>
> The dependencies DDDCommun and DDDService have somme dependencies
> defined with conf=lib like this :
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <?xml-stylesheet type="text/xsl" href="[path]/ivy-doc.xsl"?>
> <ivy-module version="1.0">
>     <info organisation="DDD" module="DDDCommun" status="release"
> revision="1.0"/>
> <configurations>
>        <include file="${fichier.configurations}"/>
>     </configurations>
>     <dependencies>
>       <dependency org="commons-lib" name="commons-lib" rev="1.5.2"
> conf="lib->*,!dev,!bea" />
> </dependencies>
>
> </ivy-module>
>
> (n.b : the artifact with conf="prj" are stored in the repository without
> version number)
>
> When I use the task retrieve : <ivy:retrieve useOrigin="true"
> pattern="${ivy.application.dir}/[artifact]-[revision].[ext]"
> conf="prj,lib" />
>
> The task copy all jars with revision number.
> But we must have the artifacts with conf 'prj' without revision number
> and the others with revision number (production constraint :) ).
>
> I tried to use two retrieve task to do this :
> <ivy:retrieve useOrigin="true"
> pattern="${ivy.application.dir}/[artifact]-[revision].[ext]" conf="lib"
> />
> <ivy:retrieve useOrigin="true"
> pattern="${ivy.application.dir}/[artifact].[ext]" conf="prj" />
> and I modified the first ivy.xml to have the conf="prj->default" instead
> of conf="prj->lib"
>
> But in this case, only first level dependencies are retrieve?? I don't
> understand why the transitive dependencies with 'lib' conf are not
> retrieve?
>
> So, there are any solutions to have the revision number for a conf and
> no revision number for another conf when I use the retrieve task?
> May be a custom pattern like <ivy:retrieve useOrigin="true"
> pattern="${ivy.application.dir}/[originname]" conf="prj" /> and in this
> case copy the jar with the originals names in the repository?


Your approach is the good one: use one retrieve for each conf, each one with
a different pattern. So your first solution should be ok, except that you do
not get your transitive dependencies. But it seems it's more a problem of
configuration mapping than a problem with retrieve. Why did you change your
conf mapping from prj->lib to prj->default? The  first one seemed better
(even though it's difficult to say, we are missing the configuration
definition file, and maybe some dependencies declaration).

Xavier

Thx, I hope my poor english is understandable.
>
> Julien.
>
>
>
>
>
>
>
>
> ________________________________________________________________________________________
> Les informations ou pieces jointes contenues dans ce message sont etablies
> a l'intention exclusive de ses destinataires.
> Le CIBAMA decline toute responsabilite au titre de ce message s'il a ete
> modifie ou falsifie.
> Si vous n'etes pas destinataire de ce message, merci de le detruire et
> d'en avertir l'expediteur.
>
> Ce message a ete analyse par l'antivirus F-Secure.
>
> ________________________________________________________________________________________




-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/