Configuring plugin depenendecies for Maven

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Configuring plugin depenendecies for Maven

Erik Finnman
Hi all,
I'm currently in the process of converting our Grails application to use Maven for dependency management (we're using Grails 1.3.7).

So far it has been going pretty well, but I'm not sure what I need to do in order for the plug-in resolution to work. I have added e.g.:

    <dependency>
      <groupId>org.grails.plugins</groupId>
      <artifactId>background-thread</artifactId>
      <version>1.6</version>
      <type>grails-plugin</type>
    </dependency>

to my pom.xml and not surprisingly this fails since Maven cannot resolve the artifact. What Maven repository should I use for plug-ins? If anyone could point me in the right direction I would appreciate it. I didn't find any notes about this in the docs.

Thanks,
Erik
Reply | Threaded
Open this post in threaded view
|

Re: Configuring plugin depenendecies for Maven

bobbywarner
Did you do this?

grails.project.dependency.resolution = {
  pom true
}

And did you uncomment mavenCentral() in BuildConfig.groovy?

Reply | Threaded
Open this post in threaded view
|

Re: Configuring plugin depenendecies for Maven

lucastex
In reply to this post by Erik Finnman
In your BuildConfig.groovy:

dependencies {
   plugins {
      runtime ':background-thread:1.6'
   }
}

[]s,

Lucas Teixeira


On Tue, Apr 19, 2011 at 12:17 PM, Erik Finnman <[hidden email]> wrote:
Hi all,
I'm currently in the process of converting our Grails application to use
Maven for dependency management (we're using Grails 1.3.7).

So far it has been going pretty well, but I'm not sure what I need to do in
order for the plug-in resolution to work. I have added e.g.:

   <dependency>
     <groupId>org.grails.plugins</groupId>
     <artifactId>background-thread</artifactId>
     <version>1.6</version>
     <type>grails-plugin</type>
   </dependency>

to my pom.xml and not surprisingly this fails since Maven cannot resolve the
artifact. What Maven repository should I use for plug-ins? If anyone could
point me in the right direction I would appreciate it. I didn't find any
notes about this in the docs.

Thanks,
Erik

--
View this message in context: http://grails.1312388.n4.nabble.com/Configuring-plugin-depenendecies-for-Maven-tp3460703p3460703.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
|

Re: Configuring plugin depenendecies for Maven

Erik Finnman
In reply to this post by bobbywarner
bobbywarner wrote
Did you do this?

grails.project.dependency.resolution = {
  pom true
}

And did you uncomment mavenCentral() in BuildConfig.groovy?
Yes, I have "pom true" i BuildConfig.groovy and have no entry for mavenCentral(). On the other hand, we do have a local Nexus repository mirroring Maven Central but could this really be a problem?
Reply | Threaded
Open this post in threaded view
|

Re: Configuring plugin depenendecies for Maven

Erik Finnman
In reply to this post by lucastex
lucastex wrote
In your BuildConfig.groovy:

dependencies {
   plugins {
      runtime ':background-thread:1.6'
   }
}
Should I have this entry in BuildConfig.groovy when managing dependencies using Maven?
Reply | Threaded
Open this post in threaded view
|

Re: Configuring plugin depenendecies for Maven

rlovtangen

On Apr 20, 2011, at 1:09 PM, Erik Finnman wrote:

>
> lucastex wrote:
>>
>> In your BuildConfig.groovy:
>>
>> dependencies {
>>   plugins {
>>      runtime ':background-thread:1.6'
>>   }
>> }
>>
>
> Should I have this entry in BuildConfig.groovy when managing dependencies
> using Maven?
>

yes, plugins are a different beast than regular jar dependencies.
But it should be next to 'dependencies', not inside:

dependencies {
}
plugins {
     runtime ':background-thread:1.6'
}



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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Configuring plugin depenendecies for Maven

Erik Finnman
Ronny Løvtangen wrote
yes, plugins are a different beast than regular jar dependencies.
But it should be next to 'dependencies', not inside:

dependencies {
}
plugins {
     runtime ':background-thread:1.6'
}
Does this also imply that I should not put these dependencies in pom.xml at all and only manage them in BuildConfig.groovy?
Reply | Threaded
Open this post in threaded view
|

Re: Configuring plugin depenendecies for Maven

rlovtangen

On Apr 20, 2011, at 1:29 PM, Erik Finnman wrote:

>
> Ronny Løvtangen wrote:
>>
>> yes, plugins are a different beast than regular jar dependencies.
>> But it should be next to 'dependencies', not inside:
>>
>> dependencies {
>> }
>> plugins {
>>     runtime ':background-thread:1.6'
>> }
>>
> Does this also imply that I should not put these dependencies in pom.xml at
> all and only manage them in BuildConfig.groovy?

Correct. Regular jar dependencies should be put in pom.xml, but plugin dependencies should only go in BuildConfig.groovy. May change with the binary plugin support in Grails 1.4, I don't know the details of that.
But for now, there is no pom.xml equivalent of adding Grails plugins.
There's some odds and ends with using Grails plugins in mavenized Grails projects. E.g. you might get a prompt to uninstall a plugin that has been installed 2 seconds ago by the same script. Just make sure you read the prompts firmly, so you don't get tricked to uninstall plugins you've just added :)

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Configuring plugin depenendecies for Maven

Erik Finnman
Ronny Løvtangen wrote
Correct. Regular jar dependencies should be put in pom.xml, but plugin dependencies should only go in BuildConfig.groovy. May change with the binary plugin support in Grails 1.4, I don't know the details of that.
But for now, there is no pom.xml equivalent of adding Grails plugins.
There's some odds and ends with using Grails plugins in mavenized Grails projects. E.g. you might get a prompt to uninstall a plugin that has been installed 2 seconds ago by the same script. Just make sure you read the prompts firmly, so you don't get tricked to uninstall plugins you've just added :)
Ok, thanks a lot for clearing this up. I'll give it another go and see if I can make it work :-).
Reply | Threaded
Open this post in threaded view
|

Re: Configuring plugin depenendecies for Maven

lucastex
Ops.

Correct, should be next, not inside and it will work instantly.
Thanks Ronny.

[]s,


Lucas Teixeira


On Wed, Apr 20, 2011 at 8:47 AM, Erik Finnman <[hidden email]> wrote:

Ronny Løvtangen wrote:
>
> Correct. Regular jar dependencies should be put in pom.xml, but plugin
> dependencies should only go in BuildConfig.groovy. May change with the
> binary plugin support in Grails 1.4, I don't know the details of that.
> But for now, there is no pom.xml equivalent of adding Grails plugins.
> There's some odds and ends with using Grails plugins in mavenized Grails
> projects. E.g. you might get a prompt to uninstall a plugin that has been
> installed 2 seconds ago by the same script. Just make sure you read the
> prompts firmly, so you don't get tricked to uninstall plugins you've just
> added :)
>

Ok, thanks a lot for clearing this up. I'll give it another go and see if I
can make it work :-).


--
View this message in context: http://grails.1312388.n4.nabble.com/Configuring-plugin-depenendecies-for-Maven-tp3460703p3462782.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
|

Re: Configuring plugin depenendecies for Maven

pledbrook
In reply to this post by rlovtangen
Correct. Regular jar dependencies should be put in pom.xml, but plugin dependencies should only go in BuildConfig.groovy. May change with the binary plugin support in Grails 1.4, I don't know the details of that.

Binary plugins will be regular JARs and hence can be managed by Maven without any modifications. But be aware that not all plugins can become binary artifacts and not everyone will be publishing their plugins in binary form. I still hope to have time to look into getting Grails core to support the 'grails-plugin' packaging type, which the Maven plugin already supports.

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware




Reply | Threaded
Open this post in threaded view
|

Re: Configuring plugin depenendecies for Maven

pledbrook
In reply to this post by rlovtangen
> Does this also imply that I should not put these dependencies in pom.xml at
> all and only manage them in BuildConfig.groovy?

Correct. Regular jar dependencies should be put in pom.xml, but plugin dependencies should only go in BuildConfig.groovy. May change with the binary plugin support in Grails 1.4, I don't know the details of that.
But for now, there is no pom.xml equivalent of adding Grails plugins.
There's some odds and ends with using Grails plugins in mavenized Grails projects. E.g. you might get a prompt to uninstall a plugin that has been installed 2 seconds ago by the same script. Just make sure you read the prompts firmly, so you don't get tricked to uninstall plugins you've just added :)

Has anyone tried with plugins deployed to a Maven compatible repository? As far as I can tell, with Maven 3 and Grails 1.3.7 you can declare such plugins as dependencies via something like:

    <dependency>
      <groupId>org.grails.plugins</groupId>
      <artifactId>assemble</artifactId>
      <version>0.7</version>
      <type>grails-plugin</type>
    </dependency>

This seems to work whether the plugin has been deployed with either "grails-plugin" or "zip" packaging. Even more interestingly, Grails 1.3.7 seems quite happy to pull plugins that have been deployed with a packaging type of "grails-plugin" as well.

If any Maven users have to time try out this feature with Grails 1.3.7, I'd appreciate it. If the above does indeed work, then Maven users' lives could be improved dramatically if we were to mirror the plugins on Grails Central into a public Maven repository.

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware




Reply | Threaded
Open this post in threaded view
|

Re: Configuring plugin depenendecies for Maven

rlovtangen

On Apr 21, 2011, at 3:29 PM, Peter Ledbrook wrote:

> Does this also imply that I should not put these dependencies in pom.xml at
> all and only manage them in BuildConfig.groovy?

Correct. Regular jar dependencies should be put in pom.xml, but plugin dependencies should only go in BuildConfig.groovy. May change with the binary plugin support in Grails 1.4, I don't know the details of that.
But for now, there is no pom.xml equivalent of adding Grails plugins.
There's some odds and ends with using Grails plugins in mavenized Grails projects. E.g. you might get a prompt to uninstall a plugin that has been installed 2 seconds ago by the same script. Just make sure you read the prompts firmly, so you don't get tricked to uninstall plugins you've just added :)

Has anyone tried with plugins deployed to a Maven compatible repository? As far as I can tell, with Maven 3 and Grails 1.3.7 you can declare such plugins as dependencies via something like:

    <dependency>
      <groupId>org.grails.plugins</groupId>
      <artifactId>assemble</artifactId>
      <version>0.7</version>
      <type>grails-plugin</type>
    </dependency>

This seems to work whether the plugin has been deployed with either "grails-plugin" or "zip" packaging. Even more interestingly, Grails 1.3.7 seems quite happy to pull plugins that have been deployed with a packaging type of "grails-plugin" as well.

If any Maven users have to time try out this feature with Grails 1.3.7, I'd appreciate it. If the above does indeed work, then Maven users' lives could be improved dramatically if we were to mirror the plugins on Grails Central into a public Maven repository.

Cool. I'll have to eat my words "But for now, there is no pom.xml equivalent of adding Grails plugins" then :)

Ronny