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 Florian Traverse <fl...@gmail.com> on 2007/09/17 13:32:52 UTC

[Ivy SVN trunk ]Sun Jars

Hi everyone :)

I'm new to Ivy, ive checked it out from your svn trunk yesterday, and I want
to solve a common problem, I think this question has been answered several
time (but I did not find them :'( ).

The problem is "Sun binary Jars". They aren't on Maven repositories and I
want to make a project with Hibernate / Spring / DWR, that have transitive
dependencies to these jars

here are my configuration files:

build.xml:

<project xmlns:ivy="antlib:fr.jayasoft.ivy.ant" name="awiki"
default="resolve">
    <target name="resolve">
        <ivy:settings file="ivysettings.xml" />
        <ivy:resolve file="ivy.xml" conf="default" />
    </target>
</project>

ivy.xml:

<ivy-module version="1.0">
    <info organisation="archetypejs.sf.net" module="awiki" />
    <dependencies>
        <dependency org="org.directwebremoting" name="dwr" rev="2.0.1" />
        <dependency org="org.springframework" name="spring" rev="2.0.6" />
        <dependency org="org.hibernate" name="hibernate" rev="3.2.1.ga" />
    </dependencies>
</ivy-module>

ivysettings.xml:

<ivysettings>
    <settings defaultResolver="projet" />
    <resolvers>
        <chain name="projet" returnFirst="true">
            <filesystem name="local" />
            <filesystem name="shared" />
            <filesystem name="libraries">
                <ivy pattern="lib/[artifact]-[revision].xml" />
                <artifact pattern="lib/[artifact]-[revision].[ext]" />
            </filesystem>
            <!--            <ibiblio name="jboss"-->
            <!--                root="http://repository.jboss.org/maven2 "
m2compatible="true" />-->
            <ibiblio name="codehaus"
                root="http://dist.codehaus.org/mule/dependencies/maven2"
                m2compatible="true" />
            <ibiblio name="default" m2compatible="true" />
        </chain>
    </resolvers>
</ivysettings>


In order to solve the javax.security/jacc-1.0 dependency problem, I've
downloaded it and putted it in the /lib directory of my project, as
"lib/jacc-1.0.jar"

I haven't well understood how to set my own local repository for this kind
of jar, and expected my really simple configuration working, by putting just
the jar (with no xml dependency describer for the jar) in the lib directory
of my prject. but of course, it doesn't work...

So, what's wrong here please ? ;)

Regards,
Temsa

Re: [Ivy SVN trunk ]Sun Jars

Posted by Jing Xue <ji...@digizenstudio.com>.
On Mon, Sep 17, 2007 at 10:55:02PM +0200, Florian Traverse wrote:
> Do I have to make a  real repository, with Ivi xml description files, or can

Yes. But from your settings, you have already got a local repository.
It's incredibly easy to publish something there. 8-)

You need the jar, and a minimalist ivy.xml file that basically goes:

<?xml version="1.0"?>
<ivy-module version="1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <info organisation="javax.security" module="jacc" />
</ivy-module>

And then some ant code like:

<target name="publish">
  <ivy:settings />
  <ivy:resolve />
  <ivy:publish forcedeliver="true" artifactspattern="jacc.jar" resolver="local" pubrevision="1.0" />
</target>

I didn't test the code above, but it's a stripped-down version of what
we use to publish our local artifacts, so it shouldn't be too far off.

Cheers.
-- 
Jing Xue

Re: [Ivy SVN trunk ]Sun Jars

Posted by Michael Terrington <mi...@sarugo.net>.
Florian Traverse wrote:
> Do I have to make a  real repository, with Ivi xml description files, or can
> I simply drop the jar in my "lib" project's directory using  something like
> this (this one seems not to work)?

I have a local filesystem repository to which I push only jars for some 
of the not publicly available java libs.  So this should be possible.

>             <filesystem name="libraries">
>                 <ivy pattern="lib/[artifact]-[revision].xml" />
>                 <artifact pattern="lib/[artifact]-[revision].[ext]" />
>             </filesystem>
> 
> I've tried to comment out  <ivy pattern="lib/[artifact]-[revision].xml" />
> but it doesn't work either. So, any solution (don't forget, I'm a noob, and
> making a real repository with all the directories and xml files really bugs
> me ATM)?

I don't know for sure, but for my local repository I have a full path in 
the patterns, so you might try 
"${basedir}/lib/[artifact]-[revision].xml" instead.  If that doesn't 
work take a look at the output from the resolve, it should tell you 
where it was looking for the files.

Regards,
Michael.
-- 
Michael Terrington <mi...@sarugo.net>
Software Development Manager
Sarugo Pty. Ltd. <http://www.sarugo.net/>
Level 2, 44 Gawler Place, Adelaide SA
Office: +61 8 8359 2373
Mobile: +61 403 201 507

Re: [Ivy SVN trunk ]Sun Jars

Posted by Florian Traverse <fl...@gmail.com>.
Great it worked, using both [module] & ${basedir} !! :)

Thanks !

Temsa

2007/9/18, Gilles Scokart <gs...@gmail.com>:
>
> Try to use [module] instead of [artefact].
>
> Ivy dependencies are defined first in term of modules.  Artefacts are only
> known when the ivy.xml file (or pom.xml) is read.  If you don't want to
> write an module descriptors, you have to work only at module level.
>
> Maybe we should define such a resolver in our default settings...
>
> Note also that it migh be possible to define a resolver that take the
> pom.xml from the maven repository and the jars from a local dir.  (I know
> it
> is possible with an ivy repository, but I'm sure it can work with a maven
> repository).
>
> Gilles
>
> 2007/9/17, Florian Traverse <fl...@gmail.com>:
> >
> > That's the point :)
> >
> > Do I have to make a  real repository, with Ivi xml description files, or
> > can
> > I simply drop the jar in my "lib" project's directory using  something
> > like
> > this (this one seems not to work)?
> >
> >             <filesystem name="libraries">
> >                 <ivy pattern="lib/[artifact]-[revision].xml" />
> >                 <artifact pattern="lib/[artifact]-[revision].[ext]" />
> >             </filesystem>
> >
> > I've tried to comment out  <ivy pattern="lib/[artifact]-[revision].xml"
> />
> > but it doesn't work either. So, any solution (don't forget, I'm a noob,
> > and
> > making a real repository with all the directories and xml files really
> > bugs
> > me ATM)?
> >
> > Regards,
> > Temsa
> > 2007/9/17, Jing Xue <ji...@digizenstudio.com>:
> > >
> > >
> > > Quoting Florian Traverse <fl...@gmail.com>:
> > >
> > > > And where do you see a Jar file ? There's only a pom ... ;oP
> > >
> > > Oops, should've looked closer.  My apologies.
> > >
> > > > I had the same problem with maven before, the solution was to
> download
> > > it
> > > > then do a mvn install with some options.
> > > >
> > > > So the question remains ... Any Idea ? :)
> > >
> > > I would look at publishing the jar into a local or shared repository,
> > > then.
> > >
> > > Cheers.
> > > --
> > > Jing Xue
> > >
> > >
> >
>
>
>
> --
> Gilles SCOKART
>

Re: [Ivy SVN trunk ]Sun Jars

Posted by Gilles Scokart <gs...@gmail.com>.
Try to use [module] instead of [artefact].

Ivy dependencies are defined first in term of modules.  Artefacts are only
known when the ivy.xml file (or pom.xml) is read.  If you don't want to
write an module descriptors, you have to work only at module level.

Maybe we should define such a resolver in our default settings...

Note also that it migh be possible to define a resolver that take the
pom.xml from the maven repository and the jars from a local dir.  (I know it
is possible with an ivy repository, but I'm sure it can work with a maven
repository).

Gilles

2007/9/17, Florian Traverse <fl...@gmail.com>:
>
> That's the point :)
>
> Do I have to make a  real repository, with Ivi xml description files, or
> can
> I simply drop the jar in my "lib" project's directory using  something
> like
> this (this one seems not to work)?
>
>             <filesystem name="libraries">
>                 <ivy pattern="lib/[artifact]-[revision].xml" />
>                 <artifact pattern="lib/[artifact]-[revision].[ext]" />
>             </filesystem>
>
> I've tried to comment out  <ivy pattern="lib/[artifact]-[revision].xml" />
> but it doesn't work either. So, any solution (don't forget, I'm a noob,
> and
> making a real repository with all the directories and xml files really
> bugs
> me ATM)?
>
> Regards,
> Temsa
> 2007/9/17, Jing Xue <ji...@digizenstudio.com>:
> >
> >
> > Quoting Florian Traverse <fl...@gmail.com>:
> >
> > > And where do you see a Jar file ? There's only a pom ... ;oP
> >
> > Oops, should've looked closer.  My apologies.
> >
> > > I had the same problem with maven before, the solution was to download
> > it
> > > then do a mvn install with some options.
> > >
> > > So the question remains ... Any Idea ? :)
> >
> > I would look at publishing the jar into a local or shared repository,
> > then.
> >
> > Cheers.
> > --
> > Jing Xue
> >
> >
>



-- 
Gilles SCOKART

Re: [Ivy SVN trunk ]Sun Jars

Posted by Florian Traverse <fl...@gmail.com>.
That's the point :)

Do I have to make a  real repository, with Ivi xml description files, or can
I simply drop the jar in my "lib" project's directory using  something like
this (this one seems not to work)?

            <filesystem name="libraries">
                <ivy pattern="lib/[artifact]-[revision].xml" />
                <artifact pattern="lib/[artifact]-[revision].[ext]" />
            </filesystem>

I've tried to comment out  <ivy pattern="lib/[artifact]-[revision].xml" />
but it doesn't work either. So, any solution (don't forget, I'm a noob, and
making a real repository with all the directories and xml files really bugs
me ATM)?

Regards,
Temsa
2007/9/17, Jing Xue <ji...@digizenstudio.com>:
>
>
> Quoting Florian Traverse <fl...@gmail.com>:
>
> > And where do you see a Jar file ? There's only a pom ... ;oP
>
> Oops, should've looked closer.  My apologies.
>
> > I had the same problem with maven before, the solution was to download
> it
> > then do a mvn install with some options.
> >
> > So the question remains ... Any Idea ? :)
>
> I would look at publishing the jar into a local or shared repository,
> then.
>
> Cheers.
> --
> Jing Xue
>
>

Re: [Ivy SVN trunk ]Sun Jars

Posted by Jing Xue <ji...@digizenstudio.com>.
Quoting Florian Traverse <fl...@gmail.com>:

> And where do you see a Jar file ? There's only a pom ... ;oP

Oops, should've looked closer.  My apologies.

> I had the same problem with maven before, the solution was to download it
> then do a mvn install with some options.
>
> So the question remains ... Any Idea ? :)

I would look at publishing the jar into a local or shared repository, then.

Cheers.
-- 
Jing Xue


Re: [Ivy SVN trunk ]Sun Jars

Posted by Florian Traverse <fl...@gmail.com>.
And where do you see a Jar file ? There's only a pom ... ;oP

I had the same problem with maven before, the solution was to download it
then do a mvn install with some options.

So the question remains ... Any Idea ? :)

2007/9/17, Jing Xue <ji...@digizenstudio.com>:
>
>
> Quoting Florian Traverse <fl...@gmail.com>:
>
> > In order to solve the javax.security/jacc-1.0 dependency problem, I've
> > downloaded it and putted it in the /lib directory of my project, as
> > "lib/jacc-1.0.jar"
>
> jacc artifacts are actually available from the maven2 public repo:
> http://repo1.maven.org/maven2/javax/security/jacc/1.0/
>
> For artifacts you can't find anywhere, the cleanest way is to publish
> them to your local or shared repository.
>
> HTH
> --
> Jing Xue
>
>

Re: [Ivy SVN trunk ]Sun Jars

Posted by Jing Xue <ji...@digizenstudio.com>.
Quoting Florian Traverse <fl...@gmail.com>:

> In order to solve the javax.security/jacc-1.0 dependency problem, I've
> downloaded it and putted it in the /lib directory of my project, as
> "lib/jacc-1.0.jar"

jacc artifacts are actually available from the maven2 public repo:
http://repo1.maven.org/maven2/javax/security/jacc/1.0/

For artifacts you can't find anywhere, the cleanest way is to publish  
them to your local or shared repository.

HTH
-- 
Jing Xue