buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rhett Sutphin <>
Subject Re: how to set ivysettings.xml location using buildr extension
Date Wed, 28 Jul 2010 04:12:04 GMT
Hi Keno,

On Jul 27, 2010, at 2:31 PM, Johan Venant wrote:

> Hi everybody,
> I'm trying to start a personal project using some "alternative" java tools.
> My dream team is composed of [ivy, buildr, jetty, jersey, freemarker,
> guice2, google apps api].
> I'm facing some huge difficulties trying to manage my ivy repositories from
> buildr. Especially with ivysettings.xml
> Basically, it seems that the buidr ivy extension try to get the
> ivysettings.xml from the ant-scripts project subfolder.
> This is not a problem for me because I need my own settings to add
> java.netand google maven repositories.
> So I put my own ivysettings in ant-scripts
> And it worked like a charme... At least to compile the project.
> I use also the jetty buildr plugin to manage jetty server. This plugin
> use Java.classpath to know which libraries to load on startup. This variable
> is not set by ivy extension so I have to do it myself.
> I assume that I will have to use the ivy filter or deps methods to retrieve
> the compile classpath and to inject it in the Java.classpath. Thus, jetty
> should by launch with a valid classpath.

I think you have a chicken and egg problem here.  Changes to Java.classpath only take effect
if they are made before the java subsystem is initialized.  Running ant tasks will initialize
the java subsystem.  Ivy4r is built on ant tasks.  So you can't use ivy4r to determine what
should go in Java.classpath.

What kind of application are you trying to launch using Jetty?  If it's a standard J2EE webapp,
you can put the dependencies in WEB-INF/lib and they'll be available.


> My main problem is that if the compile action use the good ivysettings
> located in ant-scripts, the ivy extension methods seems to use the default
> one located in the ivy jar file. And I didn't find any way to change this
> behavior.
> This is the kind of output I have using a ivy.deps inside my project :
> :: Ivy 2.1.0 - 20090925235825 :: ::
> [ivy_cachepath] :: loading settings :: url =
> jar:file:/var/lib/gems/1.9.1/gems/ivy4r-jars-1.1.0/lib/ivy-2.1.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
> [ivy_cachepath] :: resolving dependencies ::
> org.apache#hello-ivy;working@keno-desktop
> [ivy_cachepath] confs: [compile]
> [ivy_cachepath] found javax.servlet#servlet-api;2.5 in public
> ...
> Finishing by an unresolved dependencies errors on libraries from
> java.netand google repositories
> And this is the output without the deps (only compiling, no jetty stuff)
> :: Ivy 2.1.0 - 20090925235825 :: ::
> [ivy_resolve] :: loading settings :: file =
> /home/keno/workspace/gbill/ant-scripts/ivysettings.xml
> [ivy_resolve] :: resolving dependencies ::
> org.apache#hello-ivy;working@keno-desktop
> [ivy_resolve] confs: [compile]
> [ivy_resolve] found javax.servlet#servlet-api;2.5 in maven
> ...
> This works very well
> I'm a beginner on all those technologies. So any help is welcome.
> Thank you very much,
> Keno.
> PS : I also didn't find a clean way to overload the jetty version used by
> the buildr plugin. The only way I found is by change the VERSION constant
> directly inside the plugin sources.
> -- 
> KenoKles

View raw message