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 ar92 <ar...@coheris.com> on 2008/04/09 17:17:28 UTC

Issues with install and iBiblio

Hi. I'm evaluating tools to add dependency management to an existing project
with complex ant scripts.  Ivy is the front-runner, but I've had a few
problems.  I thought I'd start with the install task.

I'm using 2.0.0-beta 2 with ant 1.7.0.  

As a simple test, I have tried several variations on install calls and have
not been satisfied with any of the results.

For example, here's my target with 3 :

    <target name="install" description="--> copy files to the local
repository">
        <ivy:install matcher="glob" from="libraries2" to="libraries3"
overwrite="true" transitive="true" organisation="log4j" module="log4j"
revision="1.2.15" />
        <ivy:install matcher="glob" from="libraries2" to="libraries3"
overwrite="true" transitive="true" organisation="org/apache/ant"
module="ant" revision="*" />
        <ivy:install matcher="glob" from="libraries2" to="libraries3"
overwrite="true" transitive="true" organisation="org/*" module="*"
revision="*" />
    </target>

I'll paste the resolvers config below, but first the results: 
  The log4j jar is successfully retrieved, but not the dependencies from its
POM.  
  The second install task throws an exception.  I first tried setting
"organisation" to "org.apache.ant", but Ivy failed to find it in the iBiblio
path. So I changed it to use slashes instead of dots, and the lib was found,
but with the following results:

[ivy:install] ERROR:    libraries2: bad organisation found in
http://repo1.maven
.org/maven2/org/apache/ant/ant/1.7.0/ant-1.7.0.pom:
expected='org/apache/ant' fo
und='org.apache.ant'
[ivy:install] java.text.ParseException: inconsistent module descriptor file
foun
d in 'http://repo1.maven.org/maven2/org/apache/ant/ant/1.7.0/ant-1.7.0.pom':
bad
 organisation: expected='org/apache/ant' found='org.apache.ant';
[ivy:install]   at
org.apache.ivy.plugins.resolver.BasicResolver.checkDescriptor
Consistency(BasicResolver.java:504)
[ivy:install]   at
org.apache.ivy.plugins.resolver.BasicResolver.getDependency(B
asicResolver.java:236)
[ivy:install]   at
org.apache.ivy.plugins.resolver.IBiblioResolver.getDependency
(IBiblioResolver.java:291)
[ivy:install]   at
org.apache.ivy.core.resolve.IvyNode.loadData(IvyNode.java:225
)

It never got to the third tag. I was hoping to see what it would do and how
long it would take.


So here are the resolvers:

        <chain name="libraries">
  		<filesystem name="libraries3">
			<artifact
pattern="${repository.dir}/[organisation]/[module]/[revision]/[artifact].[ext]"
/>
			<ivy pattern="${repository.dir}/[module]-[revision].xml" />
		</filesystem>
		<ibiblio name="libraries2" m2compatible="true" usepoms="true" /> 
    </chain>

I tried both usepoms=true and usepoms=false, with the same results. (Aside:
I will probably change my ivy pattern for libraries3 to match the artifact
pattern, but I would not expect it to have caused these problems.  I did
receive an ivy file for log4j in the filesystem, although it contained no
dependencies.)

So did I miss something here, or is this a big bug? It was my understanding
that m2compatible=true means that the resolver can handle the way Maven
breaks up the org into directories.  

-- 
View this message in context: http://www.nabble.com/Issues-with-install-and-iBiblio-tp16586962p16586962.html
Sent from the ivy-user mailing list archive at Nabble.com.


Re: Issues with install and iBiblio

Posted by Xavier Hanin <xa...@gmail.com>.
On Thu, Apr 10, 2008 at 11:33 AM, ar92 <ar...@coheris.com> wrote:

>
> The cleancache fixed the problem I had with log4j dependencies, but as you
> said there are jars missing or unretrievable.  For me it bombed when
> getting
> jmx, but at least the dependencies from the POM are now in the ivy file in
> the local repo.
>
> I've since changed the test task to be like this:
>
>    <target name="install" description="--> copy files to the local
> repository">
>         <ivy:cleancache />
>         <ivy:install matcher="glob" from="libraries2" to="libraries3"
> overwrite="true" transitive="true" organisation="org.apache.ant"
> module="ant" revision="1.6.5" />
>         <ivy:install matcher="glob" from="libraries2" to="libraries3"
> overwrite="true" transitive="true" organisation="org/apache/ant"
> module="ant" revision="1.7.0" />
>         <ivy:install matcher="glob" from="libraries2" to="libraries3"
> overwrite="true" transitive="true" organisation="log4j" module="log4j"
> revision="1.2.15" />
>     </target>
>
> What I'm seeing now is that Ant 1.6.5 is not found (and is thus ignored),
> and then the ant 1.7.0 installation attempt provokes a crash with the same
> kind of "bad organisation" error that I was getting before.

You should use dots instead of slashes. For ant 1.6.5, the organization is
"ant", not org.apache.ant:
http://javarepo.xoocode.org/module/ant/ant/
http://javarepo.xoocode.org/module/org.apache.ant/ant/

Xavier


>
> -Alan
>
>
>
> Xavier Hanin wrote:
> >
> >
> > For log4j, it's supposed to work. Did you clean your cache between your
> > attempts? I've made a quick test, and it quite works:
> > It attempts to install transitive dependencies, but some are missing
> > (javax.mail is  a dependency of log4j but is not available in maven
> repo).
> > We have bad error reporting in this case (you need to use verbose mode
> to
> > get details), but it works pretty well.
> >
> > For the second attempt, Ivy is not able to list the revisions of the
> > module
> > in a maven 2 repository yet, and thus do not install anything. This is
> > somewhat related to IVY-503, but it deserves its own issue. Could you
> open
> > one?
> >
> > For your third attempt, I'm not sure we'll be able to handle this,
> because
> > we'd need to introduce some kind of recursion when looking for
> > organization
> > names. This would be nice (and is also required to fully fix IVY-503),
> but
> > very time consuming once implemented.
> >
> > Xavier
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Issues-with-install-and-iBiblio-tp16586962p16606544.html
> Sent from the ivy-user mailing list archive at Nabble.com.
>
>


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

Re: Issues with install and iBiblio

Posted by ar92 <ar...@coheris.com>.
The cleancache fixed the problem I had with log4j dependencies, but as you
said there are jars missing or unretrievable.  For me it bombed when getting
jmx, but at least the dependencies from the POM are now in the ivy file in
the local repo.

I've since changed the test task to be like this:

    <target name="install" description="--> copy files to the local
repository">
        <ivy:cleancache />        
        <ivy:install matcher="glob" from="libraries2" to="libraries3"
overwrite="true" transitive="true" organisation="org.apache.ant"
module="ant" revision="1.6.5" />
        <ivy:install matcher="glob" from="libraries2" to="libraries3"
overwrite="true" transitive="true" organisation="org/apache/ant"
module="ant" revision="1.7.0" />
        <ivy:install matcher="glob" from="libraries2" to="libraries3"
overwrite="true" transitive="true" organisation="log4j" module="log4j"
revision="1.2.15" />
    </target>

What I'm seeing now is that Ant 1.6.5 is not found (and is thus ignored),
and then the ant 1.7.0 installation attempt provokes a crash with the same
kind of "bad organisation" error that I was getting before.    
-Alan 



Xavier Hanin wrote:
> 
> 
> For log4j, it's supposed to work. Did you clean your cache between your
> attempts? I've made a quick test, and it quite works:
> It attempts to install transitive dependencies, but some are missing
> (javax.mail is  a dependency of log4j but is not available in maven repo).
> We have bad error reporting in this case (you need to use verbose mode to
> get details), but it works pretty well.
> 
> For the second attempt, Ivy is not able to list the revisions of the
> module
> in a maven 2 repository yet, and thus do not install anything. This is
> somewhat related to IVY-503, but it deserves its own issue. Could you open
> one?
> 
> For your third attempt, I'm not sure we'll be able to handle this, because
> we'd need to introduce some kind of recursion when looking for
> organization
> names. This would be nice (and is also required to fully fix IVY-503), but
> very time consuming once implemented.
> 
> Xavier
> 
> 

-- 
View this message in context: http://www.nabble.com/Issues-with-install-and-iBiblio-tp16586962p16606544.html
Sent from the ivy-user mailing list archive at Nabble.com.


Re: Issues with install and iBiblio

Posted by Xavier Hanin <xa...@gmail.com>.
On Wed, Apr 9, 2008 at 5:17 PM, ar92 <ar...@coheris.com> wrote:

>
> Hi. I'm evaluating tools to add dependency management to an existing
> project
> with complex ant scripts.  Ivy is the front-runner, but I've had a few
> problems.  I thought I'd start with the install task.
>
> I'm using 2.0.0-beta 2 with ant 1.7.0.
>
> As a simple test, I have tried several variations on install calls and
> have
> not been satisfied with any of the results.
>
> For example, here's my target with 3 :
>
>    <target name="install" description="--> copy files to the local
> repository">
>        <ivy:install matcher="glob" from="libraries2" to="libraries3"
> overwrite="true" transitive="true" organisation="log4j" module="log4j"
> revision="1.2.15" />
>        <ivy:install matcher="glob" from="libraries2" to="libraries3"
> overwrite="true" transitive="true" organisation="org/apache/ant"
> module="ant" revision="*" />
>        <ivy:install matcher="glob" from="libraries2" to="libraries3"
> overwrite="true" transitive="true" organisation="org/*" module="*"
> revision="*" />
>    </target>
>
> I'll paste the resolvers config below, but first the results:
>  The log4j jar is successfully retrieved, but not the dependencies from
> its
> POM.
>  The second install task throws an exception.  I first tried setting
> "organisation" to "org.apache.ant", but Ivy failed to find it in the
> iBiblio
> path. So I changed it to use slashes instead of dots, and the lib was
> found,
> but with the following results:
>
> [ivy:install] ERROR:    libraries2: bad organisation found in
> http://repo1.maven
> .org/maven2/org/apache/ant/ant/1.7.0/ant-1.7.0.pom:
> expected='org/apache/ant' fo
> und='org.apache.ant'
> [ivy:install] java.text.ParseException: inconsistent module descriptor
> file
> foun
> d in 'http://repo1.maven.org/maven2/org/apache/ant/ant/1.7.0/ant-1.7.0.pom
> ':
> bad
>  organisation: expected='org/apache/ant' found='org.apache.ant';
> [ivy:install]   at
> org.apache.ivy.plugins.resolver.BasicResolver.checkDescriptor
> Consistency(BasicResolver.java:504)
> [ivy:install]   at
> org.apache.ivy.plugins.resolver.BasicResolver.getDependency(B
> asicResolver.java:236)
> [ivy:install]   at
> org.apache.ivy.plugins.resolver.IBiblioResolver.getDependency
> (IBiblioResolver.java:291)
> [ivy:install]   at
> org.apache.ivy.core.resolve.IvyNode.loadData(IvyNode.java:225
> )
>
> It never got to the third tag. I was hoping to see what it would do and
> how
> long it would take.
>
>
> So here are the resolvers:
>
>        <chain name="libraries">
>                <filesystem name="libraries3">
>                        <artifact
>
> pattern="${repository.dir}/[organisation]/[module]/[revision]/[artifact].[ext]"
> />
>                        <ivy
> pattern="${repository.dir}/[module]-[revision].xml" />
>                </filesystem>
>                <ibiblio name="libraries2" m2compatible="true"
> usepoms="true" />
>    </chain>
>
> I tried both usepoms=true and usepoms=false, with the same results.
> (Aside:
> I will probably change my ivy pattern for libraries3 to match the artifact
> pattern, but I would not expect it to have caused these problems.  I did
> receive an ivy file for log4j in the filesystem, although it contained no
> dependencies.)
>
> So did I miss something here, or is this a big bug? It was my
> understanding
> that m2compatible=true means that the resolver can handle the way Maven
> breaks up the org into directories.

For log4j, it's supposed to work. Did you clean your cache between your
attempts? I've made a quick test, and it quite works:
It attempts to install transitive dependencies, but some are missing
(javax.mail is  a dependency of log4j but is not available in maven repo).
We have bad error reporting in this case (you need to use verbose mode to
get details), but it works pretty well.

For the second attempt, Ivy is not able to list the revisions of the module
in a maven 2 repository yet, and thus do not install anything. This is
somewhat related to IVY-503, but it deserves its own issue. Could you open
one?

For your third attempt, I'm not sure we'll be able to handle this, because
we'd need to introduce some kind of recursion when looking for organization
names. This would be nice (and is also required to fully fix IVY-503), but
very time consuming once implemented.

Xavier


>
> --
> View this message in context:
> http://www.nabble.com/Issues-with-install-and-iBiblio-tp16586962p16586962.html
> Sent from the ivy-user mailing list archive at Nabble.com.
>
>


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