(Quick Reference)

maven-deploy

Purpose

Installs a packaged application or plugin into the local Maven cache and then deploys it to a remote Maven-compatible repository.

Options

grails maven-deploy [--repository=repoId] [--binary]
  • repository specifies which Subversion or Maven-compatible repository the plugin should be deployed to. A remote repository must first be defined with that ID in BuildConfig.groovy.
  • binary packages the plugin in binary form before installing it. This overrides the default packaging for the plugin.

Examples

Deploy a WAR or plugin to the Maven-compatible repository declared with the ID 'myRepo':

grails maven-deploy --repository=myRepo

Package a plugin in binary form before deploying it:

grails maven-deploy --repository=otherRepo --binary

Description

Packages the current project (either a plugin or application), installs the resulting artifact into the local Maven cache along with its POM, and then deploys both to a configured remote repository.

If you want to install the artifact to a different location from the standard Maven cache, you can set the destination path in BuildConfig.groovy or settings.groovy via the option

grails.project.mavenCache = "${userHome}/my/other/cache"

This command will automatically generate a POM for the artifact based on the information in BuildConfig.groovy and the plugin descriptor (for a plugin project), but you can override this behaviour by putting your own pom.xml file in the root of the project directory.