Trying to use the example under src/example/build-a-ivy-repository/ to build a 
local repository so that I can control the dependencies being used by a project 
here and not be dependent on the maven repository being accessible. I've 
modified the build.xml file to use the advanced settings file with the maven2 
namespace by default

As well as having a local repository, I'm also interested in controlling what's 
in it, i.e. so only after we're happy to start using particular jars in the 
project will they be added to the local repository. Ideally I'd prefer to 
download these from the maven2 repo and install them into an ivy repo, rather 
than duplicating much of the work.

For some I've got these working, however as I expand or change the list I seem 
to be running into various problems, and I don't quite understand enough about 
Ivy yet to be able to work out how to workaround these.

Using:
Ant 1.8.1
Ivy 2.1.0


Currently I'm trying to add apache-wink-1.1-incubating.jar by using the example 
to have it downloaded from the maven repository and placed in a local one, but 
I'm seeing the following error:

[ivy:install] WARN:     ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:install] WARN:     ::          UNRESOLVED DEPENDENCIES         ::
[ivy:install] WARN:     ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:install] WARN:     :: org.apache.wink#wink;1.1-incubating: 
java.text.ParseException: inconsistent module descriptor file found in 
'http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.pom': bad 
organisation: expected='org.apache' found='apache';


Don't quite understand this since, looking at the namespace rules in the 
ivysettings-advanced.xml file, it looks like it should handle this? Also 
looking at the file being referenced, it seems the groupId is set to org.apache 
which I would have thought that for the above error to be correct, whould read 
"<groupId>apache</groupId>".

I tried switching to the ivysettings-basic.xml at this point just to see if 
there was some issue with the namespace rules, and I'm getting the same error.

I then tried running with the -verbose option to ant to see if there was any 
other information that could help


Apache Ant version 1.8.1 compiled on April 30 2010
Trying the default build file: build.xml
Buildfile: /build/user/darragh/svn/cmp/build/config/trunk/ivy/repo/build.xml
Detected Java version: 1.6 in: 
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
Detected OS: Linux
parsing buildfile 
/build/user/darragh/svn/cmp/build/config/trunk/ivy/repo/build.xml with URI = 
file:/build/user/darragh/svn/cmp/build/config/trunk/ivy/repo/build.xml
Project base dir set to: /build/user/darragh/svn/cmp/build/config/trunk/ivy/repo
parsing buildfile 
jar:file:/build/user/darragh/tmp/apache-ant-1.8.1/lib/ant.jar!/org/apache/tools/ant/antlib.xml
 with URI = 
jar:file:/build/user/darragh/tmp/apache-ant-1.8.1/lib/ant.jar!/org/apache/tools/ant/antlib.xml
 from a zip file
 [macrodef] creating macro  add-dep
Build sequence for target(s) `create-repo' is [load-ivy, init-ivy, create-repo]
Complete build sequence is [load-ivy, init-ivy, create-repo, clean-repo, 
clean-cache, ]

load-ivy:
parsing buildfile 
jar:file:/build/user/darragh/svn/cmp/build/ant/ivy/trunk/bin/ivy-2.1.0.jar!/org/apache/ivy/ant/antlib.xml
 with URI = 
jar:file:/build/user/darragh/svn/cmp/build/ant/ivy/trunk/bin/ivy-2.1.0.jar!/org/apache/ivy/ant/antlib.xml
 from a zip file
parsing buildfile 
jar:file:/build/user/darragh/svn/cmp/build/ant/ivy/trunk/bin/ivy.jar!/org/apache/ivy/ant/antlib.xml
 with URI = 
jar:file:/build/user/darragh/svn/cmp/build/ant/ivy/trunk/bin/ivy.jar!/org/apache/ivy/ant/antlib.xml
 from a zip file

init-ivy:
[antlib:org.apache.ivy.ant] Could not load definitions from resource 
org/apache/ivy/ant/antlib.xml. It could not be found.

create-repo:
[ivy:install] Loading 
jar:file:/build/user/darragh/svn/cmp/build/ant/ivy/trunk/bin/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivy.properties
[ivy:install] :: Ivy 2.1.0 - 20090925235825 :: http://ant.apache.org/ivy/ ::
[ivy:install] :: loading settings :: file = 
/build/user/darragh/svn/cmp/build/config/trunk/ivy/repo/settings/ivysettings-advanced.xml
[ivy:install] no default ivy user dir defined: set to 
/usr/users/tc/darragh/.ivy2
[ivy:install] settings loaded (152ms)
[ivy:install]   default cache: 
/build/user/darragh/svn/cmp/build/config/trunk/ivy/repo/cache
[ivy:install]   default resolver: my-repository
[ivy:install]   -- 2 resolvers:
[ivy:install]   libraries [ibiblio]
[ivy:install]   my-repository [file]
[ivy:install] :: installing org.apache.wink#wink;1.1-incubating ::
[ivy:install] :: resolving dependencies ::
[ivy:install] resolving dependencies for configuration 'default'
[ivy:install] == resolving dependencies for apache#ivy-install;1.0 [default]
[ivy:install] == resolving dependencies 
apache#ivy-install;1.0->org.apache.wink#wink;1.1-incubating [default->*]
[ivy:install]           tried 
http://repo1.maven.org/maven2/org/apache/wink/wink/1.1-incubating/wink-1.1-incubating.pom
[ivy:install]   libraries: found md file for org.apache.wink#wink;1.1-incubating
[ivy:install]           => 
http://repo1.maven.org/maven2/org/apache/wink/wink/1.1-incubating/wink-1.1-incubating.pom
 (1.1-incubating)
[ivy:install] downloading 
http://repo1.maven.org/maven2/org/apache/wink/wink/1.1-incubating/wink-1.1-incubating.pom
 ...
[ivy:install]   libraries: downloading 
http://repo1.maven.org/maven2/org/apache/wink/wink/1.1-incubating/wink-1.1-incubating.pom
[ivy:install]   libraries: downloading 
http://repo1.maven.org/maven2/org/apache/wink/wink/1.1-incubating/wink-1.1-incubating.pom.sha1
[ivy:install] sha1 OK for 
http://repo1.maven.org/maven2/org/apache/wink/wink/1.1-incubating/wink-1.1-incubating.pom
[ivy:install]   [SUCCESSFUL ] 
org.apache.wink#wink;1.1-incubating!wink.pom(pom.original) (885ms)
[ivy:install]           tried 
http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.pom
[ivy:install]   libraries: found md file for apache#apache;6
[ivy:install]           => 
http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.pom (6)
[ivy:install] downloading 
http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.pom ...
[ivy:install]   libraries: downloading 
http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.pom
[ivy:install]   libraries: downloading 
http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.pom.sha1
[ivy:install] sha1 OK for 
http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.pom
[ivy:install]   [SUCCESSFUL ] apache#apache;6!apache.pom(pom.original) (11042ms)
[ivy:install]           tried 
http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.jar
[ivy:install] CLIENT ERROR: Not Found 
url=http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.jar
[ivy:install] ERROR:    libraries: bad organisation found in 
http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.pom: 
expected='org.apache' found='apache'
[ivy:install] :: downloading artifacts to cache ::
[ivy:install] :: installing in my-repository ::
[ivy:install] :: install resolution report ::
[ivy:install] :: resolution report :: resolve 0ms :: artifacts dl 1ms
        ---------------------------------------------------------------------
        |                  |            modules            ||   artifacts   |
        |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        ---------------------------------------------------------------------
        |      default     |   1   |   0   |   0   |   0   ||   0   |   0   |
        ---------------------------------------------------------------------
[ivy:install] WARN:     ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:install] WARN:     ::          UNRESOLVED DEPENDENCIES         ::
[ivy:install] WARN:     ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:install] WARN:     :: org.apache.wink#wink;1.1-incubating: 
java.text.ParseException: inconsistent module descriptor file found in 
'http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.pom': bad 
organisation: expected='org.apache' found='apache';
[ivy:install] WARN:     ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:install]   report for apache#ivy-install;1.0 default produced in 
/build/user/darragh/svn/cmp/build/config/trunk/ivy/repo/cache/apache-ivy-install-default.xml
[ivy:install]
[ivy:install] :: problems summary ::
[ivy:install] :::: WARNINGS
[ivy:install]           ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:install]           ::          UNRESOLVED DEPENDENCIES         ::
[ivy:install]           ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:install]           :: org.apache.wink#wink;1.1-incubating: 
java.text.ParseException: inconsistent module descriptor file found in 
'http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.pom': bad 
organisation: expected='org.apache' found='apache';
[ivy:install]           ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:install] :::: ERRORS
[ivy:install]           libraries: bad organisation found in 
http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.pom: 
expected='org.apache' found='apache'
[ivy:install]
[ivy:install] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS



The two lines that look interesting to me are:
[ivy:install] CLIENT ERROR: Not Found 
url=http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.jar
[ivy:install] ERROR:    libraries: bad organisation found in 
http://repo1.maven.org/maven2/org/apache/apache/6/apache-6.pom: 
expected='org.apache' found='apache'

Is the first one here the real error? In which case, how do I work around that 
since that file doesn't exist.



Ivy:install line used in my build.xml file that causes this problem.

<ivy:install settingsRef="advanced.settings" organisation="org.apache.wink" 
module="wink" revision="1.1-incubating" from="${from.resolver}" 
to="${to.resolver}" transitive="false" overwrite="true" />


The following ones all work just fine. (These are actually the dependencies 
that apache-wink provides in the release tarball)
 <ivy:install settingsRef="advanced.settings" organisation="javax.activation" 
module="activation" revision="1.1" from="${from.resolver}" to="${to.resolver}" 
transitive="false" overwrite="true" />
  <ivy:install settingsRef="advanced.settings" organisation="apache" 
module="commons-lang" revision="2.3" from="${from.resolver}" 
to="${to.resolver}" transitive="false" overwrite="true" />
  <ivy:install settingsRef="advanced.settings" organisation="javax.xml.bind" 
module="jaxb-api" revision="2.1" from="${from.resolver}" to="${to.resolver}" 
transitive="false" overwrite="true" />
  <ivy:install settingsRef="advanced.settings" organisation="com.sun.xml.bind" 
module="jaxb-impl" revision="2.1.4" from="${from.resolver}" to="${to.resolver}" 
transitive="false" overwrite="true" />
  <ivy:install settingsRef="advanced.settings" organisation="javax.ws.rs" 
module="jsr311-api" revision="1.0" from="${from.resolver}" to="${to.resolver}" 
transitive="false" overwrite="true" />
  <ivy:install settingsRef="advanced.settings" organisation="org.slf4j" 
module="slf4j-api" revision="1.5.8" from="${from.resolver}" to="${to.resolver}" 
transitive="false" overwrite="true" />
  <ivy:install settingsRef="advanced.settings" organisation="org.slf4j" 
module="slf4j-simple" revision="1.5.8" from="${from.resolver}" 
to="${to.resolver}" transitive="false" overwrite="true" />
  <ivy:install settingsRef="advanced.settings" organisation="javax.xml.stream" 
module="stax-api" revision="1.0-2" from="${from.resolver}" to="${to.resolver}" 
transitive="false" overwrite="true" />


I've come across the following mailing list post from someone that also appears 
to have run into the same problem:
http://www.mail-archive.com/ivy-user@ant.apache.org/msg00488.html

But I haven't found a solution.

Any suggestions?

I could switch to downloading and publishing the jars to my local repository, 
but that seems a bit of a waste considering that they are already available in 
the maven2 repository.


--
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 

Reply via email to