3.7.9 Desplegando a un repositorio Maven - Reference Documentation
Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith
Version: null
3.7.9 Desplegando a un repositorio Maven
If you use Maven to build your Grails project, you can use the standard Maven targets
Si utiliza a Maven para construir su proyecto Grails, puede utilizar el target estándar de Maven mvn install and mvn deploy.
If not, you can deploy a Grails project or plugin to a Maven repository using the 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
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.mvn install and mvn deploy.
Si no es así, puede desplegar un proyecto Grails o un plugin en un repositorio de Maven utilizando el plugin maven-publisher.El plugin permite publicar proyectos Grails y plugins en repositorios Maven locales y remotos. Hay dos target principales adicionales agregados por el plugin:
- maven-install - instala un plugin o un proyecto Grails en la caché local de Maven.
- maven-deploy - despliega un proyecto Grails o plugin para un repositorio Maven remoto.
pom.xml válido a menos que un pom.xml ya está presente en la raíz del proyecto, en cuyo caso se utilizará este archivo pom.xml.maven-install
Themaven-install command will install the Grails project or plugin artifact into your local Maven cache:grails maven-install
maven-install
El comandomaven-install instalará el proyecto o plugin Grails en la caché local de Maven:grails maven-install
maven-deploy
Themaven-deploy command will deploy a Grails project or plugin into a remote Maven repository:grails maven-deploy
<distributionManagement> configuration within a pom.xml or that you specify the id of the remote repository to deploy to:maven-deploy
El comandomaven-deploy desplegará un proyecto Grails o plugin en un repositorio de Maven remoto:grails maven-deploy
<distributionmanagement> dentro de un pom.xml o que especifica el id del repositorio remoto en el que desplegar:grails maven-deploy --repository=myRepo
The
El argumento repository argument specifies the 'id' for the repository. Configure the details of the repository specified by this 'id' within your grails-app/conf/BuildConfig.groovy file or in your $USER_HOME/.grails/settings.groovy file:repository especifica el 'id' para el repositorio. Configure los detalles del repositorio especificado por este 'id' en el archivo grails-app/conf/BuildConfig.groovy o en el archivo $USER_HOME/.grails/settings.groovy:grails.project.dependency.distribution = {
localRepository = "/path/to/my/local"
remoteRepository(id: "myRepo", url: "http://myserver/path/to/repo")
}The syntax for configuring remote repositories matches the syntax from the remoteRepository element in the Ant Maven tasks. For example the following XML:
La sintaxis para configurar repositorios remotos coincide con la sintaxis del elemento remoteRepository en las tareas Ant Maven. Por ejemplo, el siguiente XML:<remoteRepository id="myRepo" url="scp://localhost/www/repository"> <authentication username="..." privateKey="${user.home}/.ssh/id_dsa"/> </remoteRepository>
Can be expressed as:
Puede ser expresada como:remoteRepository(id: "myRepo", url: "scp://localhost/www/repository") { authentication username: "...", privateKey: "${userHome}/.ssh/id_dsa" }
By default the plugin will try to detect the protocol to use from the URL of the repository (ie "http" from "http://.." etc.), however to specify a different protocol you can do:
De forma predeterminada el plugin intentará detectar el protocolo a usar desde la URL del repositorio (es decir "http" desde "http://..." etc.), sin embargo para especificar otro protocolo puede hacer:grails maven-deploy --repository=myRepo --protocol=webdav
The available protocols are:
Los protocolos disponibles son:
- http
- scp
- scpexe
- ftp
- webdav
- http
- scp
- scpexe
- ftp
- webdav
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.Versiones, artefactos y grupos
Maven define la noción de 'IdGrupo', 'artifactId' y 'versión'. Este plugin extrae esta información de los convenciones de proyecto Grails o del descriptor del plugin.Projects
For applications this plugin will use the Grails application name and version provided by Grails when generating thepom.xml file. To change the version you can run the set-version command:Proyectos
Para las aplicaciones de este plugin utilizará el nombre de la aplicación de Grails y la versión proporcionada por Grails al generar el archivopom.xml. Para cambiar la versión puede ejecutar el comando set-version:grails set-version 0.2
The Maven
El groupId will be the same as the project name, unless you specify a different one in Config.groovy:groupId de Maven será el mismo que el nombre del proyecto, a menos que se especifique otro diferente en Config.groovy:grails.project.groupId="com.mycompany"Plugins
With a Grails plugin thegroupId and version are taken from the following properties in the GrailsPlugin.groovy descriptor:Plugins
Con un plugin de Grails elgroupId y version proceden de las siguientes propiedades en el descriptor de GrailsPlugin.groovy:String groupId = 'myOrg' String version = '0.1'
The 'artifactId' is taken from the plugin name. For example if you have a plugin called
El 'artifactId' se toma del nombre del plugin. Por ejemplo, si tienes un plugin llamado FeedsGrailsPlugin the artifactId will be "feeds". If your plugin does not specify a groupId then this defaults to "org.grails.plugins".FeedsGrailsPlugin el artifactId será "feeds". Si tu plugin no especifica el groupId entonces por defecto utiliza "org.grails.plugins".

