ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maarten Coene <maarten_co...@yahoo.com>
Subject Re: Namespaces and rules with modules like commons-lang and log4j
Date Thu, 24 Jun 2010 20:36:19 GMT
Thanks,

I'll try to take a look at them within the next coming weeks...
Maybe your issue could be related to https://issues.apache.org/jira/browse/IVY-1154 ?

Maarten



----- Original Message ----
From: "Bailey, Darragh" <dbailey@hp.com>
To: "ivy-user@ant.apache.org" <ivy-user@ant.apache.org>
Sent: Thu, June 24, 2010 6:29:18 PM
Subject: RE: Namespaces and rules with modules like commons-lang and log4j



Attached a tarball that runs through 3 different test repositories using 3 slightly different
namespaces.

The goal is to be able to have both the apache-wink modules and the likes of log4j and commons-lang
appear in the repository like following:
org.apache.wink/wink-server
org.apache.wink/wink-client
org.apache/log4j

I've attached a tarball with the ant build script, ivy settings file & log files of the
output I'm seeing with the ivy.jar version 2.2.x-local-20100623111942.

For each of the ivy:install tasks I've set haltOnError to be false so that all of them are
attempted and it's possible to see the differences.

The three test runs create 3 separate repositories using separate caches to retrive the following
modules:
org=org.apache.wink module=wink-server
org=org.apache.wink module=wink-client
org=log4j module=log4j
org=apache module=log4j
org=org.apache module=log4j


With test1 the following are retreived successfully:
org=org.apache.wink module=wink-server
org=org.apache.wink module=wink-client
org=apache module=log4j

With test2 the following are retreived successfully:
None properly, while it retrieves the wink-server and wink-client modules, it breaks on one
of the dependencies commons-lang.

With test3 the following are retreived successfully:
org=org.apache module=log4j



I can get the desired result if I have multiple resolvers using different namespace settings
based on whether it's retreiving apache-wink modules or log4j. However that is likely to result
in duplicate modules appearing as I add more to the repository. i.e. Adding commons-lang using
a different namespace to get it to appear with an org of org.apache, while it also gets retreived
with an org of commons-lang as a dependency of apache-wink.

Maybe that is the intended way that namespaces are to be used? 
Or am I just using the name space rules incorrectly?

--
Regards,
Darragh Bailey

Systems Software Engineer
Hewlett Packard Galway Ltd.

Postal Address:    Hewlett Packard Galway Limited, Ballybrit Business Park, Galway 
Registered Office: Hewlett Packard Galway Limited, 63-74 Sir John Rogerson's Quay Dublin 2
Registered Number: 361933

_______________________________________________
The contents of this message and any attachments to it are confidential and may be legally
privileged. If you have received this message in error you should delete it from your system
immediately and advise the sender.
To any recipient of this message within HP, unless otherwise stated you should consider this
message and attachments as "HP CONFIDENTIAL".



> -----Original Message-----
> From: Maarten Coene [mailto:maarten_coene@yahoo.com] 
> Sent: 21 June 2010 22:56
> To: ivy-user@ant.apache.org
> Subject: Re: Namespaces and rules with modules like 
> commons-lang and log4j
> 
> Hi,
> 
> I've committed some additional improvements to the namespace 
> handling in SVN trunk.
> Could you give it a try to see if it solves your problems?
> 
> If not, could you please post a concrete example 
> (ivysettings.xml and ivy.xml) ?
> 
> thanks,
> Maarten
> 
> 
> 
> ----- Original Message ----
> From: "Bailey, Darragh" <dbailey@hp.com>
> To: "ivy-user@ant.apache.org" <ivy-user@ant.apache.org>
> Sent: Thu, June 17, 2010 10:17:56 PM
> Subject: Namespaces and rules with modules like commons-lang and log4j
> 
> 
> Using version downloaded from hudson:
> [ivy:install] :: Ivy 2.2.x-local-20100609212354 - 
> 20100609212354 :: http://ant.apache.org/ivy/ ::
> 
> 
> One problem that I've noticed is that I can't use namespace 
> rules as shown the the advanced settings file for the example 
> build repository to rename the org on all the modules defined 
> in that file to use "org.apache". The reason I'd like to do 
> this is, so that the orgs and modules will match up to what 
> the developers here write for import statements in the java files.
> 
> If I use that file as a direct example and specify the 
> following modules to retrieve
> 
>    <ivy:install settingsRef="ivy.default.settings" 
> organisation="org.apache.wink" module="wink-server" 
> revision="1.1-incubating"
>       from="${from.resolver}" to="${to.resolver}" 
> transitive="true" overwrite="true" />
>     <ivy:install settingsRef="ivy.default.settings" 
> organisation="org.apache.wink" module="wink-client" 
> revision="1.1-incubating"
>       from="${from.resolver}" to="${to.resolver}" 
> transitive="true" overwrite="true" />
> 
>    <ivy:install settingsRef="ivy.default.settings" 
> organisation="apache" module="log4j" revision="1.2.13"
>       from="${from.resolver}" to="${to.resolver}" 
> transitive="true" overwrite="true" />
> 
> It works fine. But modules such as commons-lang and log4j get 
> an org of "apache". Which as I mentioned previous isn't going 
> to make it any easier for the developers to add dependencies 
> than just setting up the repository without using namespaces. 
> Once they have to search for the dependency it will make 
> little difference in how they are named.
> 
> Make the following changes to the namespace rules 
> @@ -44,7 +44,7 @@
>      <namespace name="maven2">
>        <rule>   <!-- imported apache maven1 projects -->
>          <fromsystem>
> -          <src org="apache" module=".+"/>
> +          <src org="org.apache" module=".+"/>
>            <dest org="$m0" module="$m0"/>
>          </fromsystem>
>          <tosystem>
> @@ -121,7 +121,7 @@
>            <src org="xmlbeans" module="xmlbeans" />
>            <src org="xmlrpc" module="xmlrpc" />
> 
> -          <dest org="apache" module="$m0"/>
> +          <dest org="org.apache" module="$m0"/>
>          </tosystem>
>        </rule>
> 
> And I now get the following error:
> [ivy:install] :: problems summary ::
> [ivy:install] :::: WARNINGS
> [ivy:install]   the module descriptor 
> http://repo1.maven.org/maven2/org/apache/wink/wink-server/1.1-
> incubating/wink-server-1.1-incubating.pom has information 
> which can't be converted into the system namespace. It will 
> require the availability of the namespace 'maven2' to be fully usable.
> [ivy:install]   impossible to put metadata file in cache: 
> http://repo1.maven.org/maven2/commons-lang/commons-lang/2.3/co
> mmons-lang-2.3.pom (2.3). java.io.FileNotFoundException: 
> /build/user/darragh/ivy/cache/org.apache/commons-lang/ivy-2.3.
> xml.original (No such file or directory)
> [ivy:install]
> [ivy:install] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
> 
> Took a look at the cache and saw the following:
> cache/commons-lang/
> cache/commons-lang/commons-lang
> cache/commons-lang/commons-lang/ivydata-2.3.properties
> cache/apache/
> cache/apache/apache
> cache/apache/apache/ivydata-6.properties
> cache/apache/apache/ivy-6.xml.original
> cache/apache/apache/ivy-6.xml
> cache/apache/apache/ivydata-1.properties
> cache/apache/apache/ivy-1.xml.original
> cache/apache/apache/ivy-1.xml
> cache/apache/commons-lang
> cache/apache/commons-lang/ivydata-2.3.properties
> cache/apache/commons-lang/ivy-2.3.xml.original
> cache/org.apache
> cache/org.apache/apache
> cache/org.apache/apache/ivydata-6.properties
> cache/org.apache/apache/ivydata-1.properties
> cache/org.apache/commons-lang
> cache/org.apache/commons-lang/ivydata-2.3.properties
> cache/org.apache/commons-lang/jars
> cache/org.apache/commons-lang/jars/commons-lang-2.3.jar
> 
> Looks like there are some problems with the application of 
> the namespace rules with regards to some components.
> 
> 
> Thought maybe there was some interferance with the rule that 
> translates between org.apache and apache, so remove the following:
> -      <rule> <!-- new apache projects -->
> -        <fromsystem>
> -          <src org="apache" />
> -          <dest org="org.apache"/>
> -        </fromsystem>
> -        <tosystem>
> -          <src org="org.apache" />
> -          <dest org="apache" />
> -        </tosystem>
> -      </rule>
> 
> 
> Retried (after deleting the cache and partially created repo) 
> and get the following error:
> 
> [ivy:install] :: problems summary ::
> [ivy:install] :::: WARNINGS
> [ivy:install]   io problem while parsing ivy file: 
> http://repo1.maven.org/maven2/org/apache/wink/wink/1.1-incubat
> ing/wink-1.1-incubating.pom: Impossible to load parent for 
> file:/build/user/darragh/ivy/cache/org.apache.wink/wink/ivy-1.
> 1-incubating.xml.original. Parent=org.apache#apache;6
> [ivy:install]   io problem while parsing ivy file: 
> http://repo1.maven.org/maven2/org/apache/wink/wink-server/1.1-
> incubating/wink-server-1.1-incubating.pom: Impossible to load 
> parent for 
> file:/build/user/darragh/ivy/cache/org.apache.wink/wink-server
> /ivy-1.1-incubating.xml.original. 
> Parent=org.apache.wink#wink;1.1-incubating
> [ivy:install]           module not found: 
> org.apache.wink#wink-server;1.1-incubating
> [ivy:install]   ==== libraries: tried
> [ivy:install]    
> http://repo1.maven.org/maven2/apache/apache/6/apache-6.pom
> [ivy:install]     -- artifact apache#apache;6!apache.jar:
> [ivy:install]    
> http://repo1.maven.org/maven2/apache/apache/6/apache-6.jar
> [ivy:install]           ::::::::::::::::::::::::::::::::::::::::::::::
> [ivy:install]           ::          UNRESOLVED DEPENDENCIES         ::
> [ivy:install]           ::::::::::::::::::::::::::::::::::::::::::::::
> [ivy:install]           :: 
> org.apache.wink#wink-server;1.1-incubating: not found
> [ivy:install]           ::::::::::::::::::::::::::::::::::::::::::::::
> [ivy:install]
> [ivy:install] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
> 
> 
> 
> Is there anyway to get the end result desired using the 
> namespace rules? 
> 
> Or is this just a limitation of the current implementation?
> 
> Or am I missing something completely obvious in their use?
> 
> 
> --
> Regards,
> Darragh Bailey
> 
> Systems Software Engineer
> Hewlett Packard Galway Ltd.
> 
> Postal Address:    Hewlett Packard Galway Limited, Ballybrit 
> Business Park, Galway
> Registered Office: Hewlett Packard Galway Limited, 63-74 Sir 
> John Rogerson's Quay Dublin 2
> Registered Number: 361933 
> 
> 
>      
> 


      

Mime
View raw message