简体   繁体   中英

Add plugin dependency in grails

I am trying to add dependency of a plugin into my grails application, but it doesnot have any plugins in grails repo. It can be added to maven project as :

<dependency>
  <groupId>com.plaid</groupId>
  <artifactId>plaid-java</artifactId>
  <version>0.2.12</version>
</dependency>

As my project is also maven based. How do i add this plugin into my project.

PS : IT cannot be added in plugins and dependencies since there is no grails plugin associated with that.

Any help is appreciated.

You can use the create-pom org.mycompany to create your pom.xml file to make grails read the pom.xml you need to set in BuildConfig.groovy this code

 grails.project.dependency.resolution = {
   /*YOUR CONFIG*/
   pom true
   repositories {
     /*YOUR RESPOSITORIES*/
   }
}

Then you need to add your dependency in this pom.xml

You can see the official doc. in this link

We can add dependency for any plugin in grails under dependencies{} in BuildConfig.groovy as:

<groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>

For your case, the equivalent for:

<dependency>
  <groupId>com.plaid</groupId>
  <artifactId>plaid-java</artifactId>
  <version>0.2.12</version>
</dependency>

is:

dependencies{
      compile "com.plaid:plaid-java:0.2.12"
}

For more you can have a look into http://docs.grails.org/2.3.1/guide/conf.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM