From 61ff4d7fa706b1e3e2562ba7818b973a49368e80 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Tue, 29 Oct 2019 14:27:53 +0100 Subject: [PATCH] Updates following the first run of Reactor build --- .../cloud/release/internal/Releaser.java | 1 + .../release/internal/ReleaserProperties.java | 12 +++-- .../internal/buildsystem/GradleBomParser.java | 25 ++--------- .../GradleProjectNameExtractor.java | 44 +++++++++++++++++++ .../internal/buildsystem/GradleUpdater.java | 43 +++++++++++------- .../buildsystem/ProjectPomUpdater.java | 2 +- .../project/ProjectCommandExecutor.java | 36 +++++++++++---- .../internal/project/ProjectVersion.java | 5 ++- .../release/internal/project/Projects.java | 2 +- .../buildsystem/BuildsystemConfiguration.java | 2 +- .../internal/spring/SpringReleaser.java | 11 +++-- .../cloud/release/internal/spring/Tasks.java | 4 +- .../internal/spring/AcceptanceTests.java | 36 ++++++++------- 13 files changed, 146 insertions(+), 77 deletions(-) create mode 100644 spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/buildsystem/GradleProjectNameExtractor.java diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/Releaser.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/Releaser.java index 43cd075c..e2be5d7f 100644 --- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/Releaser.java +++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/Releaser.java @@ -107,6 +107,7 @@ public class Releaser implements ReleaserPropertiesAware { private void updateProjectFromBom(File project, Projects versions, ProjectVersion versionFromScRelease, boolean assertSnapshots) { + log.info("Will update the project with versions [{}]", versions); this.projectPomUpdater.updateProjectFromReleaseTrain(project, versions, versionFromScRelease, assertSnapshots); this.gradleUpdater.updateProjectFromBom(project, versions, versionFromScRelease, diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/ReleaserProperties.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/ReleaserProperties.java index a8265026..5076752b 100644 --- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/ReleaserProperties.java +++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/ReleaserProperties.java @@ -392,6 +392,7 @@ public class ReleaserProperties implements Serializable { */ private boolean updateReleaseTrainDocs = true; + // TODO: Spring Cloud specific? /** * If set to {@code false}, will not clone and update the release train wiki. */ @@ -739,6 +740,11 @@ public class ReleaserProperties implements Serializable { */ public static final String SYSTEM_PROPS_PLACEHOLDER = "{{systemProps}}"; + /** + * Placeholder for profile. If not used, profile will be appended at the end. + */ + public static final String PROFILE_PROPS_PLACEHOLDER = "{{profile}}"; + /** * Command to be executed to build the project. */ @@ -1006,17 +1012,17 @@ public class ReleaserProperties implements Serializable { /** * Command to be executed to build the project. */ - private String buildCommand = "./gradlew clean build publishToMavenLocal {{systemProps}}"; + private String buildCommand = "./gradlew clean build publishToMavenLocal --console=plain {{systemProps}}"; /** * Command to be executed to deploy a built project. */ - private String deployCommand = "./gradlew clean build publish {{systemProps}}"; + private String deployCommand = "./gradlew clean build publish --console=plain {{systemProps}}"; /** * Command to be executed to build and deploy guides project only. */ - private String deployGuidesCommand = "./gradlew clean build deployGuides {{systemProps}}"; + private String deployGuidesCommand = "./gradlew clean build deployGuides --console=plain {{systemProps}}"; /** * Command to be executed to publish documentation. If present "{{version}}" will diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/buildsystem/GradleBomParser.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/buildsystem/GradleBomParser.java index deb4945f..18220b6b 100644 --- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/buildsystem/GradleBomParser.java +++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/buildsystem/GradleBomParser.java @@ -22,20 +22,17 @@ import java.io.IOException; import java.util.List; import java.util.Map; import java.util.Properties; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import org.springframework.cloud.release.internal.ReleaserProperties; class GradleBomParser implements BomParser { - private static final Pattern VERSION_PATTERN = Pattern - .compile("^([a-zA-Z0-9]+)Version$"); - private final ReleaserProperties properties; private final List customParsers; + private final GradleProjectNameExtractor extractor = new GradleProjectNameExtractor(); + GradleBomParser(ReleaserProperties releaserProperties, List customParsers) { this.properties = releaserProperties; @@ -64,28 +61,12 @@ class GradleBomParser implements BomParser { .thisProjectRoot(thisProjectRoot).releaserProperties(this.properties) .parsers(this.customParsers).retrieveFromBom(); properties.forEach((key, value) -> { - String projectName = projectName(substitution, key); + String projectName = this.extractor.projectName(substitution, key); versionsFromBom.setVersion(projectName, value.toString()); }); return versionsFromBom; } - private String projectName(Map substitution, Object key) { - String projectName = key.toString(); - if (substitution.containsKey(key)) { - projectName = substitution.get(key); - } - else { - Matcher matcher = VERSION_PATTERN.matcher(projectName); - boolean versionMatches = matcher.matches(); - if (versionMatches) { - projectName = matcher.group(1); - } - } - projectName = projectName.replaceAll("([A-Z])", "-$1").toLowerCase(); - return projectName; - } - Properties loadProps(File file) { Properties props = new Properties(); try { diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/buildsystem/GradleProjectNameExtractor.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/buildsystem/GradleProjectNameExtractor.java new file mode 100644 index 00000000..3a3b8449 --- /dev/null +++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/buildsystem/GradleProjectNameExtractor.java @@ -0,0 +1,44 @@ +/* + * Copyright 2013-2019 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.cloud.release.internal.buildsystem; + +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +class GradleProjectNameExtractor { + + private static final Pattern VERSION_PATTERN = Pattern + .compile("^([a-zA-Z0-9]+)Version$"); + + String projectName(Map substitution, Object key) { + String projectName = key.toString(); + if (substitution.containsKey(key)) { + projectName = substitution.get(key); + } + else { + Matcher matcher = VERSION_PATTERN.matcher(projectName); + boolean versionMatches = matcher.matches(); + if (versionMatches) { + projectName = matcher.group(1); + } + } + projectName = projectName.replaceAll("([A-Z])", "-$1").toLowerCase(); + return projectName; + } + +} diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/buildsystem/GradleUpdater.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/buildsystem/GradleUpdater.java index 986ebfd1..c3b34bab 100644 --- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/buildsystem/GradleUpdater.java +++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/buildsystem/GradleUpdater.java @@ -98,11 +98,13 @@ public class GradleUpdater implements ReleaserPropertiesAware { private final List unacceptableVersionPatterns; + private final GradleProjectNameExtractor extractor = new GradleProjectNameExtractor(); + private GradlePropertiesWalker(ReleaserProperties properties, Projects projects, - ProjectVersion versionFromScRelease, boolean assertVersions) { + ProjectVersion versionFromBom, boolean assertVersions) { this.properties = properties; this.projects = projects; - List unacceptableVersionPatterns = versionFromScRelease + List unacceptableVersionPatterns = versionFromBom .unacceptableVersionPatterns(); this.unacceptableVersionPatterns = unacceptableVersionPatterns; this.skipVersionAssert = !assertVersions @@ -120,6 +122,7 @@ public class GradleUpdater implements ReleaserPropertiesAware { file); return FileVisitResult.CONTINUE; } + String parentName = file.getParentFile().getName(); log.info("Will process the file [{}] and update its gradle properties", file); final String fileContents = asString(path); @@ -128,21 +131,22 @@ public class GradleUpdater implements ReleaserPropertiesAware { Properties props = loadProps(file); final Map substitution = this.properties.getGradle() .getGradlePropsSubstitution(); + // TODO: Automatically should search for e.g. [reactor-pool] -> + // [reactorPoolVersion] + // TODO: [version] -> current project version + // reactorPoolVersion, 1.0.0.BUILD-SNAPSHOT props.forEach((key, value1) -> { - if (substitution.containsKey(key)) { - String projectName = substitution.get(key); - if (!this.projects.containsProject(projectName)) { - log.warn( - "Should update project with name [{}] but it wasn't found in the list of projects [{}]", - projectName, this.projects.asList()); - return; - } - ProjectVersion value = this.projects.forName(projectName); - log.info("Replacing [{}->{}] with [{}->{}]", key, value1, key, - value); - changedString.set(changedString.get().replace(key + "=" + value1, - key + "=" + value)); + String projectName = projectName(parentName, substitution, key); + if (!this.projects.containsProject(projectName)) { + log.warn( + "Should update project with name [{}] but it wasn't found in the list of projects [{}]", + projectName, this.projects.asList()); + return; } + ProjectVersion value = this.projects.forName(projectName); + log.info("Replacing [{}->{}] with [{}->{}]", key, value1, key, value); + changedString.set(changedString.get().replace(key + "=" + value1, + key + "=" + value)); }); storeString(path, changedString.get()); assertNoSnapshotsArePresent(path); @@ -150,6 +154,15 @@ public class GradleUpdater implements ReleaserPropertiesAware { return FileVisitResult.CONTINUE; } + private String projectName(String parentName, Map substitution, + Object key) { + // version -> current project version + if (key.equals("version")) { + return parentName; + } + return this.extractor.projectName(substitution, key); + } + private void assertNoSnapshotsArePresent(Path path) { if (this.assertVersions && !this.skipVersionAssert) { log.debug( diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/buildsystem/ProjectPomUpdater.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/buildsystem/ProjectPomUpdater.java index bdf607c0..84dfc6f8 100644 --- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/buildsystem/ProjectPomUpdater.java +++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/buildsystem/ProjectPomUpdater.java @@ -146,7 +146,7 @@ public class ProjectPomUpdater implements ReleaserPropertiesAware { .thisProjectRoot(projectRoot).releaserProperties(this.properties) .projects(projects.asProjects()).merged(); if (!this.pomUpdater.shouldProjectBeUpdated(projectRoot, versionsFromBom)) { - log.info("Skipping project updating"); + log.debug("Skipping project updating"); return; } updatePoms(projectRoot, versionsFromBom, versionFromReleaseTrain, assertVersions); diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/project/ProjectCommandExecutor.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/project/ProjectCommandExecutor.java index aa9c4144..0043d41b 100644 --- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/project/ProjectCommandExecutor.java +++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/project/ProjectCommandExecutor.java @@ -255,7 +255,7 @@ class ProcessExecutor implements ReleaserPropertiesAware { String runCommand(String[] commands, long waitTimeInMinutes) { try { String workingDir = this.workingDir; - log.info( + log.debug( "Will run the command from [{}] via {} and wait for result for [{}] minutes", workingDir, commands, waitTimeInMinutes); ProcessBuilder builder = builder(commands, workingDir); @@ -289,7 +289,15 @@ class ProcessExecutor implements ReleaserPropertiesAware { } ProcessBuilder builder(String[] commands, String workingDir) { - return new ProcessBuilder(commands).directory(new File(workingDir)).inheritIO(); + // TODO: Improve this to not pass arrays in the first place + String lastArg = String.join(" ", commands); + String[] commandsWithBash = commandToExecute(lastArg); + return new ProcessBuilder(commandsWithBash).directory(new File(workingDir)) + .inheritIO(); + } + + String[] commandToExecute(String lastArg) { + return new String[] { "/bin/bash", "-c", lastArg }; } @Override @@ -383,7 +391,7 @@ class CommandPicker { String groupId() { // makes more sense to use PomReader if (projectType == ProjectType.GRADLE) { - return "./gradlew groupId | tail -1"; + return "./gradlew groupId -q | tail -1"; } return "./mvnw -q" + " -Dexec.executable=\"echo\"" + " -Dexec.args=\"\\${project.groupId}\"" + " --non-recursive" @@ -445,7 +453,7 @@ class CommandPicker { if (command.contains(ReleaserProperties.Gradle.SYSTEM_PROPS_PLACEHOLDER)) { return command; } - return command + " " + ReleaserProperties.Maven.SYSTEM_PROPS_PLACEHOLDER; + return command + " " + ReleaserProperties.Gradle.SYSTEM_PROPS_PLACEHOLDER; } private String mavenCommandWithSystemProps(String command, ProjectVersion version, @@ -469,13 +477,13 @@ class CommandPicker { String trimmedCommand = command.trim(); if (version.isMilestone() || version.isRc()) { log.info("Adding the milestone profile to the Maven build"); - return trimmedCommand + " " + MavenProfile.MILESTONE.asMavenProfile() - + profilesToString(profiles); + return withProfile(trimmedCommand, MavenProfile.MILESTONE.asMavenProfile(), + profiles); } else if (version.isRelease() || version.isServiceRelease()) { log.info("Adding the central profile to the Maven build"); - return trimmedCommand + " " + MavenProfile.CENTRAL.asMavenProfile() - + profilesToString(profiles); + return withProfile(trimmedCommand, MavenProfile.CENTRAL.asMavenProfile(), + profiles); } else { log.info("The build is a snapshot one - will not add any profiles"); @@ -483,6 +491,18 @@ class CommandPicker { return trimmedCommand; } + private String withProfile(String command, String profile, MavenProfile... profiles) { + if (command.contains(ReleaserProperties.Maven.PROFILE_PROPS_PLACEHOLDER)) { + return command.replace(ReleaserProperties.Maven.PROFILE_PROPS_PLACEHOLDER, + profile + appendProfiles(profiles)); + } + return command + " " + profile + appendProfiles(profiles); + } + + private String appendProfiles(MavenProfile[] profiles) { + return profiles.length > 0 ? " " + profilesToString(profiles) : ""; + } + private String profilesToString(MavenProfile... profiles) { return Arrays.stream(profiles).map(profile -> "-P" + profile) .collect(Collectors.joining(" ")); diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/project/ProjectVersion.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/project/ProjectVersion.java index 7dc57493..5f9566c4 100644 --- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/project/ProjectVersion.java +++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/project/ProjectVersion.java @@ -73,8 +73,9 @@ public class ProjectVersion implements Comparable { } public ProjectVersion(File project) { - if (new File(project, "build.gradle").exists()) { - ProjectVersion projectVersion = gradleProject(project); + File buildGradle = new File(project, "build.gradle"); + if (buildGradle.exists()) { + ProjectVersion projectVersion = gradleProject(buildGradle); this.projectName = projectVersion.projectName; this.version = projectVersion.version; this.groupId = new ProjectCommandExecutor().groupId(); diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/project/Projects.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/project/Projects.java index 5c1811fc..141168fa 100644 --- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/project/Projects.java +++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/project/Projects.java @@ -76,7 +76,7 @@ public class Projects extends HashSet { } private static String additionalErrorMessage(String projectName) { - return "Either put it in the Spring Cloud Release project or set it via the [--releaser.fixed-versions[" + return "Either put it in the BOM or set it via the [--releaser.fixed-versions[" + projectName + "]=1.0.0.RELEASE] property"; } diff --git a/spring-cloud-release-tools-spring/src/main/java/org/springframework/cloud/release/internal/buildsystem/BuildsystemConfiguration.java b/spring-cloud-release-tools-spring/src/main/java/org/springframework/cloud/release/internal/buildsystem/BuildsystemConfiguration.java index b652f6a7..e40f24e5 100644 --- a/spring-cloud-release-tools-spring/src/main/java/org/springframework/cloud/release/internal/buildsystem/BuildsystemConfiguration.java +++ b/spring-cloud-release-tools-spring/src/main/java/org/springframework/cloud/release/internal/buildsystem/BuildsystemConfiguration.java @@ -40,7 +40,7 @@ class BuildsystemConfiguration { @Bean BomParser gradleBomParser() { - return new MavenBomParser(this.releaserProperties, this.customBomParsers); + return new GradleBomParser(this.releaserProperties, this.customBomParsers); } @Bean diff --git a/spring-cloud-release-tools-spring/src/main/java/org/springframework/cloud/release/internal/spring/SpringReleaser.java b/spring-cloud-release-tools-spring/src/main/java/org/springframework/cloud/release/internal/spring/SpringReleaser.java index 8215141d..84a0c207 100644 --- a/spring-cloud-release-tools-spring/src/main/java/org/springframework/cloud/release/internal/spring/SpringReleaser.java +++ b/spring-cloud-release-tools-spring/src/main/java/org/springframework/cloud/release/internal/spring/SpringReleaser.java @@ -248,9 +248,9 @@ public class SpringReleaser { } ProjectVersion versionFromBom; Projects projectsToUpdate; - log.info("Fetch from git [{}], meta release [{}]", + log.info("Fetch from git [{}], meta release [{}], project [{}]", this.properties.getGit().isFetchVersionsFromGit(), - this.properties.getMetaRelease().isEnabled()); + this.properties.getMetaRelease().isEnabled(), project); if (this.properties.getGit().isFetchVersionsFromGit() && !this.properties.getMetaRelease().isEnabled()) { printVersionRetrieval(); @@ -285,6 +285,7 @@ public class SpringReleaser { } ProjectsAndVersion processProject(Options options, File project, TaskType taskType) { + log.info("Processing the project in file [{}]", project); ProjectsAndVersion projectsAndVersion = projects(project); ProjectVersion originalVersion = new ProjectVersion(project); final Args defaultArgs = new Args(this.releaser, project, @@ -303,10 +304,8 @@ public class SpringReleaser { } private void printVersionRetrieval() { - log.info( - "\n\n\n=== RETRIEVING VERSIONS ===\n\nWill clone Spring Cloud Release" - + " to retrieve all versions for the branch [{}]", - this.properties.getPom().getBranch()); + log.info("\n\n\n=== RETRIEVING VERSIONS ===\n\nWill clone the bom" + + " to retrieve all versions"); } private void printSettingVersionFromFixedVersions(Projects projectsToUpdate) { diff --git a/spring-cloud-release-tools-spring/src/main/java/org/springframework/cloud/release/internal/spring/Tasks.java b/spring-cloud-release-tools-spring/src/main/java/org/springframework/cloud/release/internal/spring/Tasks.java index 1c343887..148c8d26 100644 --- a/spring-cloud-release-tools-spring/src/main/java/org/springframework/cloud/release/internal/spring/Tasks.java +++ b/spring-cloud-release-tools-spring/src/main/java/org/springframework/cloud/release/internal/spring/Tasks.java @@ -33,8 +33,8 @@ final class Tasks { throw new IllegalStateException("Can't instantiate a utility class"); } - static Task UPDATING_POMS = task("updatePoms", "u", "UPDATING POMS", - "Update poms with versions from Spring Cloud Release", + static Task UPDATING_POMS = task("updatePoms", "u", "UPDATING VERSIONS", + "Update versions from the BOM", args -> args.releaser.updateProjectFromBom(args.project, args.projects, args.versionFromScRelease)); static Task BUILD_PROJECT = task("build", "b", "BUILD PROJECT", "Build the project", diff --git a/spring-cloud-release-tools-spring/src/test/java/org/springframework/cloud/release/internal/spring/AcceptanceTests.java b/spring-cloud-release-tools-spring/src/test/java/org/springframework/cloud/release/internal/spring/AcceptanceTests.java index 685af2fa..7f37b1c1 100644 --- a/spring-cloud-release-tools-spring/src/test/java/org/springframework/cloud/release/internal/spring/AcceptanceTests.java +++ b/spring-cloud-release-tools-spring/src/test/java/org/springframework/cloud/release/internal/spring/AcceptanceTests.java @@ -44,7 +44,6 @@ import org.junit.rules.TemporaryFolder; import org.mockito.BDDMockito; import org.mockito.Mockito; -import org.springframework.boot.test.rule.OutputCapture; import org.springframework.cloud.release.cloud.docs.SpringCloudDocsAccessor; import org.springframework.cloud.release.cloud.github.SpringCloudGithubIssuesAccessor; import org.springframework.cloud.release.internal.Releaser; @@ -86,9 +85,6 @@ public class AcceptanceTests { @Rule public TemporaryFolder tmp = new TemporaryFolder(); - @Rule - public OutputCapture capture = new OutputCapture(); - TestPomReader testPomReader = new TestPomReader(); File springCloudConsulProject; @@ -135,6 +131,9 @@ public class AcceptanceTests { BDDMockito.given(this.saganClient.getProject(anyString())) .willReturn(newProject()); Task.stepSkipper = () -> false; + new File("/tmp/executed_build").delete(); + new File("/tmp/executed_deploy").delete(); + new File("/tmp/executed_docs").delete(); } @After @@ -362,8 +361,9 @@ public class AcceptanceTests { then(Arrays.asList("spring-cloud-starter-build", "spring-cloud-consul")) .contains(pom(project).getArtifactId()); - then(this.capture.toString()).contains("executed_build", - "executed_deploy", "executed_docs"); + then(new File("/tmp/executed_build")).exists(); + then(new File("/tmp/executed_deploy")).exists(); + then(new File("/tmp/executed_docs")).exists(); }); } @@ -375,9 +375,9 @@ public class AcceptanceTests { then(Arrays.asList("spring-cloud-starter-build", "spring-cloud-consul")) .contains(pom(project).getArtifactId()); - then(this.capture.toString()).contains("executed_build"); - then(this.capture.toString()).doesNotContain("executed_deploy", - "executed_docs"); + then(new File("/tmp/executed_build")).exists(); + then(new File("/tmp/executed_deploy")).doesNotExist(); + then(new File("/tmp/executed_docs")).doesNotExist(); }); } @@ -421,8 +421,9 @@ public class AcceptanceTests { .filter(file -> file.getName().equals("spring-cloud-consul")) .forEach(project -> { then(pom(project).getArtifactId()).isEqualTo("spring-cloud-consul"); - then(this.capture.toString()).contains("executed_build", - "executed_deploy", "executed_docs"); + then(new File("/tmp/executed_build")).exists(); + then(new File("/tmp/executed_deploy")).exists(); + then(new File("/tmp/executed_docs")).exists(); }); thenSaganWasCalled(); thenDocumentationWasUpdated(); @@ -449,8 +450,9 @@ public class AcceptanceTests { .forEach(project -> { then(Collections.singletonList("spring-cloud-consul")) .contains(pom(project).getArtifactId()); - then(this.capture.toString()).contains("executed_build", - "executed_deploy", "executed_docs"); + then(new File("/tmp/executed_build")).exists(); + then(new File("/tmp/executed_deploy")).exists(); + then(new File("/tmp/executed_docs")).exists(); }); thenSaganWasCalled(); thenDocumentationWasUpdated(); @@ -903,10 +905,12 @@ public class AcceptanceTests { file("/projects/spring-cloud-static-angel/").toURI().toString()); releaserProperties.getGit().setReleaseTrainBomUrl( file("/projects/spring-cloud-release/").toURI().toString()); - releaserProperties.getMaven().setBuildCommand("echo executed_build"); - releaserProperties.getMaven().setDeployCommand("echo executed_deploy"); releaserProperties.getMaven() - .setPublishDocsCommands(new String[] { "echo executed_docs" }); + .setBuildCommand("echo '{{profiles}}' > /tmp/executed_build"); + releaserProperties.getMaven() + .setDeployCommand("echo '{{profiles}}' > /tmp/executed_deploy"); + releaserProperties.getMaven().setPublishDocsCommands( + new String[] { "echo '{{profiles}}' > /tmp/executed_docs" }); releaserProperties.getMetaRelease() .setGitOrgUrl("file://" + this.temporaryFolder.getAbsolutePath()); releaserProperties.getMetaRelease().setEnabled(true);