Quantcast

Is it possible to configure a classpath for "grails run-app"?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Is it possible to configure a classpath for "grails run-app"?

dmurat
Hi

I'm having a problem with one misbehaving library for which I created a patch and placed corresponding java file in "src/java". When run with "grails dev run-war" everything is ok. Resulting class file is placed in WEB-INF/classes and patch behaves as expected.

However, this is not the case when the app is run with "grails run-app". Obviously original jar file is placed in classpath before my modification, and I'm getting same erroneous behavior as without the patch. Is there any way to modify classpath used by "grails run-app" and convince it to load application's class files before configured dependencies?

I'm using grails-2.0.0.BUILD-SNAPSHOT.

Damir Murat
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Is it possible to configure a classpath for "grails run-app"?

Müller, Wolfgang
+1.

For the time being, just unpack the jar and remove the file that you have patched. Crude, but works.

Cheers,
Wolfgang



On Wed, Aug 17, 2011 at 12:04 PM, dmurat <[hidden email]> wrote:
Hi

I'm having a problem with one misbehaving library for which I created a
patch and placed corresponding java file in "src/java". When run with
"grails dev run-war" everything is ok. Resulting class file is placed in
WEB-INF/classes and patch behaves as expected.

However, this is not the case when the app is run with "grails run-app".
Obviously original jar file is placed in classpath before my modification,
and I'm getting same erroneous behavior as without the patch. Is there any
way to modify classpath used by "grails run-app" and convince it to load
application's class files before configured dependencies?

I'm using grails-2.0.0.BUILD-SNAPSHOT.

Damir Murat

--
View this message in context: http://grails.1312388.n4.nabble.com/Is-it-possible-to-configure-a-classpath-for-grails-run-app-tp3749535p3749535.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Is it possible to configure a classpath for "grails run-app"?

dmurat
I settled with packaging a change in the modified jar and placing the jar in the "lib" folder. This works with both "grails run-app" and "grails run-war". This also requires commenting out related dependency from "BuildConfig.groovy".

That way, file in "src/java" isn't technically needed, but I leave it there for documentation. Furthermore, if I need to do more changes on java file, they will be immediately available with grails run-war.

However, all this is very inconvenient.

Damir Murat
Loading...