diff --git a/readme.adoc b/readme.adoc index bd2f687..fd30227 100644 --- a/readme.adoc +++ b/readme.adoc @@ -114,12 +114,11 @@ Add an `application-local.properties` to the project root and add the following * `gpg.keyname` - The GPG key name. * `gpg.passphrase` - The password of your GPG key. * `gpg.executable` - Path to your GPG executable, typically `/usr/local/MacGPG2/bin/gpg2` - or `/usr/local/bin/gpg`. -* `project-service.key` - Project Service authentication token. Must be a valid GitHub token. Can be the same - as `git.password` when using a GitHub token as password. +or `/usr/local/bin/gpg`. +* `project-service.key` - Project Service authentication token.Must be a valid GitHub token.Can be the same +as `git.password` when using a GitHub token as password. -After that, run the `verify` command (`$ verify`) to verify your settings (authentication, -correct Maven, Java, and GPG setup). +After that, run the `verify-local` command (`$ verify-local`) to verify your local settings (authentication, correct Maven, Java, and GPG setup). See `application-local.template` for details. diff --git a/src/main/java/org/springframework/data/release/build/BuildOperations.java b/src/main/java/org/springframework/data/release/build/BuildOperations.java index c2ce14b..02d5ad7 100644 --- a/src/main/java/org/springframework/data/release/build/BuildOperations.java +++ b/src/main/java/org/springframework/data/release/build/BuildOperations.java @@ -366,6 +366,17 @@ public class BuildOperations { buildSystem.withJavaVersion(executor.detectJavaVersion(project)).verify(); } + /** + * Verifies Maven staging authentication. + */ + public void verifyStagingAuthentication() { + + Project project = Projects.BUILD; + BuildSystem buildSystem = buildSystems.getRequiredPluginFor(project); + + buildSystem.withJavaVersion(executor.detectJavaVersion(project)).verifyStagingAuthentication(); + } + /** * Selects the build system for the module contained in the given {@link ModuleIteration} and executes the given * function with it. diff --git a/src/main/java/org/springframework/data/release/build/BuildSystem.java b/src/main/java/org/springframework/data/release/build/BuildSystem.java index 40b93aa..120fa9d 100644 --- a/src/main/java/org/springframework/data/release/build/BuildSystem.java +++ b/src/main/java/org/springframework/data/release/build/BuildSystem.java @@ -116,6 +116,11 @@ interface BuildSystem extends Plugin { */ void verify(); + /** + * Verify general functionality and correctness of the build setup. + */ + void verifyStagingAuthentication(); + /** * Prepare the build system with a Java version. * diff --git a/src/main/java/org/springframework/data/release/build/MavenBuildSystem.java b/src/main/java/org/springframework/data/release/build/MavenBuildSystem.java index 9d4caf8..9e1ad89 100644 --- a/src/main/java/org/springframework/data/release/build/MavenBuildSystem.java +++ b/src/main/java/org/springframework/data/release/build/MavenBuildSystem.java @@ -550,6 +550,12 @@ class MavenBuildSystem implements BuildSystem { .andIf(gpg.hasSecretKeyring(), () -> arg("gpg.secretKeyring").withValue(gpg.getSecretKeyring())); mvn.execute(BUILD, arguments); + } + + @Override + public void verifyStagingAuthentication() { + + logger.log(BUILD, "Verifying Maven Staging Authentication…"); mvn.execute(BUILD, CommandLine.of(goal("nexus-staging:rc-list-profiles"), // profile("central"))); diff --git a/src/main/java/org/springframework/data/release/cli/VerifyCommands.java b/src/main/java/org/springframework/data/release/cli/VerifyCommands.java index 60e30fd..6f1320d 100644 --- a/src/main/java/org/springframework/data/release/cli/VerifyCommands.java +++ b/src/main/java/org/springframework/data/release/cli/VerifyCommands.java @@ -60,6 +60,7 @@ class VerifyCommands extends TimedCommand { if (ObjectUtils.isEmpty(module) || "build".equals(module)) { // Maven interaction build.verify(); + build.verifyStagingAuthentication(); } if (ObjectUtils.isEmpty(module) || "deployment".equals(module)) { @@ -80,4 +81,22 @@ class VerifyCommands extends TimedCommand { logger.log("Verify", "All settings are verified. You can ship a release now."); } + @CliCommand("verify-local") + public void verifyLocalReleaseTools() { + + // Git checkout build + git.verify(); + + // Maven interaction + build.verify(); + + // GitHub verification + github.verifyAuthentication(); + + // Projects Service Verification + projectService.verifyAuthentication(); + + logger.log("Verify", "All local settings are verified. You can ship a release now."); + } + }