elCapitano
elCapitano

Reputation: 1841

How to add a plugin as a jar to a grails project

I created a custom plugin 'myPlugin' for GRAILS. I compiled and installed it as a binary (my-plugin-0.1.jar) file.

The jar file can't be found by grails in a "normal" project, because it only looks for my-plugin-0.1.zip (the plugin is defined within the plugins-block in BuildConfig.groovy)

How can i add the .jar file as a plugin?

Upvotes: 1

Views: 1623

Answers (2)

Karthick AK
Karthick AK

Reputation: 208

Add it in the dependencies block (not plugins) in BuildConfig.groovy.

Publish plugin installs the jar into local maven cache (/.m2). Verify the existence of the jar in .m2.

Also verify if the application using the plugin has mavenLocal enabled in repositories' buildConfig.

Upvotes: 1

dmahapatro
dmahapatro

Reputation: 50245

Binary plugins packaged as jar has to be referred in the dependencies section instead of the plugins section in BuildConfig

dependencies {
    compile "mygroup:myplugin:0.1"
}

or you can put the jar in application's lib directory which I would discourage. :)

Upvotes: 4

Related Questions