Arian's solution (implementing a maven plugin) is IMO a clean way to implement your requirement (and +1 for his answer).
But if you don't plan to reuse your plugin somewhere else, a quick alternative would be to hack the pom using the GMavenPlus plugin. Here is an example showing how to do so using a Java class from a library to generate some uuid and set it as a property:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.stackoverflow</groupId>
<artifactId>Q3984794</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.safehaus.jug</groupId>
<artifactId>jug</artifactId>
<version>2.0.0</version>
<!-- the classifer is important!! -->
<classifier>lgpl</classifier>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
...
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>set-custom-property</id>
<phase>initialize</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<classpath>
<element>
<groupId>org.safehaus.jug</groupId>
<artifactId>jug</artifactId>
<classifier>lgpl</classifier>
</element>
</classpath>
<source>
import org.safehaus.uuid.UUIDGenerator
def uuid = UUIDGenerator.getInstance().generateRandomBasedUUID()
project.properties.setProperty('groupName', uuid.toString())
</source>
</configuration>
</execution>
<execution>
<id>show-custom-property</id>
<phase>generate-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>
def props = project.properties
props.each {key, value -> println key + "=" + value}
</source>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Just bind the plugin to a phase prior to the gigaspaces stuff.
The second execution is just there for demonstration purpose (to show the properties):
$ mvn generate-resources
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Q3984794 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- gmaven-plugin:1.3:execute (set-custom-property) @ Q3984794 ---
[INFO]
[INFO] --- gmaven-plugin:1.3:execute (show-custom-property) @ Q3984794 ---
downloadSources=true
downloadJavadocs=true
project.reporting.outputEncoding=UTF-8
project.build.sourceEncoding=UTF-8
groupName=814ff1a5-a102-426e-875c-3c40bd85b737
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…