SlideShare a Scribd company logo
Grails Custom Plugin
Agenda
× What is plugin.
× Creating and Installing plugin
× Plugin Repositories
× Understanding a Plugin’s Structure
× Evaluating Conventions
× Hooking into Build Events
× Hooking into runtime configuration
× Adding methods at compile time
× Adding Dynamic method at runtime
× Understanding Plugin loader
What is Plugin
× A plugin is a software component which adds a specific
feature to an existing software application.
× Very similar to Grails application project
× A plugin descriptor file *GrailsPlugin.groovy
Creating and Installing Plugin
grails create-plugin [plugin-name]
× In grails-3.* you should profile to create a plugin.
× If you want to create web environment then
grails create-plugin [plugin-name] --profile=web-plugin
× If you want to create a plugin which will be used with other profile
grails create-plugin [plugin-name] --profile=plugin
Note*:- Make sure the plugin name does not contain more than one capital letter
in a row, or it won't work. Camel case is fine, though.
× The structure of a Grails plugin is very nearly the same as a Grails application
project's except that in the src/main/groovy directory under the plugin
package structure you will find a plugin descriptor class (a class that ends in
"GrailsPlugin").
× Being a regular Grails project has a number of benefits in that you can
immediately test your plugin by running (if the plugin targets the "web"
profile):
Note*:- Plugin projects don't provide an index.gsp by default since most plugins
don't need it. So, if you try to view the plugin running in a browser right after
creating it, you will receive a page not found error. You can easily create a grails-
app/views/index.gsp for your plugin if you'd like.
Plugin Descriptor
Class CustomGrailsPlugin{
}
This class defines the metadata about the plugin.
× Title:- short one-sentence description of your plugin
× grailsVersion:- The version range of Grails that the plugin supports. eg. "1.2 > *" (indicating 1.2 or
higher)
× Author :- plugin author's name
× authorEmail:- plugin author's contact e-mail
× Description:- full multi-line description of plugin's features
× Documentation:- URL of the plugin's documentation
× License:- License of the plugin
× Issuemanagement:- Issue Tracker of the plugin
× Scm:- Source code management location of the plugin
Installing Local Plugin
× Add plugin path in BuildConfig
× Add plugin in local maven then add in BuildConfig
Plugin Repositories
× The preferred way to distribute plugin is to publish to the official Grails
Central Plugin Repository. This will make your plugin visible to the list-
plugins command:
grails list-plugins
which lists all plugins that are in the central repository.
× Your plugin will also be available to the plugin-info command:
grails plugin-info [plugin-name]
which prints extra information about it, such as its description, who wrote,
etc.
Understanding a Plugin's Structure
➔ grails-app
◆ conf
◆ controller
◆ domain
◆ taglib
➔ lib
➔ src
◆ java
◆ groovy
➔ web-app
◆ js
◆ css
× When plugin installed, will go directly as plugins/custom-plugin/grails-app.
They will not be copied into main source tree.
× When you run the plugin in development mode the link to the resource will
resolve to something like /js/mycode.js. However, when the plugin is installed
into an application the path will automatically change to something like
/plugin/custom-plugin/js/mycode.js and Grails will deal with making sure the
resources are in the right place.
× pluginContextPath is responsible to manage the static resource path.
× At runtime the pluginContextPath variable will either evaluate to an empty
string or /plugins/custom-plugin depending on whether the plugin is running
standalone or has been installed in an application.
× Java and Groovy code that the plugin provides within the lib and src/java and
src/groovy directories will be compiled into the main project's web-app/WEB-
INF/classes directory so that they are made available at runtime.
Providing Basic Artefacts
Adding a new script
Adding a new grails-app artifact (controller, taglib,
service, etc.)
Providing Views, Templates and view resolution.
Excluded Artefacts
Adding a new Script
A plugin can add a new script simply by providing the
relevant Gant script in its scripts directory:
× CustomPlugin
× Grails-app
× scripts <--Add script here
× Grails create-script ShowDetailsScript
Adding a new grails-app artifact (Controller, Tag Library, Service, etc.)
× CustomPlugin
× grails-app
× controllers
× services
× etc.
× lib
× scripts
Providing Views, Templates and View resolution
× When a plugin provides a controller it may also provide default views
to be rendered.
× Grails' view resolution mechanism will first look for the view in the
application it is installed into and if that fails will attempt to look for
the view within the plugin.
× This means that you can override views provided by a plugin by
creating corresponding GSPs in the application's grails-app/views
directory.
× if the view uses templates that are also provided by the plugin then:-
× <g:render template="fooTemplate" plugin="amazon"/>
Excluded Artefacts
By default Grails excludes the following files during the packaging process:
× grails-app/conf/BootStrap.groovy
× grails-app/conf/BuildConfig.groovy (although it is used to generate dependencies.groovy)
× grails-app/conf/Config.groovy
× grails-app/conf/DataSource.groovy (and any other *DataSource.groovy)
× grails-app/conf/UrlMappings.groovy
× grails-app/conf/spring/resources.groovy
× Everything within /web-app/WEB-INF
× Everything within /web-app/plugins/**
× Everything within /test/**
× SCM management files within **/.svn/** and **/CVS/**
If your plugin requires files under the web-app/WEB-INF directory it is recommended that you modify the plugin's
scripts/_Install.groovy Gant script to install these artefacts into the target project's directory tree.
In addition, the default UrlMappings.groovy file is excluded to avoid naming conflicts, however you are free to add a
UrlMappings definition under a different name which will be included. For example a file called grails-
app/conf/BlogUrlMappings.groovy is fine.
The list of excludes is extensible with the pluginExcludes property:
// resources that are excluded from plugin packaging
def pluginExcludes = [
"grails-app/views/error.gsp"
]
Evaluating Conventions
Every plugin has an implicit application variable which is an instance of the GrailsApplication interface.
The GrailsApplication interface provides methods to evaluate the conventions within the project and
internally stores references to all artifact classes within your application.
Artifacts implement the GrailsClass interface, which represents a Grails resource such as a controller or a
tag library. For example to get all GrailsClassinstances you can do:
for (grailsClass in application.allClasses) {
println grailsClass.name
}
for (controllerClass in application.controllerClasses) {
println controllerClass.name
}
The dynamic method conventions are as follows:
× *Classes - Retrieves all the classes for a particular artefact name. For example
application.controllerClasses.
× get*Class - Retrieves a named class for a particular artefact. For example
application.getControllerClass("PersonController")
× is*Class - Returns true if the given class is of the given artefact type. For
example application.isControllerClass(PersonController)
The GrailsClass interface has a number of useful methods that let you further evaluate and work with
the conventions. These include:
× getPropertyValue - Gets the initial value of the given property on the class
× hasProperty - Returns true if the class has the specified property
× newInstance - Creates a new instance of this class.
× getName - Returns the logical name of the class in the application without the trailing
convention part if applicable
× getShortName - Returns the short name of the class without package prefix
× getFullName - Returns the full name of the class in the application with the trailing convention
part and with the package name
× getPropertyName - Returns the name of the class as a property name
× getLogicalPropertyName - Returns the logical property name of the class in the application
Hooking into Build Events
Grails plugins can do post-install configuration. This is achieved using a specially named script
under the scripts directory of the plugin -_Install.groovy.
_Install.groovy is executed after the plugin has been installed.
Below will create a new directory type under the grails-app directory and install a
configuration template:
ant.mkdir(dir: "${basedir}/grails-app/jobs")
ant.copy(file: "${pluginBasedir}/src/samples/SamplePluginConfig.groovy",
todir: "${basedir}/grails-app/conf")
The pluginBasedir variable is not available in custom scripts, but you can use fooPluginDir,
where foo is the name of your plugin.
Hooking into Runtime Configuration
Hooking into the Grails Spring configuration
Participating in web.xml Generation
Doing Post Initialisation Configuration
Hooking into the Grails Spring configuration
you can hook in Grails runtime configuration by
providing a property called doWithSpring which is
assigned a block of code
def doWithSpring = {
customPluginObject(CustomPluginObject) {}
}
Adding Dynamic Methods at Runtime
Grails plugins let you register dynamic methods with any Grails-managed or other
class at runtime. This work is done in a doWithDynamicMethods closure.
For Grails-managed classes like controllers, tag libraries and so forth you can add
methods, constructors etc. using the ExpandoMetaClass mechanism by accessing
each controller's MetaClass:
For more:-
http://docs.grails.org/2.4.4/guide/plugins.html#addingDynamicMethodsAtRuntime
Understanding Plugin Load Order
Controlling Plugin Dependencies
Controlling Load Order
Scopes and Environments
Controlling Plugin Dependencies
Plugins often depend on the presence of other plugins and can adapt depending on the presence of
others. This is implemented with two properties. The first is called dependsOn
def dependsOn = [dataSource: "1.0",
domainClass: "1.0",
i18n: "1.0",
core: "1.0"]
The dependsOn property also supports a mini expression language for specifying version ranges
def dependsOn = [foo: "* > 1.0"]
def dependsOn = [foo: "1.0 > 1.1"]
def dependsOn = [foo: "1.0 > *"]
When the wildcard * character is used it denotes "any" version. The expression syntax also excludes any
suffixes such as -BETA, -ALPHA etc. so for example the expression "1.0 > 1.1" would match any of the
following versions:
Controlling Load Order
Using dependsOn establishes a "hard" dependency in that if the dependency is
not resolved, the plugin will give up and won't load. It is possible though to have a
weaker dependency using the loadAfter and loadBefore properties
def loadAfter = ['otherplugin']
Here the plugin will be loaded after the controllers plugin if it exists, otherwise it
will just be loaded. The plugin can then adapt to the presence of the other plugin.
You can also use the loadBefore property to specify one or more plugins that your
plugin should load before:
def loadBefore = ['rabbitmq']
Scopes and Environments
It's not only plugin load order that you can control. You can also specify which environments your plugin should be
loaded in and which scopes (stages of a build). Simply declare one or both of these properties in your plugin
descriptor:
def environments = ['development', 'test', 'myCustomEnv']
def scopes = [excludes:'war']
the plugin will only load in the 'development' and 'test' environments. Nor will it be packaged into the WAR file,
because it's excluded from the 'war' phase. This allows development-only plugins to not be packaged for
production use.
The full list of available scopes are defined by the enum BuildScope,
Both properties can be one of:
× a string - a sole inclusion
× a list - a list of environments or scopes to include
× a map - for full control, with 'includes' and/or 'excludes' keys that can have string or list values
Register on local
× Comment export = false
× grails compile: to trigger dependency resolution
× grails maven-install: will work once the release plugin in BuildConfig.groovy is installed for
your plugin.
× Note that this isn't plugin installation, it's faking out a plugin release by putting the ZIP
and the POM file in your mavenLocal() repo.
Releasing our plugin
× Register on grails.org
× Fill out this form
× Provide good documentation for the users to get started.
× Once approved, install the release plugin in the plugin application
× grails publish-plugin --stacktrace
× Once successful, the plugin will be published in the grails plugin
repository. Users will be able to install it directly from Grails Plugin
portal by adding the dependency in BuildConfig.groovy
Get code:- https://bitbucket.org/vendetta30/customplugin
For any doubt please contact:- vijay@nexthoughts.com
Thank You

More Related Content

What's hot

Grails beginners workshop
Grails beginners workshopGrails beginners workshop
Grails beginners workshop
JacobAae
 
Config BuildConfig
Config BuildConfigConfig BuildConfig
Config BuildConfig
Vijay Shukla
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
Izzet Mustafaiev
 
Idiomatic gradle plugin writing
Idiomatic gradle plugin writingIdiomatic gradle plugin writing
Idiomatic gradle plugin writing
Schalk Cronjé
 
Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016
Schalk Cronjé
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new buildIgor Khotin
 
Introduction to gradle
Introduction to gradleIntroduction to gradle
Introduction to gradle
NexThoughts Technologies
 
Gradle,the new build system for android
Gradle,the new build system for androidGradle,the new build system for android
Gradle,the new build system for android
zhang ghui
 
Gradle : An introduction
Gradle : An introduction Gradle : An introduction
Gradle : An introduction
Nibodha Technologies
 
The Challenges of Container Configuration
The Challenges of Container ConfigurationThe Challenges of Container Configuration
The Challenges of Container Configuration
Gareth Rushgrove
 
Tips & Tricks for Maven Tycho
Tips & Tricks for Maven TychoTips & Tricks for Maven Tycho
Tips & Tricks for Maven Tycho
Gunnar Wagenknecht
 
Google App Engine (GAE) 演進史
Google App Engine (GAE) 演進史Google App Engine (GAE) 演進史
Google App Engine (GAE) 演進史
Simon Su
 
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java Developers
Kostas Saidis
 
PROMAND 2014 project structure
PROMAND 2014 project structurePROMAND 2014 project structure
PROMAND 2014 project structureAlexey Buzdin
 
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
Puppet
 
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
KAI CHU CHUNG
 
Google App Engine: Basic
Google App Engine: BasicGoogle App Engine: Basic
Google App Engine: Basic
KAI CHU CHUNG
 
Gdg cloud taipei ddt meetup #53 buildpack
Gdg cloud taipei ddt meetup #53 buildpackGdg cloud taipei ddt meetup #53 buildpack
Gdg cloud taipei ddt meetup #53 buildpack
KAI CHU CHUNG
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksMike Hugo
 
Creating an nuget package for EPiServer
Creating an nuget package for EPiServerCreating an nuget package for EPiServer
Creating an nuget package for EPiServer
Paul Graham
 

What's hot (20)

Grails beginners workshop
Grails beginners workshopGrails beginners workshop
Grails beginners workshop
 
Config BuildConfig
Config BuildConfigConfig BuildConfig
Config BuildConfig
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
 
Idiomatic gradle plugin writing
Idiomatic gradle plugin writingIdiomatic gradle plugin writing
Idiomatic gradle plugin writing
 
Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new build
 
Introduction to gradle
Introduction to gradleIntroduction to gradle
Introduction to gradle
 
Gradle,the new build system for android
Gradle,the new build system for androidGradle,the new build system for android
Gradle,the new build system for android
 
Gradle : An introduction
Gradle : An introduction Gradle : An introduction
Gradle : An introduction
 
The Challenges of Container Configuration
The Challenges of Container ConfigurationThe Challenges of Container Configuration
The Challenges of Container Configuration
 
Tips & Tricks for Maven Tycho
Tips & Tricks for Maven TychoTips & Tricks for Maven Tycho
Tips & Tricks for Maven Tycho
 
Google App Engine (GAE) 演進史
Google App Engine (GAE) 演進史Google App Engine (GAE) 演進史
Google App Engine (GAE) 演進史
 
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java Developers
 
PROMAND 2014 project structure
PROMAND 2014 project structurePROMAND 2014 project structure
PROMAND 2014 project structure
 
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
PuppetConf 2016: Running Puppet Software in Docker Containers – Gareth Rushgr...
 
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
 
Google App Engine: Basic
Google App Engine: BasicGoogle App Engine: Basic
Google App Engine: Basic
 
Gdg cloud taipei ddt meetup #53 buildpack
Gdg cloud taipei ddt meetup #53 buildpackGdg cloud taipei ddt meetup #53 buildpack
Gdg cloud taipei ddt meetup #53 buildpack
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And Tricks
 
Creating an nuget package for EPiServer
Creating an nuget package for EPiServerCreating an nuget package for EPiServer
Creating an nuget package for EPiServer
 

Similar to Custom plugin

How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular Framework
RapidValue
 
Mastering Grails 3 Plugins - GR8Conf US 2016
Mastering Grails 3 Plugins - GR8Conf US 2016Mastering Grails 3 Plugins - GR8Conf US 2016
Mastering Grails 3 Plugins - GR8Conf US 2016
Alvaro Sanchez-Mariscal
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
NodeXperts
 
Config/BuildConfig
Config/BuildConfigConfig/BuildConfig
Config/BuildConfig
Vijay Shukla
 
Config BuildConfig
Config BuildConfigConfig BuildConfig
Config BuildConfig
NexThoughts Technologies
 
Mastering Grails 3 Plugins - Greach 2016
Mastering Grails 3 Plugins - Greach 2016Mastering Grails 3 Plugins - Greach 2016
Mastering Grails 3 Plugins - Greach 2016
Alvaro Sanchez-Mariscal
 
Mastering Grails 3 Plugins - GR8Conf EU 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016Mastering Grails 3 Plugins - GR8Conf EU 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016
Alvaro Sanchez-Mariscal
 
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsCut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature plugins
GR8Conf
 
Plugins And Making Your Own
Plugins And Making Your OwnPlugins And Making Your Own
Plugins And Making Your Own
Lambert Beekhuis
 
Grails Asset Pipeline Plugin
Grails Asset Pipeline PluginGrails Asset Pipeline Plugin
Grails Asset Pipeline Plugin
Ali Tanwir
 
Grails 0.3-SNAPSHOT Presentation WJAX 2006 English
Grails 0.3-SNAPSHOT Presentation WJAX 2006 EnglishGrails 0.3-SNAPSHOT Presentation WJAX 2006 English
Grails 0.3-SNAPSHOT Presentation WJAX 2006 English
Sven Haiges
 
Grails Advanced
Grails Advanced Grails Advanced
Grails Advanced
Saurabh Dixit
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
David Gibbons
 
CommissionCalculationbuildclasses.netbeans_automatic_build.docx
CommissionCalculationbuildclasses.netbeans_automatic_build.docxCommissionCalculationbuildclasses.netbeans_automatic_build.docx
CommissionCalculationbuildclasses.netbeans_automatic_build.docx
monicafrancis71118
 
Grunt training deck
Grunt training deckGrunt training deck
Grunt training deck
James Ford
 
Pyramid patterns
Pyramid patternsPyramid patterns
Pyramid patterns
Carlos de la Guardia
 
Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016
Alvaro Sanchez-Mariscal
 
CICON2010: Adam Griffiths - CodeIgniter 2
CICON2010: Adam Griffiths - CodeIgniter 2CICON2010: Adam Griffiths - CodeIgniter 2
CICON2010: Adam Griffiths - CodeIgniter 2
CodeIgniter Conference
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress pluginAnthony Montalbano
 

Similar to Custom plugin (20)

How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular Framework
 
Mastering Grails 3 Plugins - GR8Conf US 2016
Mastering Grails 3 Plugins - GR8Conf US 2016Mastering Grails 3 Plugins - GR8Conf US 2016
Mastering Grails 3 Plugins - GR8Conf US 2016
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
 
Plugin development
Plugin developmentPlugin development
Plugin development
 
Config/BuildConfig
Config/BuildConfigConfig/BuildConfig
Config/BuildConfig
 
Config BuildConfig
Config BuildConfigConfig BuildConfig
Config BuildConfig
 
Mastering Grails 3 Plugins - Greach 2016
Mastering Grails 3 Plugins - Greach 2016Mastering Grails 3 Plugins - Greach 2016
Mastering Grails 3 Plugins - Greach 2016
 
Mastering Grails 3 Plugins - GR8Conf EU 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016Mastering Grails 3 Plugins - GR8Conf EU 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016
 
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsCut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature plugins
 
Plugins And Making Your Own
Plugins And Making Your OwnPlugins And Making Your Own
Plugins And Making Your Own
 
Grails Asset Pipeline Plugin
Grails Asset Pipeline PluginGrails Asset Pipeline Plugin
Grails Asset Pipeline Plugin
 
Grails 0.3-SNAPSHOT Presentation WJAX 2006 English
Grails 0.3-SNAPSHOT Presentation WJAX 2006 EnglishGrails 0.3-SNAPSHOT Presentation WJAX 2006 English
Grails 0.3-SNAPSHOT Presentation WJAX 2006 English
 
Grails Advanced
Grails Advanced Grails Advanced
Grails Advanced
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
CommissionCalculationbuildclasses.netbeans_automatic_build.docx
CommissionCalculationbuildclasses.netbeans_automatic_build.docxCommissionCalculationbuildclasses.netbeans_automatic_build.docx
CommissionCalculationbuildclasses.netbeans_automatic_build.docx
 
Grunt training deck
Grunt training deckGrunt training deck
Grunt training deck
 
Pyramid patterns
Pyramid patternsPyramid patterns
Pyramid patterns
 
Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016
 
CICON2010: Adam Griffiths - CodeIgniter 2
CICON2010: Adam Griffiths - CodeIgniter 2CICON2010: Adam Griffiths - CodeIgniter 2
CICON2010: Adam Griffiths - CodeIgniter 2
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
 

More from Vijay Shukla

Introduction of webpack 4
Introduction of webpack 4Introduction of webpack 4
Introduction of webpack 4
Vijay Shukla
 
Preview of Groovy 3
Preview of Groovy 3Preview of Groovy 3
Preview of Groovy 3
Vijay Shukla
 
Jython
JythonJython
Jython
Vijay Shukla
 
Groovy closures
Groovy closuresGroovy closures
Groovy closures
Vijay Shukla
 
Groovy
GroovyGroovy
Groovy
Vijay Shukla
 
Grails services
Grails servicesGrails services
Grails services
Vijay Shukla
 
Grails plugin
Grails pluginGrails plugin
Grails plugin
Vijay Shukla
 
Grails domain
Grails domainGrails domain
Grails domain
Vijay Shukla
 
Grails custom tag lib
Grails custom tag libGrails custom tag lib
Grails custom tag lib
Vijay Shukla
 
Grails
GrailsGrails
Grails
Vijay Shukla
 
Gorm
GormGorm
Controller
ControllerController
Controller
Vijay Shukla
 
Command object
Command objectCommand object
Command object
Vijay Shukla
 
Boot strap.groovy
Boot strap.groovyBoot strap.groovy
Boot strap.groovy
Vijay Shukla
 
Vertx
VertxVertx
Spring security
Spring securitySpring security
Spring security
Vijay Shukla
 
REST
RESTREST
GORM
GORMGORM

More from Vijay Shukla (18)

Introduction of webpack 4
Introduction of webpack 4Introduction of webpack 4
Introduction of webpack 4
 
Preview of Groovy 3
Preview of Groovy 3Preview of Groovy 3
Preview of Groovy 3
 
Jython
JythonJython
Jython
 
Groovy closures
Groovy closuresGroovy closures
Groovy closures
 
Groovy
GroovyGroovy
Groovy
 
Grails services
Grails servicesGrails services
Grails services
 
Grails plugin
Grails pluginGrails plugin
Grails plugin
 
Grails domain
Grails domainGrails domain
Grails domain
 
Grails custom tag lib
Grails custom tag libGrails custom tag lib
Grails custom tag lib
 
Grails
GrailsGrails
Grails
 
Gorm
GormGorm
Gorm
 
Controller
ControllerController
Controller
 
Command object
Command objectCommand object
Command object
 
Boot strap.groovy
Boot strap.groovyBoot strap.groovy
Boot strap.groovy
 
Vertx
VertxVertx
Vertx
 
Spring security
Spring securitySpring security
Spring security
 
REST
RESTREST
REST
 
GORM
GORMGORM
GORM
 

Recently uploaded

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 

Recently uploaded (20)

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 

Custom plugin

  • 2. Agenda × What is plugin. × Creating and Installing plugin × Plugin Repositories × Understanding a Plugin’s Structure × Evaluating Conventions × Hooking into Build Events × Hooking into runtime configuration × Adding methods at compile time × Adding Dynamic method at runtime × Understanding Plugin loader
  • 3. What is Plugin × A plugin is a software component which adds a specific feature to an existing software application. × Very similar to Grails application project × A plugin descriptor file *GrailsPlugin.groovy
  • 4. Creating and Installing Plugin grails create-plugin [plugin-name] × In grails-3.* you should profile to create a plugin. × If you want to create web environment then grails create-plugin [plugin-name] --profile=web-plugin × If you want to create a plugin which will be used with other profile grails create-plugin [plugin-name] --profile=plugin Note*:- Make sure the plugin name does not contain more than one capital letter in a row, or it won't work. Camel case is fine, though.
  • 5. × The structure of a Grails plugin is very nearly the same as a Grails application project's except that in the src/main/groovy directory under the plugin package structure you will find a plugin descriptor class (a class that ends in "GrailsPlugin"). × Being a regular Grails project has a number of benefits in that you can immediately test your plugin by running (if the plugin targets the "web" profile): Note*:- Plugin projects don't provide an index.gsp by default since most plugins don't need it. So, if you try to view the plugin running in a browser right after creating it, you will receive a page not found error. You can easily create a grails- app/views/index.gsp for your plugin if you'd like.
  • 6. Plugin Descriptor Class CustomGrailsPlugin{ } This class defines the metadata about the plugin. × Title:- short one-sentence description of your plugin × grailsVersion:- The version range of Grails that the plugin supports. eg. "1.2 > *" (indicating 1.2 or higher) × Author :- plugin author's name × authorEmail:- plugin author's contact e-mail × Description:- full multi-line description of plugin's features × Documentation:- URL of the plugin's documentation × License:- License of the plugin × Issuemanagement:- Issue Tracker of the plugin × Scm:- Source code management location of the plugin
  • 7. Installing Local Plugin × Add plugin path in BuildConfig × Add plugin in local maven then add in BuildConfig
  • 8. Plugin Repositories × The preferred way to distribute plugin is to publish to the official Grails Central Plugin Repository. This will make your plugin visible to the list- plugins command: grails list-plugins which lists all plugins that are in the central repository. × Your plugin will also be available to the plugin-info command: grails plugin-info [plugin-name] which prints extra information about it, such as its description, who wrote, etc.
  • 9. Understanding a Plugin's Structure ➔ grails-app ◆ conf ◆ controller ◆ domain ◆ taglib ➔ lib ➔ src ◆ java ◆ groovy ➔ web-app ◆ js ◆ css
  • 10. × When plugin installed, will go directly as plugins/custom-plugin/grails-app. They will not be copied into main source tree. × When you run the plugin in development mode the link to the resource will resolve to something like /js/mycode.js. However, when the plugin is installed into an application the path will automatically change to something like /plugin/custom-plugin/js/mycode.js and Grails will deal with making sure the resources are in the right place. × pluginContextPath is responsible to manage the static resource path. × At runtime the pluginContextPath variable will either evaluate to an empty string or /plugins/custom-plugin depending on whether the plugin is running standalone or has been installed in an application. × Java and Groovy code that the plugin provides within the lib and src/java and src/groovy directories will be compiled into the main project's web-app/WEB- INF/classes directory so that they are made available at runtime.
  • 11. Providing Basic Artefacts Adding a new script Adding a new grails-app artifact (controller, taglib, service, etc.) Providing Views, Templates and view resolution. Excluded Artefacts
  • 12. Adding a new Script A plugin can add a new script simply by providing the relevant Gant script in its scripts directory: × CustomPlugin × Grails-app × scripts <--Add script here × Grails create-script ShowDetailsScript
  • 13. Adding a new grails-app artifact (Controller, Tag Library, Service, etc.) × CustomPlugin × grails-app × controllers × services × etc. × lib × scripts
  • 14. Providing Views, Templates and View resolution × When a plugin provides a controller it may also provide default views to be rendered. × Grails' view resolution mechanism will first look for the view in the application it is installed into and if that fails will attempt to look for the view within the plugin. × This means that you can override views provided by a plugin by creating corresponding GSPs in the application's grails-app/views directory. × if the view uses templates that are also provided by the plugin then:- × <g:render template="fooTemplate" plugin="amazon"/>
  • 15. Excluded Artefacts By default Grails excludes the following files during the packaging process: × grails-app/conf/BootStrap.groovy × grails-app/conf/BuildConfig.groovy (although it is used to generate dependencies.groovy) × grails-app/conf/Config.groovy × grails-app/conf/DataSource.groovy (and any other *DataSource.groovy) × grails-app/conf/UrlMappings.groovy × grails-app/conf/spring/resources.groovy × Everything within /web-app/WEB-INF × Everything within /web-app/plugins/** × Everything within /test/** × SCM management files within **/.svn/** and **/CVS/** If your plugin requires files under the web-app/WEB-INF directory it is recommended that you modify the plugin's scripts/_Install.groovy Gant script to install these artefacts into the target project's directory tree. In addition, the default UrlMappings.groovy file is excluded to avoid naming conflicts, however you are free to add a UrlMappings definition under a different name which will be included. For example a file called grails- app/conf/BlogUrlMappings.groovy is fine. The list of excludes is extensible with the pluginExcludes property: // resources that are excluded from plugin packaging def pluginExcludes = [ "grails-app/views/error.gsp" ]
  • 16. Evaluating Conventions Every plugin has an implicit application variable which is an instance of the GrailsApplication interface. The GrailsApplication interface provides methods to evaluate the conventions within the project and internally stores references to all artifact classes within your application. Artifacts implement the GrailsClass interface, which represents a Grails resource such as a controller or a tag library. For example to get all GrailsClassinstances you can do: for (grailsClass in application.allClasses) { println grailsClass.name } for (controllerClass in application.controllerClasses) { println controllerClass.name }
  • 17. The dynamic method conventions are as follows: × *Classes - Retrieves all the classes for a particular artefact name. For example application.controllerClasses. × get*Class - Retrieves a named class for a particular artefact. For example application.getControllerClass("PersonController") × is*Class - Returns true if the given class is of the given artefact type. For example application.isControllerClass(PersonController)
  • 18. The GrailsClass interface has a number of useful methods that let you further evaluate and work with the conventions. These include: × getPropertyValue - Gets the initial value of the given property on the class × hasProperty - Returns true if the class has the specified property × newInstance - Creates a new instance of this class. × getName - Returns the logical name of the class in the application without the trailing convention part if applicable × getShortName - Returns the short name of the class without package prefix × getFullName - Returns the full name of the class in the application with the trailing convention part and with the package name × getPropertyName - Returns the name of the class as a property name × getLogicalPropertyName - Returns the logical property name of the class in the application
  • 19. Hooking into Build Events Grails plugins can do post-install configuration. This is achieved using a specially named script under the scripts directory of the plugin -_Install.groovy. _Install.groovy is executed after the plugin has been installed. Below will create a new directory type under the grails-app directory and install a configuration template: ant.mkdir(dir: "${basedir}/grails-app/jobs") ant.copy(file: "${pluginBasedir}/src/samples/SamplePluginConfig.groovy", todir: "${basedir}/grails-app/conf") The pluginBasedir variable is not available in custom scripts, but you can use fooPluginDir, where foo is the name of your plugin.
  • 20. Hooking into Runtime Configuration Hooking into the Grails Spring configuration Participating in web.xml Generation Doing Post Initialisation Configuration
  • 21. Hooking into the Grails Spring configuration you can hook in Grails runtime configuration by providing a property called doWithSpring which is assigned a block of code def doWithSpring = { customPluginObject(CustomPluginObject) {} }
  • 22. Adding Dynamic Methods at Runtime Grails plugins let you register dynamic methods with any Grails-managed or other class at runtime. This work is done in a doWithDynamicMethods closure. For Grails-managed classes like controllers, tag libraries and so forth you can add methods, constructors etc. using the ExpandoMetaClass mechanism by accessing each controller's MetaClass: For more:- http://docs.grails.org/2.4.4/guide/plugins.html#addingDynamicMethodsAtRuntime
  • 23. Understanding Plugin Load Order Controlling Plugin Dependencies Controlling Load Order Scopes and Environments
  • 24. Controlling Plugin Dependencies Plugins often depend on the presence of other plugins and can adapt depending on the presence of others. This is implemented with two properties. The first is called dependsOn def dependsOn = [dataSource: "1.0", domainClass: "1.0", i18n: "1.0", core: "1.0"] The dependsOn property also supports a mini expression language for specifying version ranges def dependsOn = [foo: "* > 1.0"] def dependsOn = [foo: "1.0 > 1.1"] def dependsOn = [foo: "1.0 > *"] When the wildcard * character is used it denotes "any" version. The expression syntax also excludes any suffixes such as -BETA, -ALPHA etc. so for example the expression "1.0 > 1.1" would match any of the following versions:
  • 25. Controlling Load Order Using dependsOn establishes a "hard" dependency in that if the dependency is not resolved, the plugin will give up and won't load. It is possible though to have a weaker dependency using the loadAfter and loadBefore properties def loadAfter = ['otherplugin'] Here the plugin will be loaded after the controllers plugin if it exists, otherwise it will just be loaded. The plugin can then adapt to the presence of the other plugin. You can also use the loadBefore property to specify one or more plugins that your plugin should load before: def loadBefore = ['rabbitmq']
  • 26. Scopes and Environments It's not only plugin load order that you can control. You can also specify which environments your plugin should be loaded in and which scopes (stages of a build). Simply declare one or both of these properties in your plugin descriptor: def environments = ['development', 'test', 'myCustomEnv'] def scopes = [excludes:'war'] the plugin will only load in the 'development' and 'test' environments. Nor will it be packaged into the WAR file, because it's excluded from the 'war' phase. This allows development-only plugins to not be packaged for production use. The full list of available scopes are defined by the enum BuildScope, Both properties can be one of: × a string - a sole inclusion × a list - a list of environments or scopes to include × a map - for full control, with 'includes' and/or 'excludes' keys that can have string or list values
  • 27. Register on local × Comment export = false × grails compile: to trigger dependency resolution × grails maven-install: will work once the release plugin in BuildConfig.groovy is installed for your plugin. × Note that this isn't plugin installation, it's faking out a plugin release by putting the ZIP and the POM file in your mavenLocal() repo.
  • 28. Releasing our plugin × Register on grails.org × Fill out this form × Provide good documentation for the users to get started. × Once approved, install the release plugin in the plugin application × grails publish-plugin --stacktrace × Once successful, the plugin will be published in the grails plugin repository. Users will be able to install it directly from Grails Plugin portal by adding the dependency in BuildConfig.groovy
  • 29. Get code:- https://bitbucket.org/vendetta30/customplugin For any doubt please contact:- vijay@nexthoughts.com