Maven GForge Plugin

From mvn-gforge-plugin (inactive) Wiki
(Redirected from Main Page)
Jump to: navigation, search

The Maven GForge Plugin can upload releases to Evolvis. To use the plugin you have to insert it in the pom.xml of your maven project. The Maven GForge Plugin has two goals: prepare and upload.

Contents

Configuration of your pom.xml file

You can set the following parameters for the Maven GForge Plugin in your pom.xml file.

  • gForgeAPIPort_address - your GForge API port adress (string, mandatory, e.g.: http://evolvis.org/soap/index.php)
  • releaseChanges - changes since the last release (string, default: empty), you can also set this parameter with -DreleaseChanges while executing the plugin
  • releaseNotes - notes for this release (string, default: empty), you can also set this parameter with -DreleaseNotes while executing the plugin
  • releaseNumber - release number of the release (string, default: automatically detected), you can also set this parameter with -DreleaseNumber while executing the plugin
  • gForgeUserDataPath - path to the file with your GForge account settings (string, default: ~/.m2)
  • gForgeUserDataFile - file name of the the file with your GForge account settings (string, default: gforge.access)
  • gForgeProject - name of your GForge project (groupID) (string, default: maven artifactId)
  • uploadFilePath - path to the files to upload relativ to your project home (string, default: target/checkout/)
  • processorType - the processor type your release is built for (string, default: any, other possible values: i386, IA64, Alpha, PPC, MIPS, Sparc, UltraSparc, ARM, Other)
  • fileTypes - list of file type to release additionally to the binary release files (list of strings, e.g. sources, javadoc).

Exemplary configuration for your pom.xml:

<plugins>
  <plugin>
     <groupId>de.tarent.maven.plugins</groupId>
     <artifactId>mvn-gforge-plugin</artifactId>
     <configuration>
        <gForgeAPIPort_address>http://evolvis.org/soap/index.php</gForgeAPIPort_address>
        <fileTypes>
           <type>javadoc</type>
           <type>sources</type>
        </fileTypes>
        <processorType>i386</processorType>
     </configuration>
  </plugin>
</plugins>

File with your GForge account settings

Per default the file ~/.m2/gforge.access is used to access the GForge account settings. The parameter gForgeUserDataPath and gForgeUserDataFile in your pom.xml file can overwrite the filename and the path.
Exemplary configuration of your file with the GForge account settings:

<?xml version="1.0"?>
 <userdata>
  <user>myusername</user>
  <password>mypassword</password>
 </userdata>

What happens during the execution of the goals?

mvn-gforge-plugin:prepare

To determine the release number the file release.properties is automatically read out. This file is created by the maven release plugin. Because the release plugin deletes this file while executing release:perform, the Maven GForge Plugin saves the release number in the file gforge.releasenumber.

mvn-gforge-plugin:upload

The SOAP GForgeAPI

The required classes to access the Evolvis Webservice were created with the Eclipse Web tools. The documentation can be found here. Each GForge user can be in different groups, which represent the projects in GForge. Every project can contain several packages.

Upload the files

The plugin determines at first the project ID of your GForge project. Per default the maven artifact ID is assumed as GForge project name. It is supported to use only one package within a project at the moment. All releases are uploaded to this package. The plugin checks if there are binary files to upload before it creates the entry for the new release.
When the release entry is created, the plugin determines all files that will be uploaded. It selects all files that satisfy the following pattern:

<project name>-<release number>[-<file type>].*

E.g. if your projectname is mvn-gforge-plugin, the release number 0.1.1 and the list of file types contains javadoc and sources, the plugin selects all files that begin with:

mvn-gforge-plugin-0.1.1.*
mvn-gforge-plugin-0.1.1-javadoc.*
mvn-gforge-plugin-0.1.1-sources.*

Using the plugin

The plugin is executed together with the release plugin. The goal prepare has to be performed between release:prepare and release:perform to get the release number. After release:perform the goal upload can be executed.
The command to create and upload a release:

mvn release:prepare de.tarent.maven.plugins:mvn-gforge-plugin:prepare release:perform de.tarent.maven.plugins:mvn-gforge-plugin:upload

Instead of using the mvn-gforge-plugin:prepare goal you can define the release number in your pom.xml file or with -DreleaseNumber:

mvn release:prepare release:perform de.tarent.maven.plugins:mvn-gforge-plugin:upload "-DreleaseNumber=<release number>"

The uploaded files are first encoded with base64. Because this encoded file is transmitted as one big string you need a lot memory if you want to upload big files. You can tell maven to pass additional options to the the JVM with the environment variable MAVEN_OPTS. To allocate more heap memory you can set:

export MAVEN_OPTS="-Xmx256m -Xms64m"