GMavenPlus
repository·master·Indexed 43 days ago
https://github.com/groovy/gmavenplusA Maven plugin that enables the integration of Groovy into Maven projects, allowing for Groovy compilation and execution within the Maven build lifecycle. It is a rewrite of the original GMaven plugin.
What's inside GMavenPlus
- GMavenPlus is a Maven plugin designed to integrate Groovy into Maven-based projects. It is a rewrite of the original GMaven plugin and provides the necessary tooling to compile and run Groovy code within a Maven lifecycle.
Run routine development tasks with Maven Wrapper
masterUse the Maven Wrapper (
./mvnwon Unix/macOS or./mvnw.cmdon Windows) for all routine development tasks to ensure consistent environment behavior.Common Development Commands
Task Command Run unit tests <mvnw> testRun a specific test class <mvnw> -Dtest=ClassNameTest testRun the full test suite (including integration tests) <mvnw> -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Dgpg.skip=true clean install invoker:install invoker:runRun integration tests only <mvnw> -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Dgpg.skip=true clean install invoker:install invoker:runRun selected integration projects <mvnw> -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Dgpg.skip=true -Dinvoker.test=basicCompile,advancedCompile clean install invoker:install invoker:runInstall without tests or Invoker projects <mvnw> -Dmaven.test.skip=true -Dinvoker.skip=true -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -Dgpg.skip=true clean install# Example: Running a specific test class ./mvnw -Dtest=ClassNameTest testGenerate JDK toolchains for integration tests
masterBefore running integration tests that fork a JVM, you must generate the JDK toolchains file using the
maven-toolchains-plugin.<mvnw> org.apache.maven.plugins:maven-toolchains-plugin:3.2.0:generate-jdk-toolchains-xml -Dtoolchain.file=src/it/toolchains.xmlMaintain site and dependencies
masterUse the following commands for site generation and dependency management. Note that
versions:*goals modifypom.xmlin place; always review diffs to ensure compatibility with Java 8, Maven Plugin API, and Groovy requirements.Site Management
Task Command Generate and stage the site <mvnw> clean site site:stageGenerate and stage the site without tests <mvnw> -Dmaven.test.skip=true -DskipITs clean site site:stageDeploy the site <mvnw> clean site-deployDependency and Wrapper Maintenance
Task Command Update the Maven Wrapper <mvnw> wrapper:wrapper -Dmaven=[Desired Maven version]Show available dependency, property, and plugin updates <mvnw> versions:display-dependency-updates versions:display-property-updates versions:display-plugin-updatesUpdate all dependency and plugin versions <mvnw> versions:use-latest-versions -DprocessDependencies=true -DprocessPlugins=true -DprocessPluginDependencies=true -DprocessParent=trueUpdate dependency and plugin versions held in properties <mvnw> versions:update-properties -DprocessDependencies=true -DprocessPlugins=trueShow runtime dependencies <mvnw> dependency:tree -Dscope=runtimeShow test dependencies <mvnw> dependency:tree -Dscope=testShow compile dependencies <mvnw> dependency:tree -Dscope=compilePackage and publish artifacts
masterUse these commands to package, sign, and deploy the plugin.
Task Command Package and sign <mvnw> -Dmaven.test.skip=true clean verifyDeploy a tested snapshot <mvnw> -Dmaven.test.skip=true -Dinvoker.skip=true clean deployDeploy a new snapshot <mvnw> clean deployPerform a plugin release
masterFollow these steps to release the plugin. You can perform a dry run by adding
-DdryRun=trueto the release commands.- Ensure
gpg-agentis running. - Verify signing capability:
- Linux/Cmd:
echo "test" | gpg --clearsign - PowerShell:
Write-Host "test" | gpg --clearsign
- Linux/Cmd:
- Run
<mvnw> clean release:prepare. - Run
<mvnw> release:perform. - Verify the plugin with a test project and run
publish.shorpublish.ps1. - Complete administrative tasks: Fetch from origin, create the next GitHub version, update the Usage and Examples wiki pages, and update the Android example.
- Announce the release on
gmavenplus@googlegroups.com,users@groovy.apache.org, the Groovy Community Slack, and Twitter/X with#GMavenPlusand#GroovyLang.
- Ensure
Redeploy artifacts after a signing failure
masterIf a release fails due to signing issues, follow these steps to manually deploy artifacts to the Central Portal.
- Start
gpg-agentand verify signing. - Ensure the Maven
centralserver entry uses a Central Portal user token (OSSRH tokens are deprecated). - Check out the
prepare releasecommit and copypom.xmltotarget/gmavenplus-plugin-<version>.pom. - Deploy each artifact (POM, JAR, Sources, Javadoc) using
gpg:sign-and-deploy-fileto the following URL:https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2Use-DrepositoryId=central. - Since
gpg:sign-and-deploy-filedoes not trigger the full Mavendeploylifecycle, you must manually upload the deployment to the Central Publisher Portal usingcurlto trigger automatic publication.
Note: Replace
<namespace>with your namespace fromhttps://central.sonatype.com/publishing/namespaces. The bearer token is the Base64-encoded Central Portal token (username:password).# 1. Deploy the POM <mvnw> gpg:sign-and-deploy-file '-DpomFile=target/gmavenplus-plugin-<version>.pom' '-Dfile=target/gmavenplus-plugin-<version>.pom' '-Durl=https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2' '-DrepositoryId=central' # 2. Deploy the JAR <mvnw> gpg:sign-and-deploy-file '-DpomFile=target/gmavenplus-plugin-<version>.pom' '-Dfile=target/gmavenplus-plugin-<version>.jar' '-Durl=https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2' '-DrepositoryId=central' # 3. Upload to Central Portal to trigger automatic publication curl --request POST --header "Authorization: Bearer <base64(token-username:token-password)>" "https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/<namespace>?publishing_type=automatic"- Start