How can I add dependency to Grails build system?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I add dependency to Grails build system?

Fedor Belov
I'm trying to change grails-core and use external dependency. I've used it in DirectoryWatcher class. I've added this dependency to ./grails-core/build.gradle and ./grails-bootsrap/build.gradle but I still get 'java.lang.NoClassDefFoundError' exception on startup (when Gant scripts are executed). How can I add this dependency to Grails build system?
Reply | Threaded
Open this post in threaded view
|

Re: How can I add dependency to Grails build system?

burtbeckwith
Are you confusing NoClassDefFoundError with ClassNotFoundException? ClassNotFoundException means the class isn't there, but NoClassDefFoundError means it's there but something it needs isn't. So depending on which class it's complaining about, you're likely missing one or more other dependencies.

Burt

Fedor Belov wrote
I'm trying to change grails-core and use external dependency. I've used it in DirectoryWatcher class. I've added this dependency to ./grails-core/build.gradle and ./grails-bootsrap/build.gradle but I still get 'java.lang.NoClassDefFoundError' exception on startup (when Gant scripts are executed). How can I add this dependency to Grails build system?
Reply | Threaded
Open this post in threaded view
|

Re: How can I add dependency to Grails build system?

Fedor Belov
I'm getting following stacktrace:

java.lang.NoClassDefFoundError: Lnet/contentobjects/jnotify/JNotifyListener;
....
Caused by: java.lang.ClassNotFoundException: net.contentobjects.jnotify.JNotifyListener

JNotifyListener - class from dependency which I'm trying to add

I've temporary solved my problem by manually adding my dependency to ./conf/groovy-starter.conf file. As I understand this file was generated when I built grails (gradle install). What is correct way to add my dependency to this?
Reply | Threaded
Open this post in threaded view
|

Re: How can I add dependency to Grails build system?

pledbrook
In reply to this post by Fedor Belov
> I'm trying to change grails-core and use external dependency. I've used it in
> DirectoryWatcher class. I've added this dependency to
> ./grails-core/build.gradle and ./grails-bootsrap/build.gradle but I still
> get 'java.lang.NoClassDefFoundError' exception on startup (when Gant scripts
> are executed). How can I add this dependency to Grails build system?

Is this new dependency in the POM of the grails-core JAR? If not, then
the application has no way of knowing that it needs it. You could try
to run `grails dependency-report` to see whether the application is
picking up the dependency or not, and if so in which scope.

Peter

--
Peter Ledbrook
t: @pledbrook

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: How can I add dependency to Grails build system?

Fedor Belov
Why are you talking about POM? Doesn't grails-core use Gradle to build sources?
The exception occurs when GAnt script is executed - Grails build system requires this dependency and doesn't load it (this is the problem).

31.07.2013 15:52, pledbrook [via Grails] пишет:
> I'm trying to change grails-core and use external dependency. I've used it in
> DirectoryWatcher class. I've added this dependency to
> ./grails-core/build.gradle and ./grails-bootsrap/build.gradle but I still
> get 'java.lang.NoClassDefFoundError' exception on startup (when Gant scripts
> are executed). How can I add this dependency to Grails build system?

Is this new dependency in the POM of the grails-core JAR? If not, then
the application has no way of knowing that it needs it. You could try
to run `grails dependency-report` to see whether the application is
picking up the dependency or not, and if so in which scope.

Peter

--
Peter Ledbrook
t: @pledbrook

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

    http://xircles.codehaus.org/manage_email





If you reply to this email, your message will be added to the discussion below:
http://grails.1312388.n4.nabble.com/How-can-I-add-dependency-to-Grails-build-system-tp4647389p4647417.html
To unsubscribe from How can I add dependency to Grails build system?, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: How can I add dependency to Grails build system?

pledbrook

The Gradle build for Grails generates POMs for all the Grails JARs. Those POMs contain the dependencies of those JARs. The Grails build system then uses the POMs to fetch the transitive dependencies of the Grails JARs.

In your case, a Grails application has a dependency on grails-core. The Grails commands look at the POM for grails-core to determine what else needs to be included in the classpath. So the POM needs to include your new JAR dependency.

Hope that's clear,

Peter

On 31 Jul 2013 13:12, "Fedor Belov" <[hidden email]> wrote:
Why are you talking about POM? Doesn't grails-core use Gradle to build sources?
The exception occurs when GAnt script is executed - Grails build system requires this dependency and doesn't load it (this is the problem).

<a href="tel:31.07.2013%2015" value="+13107201315" target="_blank">31.07.2013 15:52, pledbrook [via Grails] пишет:
> I'm trying to change grails-core and use external dependency. I've used it in
> DirectoryWatcher class. I've added this dependency to
> ./grails-core/build.gradle and ./grails-bootsrap/build.gradle but I still
> get 'java.lang.NoClassDefFoundError' exception on startup (when Gant scripts
> are executed). How can I add this dependency to Grails build system?

Is this new dependency in the POM of the grails-core JAR? If not, then
the application has no way of knowing that it needs it. You could try
to run `grails dependency-report` to see whether the application is
picking up the dependency or not, and if so in which scope.

Peter

--
Peter Ledbrook
t: @pledbrook

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

    http://xircles.codehaus.org/manage_email





If you reply to this email, your message will be added to the discussion below:
http://grails.1312388.n4.nabble.com/How-can-I-add-dependency-to-Grails-build-system-tp4647389p4647417.html
To unsubscribe from How can I add dependency to Grails build system?, click here.
NAML



View this message in context: Re: How can I add dependency to Grails build system?
Sent from the Grails - dev mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: How can I add dependency to Grails build system?

Fedor Belov
Hm... So *** complex. Anyway I've found pom-default.xml in "./grails-core/build/poms" and it contains my dependency. As I said only manual editing of "./conf/groovy-start.conf" helps me