diff --git a/release-tools/Spring Data Release Tools.sonargraph b/release-tools/Spring Data Release Tools.sonargraph
deleted file mode 100644
index ef89de8..0000000
--- a/release-tools/Spring Data Release Tools.sonargraph
+++ /dev/null
@@ -1,149 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/release-tools/application-local.template b/release-tools/application-local.template
deleted file mode 100644
index 7f47f84..0000000
--- a/release-tools/application-local.template
+++ /dev/null
@@ -1,32 +0,0 @@
-# Git
-git.username=
-git.author=
-git.email=
-git.password=
-github.api.url=https://api.github.com
-
-# IO
-
-# Optionally set the JavaHome path used for exeuting maven goals (eg. /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/)
-# If the property does not exist, is empty or points to an invalid directory the OS default JavaHome will be used.
-#io.javaHome=
-
-# Maven
-maven.mavenHome=
-maven.console-logger=false
-maven.parallelize=true
-
-# Deployment
-# Must be always the encrypted password taken from the Artifactory GUI/Profile view
-deployment.username=
-deployment.password=
-deployment.api-key=
-
-# GPG
-gpg.keyname=
-gpg.password=
-gpg.executable=/usr/local/bin/gpg2
-
-# A GitHub token with user:email, read:user and read:org scopes.
-# User needs to be part of the Spring team on GitHub as well.
-sagan.key=
diff --git a/release-tools/lombok.config b/release-tools/lombok.config
deleted file mode 100644
index 255addb..0000000
--- a/release-tools/lombok.config
+++ /dev/null
@@ -1,2 +0,0 @@
-lombok.nonNull.exceptionType = IllegalArgumentException
-lombok.anyConstructor.addConstructorProperties = true
diff --git a/release-tools/pom.xml b/release-tools/pom.xml
deleted file mode 100644
index 206722d..0000000
--- a/release-tools/pom.xml
+++ /dev/null
@@ -1,163 +0,0 @@
-
- 4.0.0
- org.springframework.data.build
- spring-data-release-cli
- 1.0.0.BUILD-SNAPSHOT
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.3.4.RELEASE
-
-
-
- 2.0.0.RELEASE
- 1.18.18
-
-
-
-
-
- org.springframework.boot
- spring-boot-starter
-
-
-
- org.springframework.boot
- spring-boot-starter-logging
-
-
-
- org.springframework
- spring-web
-
-
-
- org.springframework.data
- spring-data-commons
-
-
-
- com.fasterxml.jackson.core
- jackson-databind
-
-
-
- com.fasterxml.jackson.module
- jackson-module-parameter-names
-
-
-
- joda-time
- joda-time
- 2.10.8
-
-
-
- org.springframework.shell
- spring-shell
- 1.2.0.RELEASE
-
-
-
- org.xmlbeam
- xmlprojector
- 1.4.7
-
-
-
- com.googlecode.plist
- dd-plist
- 1.23
-
-
-
- org.apache.commons
- commons-exec
- 1.3
-
-
-
- org.apache.httpcomponents
- httpclient
-
-
-
- org.projectlombok
- lombok
- provided
-
-
-
- org.springframework.plugin
- spring-plugin-core
- ${spring-plugin.version}
-
-
-
- org.springframework.boot
- spring-boot-starter-test
-
-
-
- org.eclipse.jgit
- org.eclipse.jgit
- 5.6.0.201912101111-r
-
-
-
- org.springframework.boot
- spring-boot-configuration-processor
- true
-
-
-
- org.apache.maven.shared
- maven-invoker
- 3.0.1
-
-
-
- org.jgrapht
- jgrapht-core
- 0.9.1
-
-
-
- com.github.tomakehurst
- wiremock
- 2.26.3
- test
-
-
-
- com.google.guava
- guava
- 29.0-jre
- test
-
-
-
- javax.servlet
- javax.servlet-api
- test
-
-
-
-
-
- ${project.name}
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
-
-
diff --git a/release-tools/readme.md b/release-tools/readme.md
deleted file mode 100644
index 1696e55..0000000
--- a/release-tools/readme.md
+++ /dev/null
@@ -1,99 +0,0 @@
-## General Notes
-
-* Use the command `help` to get a list of all commands in the release tools.
-* After fixing a problem use `workspace cleanup` to cleanup any mess left behind by the previous step.
-
-## One Time Setup
-
-### Infrastructure requirements
-
-- Ensure you have the credentials for `buildmaster` accounts on https://repo.spring.io.
-- Ensure yoiu have the credentials for https://oss.sonatype.org (to deploy and promote GA and service releases, need deployment permissions for `org.springframework.data`) in `settings.xml` for server with id `sonatype`.
-
-Both are available in the Spring/Pivotal Last Pass repository.
-
-### Prepare local configuration and credentials
-
-Add an `application-local.properties` to the project root and add the following properties:
-
-- `git.username` - Your GitHub username.
-- `git.password` - Your GitHub Password (or API key with scopes: `public_repo, read:org, repo:status, repo_deployment, user` when using 2FA).
-- `git.author` - Your full name (used for preparing commits).
-- `git.email` - Your email (used for preparing commits).
-- `maven.mavenHome` - Pointing to the location of your Maven installation.
-- `deployment.username` - Your Artifactory user.
-- `deployment.api-key` - The Artifactory API key to use for artifact promotion.
-- `deployment.password` - The encrypted Artifactory password..
-- `gpg.keyname` - The GPG key name.
-- `gpg.password` - The password of your GPG key.
-- `gpg.executable` - Path to your GPG executable, typically `/usr/local/MacGPG2/bin/gpg2`
- or `/usr/local/bin/gpg`.
-- `sagan.key` - Sagan 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).
-
-See `application-local.template` for details.
-
-## The release process
-
-
-| Action | Command |
-|--------|---------|
-| Build and execute the release shell | `mvn package && java -jar target/spring-data-release-cli.jar` |
-| | *All following commands are run in the release shell* |
-| **Pre-release checks** | |
-| Ensure all work on CVEs potentially contained in the release is done (incl. backports etc.) | N.A. |
-| Upgrade dependencies in Spring Data Build parent pom (mind minor/major version rules) | N.A. |
-| All release tickets are present | `$ tracker releasetickets $trainIteration` |
-| Review open tickets for release | N.A. |
-| Self-assign release tickets | `$ tracker prepare $trainIteration` |
-| Announce release preparations to mailing list (https://groups.google.com/forum/#!forum/spring-data-dev) | N.A. |
-| **Release the binaries** ||
-| | `$ release prepare $trainIteration` |
-| Build the artefacts and push them to the apropriate maven repository | `$ release build $trainIteration` |
-| |`$ release conclude $trainIteration` |
-| Push the created commits to GitHub |`$ github push $trainIteration` |
-| Push new maintanance branches if the release version was a GA release (`X.Y.0` version)|`$ git push $trainIteration.next`|
-| Distribute documentation and static resources from tag |`$ release distribute $trainIteration`|
-| **Post-release tasks** ||
-|Close JIRA tickets and GitHub release tickets.|`$ tracker close $trainIteration`|
-|Create new release versions and tickets for upcoming version|`$ tracker setup-next $trainIteration.next`|
-| Update versions in Sagan. `$targets` is given as comma separated lists of code names, without spaces. E.g. `Moore,Neumann` | `$ sagan update $releasetrains`|
-| Create list of docs for release announcements | `$ announcement $trainIteration`|
-| Announce release (Blog, Twitter) and notify downstream dependency projects as needed. | N.A. |
-
-### Utilities
-
-#### GitHub Labels
-
-`ProjectLabelConfiguration` contains a per-project configuration which labels should be present in a project. To apply that configuration (create or update), use:
-
-```
-$ github update labels $project
-```
-
-#### Dependency Upgrade
-
-`ProjectDependencies` contains a per-project configuration of dependencies.
-
-Workflow:
-
-* Check for dependency upgrades `$ dependency check $trainIteration`
-
-Reports upgradable dependencies for Build and Modules and
-creates `dependency-upgrade-build.properties` file.
-Edit `dependency-upgrade-build.properties` to specify the dependency version to upgrade.
-Removing a line will omit that dependency upgrade.
-
-* Apply dependency upgrade with `$ dependency upgrade $trainIteration`. Applies dependency
- upgrades currently only to Spring Data Build.
-* Report store-specific dependencies to Spring Boot's current upgrade
- ticket ([sample](https://github.com/spring-projects/spring-boot/issues/24036)) `$ dependency report $trainIteration`
-
-#### CI Properties Distribution
-
-To distribute `ci/pipeline.properties` across all modules use:
-
-`$ infra distribute ci-properties $trainIteration`
diff --git a/release-tools/src/main/java/org/springframework/data/release/Application.java b/release-tools/src/main/java/org/springframework/data/release/Application.java
deleted file mode 100644
index 6bd62f0..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/Application.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2015-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release;
-
-import java.util.logging.Logger;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.shell.support.logging.HandlerUtils;
-
-/**
- * @author Oliver Gierke
- */
-@SpringBootApplication
-public class Application {
-
- public static void main(String[] args) {
-
- SpringApplication application = new SpringApplication(Application.class);
- application.setAdditionalProfiles("local");
-
- try {
- BootShim bs = new BootShim(args, application.run(args));
- bs.run();
- } catch (RuntimeException e) {
- throw e;
- } finally {
- HandlerUtils.flushAllHandlers(Logger.getLogger(""));
- }
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/BootShim.java b/release-tools/src/main/java/org/springframework/data/release/BootShim.java
deleted file mode 100644
index aec0a2c..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/BootShim.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package org.springframework.data.release;
-
-import java.io.IOException;
-
-import org.springframework.beans.factory.support.BeanDefinitionRegistry;
-import org.springframework.beans.factory.support.DefaultListableBeanFactory;
-import org.springframework.beans.factory.support.RootBeanDefinition;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.annotation.ClassPathBeanDefinitionScanner;
-import org.springframework.context.support.GenericApplicationContext;
-import org.springframework.shell.CommandLine;
-import org.springframework.shell.ShellException;
-import org.springframework.shell.SimpleShellCommandLineOptions;
-import org.springframework.shell.core.ExitShellRequest;
-import org.springframework.shell.core.JLineShellComponent;
-import org.springframework.util.StopWatch;
-
-public class BootShim {
-
- private static StopWatch sw = new StopWatch("Spring Shell");
- private static CommandLine commandLine;
- private ConfigurableApplicationContext ctx;
-
- public BootShim(String[] args, ConfigurableApplicationContext context) {
- this.ctx = context;
-
- try {
- commandLine = SimpleShellCommandLineOptions.parseCommandLine(args);
- } catch (IOException var5) {
- throw new ShellException(var5.getMessage(), var5);
- }
-
- this.configureApplicationContext(this.ctx);
- ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner((BeanDefinitionRegistry) this.ctx);
- if (commandLine.getDisableInternalCommands()) {
- scanner.scan(new String[] { "org.springframework.shell.converters", "org.springframework.shell.plugin.support" });
- } else {
- scanner.scan(new String[] { "org.springframework.shell.commands", "org.springframework.shell.converters",
- "org.springframework.shell.plugin.support" });
- }
-
- }
-
- public ApplicationContext getApplicationContext() {
- return this.ctx;
- }
-
- private void configureApplicationContext(ConfigurableApplicationContext annctx) {
- this.createAndRegisterBeanDefinition(annctx, CustomShellComponent.class, "shell");
- annctx.getBeanFactory().registerSingleton("commandLine", commandLine);
- }
-
- protected void createAndRegisterBeanDefinition(GenericApplicationContext annctx, Class> clazz) {
- this.createAndRegisterBeanDefinition(annctx, clazz, (String) null);
- }
-
- protected void createAndRegisterBeanDefinition(ConfigurableApplicationContext annctx, Class> clazz, String name) {
- RootBeanDefinition rbd = new RootBeanDefinition();
- rbd.setBeanClass(clazz);
- DefaultListableBeanFactory bf = (DefaultListableBeanFactory) annctx.getBeanFactory();
- if (name != null) {
- bf.registerBeanDefinition(name, rbd);
- } else {
- bf.registerBeanDefinition(clazz.getSimpleName(), rbd);
- }
- }
-
- public ExitShellRequest run() {
- sw.start();
- String[] commandsToExecuteAndThenQuit = commandLine.getShellCommandsToExecute();
- JLineShellComponent shell = (JLineShellComponent) this.ctx.getBean("shell", JLineShellComponent.class);
- ExitShellRequest exitShellRequest;
- if (null != commandsToExecuteAndThenQuit) {
- boolean successful = false;
- exitShellRequest = ExitShellRequest.FATAL_EXIT;
- String[] arr$ = commandsToExecuteAndThenQuit;
- int len$ = commandsToExecuteAndThenQuit.length;
-
- for (int i$ = 0; i$ < len$; ++i$) {
- String cmd = arr$[i$];
- successful = shell.executeCommand(cmd).isSuccess();
- if (!successful) {
- break;
- }
- }
-
- if (successful) {
- exitShellRequest = ExitShellRequest.NORMAL_EXIT;
- }
- } else {
- shell.start();
- shell.promptLoop();
- exitShellRequest = shell.getExitShellRequest();
- if (exitShellRequest == null) {
- exitShellRequest = ExitShellRequest.NORMAL_EXIT;
- }
-
- shell.waitForComplete();
- }
-
- sw.stop();
- if (shell.isDevelopmentMode()) {
- System.out.println("Total execution time: " + sw.getLastTaskTimeMillis() + " ms");
- }
-
- return exitShellRequest;
- }
-
- public JLineShellComponent getJLineShellComponent() {
- return (JLineShellComponent) this.ctx.getBean("shell", JLineShellComponent.class);
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/CliComponent.java b/release-tools/src/main/java/org/springframework/data/release/CliComponent.java
deleted file mode 100644
index e5b01ef..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/CliComponent.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2015-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.springframework.stereotype.Component;
-
-/**
- * @author Oliver Gierke
- */
-@Component
-@Target(ElementType.TYPE)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface CliComponent {
-
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/CustomShellComponent.java b/release-tools/src/main/java/org/springframework/data/release/CustomShellComponent.java
deleted file mode 100644
index bbd4efa..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/CustomShellComponent.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright 2016-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release;
-
-import java.lang.reflect.Method;
-import java.util.logging.Logger;
-
-import org.springframework.shell.core.ExecutionProcessor;
-import org.springframework.shell.core.ExecutionStrategy;
-import org.springframework.shell.core.JLineShellComponent;
-import org.springframework.shell.core.SimpleExecutionStrategy;
-import org.springframework.shell.event.ParseResult;
-import org.springframework.shell.support.logging.HandlerUtils;
-import org.springframework.util.Assert;
-import org.springframework.util.ReflectionUtils;
-
-/**
- * Extension of {@link JLineShellComponent} to customize the {@link ExecutionStrategy} to one that can deal with package
- * protected command classes.
- *
- * @author Oliver Gierke
- * @see https://github.com/spring-projects/spring-shell/pull/93
- */
-class CustomShellComponent extends JLineShellComponent {
-
- private final ExecutionStrategy executionStrategy = new CustomExecutionStrategy();
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.core.JLineShellComponent#getExecutionStrategy()
- */
- @Override
- protected ExecutionStrategy getExecutionStrategy() {
- return executionStrategy;
- }
-
- /**
- * Effectively a copy of {@link SimpleExecutionStrategy} but with the tweaks provided in PR 93 for Spring shell to
- * enable execution of package protected command classes.
- *
- * @author Oliver Gierke
- * @see https://github.com/spring-projects/spring-shell/pull/93
- */
- static class CustomExecutionStrategy implements ExecutionStrategy {
-
- private static final Logger logger = HandlerUtils.getLogger(SimpleExecutionStrategy.class);
-
- private final Class> mutex = SimpleExecutionStrategy.class;
-
- public Object execute(ParseResult parseResult) throws RuntimeException {
- Assert.notNull(parseResult, "Parse result required");
- synchronized (mutex) {
- Assert.isTrue(isReadyForCommands(), "SimpleExecutionStrategy not yet ready for commands");
- Object target = parseResult.getInstance();
- if (target instanceof ExecutionProcessor) {
- ExecutionProcessor processor = ((ExecutionProcessor) target);
- parseResult = processor.beforeInvocation(parseResult);
- try {
- Object result = invoke(parseResult);
- processor.afterReturningInvocation(parseResult, result);
- return result;
- } catch (Throwable th) {
- processor.afterThrowingInvocation(parseResult, th);
- return handleThrowable(th);
- }
- } else {
- return invoke(parseResult);
- }
- }
- }
-
- private Object invoke(ParseResult parseResult) {
- try {
- Method method = parseResult.getMethod();
- ReflectionUtils.makeAccessible(method);
- return ReflectionUtils.invokeMethod(method, parseResult.getInstance(), parseResult.getArguments());
- } catch (Throwable th) {
- logger.severe("Command failed");
- return handleThrowable(th);
- }
- }
-
- private Object handleThrowable(Throwable th) {
- if (th instanceof Error) {
- throw ((Error) th);
- }
- if (th instanceof RuntimeException) {
- throw ((RuntimeException) th);
- }
- throw new RuntimeException(th);
- }
-
- public boolean isReadyForCommands() {
- return true;
- }
-
- public void terminate() {}
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/TimedCommand.java b/release-tools/src/main/java/org/springframework/data/release/TimedCommand.java
deleted file mode 100644
index 0dfd75d..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/TimedCommand.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2016-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release;
-
-import org.springframework.shell.core.CommandMarker;
-import org.springframework.shell.core.ExecutionProcessor;
-import org.springframework.shell.event.ParseResult;
-import org.springframework.util.StopWatch;
-
-/**
- * Base class for command implementations who want to get their execution time logged.
- *
- * @author Oliver Gierke
- */
-public abstract class TimedCommand implements ExecutionProcessor, CommandMarker {
-
- private StopWatch watch;
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.core.ExecutionProcessor#beforeInvocation(org.springframework.shell.event.ParseResult)
- */
- @Override
- public ParseResult beforeInvocation(ParseResult invocationContext) {
-
- watch = new StopWatch();
- watch.start();
-
- return invocationContext;
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.core.ExecutionProcessor#afterReturningInvocation(org.springframework.shell.event.ParseResult, java.lang.Object)
- */
- @Override
- public void afterReturningInvocation(ParseResult invocationContext, Object result) {
- stopAndLog();
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.core.ExecutionProcessor#afterThrowingInvocation(org.springframework.shell.event.ParseResult, java.lang.Throwable)
- */
- @Override
- public void afterThrowingInvocation(ParseResult invocationContext, Throwable thrown) {
- stopAndLog();
- }
-
- private void stopAndLog() {
-
- watch.stop();
- System.out.println(String.format("Took: %.2f sec.", watch.getTotalTimeSeconds()));
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/announcement/AnnouncementCommands.java b/release-tools/src/main/java/org/springframework/data/release/announcement/AnnouncementCommands.java
deleted file mode 100644
index 1b2d84a..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/announcement/AnnouncementCommands.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2015-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.announcement;
-
-import lombok.NonNull;
-import lombok.RequiredArgsConstructor;
-
-import org.springframework.data.release.CliComponent;
-import org.springframework.data.release.TimedCommand;
-import org.springframework.data.release.model.TrainIteration;
-import org.springframework.shell.core.annotation.CliCommand;
-import org.springframework.shell.core.annotation.CliOption;
-
-/**
- * Commands to create markup to be used in announcing blog posts.
- *
- * @author Oliver Gierke
- */
-@CliComponent
-@RequiredArgsConstructor
-class AnnouncementCommands extends TimedCommand {
-
- private final @NonNull AnnouncementOperations operations;
-
- @CliCommand("announcement")
- public void announce(@CliOption(key = "", mandatory = true) TrainIteration iteration) throws Exception {
- System.out.println(operations.getProjectBulletpoints(iteration));
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/announcement/AnnouncementOperations.java b/release-tools/src/main/java/org/springframework/data/release/announcement/AnnouncementOperations.java
deleted file mode 100644
index 269783f..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/announcement/AnnouncementOperations.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2014-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.announcement;
-
-import static org.springframework.data.release.model.Projects.*;
-
-import org.springframework.data.release.build.MavenArtifact;
-import org.springframework.data.release.cli.StaticResources;
-import org.springframework.data.release.model.Project;
-import org.springframework.data.release.model.TrainIteration;
-import org.springframework.stereotype.Component;
-import org.springframework.util.Assert;
-
-/**
- * @author Oliver Gierke
- */
-@Component
-public class AnnouncementOperations {
-
- /**
- * Returns the project list and links to be included in the release announcement for the given {@link TrainIteration}.
- *
- * @param iteration must not be {@literal null}.
- * @return
- */
- public String getProjectBulletpoints(TrainIteration iteration) {
-
- Assert.notNull(iteration, "Iteration must not be null!");
-
- StringBuilder builder = new StringBuilder();
-
- iteration.getModulesExcept(BUILD, BOM).forEach(module -> {
-
- Project project = module.getProject();
-
- builder.append("* ");
- builder.append(project.getFullName()).append(" ");
- builder.append("`");
- builder.append(module.getShortVersionString());
- builder.append("`");
- builder.append(" - ");
-
- MavenArtifact artifact = new MavenArtifact(module);
-
- builder.append(getMarkDownLink("Artifacts", artifact.getRootUrl()));
- builder.append(" - ");
-
- StaticResources resources = new StaticResources(module);
-
- builder.append(getMarkDownLink("Javadoc", resources.getJavaDocUrl())).append(" - ");
- builder.append(getMarkDownLink("Documentation", resources.getDocumentationUrl())).append(" - ");
- builder.append(getMarkDownLink("Changelog", resources.getChangelogUrl()));
-
- builder.append("\n");
- });
-
- return builder.toString();
- }
-
- private static String getMarkDownLink(String name, String url) {
- return String.format("[%s](%s)", name, url);
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/build/BuildCommands.java b/release-tools/src/main/java/org/springframework/data/release/build/BuildCommands.java
deleted file mode 100644
index 194a278..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/build/BuildCommands.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright 2016-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.build;
-
-import lombok.AccessLevel;
-import lombok.NonNull;
-import lombok.RequiredArgsConstructor;
-import lombok.experimental.FieldDefaults;
-
-import java.io.IOException;
-import java.util.Optional;
-
-import org.springframework.data.release.CliComponent;
-import org.springframework.data.release.TimedCommand;
-import org.springframework.data.release.cli.TrainIterationConverter;
-import org.springframework.data.release.git.GitOperations;
-import org.springframework.data.release.io.Workspace;
-import org.springframework.data.release.model.Project;
-import org.springframework.data.release.model.Projects;
-import org.springframework.data.release.model.ReleaseTrains;
-import org.springframework.data.release.model.Train;
-import org.springframework.data.release.model.TrainIteration;
-import org.springframework.data.release.utils.Logger;
-import org.springframework.shell.core.annotation.CliCommand;
-import org.springframework.shell.core.annotation.CliOption;
-import org.springframework.util.Assert;
-
-/**
- * @author Oliver Gierke
- * @author Mark Paluch
- */
-@CliComponent
-@RequiredArgsConstructor
-@FieldDefaults(level = AccessLevel.PRIVATE, makeFinal = true)
-class BuildCommands extends TimedCommand {
-
- @NonNull BuildOperations build;
- @NonNull Workspace workspace;
- @NonNull GitOperations git;
- @NonNull Logger logger;
-
- /**
- * Removes all Spring Data artifacts from the local repository.
- *
- * @throws IOException
- */
- @CliCommand("build purge artifacts")
- public void purge() throws IOException {
-
- logger.log("Workspace", "Cleaning up workspace directory at %s.",
- workspace.getWorkingDirectory().getAbsolutePath());
-
- workspace.purge(build.getLocalRepository(),
- path -> build.getLocalRepository().relativize(path).startsWith("org/springframework/data"));
- }
-
- /**
- * Triggers a build for all modules of the given {@link TrainIteration}.
- *
- * @param iteration must not be {@literal null}.
- * @param projectKey can be {@literal null} or empty.
- */
- @CliCommand("build")
- public void build(@CliOption(key = "", mandatory = true) TrainIteration iteration, //
- @CliOption(key = "module") String projectKey) {
-
- Assert.notNull(iteration, "Train iteration must not be null!");
- Optional project = Projects.byName(projectKey);
-
- project.ifPresent(it -> build.triggerBuild(iteration.getModule(it)));
-
- if (!project.isPresent()) {
- git.prepare(iteration);
- iteration.forEach(build::triggerBuild);
- }
- }
-
- /**
- * @param trainOrIteration must not be {@literal null}. Accepts release train names and train iterations.
- */
- @CliCommand("build-distribute")
- public void buildDistribute(@CliOption(key = "", mandatory = true) String trainOrIteration) {
-
- Assert.hasText(trainOrIteration, "Train or iteration must not be null or empty!");
-
- if (trainOrIteration.contains(" ")) {
-
- TrainIteration trainIteration = new TrainIterationConverter().convertFromText(trainOrIteration,
- TrainIteration.class, null);
-
- Assert.notNull(trainIteration, "TrainIteration must not be null!");
- git.prepare(trainIteration);
- build.distributeResources(trainIteration);
-
- return;
- }
-
- Train train = ReleaseTrains.getTrainByName(trainOrIteration);
-
- Assert.notNull(train, "Train must not be null!");
-
- git.checkout(train);
- build.distributeResources(train);
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/build/BuildConfiguration.java b/release-tools/src/main/java/org/springframework/data/release/build/BuildConfiguration.java
deleted file mode 100644
index 17eb9b0..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/build/BuildConfiguration.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2016-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.build;
-
-import java.util.List;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.data.release.model.Project;
-import org.springframework.plugin.core.OrderAwarePluginRegistry;
-import org.springframework.plugin.core.PluginRegistry;
-
-import org.xmlbeam.XBProjector;
-import org.xmlbeam.XBProjector.Flags;
-import org.xmlbeam.config.DefaultXMLFactoriesConfig;
-import org.xmlbeam.config.DefaultXMLFactoriesConfig.NamespacePhilosophy;
-
-/**
- * Spring configuration for build related components.
- *
- * @author Oliver Gierke
- */
-@Configuration(proxyBeanMethods = false)
-class BuildConfiguration {
-
- @Bean
- public PluginRegistry buildSystems(List extends BuildSystem> buildSystems) {
- return OrderAwarePluginRegistry.create(buildSystems);
- }
-
- @Bean
- public XBProjector projectionFactory() {
-
- DefaultXMLFactoriesConfig config = new DefaultXMLFactoriesConfig();
- config.setNamespacePhilosophy(NamespacePhilosophy.AGNOSTIC);
- config.setOmitXMLDeclaration(false);
- config.setPrettyPrinting(false);
-
- return new XBProjector(config, Flags.TO_STRING_RENDERS_XML);
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/build/BuildExecutor.java b/release-tools/src/main/java/org/springframework/data/release/build/BuildExecutor.java
deleted file mode 100644
index e91b211..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/build/BuildExecutor.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * Copyright 2019-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.build;
-
-import lombok.NonNull;
-import lombok.RequiredArgsConstructor;
-import lombok.SneakyThrows;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.function.BiFunction;
-import java.util.function.Supplier;
-import java.util.stream.Collector;
-import java.util.stream.Collectors;
-
-import javax.annotation.PreDestroy;
-
-import org.apache.commons.io.IOUtils;
-
-import org.springframework.data.release.infra.InfrastructureOperations;
-import org.springframework.data.release.io.Workspace;
-import org.springframework.data.release.model.JavaVersion;
-import org.springframework.data.release.model.Project;
-import org.springframework.data.release.model.ProjectAware;
-import org.springframework.data.release.utils.ListWrapperCollector;
-import org.springframework.data.util.Streamable;
-import org.springframework.plugin.core.PluginRegistry;
-import org.springframework.stereotype.Component;
-import org.springframework.util.Assert;
-
-/**
- * Build executor service.
- *
- * @author Mark Paluch
- */
-@Component
-@RequiredArgsConstructor
-class BuildExecutor {
-
- private final @NonNull PluginRegistry buildSystems;
- private final MavenProperties mavenProperties;
- private final ExecutorService executor;
- private final Workspace workspace;
-
- @PreDestroy
- public void shutdown() {
- executor.shutdown();
- }
-
- /**
- * Selects the build system for each module contained in the given iteration and executes the given function for it
- * considering pre-requites, honoring the order.
- *
- * @param iteration must not be {@literal null}.
- * @param function must not be {@literal null}.
- * @return
- */
- public Summary doWithBuildSystemOrdered(Streamable iteration,
- BiFunction function) {
- return doWithBuildSystem(iteration, function, true);
- }
-
- /**
- * Selects the build system for each module contained in the given iteration and executes the given function for it
- * considering pre-requites, without considering the execution order.
- *
- * @param iteration must not be {@literal null}.
- * @param function must not be {@literal null}.
- * @return
- */
- public Summary doWithBuildSystemAnyOrder(Streamable iteration,
- BiFunction function) {
- return doWithBuildSystem(iteration, function, false);
- }
-
- private Summary doWithBuildSystem(Streamable iteration,
- BiFunction function, boolean considerDependencyOrder) {
-
- Map> results = new ConcurrentHashMap<>();
-
- // Add here projects that should be skipped because of a partial deployment to e.g. Sonatype.
- Set skip = new HashSet<>(Arrays.asList());
-
- skip.forEach(it -> results.put(it, CompletableFuture.completedFuture(null)));
-
- for (M moduleIteration : iteration) {
-
- if (skip.contains(moduleIteration.getProject())) {
- continue;
- }
-
- if (considerDependencyOrder) {
- Set dependencies = moduleIteration.getProject().getDependencies();
- for (Project dependency : dependencies) {
-
- CompletableFuture futureResult = results.get(dependency);
-
- if (futureResult == null) {
-
- if (!iteration.stream().map(ProjectAware::getProject).anyMatch(project -> project.equals(dependency))) {
- throw new IllegalStateException(moduleIteration.getProject().getName() + " requires "
- + dependency.getName() + " which is not part of the Iteration. Please fix Projects/Iterations setup");
- }
-
- throw new IllegalStateException("No future result for " + dependency.getName() + ", required by "
- + moduleIteration.getProject().getName());
- }
-
- futureResult.join();
- }
- }
-
- CompletableFuture result = run(moduleIteration, function);
- results.put(moduleIteration.getProject(), result);
- }
-
- return iteration.stream()//
- .map(module -> {
-
- CompletableFuture future = results.get(module.getProject());
-
- try {
- return new ExecutionResult(module.getProject(), future.get());
- }
-
- catch (InterruptedException | ExecutionException e) {
- return new ExecutionResult(module.getProject(), e.getCause());
- }
-
- }) //
- .collect(toSummaryCollector());
- }
-
- private CompletableFuture run(M module, BiFunction function) {
-
- Assert.notNull(module, "Module must not be null!");
-
- CompletableFuture result = new CompletableFuture<>();
- Supplier exception = () -> new IllegalStateException(
- String.format("No build system plugin found for project %s!", module.getProject()));
-
- BuildSystem buildSystem = buildSystems.getPluginFor(module.getProject(), exception)
- .withJavaVersion(detectJavaVersion(module.getProject()));
-
- Runnable runnable = () -> {
-
- try {
-
- result.complete(function.apply(buildSystem, module));
- } catch (Exception e) {
- result.completeExceptionally(e);
- }
- };
-
- executor.execute(runnable);
-
- return result;
- }
-
- @SneakyThrows
- public JavaVersion detectJavaVersion(Project project) {
-
- File ciProperties = workspace.getFile(InfrastructureOperations.CI_PROPERTIES, project);
-
- if (!ciProperties.exists()) {
- throw new IllegalStateException(String.format("Cannot find %s for project %s", ciProperties, project));
- }
-
- Properties properties = new Properties();
-
- try (FileInputStream fis = new FileInputStream(ciProperties)) {
- properties.load(fis);
- }
-
- return JavaVersion.fromDockerTag(properties.getProperty("java.main.tag"));
- }
-
- /**
- * Returns a new collector to toSummaryCollector {@link ExecutionResult} as {@link Summary} using the {@link Stream}
- * API.
- *
- * @return
- */
- public static Collector, ?, Summary> toSummaryCollector() {
- return ListWrapperCollector.collectInto(Summary::new);
- }
-
- public static class ExecutionResult {
-
- private final Project project;
- private final T result;
- private final Throwable failure;
-
- public ExecutionResult(Project project, Throwable failure) {
- this.project = project;
- this.result = null;
- this.failure = failure;
- }
-
- public ExecutionResult(Project project, T result) {
- this.project = project;
- this.result = result;
- this.failure = null;
- }
-
- public T getResult() {
- return result;
- }
-
- @Override
- public String toString() {
- return String.format("%-14s - %s", project.getName(),
- isSuccessful() ? "๐ Successful" : "๐งจ Error: " + failure.getMessage());
- }
-
- public boolean isSuccessful() {
- return this.failure == null;
- }
- }
-
- public static class Summary {
-
- private final List> executions;
-
- public Summary(List> executions) {
- this.executions = executions;
-
- if (!isSuccessful()) {
- throw new BuildFailed(this);
- }
- }
-
- public List> getExecutions() {
- return executions;
- }
-
- public boolean isSuccessful() {
- return this.executions.stream().allMatch(ExecutionResult::isSuccessful);
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
-
- builder.append("Execution summary");
- builder.append(IOUtils.LINE_SEPARATOR);
- builder.append(executions.stream().map(it -> "\t" + it).collect(Collectors.joining(IOUtils.LINE_SEPARATOR)));
-
- return builder.toString();
- }
- }
-
- static class BuildFailed extends RuntimeException {
-
- public BuildFailed(Summary> summary) {
- super(summary.toString());
- }
- }
-
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/build/BuildOperations.java b/release-tools/src/main/java/org/springframework/data/release/build/BuildOperations.java
deleted file mode 100644
index d36dc37..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/build/BuildOperations.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Copyright 2016-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.build;
-
-import lombok.NonNull;
-import lombok.RequiredArgsConstructor;
-
-import java.nio.file.Path;
-import java.util.List;
-import java.util.function.BiFunction;
-import java.util.function.Supplier;
-import java.util.stream.Collectors;
-
-import org.assertj.core.util.VisibleForTesting;
-
-import org.springframework.data.release.deployment.DeploymentInformation;
-import org.springframework.data.release.model.Module;
-import org.springframework.data.release.model.ModuleIteration;
-import org.springframework.data.release.model.Phase;
-import org.springframework.data.release.model.Project;
-import org.springframework.data.release.model.Projects;
-import org.springframework.data.release.model.Train;
-import org.springframework.data.release.model.TrainIteration;
-import org.springframework.data.release.utils.Logger;
-import org.springframework.plugin.core.PluginRegistry;
-import org.springframework.stereotype.Component;
-import org.springframework.util.Assert;
-
-/**
- * @author Oliver Gierke
- * @author Mark Paluch
- */
-@Component
-@RequiredArgsConstructor
-public class BuildOperations {
-
- private final @NonNull PluginRegistry buildSystems;
- private final @NonNull Logger logger;
- private final @NonNull MavenProperties properties;
- private final @NonNull BuildExecutor executor;
-
- /**
- * Updates all inter-project dependencies based on the given {@link TrainIteration} and release {@link Phase}.
- *
- * @param iteration must not be {@literal null}.
- * @param phase must not be {@literal null}.
- * @throws Exception
- */
- public void updateProjectDescriptors(TrainIteration iteration, Phase phase) throws Exception {
-
- Assert.notNull(iteration, "Train iteration must not be null!");
- Assert.notNull(phase, "Phase must not be null!");
-
- UpdateInformation updateInformation = UpdateInformation.of(iteration, phase);
-
- BuildExecutor.Summary summary = executor.doWithBuildSystemOrdered(iteration,
- (system, it) -> system.updateProjectDescriptors(it, updateInformation));
-
- logger.log(iteration, "Update Project Descriptors done: %s", summary);
- }
-
- /**
- * Triggers the distribution builds for all modules participating in the given {@link TrainIteration}.
- *
- * @param iteration must not be {@literal null}.
- */
- public void distributeResources(TrainIteration iteration) {
-
- Assert.notNull(iteration, "Train iteration must not be null!");
-
- distributeResources(iteration.getTrain());
- }
-
- /**
- * Triggers the distribution builds for all modules participating in the given {@link Train}.
- *
- * @param train must not be {@literal null}.
- */
- public void distributeResources(Train train) {
-
- Assert.notNull(train, "Train must not be null!");
-
- BuildExecutor.Summary summary = executor.doWithBuildSystemAnyOrder(train,
- BuildSystem::triggerDistributionBuild);
-
- logger.log(train, "Distribution build: %s", summary);
- }
-
- /**
- * Triggers the distribution builds for the given module.
- *
- * @param iteration must not be {@literal null}.
- */
- public void distributeResources(ModuleIteration iteration) {
-
- Assert.notNull(iteration, "ModuleIteration must not be null!");
-
- doWithBuildSystem(iteration, BuildSystem::triggerDistributionBuild);
- }
-
- /**
- * Performs the release build for all modules in the given {@link TrainIteration}.
- *
- * @param iteration must not be {@literal null}.
- * @return
- */
- public List performRelease(TrainIteration iteration) {
-
- BuildExecutor.Summary summary = executor.doWithBuildSystemOrdered(iteration,
- (buildSystem, moduleIteration) -> performRelease(moduleIteration));
-
- logger.log(iteration, "Release: %s", summary);
-
- return summary.getExecutions().stream().map(BuildExecutor.ExecutionResult::getResult).collect(Collectors.toList());
- }
-
- /**
- * Performs the release build for the given {@link ModuleIteration}.
- *
- * @param module must not be {@literal null}.
- * @return
- */
- public DeploymentInformation performRelease(ModuleIteration module) {
- return buildAndDeployRelease(module);
- }
-
- /**
- * Prepares the versions of the given {@link TrainIteration} depending on the given {@link Phase}.
- *
- * @param iteration must not be {@literal null}.
- * @param phase must not be {@literal null}.
- */
- public void prepareVersions(TrainIteration iteration, Phase phase) {
-
- Assert.notNull(iteration, "Train iteration must not be null!");
- Assert.notNull(phase, "Phase must not be null!");
-
- BuildExecutor.Summary summary = executor.doWithBuildSystemOrdered(iteration,
- (system, module) -> system.prepareVersion(module, phase));
-
- logger.log(iteration, "Prepare versions: %s", summary);
- }
-
- /**
- * Prepares the version of the given {@link ModuleIteration} depending on the given {@link Phase}.
- *
- * @param iteration must not be {@literal null}.
- * @param phase must not be {@literal null}.
- * @return
- */
- @VisibleForTesting
- public ModuleIteration prepareVersion(ModuleIteration iteration, Phase phase) {
-
- Assert.notNull(iteration, "Module iteration must not be null!");
- Assert.notNull(phase, "Phase must not be null!");
-
- return doWithBuildSystem(iteration, (system, module) -> system.prepareVersion(module, phase));
- }
-
- /**
- * Returns the {@link Path} of the local artifact repository.
- *
- * @return
- */
- public Path getLocalRepository() {
- return properties.getLocalRepository().toPath();
- }
-
- /**
- * Builds the release for the given {@link ModuleIteration} and deploys it to the staging repository.
- *
- * @param module must not be {@literal null}.
- * @return
- */
- public DeploymentInformation buildAndDeployRelease(ModuleIteration module) {
- return doWithBuildSystem(module, BuildSystem::deploy);
- }
-
- /**
- * Triggers a normal build for the given {@link ModuleIteration}.
- *
- * @param module must not be {@literal null}.
- * @return
- */
- public ModuleIteration triggerBuild(ModuleIteration module) {
- return doWithBuildSystem(module, BuildSystem::triggerBuild);
- }
-
- /**
- * Triggers the pre-release checks for all modules of the given {@link TrainIteration}.
- *
- * @param iteration must not be {@literal null}.
- */
- public void runPreReleaseChecks(TrainIteration iteration) {
-
- Assert.notNull(iteration, "Train iteration must not be null!");
-
- executor.doWithBuildSystemAnyOrder(iteration, BuildSystem::triggerPreReleaseCheck);
- }
-
- /**
- * Verifies Java version presence and that the project can be build using Maven.
- */
- public void verify() {
-
- Project project = Projects.BUILD;
- BuildSystem buildSystem = buildSystems.getRequiredPluginFor(project);
-
- buildSystem.withJavaVersion(executor.detectJavaVersion(project)).verify();
- }
-
- /**
- * Selects the build system for the module contained in the given {@link ModuleIteration} and executes the given
- * function with it.
- *
- * @param module must not be {@literal null}.
- * @param function must not be {@literal null}.
- * @return
- */
- private T doWithBuildSystem(ModuleIteration module, BiFunction function) {
-
- Assert.notNull(module, "ModuleIteration must not be null!");
-
- Supplier exception = () -> new IllegalStateException(
- String.format("No build system plugin found for project %s!", module.getProject()));
-
- BuildSystem buildSystem = buildSystems.getPluginFor(module.getProject(), exception);
-
- return function.apply(buildSystem.withJavaVersion(executor.detectJavaVersion(module.getProject())), module);
- }
-
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/build/BuildSystem.java b/release-tools/src/main/java/org/springframework/data/release/build/BuildSystem.java
deleted file mode 100644
index 1f77a7c..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/build/BuildSystem.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2016-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.build;
-
-import org.springframework.data.release.deployment.DeploymentInformation;
-import org.springframework.data.release.model.JavaVersion;
-import org.springframework.data.release.model.ModuleIteration;
-import org.springframework.data.release.model.Phase;
-import org.springframework.data.release.model.Project;
-import org.springframework.data.release.model.ProjectAware;
-import org.springframework.plugin.core.Plugin;
-
-/**
- * Plugin interface to back different build systems.
- *
- * @author Oliver Gierke
- * @author Mark Paluch
- */
-interface BuildSystem extends Plugin {
-
- /**
- * Updates the project descriptors for the given {@link ModuleIteration} using the given {@link UpdateInformation}.
- *
- * @param iteration must not be {@literal null}.
- * @param updateInformation must not be {@literal null}.
- */
- M updateProjectDescriptors(M iteration, UpdateInformation updateInformation);
-
- /**
- * Prepares the project descriptor of the {@link ModuleIteration} for the given release {@link Phase}.
- *
- * @param module must not be {@literal null}.
- * @param phase must not be {@literal null}.
- * @return
- */
- ModuleIteration prepareVersion(ModuleIteration module, Phase phase);
-
- /**
- * Deploy artifacts for the given {@link ModuleIteration} and return the {@link DeploymentInformation}.
- *
- * @param module must not be {@literal null}.
- * @return
- */
- DeploymentInformation deploy(ModuleIteration module);
-
- /**
- * Runs the distribution build.
- *
- * @param module must not be {@literal null}.
- * @return
- */
- M triggerDistributionBuild(M module);
-
- M triggerBuild(M module);
-
- /**
- * Triggers the pre-release checks for the given {@link ModuleIteration}.
- *
- * @param module must not be {@literal null}.
- * @return
- */
- M triggerPreReleaseCheck(M module);
-
- /**
- * Verify general functionality and correctness of the build setup.
- */
- void verify();
-
- /**
- * Prepare the build system with a Java version.
- *
- * @param javaVersion
- * @return
- */
- BuildSystem withJavaVersion(JavaVersion javaVersion);
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/build/CommandLine.java b/release-tools/src/main/java/org/springframework/data/release/build/CommandLine.java
deleted file mode 100644
index 0c7c58b..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/build/CommandLine.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * Copyright 2017-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.build;
-
-import lombok.AccessLevel;
-import lombok.NonNull;
-import lombok.RequiredArgsConstructor;
-import lombok.Value;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
-import java.util.function.BooleanSupplier;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import org.springframework.data.release.model.Masked;
-import org.springframework.util.Assert;
-
-/**
- * Value object to represent a Maven command line.
- *
- * @author Oliver Gierke
- */
-@Value
-class CommandLine {
-
- @NonNull List goals;
- @NonNull List arguments;
-
- /**
- * Creates a new {@link CommandLine} for the given {@link Goal} and {@link Argument}s.
- *
- * @param goal must not be {@literal null}.
- * @param argument must not be {@literal null}.
- * @return
- */
- public static CommandLine of(Goal goal, Argument... argument) {
- return new CommandLine(Collections.singletonList(goal), Arrays.asList(argument));
- }
-
- /**
- * Creates a new {@link CommandLine} for the given {@link Goal}s and {@link Argument}s.
- *
- * @param goal must not be {@literal null}.
- * @param argument must not be {@literal null}.
- * @return
- */
- public static CommandLine of(Goal first, Goal second, Argument... argument) {
- return new CommandLine(Arrays.asList(first, second), Arrays.asList(argument));
- }
-
- /**
- * Returns a new {@link CommandLine} with the given {@link Argument} added in case the given {@link BooleanSupplier}
- * evaluates to {@literal true}.
- *
- * @param argument must not be {@literal null}.
- * @param condition must not be {@literal null}.
- * @return
- */
- public CommandLine conditionalAnd(Argument argument, BooleanSupplier condition) {
- return condition.getAsBoolean() ? and(argument) : this;
- }
-
- /**
- * Returns a new {@link CommandLine} with the given {@link Argument} added.
- *
- * @param argument must not be {@literal null}.
- * @return
- */
- public CommandLine and(Argument argument) {
-
- Assert.notNull(argument, "Argument must not be null!");
-
- List newArguments = new ArrayList(arguments.size() + 1);
- newArguments.addAll(arguments);
- newArguments.add(argument);
-
- return new CommandLine(goals, newArguments);
- }
-
- /**
- * Renders the current {@link CommandLine} as a plain {@link List} of {@link String}s using the given {@link Function}
- * to expand the {@link Goal}s.
- *
- * @param goalExpansion must not be {@literal null}.
- * @return
- */
- public List toCommandLine(Function goalExpansion) {
-
- Stream goalStream = goals.stream().map(goalExpansion);
- Stream argumentStream = arguments.stream().map(it -> it.toCommandLineArgument());
-
- return Stream.concat(goalStream, argumentStream).collect(Collectors.toList());
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
-
- Stream goalStream = goals.stream().map(it -> it.getGoal());
- Stream argumentStream = arguments.stream().map(Object::toString);
-
- return Stream.concat(goalStream, argumentStream).collect(Collectors.joining(" "));
- }
-
- /**
- * Represents a Maven goal to invoke. Can be a custom one but also one of the predefined instances.
- *
- * @author Oliver Gierke
- */
- @Value(staticConstructor = "goal")
- public static class Goal {
-
- public static final Goal CLEAN = Goal.goal("clean");
- public static final Goal INSTALL = Goal.goal("install");
- public static final Goal DEPLOY = Goal.goal("deploy");
- public static final Goal VALIDATE = Goal.goal("validate");
- public static final Goal VERIFY = Goal.goal("verify");
-
- String goal;
- }
-
- @Value
- @RequiredArgsConstructor(access = AccessLevel.PRIVATE)
- public static class Argument {
-
- public static Argument SKIP_TESTS = Argument.arg("skipTests");
-
- @NonNull String name;
- @NonNull Optional> value;
-
- private Argument(String name, ArgumentValue> value) {
- this(name, Optional.of(value));
- }
-
- static Argument of(String name) {
- return new Argument(name, Optional.empty());
- }
-
- /**
- * Enables the given comma-separated profiles for the {@link CommandLine}.
- *
- * @param name must not be {@literal null} or empty.
- * @return
- */
- public static Argument profile(String name, String... others) {
-
- Assert.hasText(name, "Profiles must not be null or empty!");
- Assert.notNull(others, "Other profiles must not be null!");
-
- String profiles = Stream.concat(Stream.of(name), Arrays.stream(others)).collect(Collectors.joining(","));
-
- return Argument.of("-P".concat(profiles));
- }
-
- public static Argument arg(String name) {
- return Argument.of("-D".concat(name));
- }
-
- public static Argument debug() {
- return Argument.of("-X");
- }
-
- public Argument withValue(Object value) {
- return new Argument(name, ArgumentValue.of(value));
- }
-
- public Argument withQuotedValue(Object value) {
- return new Argument(name, ArgumentValue.of(value, it -> String.format("\"%s\"", it.toString())));
- }
-
- public Argument withValue(Masked masked) {
- return new Argument(name, ArgumentValue.of(masked));
- }
-
- public String toCommandLineArgument() {
- return toNameValuePair(value.map(ArgumentValue::toCommandLine));
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return toNameValuePair(value.map(Object::toString));
- }
-
- private String toNameValuePair(Optional source) {
-
- return source//
- .map(it -> String.format("%s=%s", name, it))//
- .orElse(name);
- }
-
- @RequiredArgsConstructor(access = AccessLevel.PRIVATE)
- private static class ArgumentValue {
-
- private final @NonNull T value;
- private final @NonNull Optional> preparer;
- private final @NonNull Optional> toString;
-
- public static ArgumentValue of(T value) {
- return new ArgumentValue<>(value, Optional.empty(), Optional.empty());
- }
-
- public static ArgumentValue of(T value, Function preparer) {
- return new ArgumentValue<>(value, Optional.of(preparer), Optional.empty());
- }
-
- /**
- * Returns an {@link ArgumentValue} for the given {@link Masked} value.
- *
- * @param masked must not be {@literal null}.
- * @return
- */
- public static ArgumentValue of(T masked) {
- return new ArgumentValue<>(masked, Optional.empty(), Optional.of(it -> it.masked()));
- }
-
- /**
- * Returns the {@link String} variant of the argument value.
- *
- * @return
- */
- public String toCommandLine() {
- return preparer.map(it -> it.apply(value)).orElseGet(() -> value.toString());
- }
-
- /*
- * (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return toString.map(it -> it.apply(value)).orElseGet(() -> toCommandLine());
- }
- }
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/build/GroupId.java b/release-tools/src/main/java/org/springframework/data/release/build/GroupId.java
deleted file mode 100644
index 0eba8be..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/build/GroupId.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2014-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.build;
-
-import lombok.Value;
-
-/**
- * Value object to represent an artifacts group identifier.
- *
- * @author Oliver Gierke
- */
-@Value(staticConstructor = "of")
-class GroupId {
-
- private final String value;
-
- public String asPath() {
- return value.replace('.', '/');
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/build/MavenArtifact.java b/release-tools/src/main/java/org/springframework/data/release/build/MavenArtifact.java
deleted file mode 100644
index 730a0d4..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/build/MavenArtifact.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2014-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.build;
-
-import static org.springframework.data.release.model.Projects.*;
-
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-
-import org.springframework.data.release.model.ArtifactVersion;
-import org.springframework.data.release.model.ModuleIteration;
-import org.springframework.data.release.model.Project;
-import org.springframework.util.Assert;
-
-/**
- * Value object to represent a Maven artifact.
- *
- * @author Oliver Gierke
- */
-@EqualsAndHashCode
-public class MavenArtifact {
-
- private static final GroupId GROUP_ID = GroupId.of("org.springframework.data");
-
- private final Project project;
- private final @Getter Repository repository;
- private final @Getter ArtifactVersion version;
-
- /**
- * Creates a new {@link MavenArtifact} for the given {@link ModuleIteration}.
- *
- * @param module must not be {@literal null}.
- */
- public MavenArtifact(ModuleIteration module) {
-
- Assert.notNull(module, "Module iteration must not be null!");
-
- this.project = module.getModule().getProject();
- this.repository = new Repository(module.getIteration());
- this.version = ArtifactVersion.of(module);
- }
-
- public MavenArtifact(Project project, ArtifactVersion version) {
-
- this.project = project;
- this.repository = new Repository(version);
- this.version = version;
- }
-
- public String getGroupId() {
- return GROUP_ID.getValue();
- }
-
- /**
- * Returns the Maven artifact identifier.
- *
- * @return
- */
- public String getArtifactId() {
-
- String artifactId = String.format("spring-data-%s", project.getName().toLowerCase());
-
- return REST.equals(project) ? artifactId.concat("-webmvc") : artifactId;
- }
-
- public ArtifactVersion getNextDevelopmentVersion() {
- return version.getNextDevelopmentVersion();
- }
-
- /**
- * Returns the URL pointing to the artifacts.
- *
- * @return
- */
- public String getRootUrl() {
- return String.format("%s/%s/%s/%s", repository.getUrl(), GROUP_ID.asPath(), getArtifactId(), version);
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/build/MavenBuildSystem.java b/release-tools/src/main/java/org/springframework/data/release/build/MavenBuildSystem.java
deleted file mode 100644
index c108886..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/build/MavenBuildSystem.java
+++ /dev/null
@@ -1,464 +0,0 @@
-/*
- * Copyright 2014-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.build;
-
-import static org.springframework.data.release.build.CommandLine.Argument.*;
-import static org.springframework.data.release.build.CommandLine.Goal.*;
-import static org.springframework.data.release.model.Projects.*;
-
-import lombok.AccessLevel;
-import lombok.RequiredArgsConstructor;
-import lombok.experimental.FieldDefaults;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.nio.charset.StandardCharsets;
-import java.util.List;
-import java.util.function.Consumer;
-import java.util.regex.Pattern;
-
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.commons.io.IOUtils;
-
-import org.springframework.core.annotation.Order;
-import org.springframework.data.release.build.CommandLine.Argument;
-import org.springframework.data.release.build.CommandLine.Goal;
-import org.springframework.data.release.build.Pom.Artifact;
-import org.springframework.data.release.deployment.DefaultDeploymentInformation;
-import org.springframework.data.release.deployment.DeploymentInformation;
-import org.springframework.data.release.deployment.DeploymentProperties;
-import org.springframework.data.release.io.Workspace;
-import org.springframework.data.release.model.ArtifactVersion;
-import org.springframework.data.release.model.Gpg;
-import org.springframework.data.release.model.JavaVersion;
-import org.springframework.data.release.model.ModuleIteration;
-import org.springframework.data.release.model.Phase;
-import org.springframework.data.release.model.Project;
-import org.springframework.data.release.model.ProjectAware;
-import org.springframework.data.release.model.TrainIteration;
-import org.springframework.data.release.utils.Logger;
-import org.springframework.stereotype.Component;
-import org.springframework.util.Assert;
-
-import org.xmlbeam.ProjectionFactory;
-import org.xmlbeam.XBProjector;
-import org.xmlbeam.dom.DOMAccess;
-import org.xmlbeam.io.XBStreamInput;
-
-/**
- * @author Oliver Gierke
- * @author Mark Paluch
- */
-@Component
-@Order(100)
-@RequiredArgsConstructor
-@FieldDefaults(level = AccessLevel.PRIVATE, makeFinal = true)
-class MavenBuildSystem implements BuildSystem {
-
- static String POM_XML = "pom.xml";
-
- Workspace workspace;
- ProjectionFactory projectionFactory;
- Logger logger;
- MavenRuntime mvn;
- DeploymentProperties properties;
- Gpg gpg;
-
- @Override
- public BuildSystem withJavaVersion(JavaVersion javaVersion) {
- return new MavenBuildSystem(workspace, projectionFactory, logger, mvn.withJavaVersion(javaVersion), properties,
- gpg);
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.release.build.BuildSystem#updateProjectDescriptors(org.springframework.data.release.model.ModuleIteration, org.springframework.data.release.model.TrainIteration, org.springframework.data.release.model.Phase)
- */
- @Override
- public M updateProjectDescriptors(M module, UpdateInformation information) {
-
- PomUpdater updater = new PomUpdater(logger, information, module.getProject());
-
- if (updater.isBuildProject()) {
-
- if (information.isBomInBuildProject()) {
- updateBom(information, "bom/pom.xml", BUILD);
- }
-
- updateParentPom(information);
-
- } else if (updater.isBomProject()) {
- updateBom(information, "bom/pom.xml", BOM);
- } else {
-
- doWithProjection(workspace.getFile(POM_XML, updater.getProject()), pom -> {
-
- updater.updateDependencyProperties(pom);
- updater.updateParentVersion(pom);
- updater.updateRepository(pom);
- });
- }
-
- return module;
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.release.build.BuildSystem#triggerDistributionBuild(org.springframework.data.release.model.Module)
- */
- @Override
- public M triggerDistributionBuild(M module) {
-
- Project project = module.getProject();
-
- if (BUILD.equals(project)) {
- return module;
- }
-
- if (BOM.equals(project)) {
- return module;
- }
-
- if (!isMavenProject(project)) {
- logger.log(project, "Skipping project as no pom.xml could be found in the working directory!");
- return module;
- }
-
- logger.log(project, "Triggering distribution buildโฆ");
-
- mvn.execute(project, CommandLine.of(Goal.CLEAN, Goal.DEPLOY, //
- SKIP_TESTS, profile("distribute"), Argument.of("-B"),
- arg("artifactory.server").withValue(properties.getServer().getUri()),
- arg("artifactory.distribution-repository").withValue(properties.getDistributionRepository()),
- arg("artifactory.username").withValue(properties.getUsername()),
- arg("artifactory.password").withValue(properties.getPassword())));
-
- mvn.execute(project, CommandLine.of(Goal.CLEAN, Goal.DEPLOY, //
- SKIP_TESTS, profile("distribute-schema"), Argument.of("-B"),
- arg("artifactory.server").withValue(properties.getServer().getUri()),
- arg("artifactory.distribution-repository").withValue(properties.getDistributionRepository()),
- arg("artifactory.username").withValue(properties.getUsername()),
- arg("artifactory.password").withValue(properties.getPassword())));
-
- logger.log(project, "Successfully finished distribution build!");
-
- return module;
- }
-
- private void updateBom(UpdateInformation updateInformation, String file, Project project) {
-
- TrainIteration iteration = updateInformation.getTrain();
-
- logger.log(BUILD, "Updating BOM pom.xmlโฆ");
-
- doWithProjection(workspace.getFile(file, project), pom -> {
-
- for (ModuleIteration module : iteration.getModulesExcept(BUILD, BOM)) {
-
- ArtifactVersion version = updateInformation.getProjectVersionToSet(module.getProject());
-
- logger.log(project, "%s", module);
-
- String moduleArtifactId = new MavenArtifact(module).getArtifactId();
- pom.setDependencyManagementVersion(moduleArtifactId, version);
- logger.log(project, "Updated managed dependency version for %s to %s!", moduleArtifactId, version);
-
- module.getProject().doWithAdditionalArtifacts(additionalArtifact -> {
-
- String artifactId = additionalArtifact.getArtifactId();
- Artifact artifact = pom.getManagedDependency(artifactId);
-
- if (artifact != null) {
- pom.setDependencyManagementVersion(artifactId, version);
- logger.log(project, "Updated managed dependency version for %s to %s!", artifactId, version);
- } else {
- logger.log(project, "Artifact %s not found, skipping update!", artifactId);
- }
- });
- }
-
- if (updateInformation.getPhase().equals(Phase.PREPARE)) {
-
- // Make sure we have no snapshot leftovers
- List snapshotDependencies = pom.getSnapshotDependencies();
-
- if (!snapshotDependencies.isEmpty()) {
- throw new IllegalStateException(String.format("Found snapshot dependencies %s!", snapshotDependencies));
- }
- }
- });
- }
-
- private void updateParentPom(UpdateInformation information) {
-
- // Fix version of shared resources to to-be-released version.
- doWithProjection(workspace.getFile("parent/pom.xml", BUILD), ParentPom.class, pom -> {
-
- logger.log(BUILD, "Setting shared resources version to %s.", information.getParentVersionToSet());
- pom.setSharedResourcesVersion(information.getParentVersionToSet());
-
- logger.log(BUILD, "Setting releasetrain property to %s.", information.getReleaseTrainVersion());
- pom.setReleaseTrain(information.getReleaseTrainVersion());
- });
- }
-
- public boolean isMavenProject(ModuleIteration module) {
-
- Project project = module.getProject();
-
- if (!isMavenProject(project)) {
- logger.log(module, "No pom.xml file found, skipping project.");
- return false;
- }
-
- return true;
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.release.build.BuildSystem#prepareVersion(org.springframework.data.release.model.ModuleIteration, org.springframework.data.release.model.Phase)
- */
- @Override
- public ModuleIteration prepareVersion(ModuleIteration module, Phase phase) {
-
- Project project = module.getProject();
- UpdateInformation information = UpdateInformation.of(module.getTrainIteration(), phase);
-
- CommandLine goals = CommandLine.of(goal("versions:set"), goal("versions:commit"));
-
- if (BOM.equals(project)) {
-
- mvn.execute(project, goals.and(arg("newVersion").withValue(information.getReleaseTrainVersion())) //
- .and(arg("generateBackupPoms").withValue("false")));
-
- mvn.execute(project, goals.and(arg("newVersion").withValue(information.getReleaseTrainVersion())) //
- .and(arg("generateBackupPoms").withValue("false")) //
- .and(arg("processAllModules").withValue("true")) //
- .and(Argument.of("-pl").withValue("bom")));
-
- } else {
- mvn.execute(project, goals.and(arg("newVersion").withValue(information.getProjectVersionToSet(project)))
- .and(arg("generateBackupPoms").withValue("false")));
- }
-
- if (BUILD.equals(project)) {
-
- if (!module.getTrain().usesCalver()) {
- mvn.execute(project, goals.and(arg("newVersion").withValue(information.getReleaseTrainVersion())) //
- .and(arg("generateBackupPoms").withValue("false")) //
- .and(arg("groupId").withValue("org.springframework.data")) //
- .and(arg("artifactId").withValue("spring-data-releasetrain")));
- }
-
- mvn.execute(project, CommandLine.of(Goal.INSTALL));
- }
-
- return module;
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.release.build.BuildSystem#deploy(org.springframework.data.release.model.ModuleIteration)
- */
- @Override
- public DeploymentInformation deploy(ModuleIteration module) {
-
- Assert.notNull(module, "Module must not be null!");
-
- DeploymentInformation information = new DefaultDeploymentInformation(module, properties);
-
- deployToArtifactory(module, information);
- deployToMavenCentral(module);
-
- return information;
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.release.build.BuildSystem#triggerBuild(org.springframework.data.release.model.ModuleIteration)
- */
- @Override
- public M triggerBuild(M module) {
-
- CommandLine arguments = CommandLine.of(Goal.CLEAN, Goal.INSTALL)//
- .conditionalAnd(SKIP_TESTS, () -> module.getProject().skipTests());
-
- mvn.execute(module.getProject(), arguments);
-
- return module;
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.release.build.BuildSystem#triggerPreReleaseCheck(org.springframework.data.release.model.ModuleIteration)
- */
- public M triggerPreReleaseCheck(M module) {
-
- mvn.execute(module.getProject(), CommandLine.of(Goal.CLEAN, Goal.VALIDATE, profile("pre-release")));
-
- return module;
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.plugin.core.Plugin#supports(java.lang.Object)
- */
- @Override
- public boolean supports(Project project) {
- return isMavenProject(project);
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.release.build.BuildSystem#verify()
- */
- @Override
- public void verify() {
-
- logger.log(BUILD, "Verifying Maven Build Systemโฆ");
-
- CommandLine arguments = CommandLine.of(Goal.CLEAN, Goal.VERIFY, //
- profile("central"), //
- SKIP_TESTS, //
- arg("gpg.executable").withValue(gpg.getExecutable()), //
- arg("gpg.keyname").withValue(gpg.getKeyname()), //
- arg("gpg.password").withValue(gpg.getPassword()));
-
- mvn.execute(BUILD, arguments);
-
- mvn.execute(BUILD, CommandLine.of(Goal.goal("nexus-staging:rc-list-profiles"), //
- profile("central")));
- }
-
- /**
- * Triggers Maven commands to deploy module artifacts to Spring Artifactory.
- *
- * @param module must not be {@literal null}.
- * @param information must not be {@literal null}.
- */
- private void deployToArtifactory(ModuleIteration module, DeploymentInformation information) {
-
- Assert.notNull(module, "Module iteration must not be null!");
- Assert.notNull(information, "Deployment information must not be null!");
-
- if (!module.getIteration().isPreview()) {
- logger.log(module, "Not a preview version (milestone or release candidate). Skipping Artifactory deployment.");
- return;
- }
-
- logger.log(module, "Deploying artifacts to Spring Artifactoryโฆ");
-
- CommandLine arguments = CommandLine.of(Goal.CLEAN, Goal.DEPLOY, //
- profile("ci,release,artifactory"), //
- SKIP_TESTS, //
- arg("artifactory.server").withValue(properties.getServer().getUri()),
- arg("artifactory.staging-repository").withValue(properties.getStagingRepository()),
- arg("artifactory.username").withValue(properties.getUsername()),
- arg("artifactory.password").withValue(properties.getPassword()),
- arg("artifactory.build-name").withQuotedValue(information.getBuildName()),
- arg("artifactory.build-number").withValue(information.getBuildNumber()));
-
- mvn.execute(module.getProject(), arguments);
- }
-
- /**
- * Triggers Maven commands to deploy to Sonatype's OSS Nexus if the given {@link ModuleIteration} refers to a version
- * that has to be publicly released.
- *
- * @param module must not be {@literal null}.
- */
- private void deployToMavenCentral(ModuleIteration module) {
-
- Assert.notNull(module, "Module iteration must not be null!");
-
- if (!module.getIteration().isPublic()) {
-
- logger.log(module, "Skipping deployment to Maven Central as it's not a public version!");
- return;
- }
-
- logger.log(module, "Deploying artifacts to Sonatype OSS Nexusโฆ");
-
- CommandLine arguments = CommandLine.of(Goal.CLEAN, Goal.DEPLOY, //
- profile("ci,release,central"), //
- SKIP_TESTS, //
- arg("gpg.executable").withValue(gpg.getExecutable()), //
- arg("gpg.keyname").withValue(gpg.getKeyname()), //
- arg("gpg.password").withValue(gpg.getPassword()));
-
- mvn.execute(module.getProject(), arguments);
- }
-
- private boolean isMavenProject(Project project) {
- return workspace.getFile(POM_XML, project).exists();
- }
-
- private void doWithProjection(File file, Consumer callback) {
- doWithProjection(file, Pom.class, callback);
- }
-
- /**
- * TODO: Move XML file callbacks using the {@link ProjectionFactory} to {@link Workspace}.
- */
- private void doWithProjection(File file, Class type, Consumer callback) {
-
- try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file))) {
- byte[] content = doWithProjection((XBProjector) projectionFactory, bis, type, callback);
-
- try (FileOutputStream fos = new FileOutputStream(file)) {
- fos.write(content);
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- static byte[] doWithProjection(XBProjector projector, InputStream stream, Class type,
- Consumer callback) throws IOException {
-
- XBStreamInput io = projector.io().stream(stream);
- T pom = io.read(type);
- callback.accept(pom);
-
- StringWriter writer = new StringWriter();
- try {
- projector.config().createTransformer().transform(new DOMSource(((DOMAccess) pom).getDOMNode()),
- new StreamResult(writer));
- } catch (TransformerException e) {
- throw new RuntimeException(e);
- }
-
- String s = writer.toString();
-
- if (s.contains("standalone=\"no\"?><")) {
- s = s.replaceAll(Pattern.quote("standalone=\"no\"?><"), "standalone=\"no\"?>" + IOUtils.LINE_SEPARATOR + "<");
- }
-
- if (!s.endsWith(IOUtils.LINE_SEPARATOR)) {
- s += IOUtils.LINE_SEPARATOR;
- }
-
- return s.getBytes(StandardCharsets.UTF_8);
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/build/MavenProperties.java b/release-tools/src/main/java/org/springframework/data/release/build/MavenProperties.java
deleted file mode 100644
index 4acc907..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/build/MavenProperties.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2015-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.build;
-
-import lombok.Data;
-import lombok.extern.slf4j.Slf4j;
-
-import java.io.File;
-import java.util.Map;
-
-import org.apache.commons.io.FileUtils;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.stereotype.Component;
-import org.springframework.util.Assert;
-
-/**
- * Maven configuration properties.
- *
- * @author Oliver Gierke
- * @author Mark Paluch
- */
-@Slf4j
-@Data
-@Component
-@ConfigurationProperties(prefix = "maven")
-class MavenProperties {
-
- private File mavenHome;
- private File localRepository;
- private Map plugins;
- private boolean consoleLogger = true;
- private boolean parallelize = false;
-
- /**
- * Configures the local Maven repository location to use. In case the given folder does not already exists it's
- * created.
- *
- * @param localRepository must not be {@literal null} or empty.
- */
- public void setLocalRepository(String localRepository) {
-
- Assert.hasText(localRepository, "Local repository must not be null!");
-
- log.info("Using {} as local Maven repository!", localRepository);
-
- this.localRepository = new File(localRepository.replace("~", FileUtils.getUserDirectoryPath()));
-
- if (!this.localRepository.exists()) {
- this.localRepository.mkdirs();
- }
- }
-
- /**
- * Returns the fully-qualified plugin goal for the given local one.
- *
- * @param goal must not be {@literal null} or empty.
- * @return
- */
- public String getFullyQualifiedPlugin(String goal) {
-
- Assert.hasText(goal, "Goal must not be null or empty!");
-
- if (goal.startsWith("-")) {
- return goal;
- }
-
- String[] parts = goal.split(":");
-
- if (parts.length != 2 || !plugins.containsKey(parts[0])) {
- return goal;
- }
-
- return plugins.get(parts[0]).concat(":").concat(parts[1]);
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/build/MavenRuntime.java b/release-tools/src/main/java/org/springframework/data/release/build/MavenRuntime.java
deleted file mode 100644
index a49d68e..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/build/MavenRuntime.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright 2015-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.build;
-
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-
-import java.io.Closeable;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import org.apache.maven.shared.invoker.DefaultInvocationRequest;
-import org.apache.maven.shared.invoker.DefaultInvoker;
-import org.apache.maven.shared.invoker.InvocationRequest;
-import org.apache.maven.shared.invoker.InvocationResult;
-import org.apache.maven.shared.invoker.Invoker;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.release.io.JavaRuntimes;
-import org.springframework.data.release.io.Workspace;
-import org.springframework.data.release.model.JavaVersion;
-import org.springframework.data.release.model.Project;
-import org.springframework.data.release.utils.Logger;
-import org.springframework.shell.support.util.StringUtils;
-import org.springframework.stereotype.Component;
-
-/**
- * @author Oliver Gierke
- * @author Mark Paluch
- */
-@Slf4j
-@Component
-class MavenRuntime {
-
- private final Workspace workspace;
- private final Logger logger;
- private final MavenProperties properties;
- private final JavaRuntimes.JdkInstallation jdk;
-
- /**
- * Creates a new {@link MavenRuntime} for the given {@link Workspace} and Maven home.
- *
- * @param workspace must not be {@literal null}.
- * @param logger must not be {@literal null}.
- * @param properties must not be {@literal null}.
- */
- @Autowired
- public MavenRuntime(Workspace workspace, Logger logger, MavenProperties properties) {
- this(workspace, logger, properties, JavaVersion.JAVA_8);
- }
-
- private MavenRuntime(Workspace workspace, Logger logger, MavenProperties properties,
- JavaVersion requiredJavaVersion) {
-
- this.workspace = workspace;
- this.logger = logger;
- this.properties = properties;
- this.jdk = JavaRuntimes.Selector.from(requiredJavaVersion).notGraalVM().getRequiredJdkInstallation();
- }
-
- public MavenRuntime withJavaVersion(JavaVersion javaVersion) {
- return new MavenRuntime(workspace, logger, properties, javaVersion);
- }
-
- public void execute(Project project, CommandLine arguments) {
-
- logger.log(project, "๐ฆ Executing mvn %s", arguments.toString());
-
- try (MavenLogger mavenLogger = getLogger(project, arguments.getGoals())) {
-
- Invoker invoker = new DefaultInvoker();
- invoker.setMavenHome(properties.getMavenHome());
- invoker.setOutputHandler(mavenLogger::info);
- invoker.setErrorHandler(mavenLogger::warn);
-
- File localRepository = properties.getLocalRepository();
-
- if (localRepository != null) {
- invoker.setLocalRepositoryDirectory(localRepository);
- }
-
- File javaHome = getJavaHome();
- mavenLogger.info(String.format("Java Home: %s", jdk));
- mavenLogger.info(String.format("Executing: mvn %s", arguments));
-
- InvocationRequest request = new DefaultInvocationRequest();
- request.setJavaHome(javaHome);
- request.setShellEnvironmentInherited(true);
- request.setBaseDirectory(workspace.getProjectDirectory(project));
- request.setBatchMode(true);
-
- request.setGoals(arguments.toCommandLine(it -> properties.getFullyQualifiedPlugin(it.getGoal())));
-
- InvocationResult result = invoker.execute(request);
-
- if (result.getExitCode() != 0) {
- logger.warn(project, "๐ Failed execution mvn %s", arguments.toString());
-
- throw new IllegalStateException("๐ Failed execution mvn " + arguments.toString(),
- result.getExecutionException());
- }
- logger.log(project, "๐ Successful execution mvn %s", arguments.toString());
- } catch (Exception e) {
- if (e instanceof RuntimeException) {
- throw (RuntimeException) e;
- }
- throw new RuntimeException(e);
- }
- }
-
- private File getJavaHome() {
- return jdk.getHome().getAbsoluteFile();
- }
-
- private MavenLogger getLogger(Project project, List goals) {
-
- if (this.properties.isConsoleLogger()) {
- return new SlfLogger(log, project);
- }
-
- return new FileLogger(log, project, this.workspace.getLogsDirectory(), goals);
- }
-
- /**
- * Maven Logging Forwarder.
- */
- interface MavenLogger extends Closeable {
-
- void info(String message);
-
- void warn(String message);
- }
-
- @RequiredArgsConstructor
- static class SlfLogger implements MavenLogger {
-
- private final org.slf4j.Logger logger;
- private final String logPrefix;
-
- SlfLogger(org.slf4j.Logger logger, Project project) {
- this.logger = logger;
- this.logPrefix = StringUtils.padRight(project.getName(), 10);
- }
-
- @Override
- public void info(String message) {
- logger.info(logPrefix + ": " + message);
- }
-
- @Override
- public void warn(String message) {
- logger.warn(logPrefix + ": " + message);
- }
-
- @Override
- public void close() throws IOException {
- // no-op
- }
- }
-
- static class FileLogger implements MavenLogger {
-
- private final PrintWriter printWriter;
- private final FileOutputStream outputStream;
-
- FileLogger(org.slf4j.Logger logger, Project project, File logsDirectory, List goals) {
-
- if (!logsDirectory.exists()) {
- logsDirectory.mkdirs();
- }
-
- String goalNames = goals.stream().map(CommandLine.Goal::getGoal).collect(Collectors.joining("-"));
-
- String filename = String.format("mvn-%s-%s.log", project.getName(), goalNames).replace(':', '.');
-
- try {
- File file = new File(logsDirectory, filename);
- logger.info("Routing Maven output to " + file.getCanonicalPath());
- outputStream = new FileOutputStream(file, true);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
-
- printWriter = new PrintWriter(outputStream, true);
- }
-
- @Override
- public void info(String message) {
- printWriter.println(message);
- }
-
- @Override
- public void warn(String message) {
- printWriter.println(message);
- }
-
- @Override
- public void close() throws IOException {
- printWriter.close();
- outputStream.close();
- }
- }
-
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/build/ParentPom.java b/release-tools/src/main/java/org/springframework/data/release/build/ParentPom.java
deleted file mode 100644
index 17907ea..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/build/ParentPom.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2014-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.build;
-
-import org.springframework.data.release.model.ArtifactVersion;
-import org.xmlbeam.annotation.XBValue;
-import org.xmlbeam.annotation.XBWrite;
-
-/**
- * @author Oliver Gierke
- * @author Mark Paluch
- */
-public interface ParentPom extends Pom {
-
- @XBWrite("/project/properties/releasetrain")
- void setReleaseTrain(@XBValue String releaseTrain);
-
- @XBWrite("/project/profiles/profile[id=\"distribute\"]/dependencies/dependency[artifactId=\"spring-data-build-resources\"]/version")
- void setSharedResourcesVersion(@XBValue ArtifactVersion value);
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/build/Pom.java b/release-tools/src/main/java/org/springframework/data/release/build/Pom.java
deleted file mode 100644
index 28d7458..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/build/Pom.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright 2014-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.build;
-
-import java.util.List;
-
-import org.springframework.data.release.model.ArtifactVersion;
-import org.xmlbeam.annotation.XBRead;
-import org.xmlbeam.annotation.XBValue;
-import org.xmlbeam.annotation.XBWrite;
-
-/**
- * @author Oliver Gierke
- */
-public interface Pom {
-
- @XBRead("/project")
- Artifact getArtifact();
-
- @XBRead("/project/version")
- String getRawVersion();
-
- @XBRead("/project/version")
- ArtifactVersion getVersion();
-
- @XBWrite("/project/version")
- void setVersion(ArtifactVersion version);
-
- @XBWrite("/project/parent/version")
- void setParentVersion(ArtifactVersion version);
-
- @XBRead("/project/properties/{0}")
- String getProperty(String property);
-
- @XBWrite("/project/properties/{0}")
- void setProperty(String property, @XBValue ArtifactVersion value);
-
- @XBWrite("/project/properties/{0}")
- void setProperty(String property, @XBValue String value);
-
- @XBWrite("/project/repositories/repository[id=\"{0}\"]/id")
- void setRepositoryId(String oldId, @XBValue String newId);
-
- @XBWrite("/project/repositories/repository[id=\"{0}\"]/url")
- void setRepositoryUrl(String id, @XBValue String url);
-
- /**
- * Sets the version of the dependency with the given artifact identifier to the given {@link ArtifactVersion}.
- *
- * @param artifactId
- * @param version
- */
- @XBWrite("/project/dependencies/dependency[artifactId=\"{0}\"]/version")
- Pom setDependencyVersion(String artifactId, @XBValue ArtifactVersion version);
-
- @XBRead("/project/dependencies/dependency[artifactId=\"{0}\"]/version")
- String getDependencyVersion(String artifactId);
-
- @XBWrite("/project/dependencyManagement/dependencies/dependency[artifactId=\"{0}\"]/version")
- Pom setDependencyManagementVersion(String artifactId, @XBValue ArtifactVersion version);
-
- @XBRead("/project/dependencyManagement/dependencies/dependency[artifactId=\"{0}\"]")
- Artifact getManagedDependency(String artifactId);
-
- @XBRead("//dependency[substring(version, string-length(version) - string-length('-SNAPSHOT') + 1) = '-SNAPSHOT']")
- List getSnapshotDependencies();
-
- public interface Repository {
-
- @XBRead("child::id")
- String getId();
-
- @XBRead("child::url")
- String getUrl();
- }
-
- public interface Artifact {
-
- @XBRead("child::groupId")
- GroupId getGroupId();
-
- @XBRead("child::artifactId")
- String getArtifactId();
-
- @XBRead("child::version")
- String getVersion();
-
- default String getArtifactPath() {
- return "/".concat(getGroupId().asPath()).concat("/").concat(getArtifactId());
- }
-
- default String getPath() {
- return getArtifactPath().concat(getVersion());
- }
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/build/PomUpdater.java b/release-tools/src/main/java/org/springframework/data/release/build/PomUpdater.java
deleted file mode 100644
index d60ca06..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/build/PomUpdater.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright 2015-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.build;
-
-import static org.springframework.data.release.model.Phase.*;
-import static org.springframework.data.release.model.Projects.*;
-
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-
-import org.springframework.data.release.model.ArtifactVersion;
-import org.springframework.data.release.model.Project;
-import org.springframework.data.release.utils.Logger;
-import org.springframework.util.Assert;
-
-/**
- * @author Oliver Gierke
- */
-@RequiredArgsConstructor
-class PomUpdater {
-
- private final Logger logger;
- private final UpdateInformation information;
- private final @Getter Project project;
-
- public boolean isBuildProject() {
- return BUILD.equals(project);
- }
-
- public boolean isBomProject() {
- return BOM.equals(project);
- }
-
- public void updateArtifactVersion(Pom pom) {
-
- ArtifactVersion version = information.getProjectVersionToSet(project);
- logger.log(project, "Updated project version to %s.", version);
- pom.setVersion(version);
- }
-
- public void updateDependencyProperties(Pom pom) {
-
- project.getDependencies().forEach(dependency -> {
-
- String dependencyProperty = dependency.getDependencyProperty();
-
- if (pom.getProperty(dependencyProperty) == null) {
- return;
- }
-
- ArtifactVersion version = information.getProjectVersionToSet(dependency);
-
- logger.log(project, "Updating %s dependency version property %s to %s.", dependency.getFullName(),
- dependencyProperty, version);
- pom.setProperty(dependencyProperty, version);
- });
- }
-
- /**
- * Updates the version of the parent project in the given {@link Pom}.
- *
- * @param pom must not be {@literal null}.
- */
- public void updateParentVersion(Pom pom) {
-
- Assert.notNull(pom, "Pom must not be null!");
-
- ArtifactVersion version = information.getParentVersionToSet();
-
- logger.log(project, "Updating Spring Data Build Parent version to %s.", version);
- pom.setParentVersion(version);
- }
-
- /**
- * Updates the repository section in the given {@link Pom}.
- *
- * @param pom must not be {@literal null}.
- */
- public void updateRepository(Pom pom) {
-
- Assert.notNull(pom, "Pom must not be null!");
-
- String message = "Switching to Spring repository %s (%s).";
- Repository repository = information.getRepository();
-
- if (PREPARE.equals(information.getPhase())) {
-
- logger.log(project, message, repository.getId(), repository.getUrl());
-
- pom.setRepositoryId(repository.getSnapshotId(), repository.getId());
- pom.setRepositoryUrl(repository.getId(), repository.getUrl());
-
- } else {
-
- logger.log(project, message, repository.getSnapshotId(), repository.getSnapshotUrl());
-
- pom.setRepositoryId(repository.getId(), repository.getSnapshotId());
- pom.setRepositoryUrl(repository.getSnapshotId(), repository.getSnapshotUrl());
- }
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/build/Repository.java b/release-tools/src/main/java/org/springframework/data/release/build/Repository.java
deleted file mode 100644
index 4100aaa..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/build/Repository.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2014-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.build;
-
-import lombok.Value;
-
-import org.springframework.data.release.model.ArtifactVersion;
-import org.springframework.data.release.model.Iteration;
-import org.springframework.util.Assert;
-
-/**
- * @author Oliver Gierke
- */
-
-@Value
-public class Repository {
-
- private static final String ID_BASE = "spring-libs-";
- private static final String BASE = "https://repo.spring.io/libs-";
-
- String id, url;
-
- public Repository(Iteration iteration) {
-
- Assert.notNull(iteration, "Iteration must not be null!");
-
- this.id = ID_BASE.concat(iteration.isPublic() ? "release" : "milestone");
- this.url = BASE.concat(iteration.isPublic() ? "release" : "milestone");
- }
-
- public Repository(ArtifactVersion version) {
-
- String suffix = getSuffixFor(version);
-
- this.id = ID_BASE.concat(suffix);
- this.url = BASE.concat(suffix);
- }
-
- public String getSnapshotId() {
- return ID_BASE.concat("snapshot");
- }
-
- public String getSnapshotUrl() {
- return BASE.concat("snapshot");
- }
-
- private static String getSuffixFor(ArtifactVersion version) {
-
- if (version.isSnapshotVersion()) {
- return "snapshot";
- }
-
- if (version.isMilestoneVersion() || version.isReleaseCandidateVersion()) {
- return "milestone";
- }
-
- if (version.isReleaseVersion()) {
- return "release";
- }
-
- throw new IllegalArgumentException(String.format("Unsupported ArtifactVersion %s!", version));
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/build/UpdateInformation.java b/release-tools/src/main/java/org/springframework/data/release/build/UpdateInformation.java
deleted file mode 100644
index 00b1ded..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/build/UpdateInformation.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright 2015-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.build;
-
-import static org.springframework.data.release.model.Projects.*;
-
-import lombok.Getter;
-import lombok.NonNull;
-import lombok.RequiredArgsConstructor;
-
-import org.springframework.data.release.model.ArtifactVersion;
-import org.springframework.data.release.model.Phase;
-import org.springframework.data.release.model.Project;
-import org.springframework.data.release.model.TrainIteration;
-import org.springframework.util.Assert;
-
-/**
- * Value object to expose update information for a given {@link TrainIteration} and phase.
- *
- * @author Oliver Gierke
- */
-@RequiredArgsConstructor(staticName = "of")
-public class UpdateInformation {
-
- private final @NonNull @Getter TrainIteration train;
- private final @NonNull @Getter Phase phase;
-
- /**
- * Returns the {@link ArtifactVersion} to be set for the given {@link Project}.
- *
- * @param dependency must not be {@literal null}.
- * @return will never be {@literal null}.
- */
- public ArtifactVersion getProjectVersionToSet(Project dependency) {
-
- Assert.notNull(dependency, "Project must not be null!");
-
- ArtifactVersion dependencyVersion = train.getModuleVersion(dependency);
-
- switch (phase) {
- case PREPARE:
- return dependencyVersion;
- case CLEANUP:
- return dependencyVersion.getNextDevelopmentVersion();
- case MAINTENANCE:
- return dependencyVersion.getNextBugfixVersion();
- }
-
- throw new IllegalStateException("Unexpected phase detected " + phase + " detected!");
- }
-
- /**
- * Returns the {@link ArtifactVersion} to be set for the parent reference.
- *
- * @return will never be {@literal null}.
- */
- public ArtifactVersion getParentVersionToSet() {
-
- ArtifactVersion version = train.getModuleVersion(BUILD);
-
- switch (phase) {
- case PREPARE:
- return version;
- case CLEANUP:
- return version.getNextDevelopmentVersion();
- case MAINTENANCE:
- return version.getNextBugfixVersion();
- }
-
- throw new IllegalStateException("Unexpected phase detected " + phase + " detected!");
- }
-
- /**
- * Returns the {@link Repository} to use (milestone or release).
- *
- * @return will never be {@literal null}.
- */
- public Repository getRepository() {
- return new Repository(train.getIteration());
- }
-
- /**
- * Returns the version {@link String} to be used to describe the release train.
- *
- * @return will never be {@literal null}.
- */
- public String getReleaseTrainVersion() {
-
- boolean usesCalver = train.getTrain().usesCalver();
-
- switch (phase) {
- case PREPARE:
- return train.getReleaseTrainNameAndVersion();
- case MAINTENANCE:
- if (usesCalver) {
- return String.format("%s-SNAPSHOT", train.getNextBugfixName());
- }
-
- case CLEANUP:
-
- if (usesCalver) {
-
- if (train.getIteration().isGAIteration()) {
- return String.format("%s-SNAPSHOT", train.getNextIterationName());
- }
-
- return String.format("%s-SNAPSHOT", train.getNextBugfixName());
- }
-
- return String.format("%s-BUILD-SNAPSHOT", train.getName());
- }
-
- throw new IllegalStateException("Unexpected phase detected " + phase + " detected!");
- }
-
- public boolean isBomInBuildProject() {
- return !train.getTrain().usesCalver();
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/cli/ModelCommands.java b/release-tools/src/main/java/org/springframework/data/release/cli/ModelCommands.java
deleted file mode 100644
index 330e07a..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/cli/ModelCommands.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2014-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.cli;
-
-import java.util.stream.Collectors;
-
-import org.springframework.data.release.CliComponent;
-import org.springframework.data.release.TimedCommand;
-import org.springframework.data.release.model.ReleaseTrains;
-import org.springframework.data.release.model.Train;
-import org.springframework.shell.core.annotation.CliCommand;
-import org.springframework.shell.core.annotation.CliOption;
-
-/**
- * @author Oliver Gierke
- */
-@CliComponent
-class ModelCommands extends TimedCommand {
-
- @CliCommand(value = "trains", help = "Displays all release trains or contents of them if a name is provided")
- public String train(@CliOption(key = { "", "train" }) Train train) {
-
- return train != null ? train.toString()
- : ReleaseTrains.TRAINS.stream().map(Train::getName).collect(Collectors.joining(", "));
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/cli/ProjectConverter.java b/release-tools/src/main/java/org/springframework/data/release/cli/ProjectConverter.java
deleted file mode 100644
index 435f776..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/cli/ProjectConverter.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2014-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.cli;
-
-import java.util.List;
-
-import org.springframework.data.release.model.Project;
-import org.springframework.data.release.model.Projects;
-import org.springframework.shell.core.Completion;
-import org.springframework.shell.core.Converter;
-import org.springframework.shell.core.MethodTarget;
-import org.springframework.stereotype.Component;
-
-/**
- * @author Mark Paluch
- */
-@Component
-public class ProjectConverter implements Converter {
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.core.Converter#supports(java.lang.Class, java.lang.String)
- */
- @Override
- public boolean supports(Class> type, String optionContext) {
- return Project.class.isAssignableFrom(type);
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.core.Converter#convertFromText(java.lang.String, java.lang.Class, java.lang.String)
- */
- @Override
- public Project convertFromText(String value, Class> targetType, String optionContext) {
- return Projects.requiredByName(value);
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.core.Converter#getAllPossibleValues(java.util.List, java.lang.Class, java.lang.String, java.lang.String, org.springframework.shell.core.MethodTarget)
- */
- @Override
- public boolean getAllPossibleValues(List completions, Class> targetType, String existingData,
- String optionContext, MethodTarget target) {
-
- for (Project project : Projects.all()) {
- completions.add(new Completion(project.getName()));
- }
-
- return true;
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/cli/ReleaseCommands.java b/release-tools/src/main/java/org/springframework/data/release/cli/ReleaseCommands.java
deleted file mode 100644
index 50b168e..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/cli/ReleaseCommands.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright 2014-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.cli;
-
-import static org.springframework.data.release.model.Projects.*;
-
-import lombok.AccessLevel;
-import lombok.NonNull;
-import lombok.RequiredArgsConstructor;
-import lombok.experimental.FieldDefaults;
-
-import org.springframework.data.release.CliComponent;
-import org.springframework.data.release.TimedCommand;
-import org.springframework.data.release.build.BuildOperations;
-import org.springframework.data.release.deployment.DeploymentInformation;
-import org.springframework.data.release.deployment.DeploymentOperations;
-import org.springframework.data.release.git.GitOperations;
-import org.springframework.data.release.issues.IssueTrackerCommands;
-import org.springframework.data.release.issues.github.GitHubCommands;
-import org.springframework.data.release.misc.ReleaseOperations;
-import org.springframework.data.release.model.ArtifactVersion;
-import org.springframework.data.release.model.ModuleIteration;
-import org.springframework.data.release.model.Phase;
-import org.springframework.data.release.model.Project;
-import org.springframework.data.release.model.Projects;
-import org.springframework.data.release.model.ReleaseTrains;
-import org.springframework.data.release.model.Train;
-import org.springframework.data.release.model.TrainIteration;
-import org.springframework.shell.core.annotation.CliCommand;
-import org.springframework.shell.core.annotation.CliOption;
-import org.springframework.util.Assert;
-
-/**
- * @author Oliver Gierke
- */
-@CliComponent
-@RequiredArgsConstructor
-@FieldDefaults(level = AccessLevel.PRIVATE, makeFinal = true)
-class ReleaseCommands extends TimedCommand {
-
- @NonNull GitOperations git;
- @NonNull ReleaseOperations misc;
- @NonNull DeploymentOperations deployment;
- @NonNull BuildOperations build;
- @NonNull IssueTrackerCommands tracker;
- @NonNull GitHubCommands gitHub;
-
- @CliCommand("release predict")
- public String predictTrainAndIteration() {
-
- return git.getTags(COMMONS).getLatest().toArtifactVersion().//
- map(ReleaseCommands::getTrainNameForCommonsVersion).//
- orElse(null);
- }
-
- /**
- * Composite command to ship a full release.
- *
- * @param iteration
- * @throws Exception
- */
- @CliCommand(value = "ship-it")
- public void shipIt(@CliOption(key = "", mandatory = true) TrainIteration iteration) throws Exception {
-
- tracker.trackerPrepare(iteration);
-
- prepare(iteration);
-
- buildRelease(iteration, null);
-
- conclude(iteration);
-
- gitHub.push(iteration);
-
- distribute(iteration, null);
-
- tracker.closeIteration(iteration);
- }
-
- /**
- * Prepares the release of the given iteration of the given train.
- *
- * @param iteration
- * @throws Exception
- */
- @CliCommand(value = "release prepare", help = "Prepares the release of the iteration of the given train.")
- public void prepare(@CliOption(key = "", mandatory = true) TrainIteration iteration) throws Exception {
-
- git.prepare(iteration);
-
- build.runPreReleaseChecks(iteration);
-
- misc.updateResources(iteration);
- build.updateProjectDescriptors(iteration, Phase.PREPARE);
- git.commit(iteration, "Prepare %s.");
-
- build.prepareVersions(iteration, Phase.PREPARE);
- git.commit(iteration, "Release version %s.");
- }
-
- @CliCommand(value = "release build")
- public void buildRelease(@CliOption(key = "", mandatory = true) TrainIteration iteration, //
- @CliOption(key = "project", mandatory = false) String projectName) {
-
- if (!iteration.getIteration().isPublic()) {
- deployment.verifyAuthentication();
- }
-
- if (projectName != null) {
-
- Project project = Projects.requiredByName(projectName);
- ModuleIteration module = iteration.getModule(project);
-
- DeploymentInformation information = build.performRelease(module);
- deployment.promote(information);
-
- } else {
- build.performRelease(iteration).forEach(deployment::promote);
- }
- }
-
- /**
- * Concludes the release of the given {@link TrainIteration}.
- *
- * @param iteration
- * @throws Exception
- */
- @CliCommand(value = "release conclude")
- public void conclude(@CliOption(key = "", mandatory = true) TrainIteration iteration) throws Exception {
-
- Assert.notNull(iteration, "Train iteration must not be null!");
-
- // Tag release
- git.tagRelease(iteration);
-
- if (iteration.getTrain().isAlwaysUseBranch()) {
- setupMaintenanceVersions(iteration);
- } else {
-
- build.prepareVersions(iteration, Phase.CLEANUP);
- git.commit(iteration, "Prepare next development iteration.");
-
- // Prepare main branch
- build.updateProjectDescriptors(iteration, Phase.CLEANUP);
- git.commit(iteration, "After release cleanups.");
-
- // Prepare maintenance branches
- if (iteration.getIteration().isGAIteration()) {
-
- // Create bugfix branches
- git.createMaintenanceBranches(iteration);
-
- // Set project version to maintenance once
- setupMaintenanceVersions(iteration);
- }
- }
- }
-
- private void setupMaintenanceVersions(TrainIteration iteration) throws Exception {
-
- // Set project version to maintenance once
- build.prepareVersions(iteration, Phase.MAINTENANCE);
- git.commit(iteration, "Prepare next development iteration.");
-
- // Update inter-project dependencies and repositories
- build.updateProjectDescriptors(iteration, Phase.MAINTENANCE);
- git.commit(iteration, "After release cleanups.");
-
- // Back to main branch
- git.checkout(iteration);
- }
-
- /**
- * Triggers the distribution of release artifacts for all projects.
- *
- * @param iteration
- * @throws Exception
- */
- @CliCommand("release distribute")
- public void distribute(@CliOption(key = "", mandatory = true) TrainIteration iteration,
- @CliOption(key = "project", mandatory = false) String projectName) {
-
- git.checkout(iteration);
-
- if (projectName != null) {
- Project project = Projects.requiredByName(projectName);
- ModuleIteration module = iteration.getModule(project);
-
- build.distributeResources(module);
- } else {
- build.distributeResources(iteration);
- }
- }
-
- private static String getTrainNameForCommonsVersion(ArtifactVersion version) {
-
- return ReleaseTrains.TRAINS.stream().//
- filter(train -> version.toString().startsWith(train.getModule(COMMONS).getVersion().toString())).//
- findFirst().map(Train::getName).orElse(null);
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/cli/SpringDataReleaseCliBannerProvider.java b/release-tools/src/main/java/org/springframework/data/release/cli/SpringDataReleaseCliBannerProvider.java
deleted file mode 100644
index 12601de..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/cli/SpringDataReleaseCliBannerProvider.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2014-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.cli;
-
-import org.apache.commons.io.IOUtils;
-
-import org.springframework.boot.SpringBootVersion;
-import org.springframework.core.Ordered;
-import org.springframework.core.annotation.Order;
-import org.springframework.shell.plugin.BannerProvider;
-import org.springframework.shell.support.util.FileUtils;
-import org.springframework.stereotype.Component;
-
-@Order(Ordered.HIGHEST_PRECEDENCE)
-@Component
-class SpringDataReleaseCliBannerProvider implements BannerProvider {
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.plugin.NamedProvider#getProviderName()
- */
- @Override
- public String getProviderName() {
- return "Spring Data Release Shell";
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.plugin.BannerProvider#getBanner()
- */
- @Override
- public String getBanner() {
-
- StringBuilder builder = new StringBuilder();
-
- builder.append(FileUtils.readBanner(SpringDataReleaseCliBannerProvider.class, "banner.txt"));
- builder.append(getVersion()).append(IOUtils.LINE_SEPARATOR);
- builder.append(IOUtils.LINE_SEPARATOR);
-
- return builder.toString();
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.plugin.BannerProvider#getVersion()
- */
- @Override
- public String getVersion() {
- return "1.0 on Spring Boot " + SpringBootVersion.getVersion();
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.plugin.BannerProvider#getWelcomeMessage()
- */
- @Override
- public String getWelcomeMessage() {
- return "Welcome to the Spring Data Release Shell!";
- }
-
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/cli/SpringDataReleaseCliPromptProvider.java b/release-tools/src/main/java/org/springframework/data/release/cli/SpringDataReleaseCliPromptProvider.java
deleted file mode 100644
index 790f6bb..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/cli/SpringDataReleaseCliPromptProvider.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2014-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.cli;
-
-import org.springframework.core.Ordered;
-import org.springframework.core.annotation.Order;
-import org.springframework.shell.plugin.PromptProvider;
-import org.springframework.stereotype.Component;
-
-/**
- * @author Oliver Gierke
- */
-@Component
-@Order(Ordered.HIGHEST_PRECEDENCE)
-class SpringDataReleaseCliPromptProvider implements PromptProvider {
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.plugin.PromptProvider#getPrompt()
- */
- @Override
- public String getPrompt() {
- return "$ ";
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.plugin.NamedProvider#getProviderName()
- */
- @Override
- public String getProviderName() {
- return "spring-data-release-cli";
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/cli/StaticResources.java b/release-tools/src/main/java/org/springframework/data/release/cli/StaticResources.java
deleted file mode 100644
index 1c35af9..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/cli/StaticResources.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2014-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.cli;
-
-import lombok.RequiredArgsConstructor;
-
-import org.springframework.data.release.git.GitProject;
-import org.springframework.data.release.git.Tag;
-import org.springframework.data.release.git.VersionTags;
-import org.springframework.data.release.model.ArtifactVersion;
-import org.springframework.data.release.model.DocumentationMetadata;
-import org.springframework.data.release.model.ModuleIteration;
-import org.springframework.data.release.model.Project;
-
-/**
- * @author Oliver Gierke
- * @author Mark Paluch
- */
-@RequiredArgsConstructor
-public class StaticResources {
-
- private final DocumentationMetadata metadata;
-
- private final String releaseUrl;
-
- public StaticResources(ModuleIteration module) {
-
- this.metadata = DocumentationMetadata.of(module.getProject(), ArtifactVersion.of(module), false);
-
- Project project = module.getProject();
- GitProject gitProject = GitProject.of(project);
- Tag tag = VersionTags.empty(module.getProject()).createTag(module);
-
- this.releaseUrl = String.format("%s/releases/tag/%s", gitProject.getProjectUri(), tag.getName());
- }
-
- public String getDocumentationUrl() {
- return metadata.getReferenceDocUrl();
- }
-
- public String getJavaDocUrl() {
- return metadata.getApiDocUrl();
- }
-
- public String getChangelogUrl() {
- return releaseUrl;
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/cli/TrainConverter.java b/release-tools/src/main/java/org/springframework/data/release/cli/TrainConverter.java
deleted file mode 100644
index fe17326..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/cli/TrainConverter.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2014-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.cli;
-
-import java.util.List;
-import java.util.regex.Pattern;
-
-import org.springframework.data.release.model.ArtifactVersion;
-import org.springframework.data.release.model.ReleaseTrains;
-import org.springframework.data.release.model.Train;
-import org.springframework.shell.core.Completion;
-import org.springframework.shell.core.Converter;
-import org.springframework.shell.core.MethodTarget;
-import org.springframework.stereotype.Component;
-import org.springframework.util.StringUtils;
-
-/**
- * @author Oliver Gierke
- * @author Mark Paluch
- */
-@Component
-public class TrainConverter implements Converter {
-
- private static final Pattern CALVER = Pattern.compile("(\\d{4})(\\.(\\d))+");
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.core.Converter#supports(java.lang.Class, java.lang.String)
- */
- @Override
- public boolean supports(Class> type, String optionContext) {
- return Train.class.isAssignableFrom(type);
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.core.Converter#convertFromText(java.lang.String, java.lang.Class, java.lang.String)
- */
- @Override
- public Train convertFromText(String value, Class> targetType, String optionContext) {
-
- if (StringUtils.isEmpty(value)) {
- return null;
- }
-
- if (CALVER.matcher(value).matches()) {
-
- ArtifactVersion version = ArtifactVersion.of(value);
- return ReleaseTrains.getTrainByCalver(version.getVersion());
- }
-
- return ReleaseTrains.getTrainByName(value);
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.core.Converter#getAllPossibleValues(java.util.List, java.lang.Class, java.lang.String, java.lang.String, org.springframework.shell.core.MethodTarget)
- */
- @Override
- public boolean getAllPossibleValues(List completions, Class> targetType, String existingData,
- String optionContext, MethodTarget target) {
- return false;
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/cli/TrainIterationConverter.java b/release-tools/src/main/java/org/springframework/data/release/cli/TrainIterationConverter.java
deleted file mode 100644
index 9b698aa..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/cli/TrainIterationConverter.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright 2014-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.cli;
-
-import java.util.List;
-import java.util.regex.Pattern;
-
-import org.springframework.data.release.model.ArtifactVersion;
-import org.springframework.data.release.model.Iteration;
-import org.springframework.data.release.model.ReleaseTrains;
-import org.springframework.data.release.model.Train;
-import org.springframework.data.release.model.TrainIteration;
-import org.springframework.shell.core.Completion;
-import org.springframework.shell.core.Converter;
-import org.springframework.shell.core.MethodTarget;
-import org.springframework.stereotype.Component;
-
-/**
- * @author Oliver Gierke
- * @author Mark Paluch
- */
-@Component
-public class TrainIterationConverter implements Converter {
-
- private static final Pattern CALVER = Pattern.compile("(\\d{4})(\\.(\\d+))+(-M(\\d)|-RC(\\d))?");
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.core.Converter#supports(java.lang.Class, java.lang.String)
- */
- @Override
- public boolean supports(Class> type, String optionContext) {
- return TrainIteration.class.equals(type);
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.core.Converter#convertFromText(java.lang.String, java.lang.Class, java.lang.String)
- */
- @Override
- public TrainIteration convertFromText(String value, Class> targetType, String optionContext) {
-
- if (CALVER.matcher(value).matches()) {
-
- ArtifactVersion version = ArtifactVersion.of(value);
- Train train = ReleaseTrains.getTrainByCalver(version.getVersion());
-
- if (version.isReleaseVersion()) {
- if (version.isBugFixVersion()) {
- return train.getIteration("SR" + version.getVersion().getBugfix());
- }
- return train.getIteration(Iteration.GA);
- }
-
- return train.getIteration(version.getSuffix());
- }
-
- String[] parts = value.split(" ");
-
- if (parts.length != 2) {
- throw new IllegalArgumentException(String.format("Cannot resolve TrainIteration from '%s'", value));
- }
-
- Train train = ReleaseTrains.getTrainByName(parts[0].trim());
-
- return train.getIteration(parts[1].trim());
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.shell.core.Converter#getAllPossibleValues(java.util.List, java.lang.Class, java.lang.String, java.lang.String, org.springframework.shell.core.MethodTarget)
- */
- @Override
- public boolean getAllPossibleValues(List completions, Class> targetType, String existingData,
- String optionContext, MethodTarget target) {
-
- for (Train train : ReleaseTrains.TRAINS) {
-
- for (Iteration iteration : train.getIterations()) {
-
- TrainIteration trainIteration = train.getIteration(iteration.getName());
-
- completions.add(new Completion(trainIteration.toString()));
-
- if (trainIteration.getTrain().usesCalver()) {
- completions.add(new Completion(trainIteration.getCalver().toMajorMinorBugfix()));
- }
- }
- }
-
- return true;
- }
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/cli/VerifyCommands.java b/release-tools/src/main/java/org/springframework/data/release/cli/VerifyCommands.java
deleted file mode 100644
index 7d0b0c4..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/cli/VerifyCommands.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2021-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.cli;
-
-import lombok.AccessLevel;
-import lombok.NonNull;
-import lombok.RequiredArgsConstructor;
-import lombok.experimental.FieldDefaults;
-
-import org.springframework.data.release.CliComponent;
-import org.springframework.data.release.TimedCommand;
-import org.springframework.data.release.build.BuildOperations;
-import org.springframework.data.release.deployment.DeploymentOperations;
-import org.springframework.data.release.git.GitOperations;
-import org.springframework.data.release.issues.github.GitHub;
-import org.springframework.data.release.sagan.SaganClient;
-import org.springframework.data.release.utils.Logger;
-import org.springframework.shell.core.annotation.CliCommand;
-
-/**
- * Commands to verify a correct Release Tools Setup.
- *
- * @author Mark Paluch
- */
-@CliComponent
-@RequiredArgsConstructor
-@FieldDefaults(level = AccessLevel.PRIVATE, makeFinal = true)
-class VerifyCommands extends TimedCommand {
-
- @NonNull GitOperations git;
- @NonNull GitHub github;
- @NonNull DeploymentOperations deployment;
- @NonNull BuildOperations build;
- @NonNull SaganClient saganClient;
- @NonNull Logger logger;
-
- @CliCommand("verify")
- public void verifyReleaseTools() {
-
- // Git checkout build
- git.verify();
-
- // Maven interaction
- build.verify();
-
- // Artifactory verification
- deployment.verifyAuthentication();
-
- // GitHub verification
- github.verifyAuthentication();
-
- // Sagan Verification
- saganClient.verifyAuthentication();
-
- logger.log("Verify", "All settings are verified. You can ship a release now.");
- }
-
-}
diff --git a/release-tools/src/main/java/org/springframework/data/release/deployment/ArtifactoryClient.java b/release-tools/src/main/java/org/springframework/data/release/deployment/ArtifactoryClient.java
deleted file mode 100644
index 0f56c61..0000000
--- a/release-tools/src/main/java/org/springframework/data/release/deployment/ArtifactoryClient.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright 2015-2022 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.release.deployment;
-
-import lombok.RequiredArgsConstructor;
-import lombok.Value;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.function.Consumer;
-
-import org.springframework.data.release.model.ModuleIteration;
-import org.springframework.data.release.utils.Logger;
-import org.springframework.util.Assert;
-import org.springframework.web.client.HttpClientErrorException;
-import org.springframework.web.client.RestOperations;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-/**
- * A client to interact with Artifactory.
- *
- * @author Oliver Gierke
- * @author Mark Paluch
- */
-@RequiredArgsConstructor
-class ArtifactoryClient {
-
- private final RestOperations template;
- private final Logger logger;
- private final DeploymentProperties properties;
-
- /**
- * Triggers the promotion of the artifacts identified by the given {@link DeploymentInformation}.
- *
- * @param information must not be {@literal null}.
- */
- public void promote(DeploymentInformation information) {
-
- Assert.notNull(information, "DeploymentInformation must not be null!");
-
- ModuleIteration module = information.getModule();
- URI uri = properties.getServer().getPromotionResource(information);
-
- logger.log(module, "Promoting %s %s from %s to %s.", information.getBuildName(), information.getBuildNumber(),
- properties.getStagingRepository(), information.getTargetRepository());
-
- try {
- template.postForEntity(uri,
- new PromotionRequest(information.getTargetRepository(), properties.getStagingRepository()), String.class);
- } catch (HttpClientErrorException o_O) {
- handle(message -> logger.warn(information.getModule(), message), "Promotion failed!", o_O);
- }
- }
-
- public void verify() {
-
- URI verificationResource = properties.getServer().getVerificationResource();
-
- try {
-
- logger.log("Artifactory", "Verifying authentication using a GET call to %s.", verificationResource);
-
- template.getForEntity(verificationResource, String.class);
-
- logger.log("Artifactory", "Authentication verified!");
-
- } catch (HttpClientErrorException o_O) {
- handle(message -> logger.log("Artifactory Client", message), "Authentication verification failed!", o_O);
- throw new IllegalStateException("Authentication verification failed!");
- }
- }
-
- private void handle(Consumer