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 Mon, 21 Jun 2010 21:56:07 GMT
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/commons-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-incubating/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