Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated documentation with details on resolving Grails plugins via ma…
…ven repositories
- Loading branch information
1 parent
16d770b
commit f490264
Showing
5 changed files
with
183 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
src/guide/2.2 Upgrading from previous versions of Grails.gdoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
You can deploy a Grails project or plugin to a Maven repository using the [maven-publisher|http://grails.org/plugin/maven-publisher] plugin. | ||
|
||
The plugin provides the ability to publish Grails projects and plugins to local and remote Maven repositories. There are two key additional targets added by the plugin: | ||
|
||
* *maven-install* - Installs a Grails project or plugin into your local Maven cache | ||
* *maven-deploy* - Deploys a Grails project or plugin to a remote Maven repository | ||
|
||
By default this plugin will automatically generate a valid @pom.xml@ for you unless a @pom.xml@ is already present in the root of the project, in which case this @pom.xml@ file will be used. | ||
|
||
h4. maven-install | ||
|
||
The @maven-install@ command will install the Grails project or plugin artifact into your local Maven cache: | ||
|
||
{code} | ||
grails maven-install | ||
{code} | ||
|
||
In the case of plugins, the plugin zip file will be installed, whilst for application the application WAR file will be installed. | ||
|
||
h4. maven-deploy | ||
|
||
The @maven-deploy@ command will deploy a Grails project or plugin into a remote Maven repository: | ||
|
||
{code} | ||
grails maven-deploy | ||
{code} | ||
|
||
It is assumed that you have specified the necessary @<distributionManagement>@ configuration within a @pom.xml@ or that you specify the @id@ of the remote repository to deploy to: | ||
|
||
{code} | ||
grails maven-deploy --repository=myRepo | ||
{code} | ||
|
||
The @repository@ argument specifies the 'id' for the repository. You need to configure the details of the repository specified by this 'id' within your @grails-app/conf/BuildConfig.groovy@ file or in your @USER_HOMER/.grails/settings.groovy@ file: | ||
|
||
{code} | ||
grails.project.dependency.distribution = { | ||
localRepository = "/path/to/my/local" | ||
remoteRepository(id:"myRepo", url:"http://myserver/path/to/repo") | ||
} | ||
{code} | ||
|
||
The syntax for configuring remote repositories matches the syntax from the [remoteRepository|http://maven.apache.org/ant-tasks/reference.html#remoteRepository] element in the Ant Maven tasks. For example the following XML: | ||
|
||
{code} | ||
<remoteRepository id="myRepo" url="scp://localhost/www/repository"> | ||
<authentication username="..." privateKey="${user.home}/.ssh/id_dsa"/> | ||
</remoteRepository> | ||
{code} | ||
|
||
Can be expressed as: | ||
|
||
{code} | ||
remoteRepository(id:"myRepo", url:"scp://localhost/www/repository") { | ||
authentication username:"...", privateKey:"${userHome}/.ssh/id_dsa" | ||
} | ||
{code} | ||
|
||
By default the plugin will try to detect the protocol to use from the URL of the repository (ie "http" from "http://.." etc.), however if you need to explicitly specify a different protocol you can do: | ||
|
||
{code} | ||
grails maven-deploy --repository=myRepo --protocol=webdav | ||
{code} | ||
|
||
The available protocols are: | ||
|
||
* http | ||
* scp | ||
* scpexe | ||
* ftp | ||
* webdav | ||
|
||
h4. Groups, Artifacts and Versions | ||
|
||
Maven defines the notion of a 'groupId', 'artifactId' and a 'version'. This plugin pulls this information from the Grails project conventions or plugin descriptor. | ||
|
||
h5. Projects | ||
|
||
For applications this plugin will use the Grails application name and version provided by Grails when generating the @pom.xml@ file. To change the version you can run the @set-version@ command: | ||
|
||
{code} | ||
grails set-version 0.2 | ||
{code} | ||
|
||
The Maven @groupId@ will be the same as the project name, unless you specify a different one in Config.groovy: | ||
|
||
{code} | ||
grails.project.groupId="com.mycompany" | ||
{code} | ||
|
||
h5. Plugins | ||
|
||
With a Grails plugin the @groupId@ and @version@ are taken from the following properties in the *GrailsPlugin.groovy descriptor: | ||
|
||
{code} | ||
String groupId = 'myOrg' | ||
String version = '0.1' | ||
{code} | ||
|
||
The 'artifactId' is taken from the plugin name. For example if you have a plugin called @FeedsGrailsPlugin@ the @artifactId@ will be "feeds". If your plugin does not specify a @groupId@ then this defaults to "org.grails.plugins". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
As of Grails 1.3 you can declaratively specify dependencies on plugins rather than using the [install-plugin|commandLine] command: | ||
|
||
{code} | ||
plugins { | ||
runtime ':hibernate:1.2.1' | ||
} | ||
{code} | ||
|
||
If you don't specify a group id the default plugin group id of @org.grails.plugins@ is used. You can specify to use the latest version of a particular plugin by using "latest.integration" as the version number: | ||
|
||
{code} | ||
plugins { | ||
runtime ':hibernate:latest.integration' | ||
} | ||
{code} | ||
|
||
And of course if you are using a Maven repository with an alternative group id you can specify a group id: | ||
|
||
{code} | ||
plugins { | ||
runtime 'mycompany:hibernate:latest.integration' | ||
} | ||
{code} | ||
|
||
|
||
|
||
|