diff --git a/pom.xml b/pom.xml
index 44b0737d..a44d78a8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
org.springframework.cloudspring-cloud-build
- 1.3.5.RELEASE
+ 1.3.7.RELEASE
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 c638f395..d218c918 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
@@ -89,8 +89,7 @@ public class Releaser {
ProjectVersion originalVersion = originalVersion(project);
log.info("Original project version is [{}]", originalVersion);
if ((scReleaseVersion.isRelease() || scReleaseVersion.isServiceRelease()) && originalVersion.isSnapshot()) {
- Projects newProjects = new Projects();
- newProjects.add(new ProjectVersion(originalVersion.projectName, originalVersion.bumpedVersion()));
+ Projects newProjects = Projects.forRollback(projects, originalVersion);
updateProjectFromScRelease(project, newProjects, originalVersion, SKIP_SNAPSHOT_ASSERTION);
this.projectGitHandler.commitAfterBumpingVersions(project, originalVersion);
log.info("\nSuccessfully reverted the commit and bumped snapshot versions");
diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/PomUpdater.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/PomUpdater.java
index 3d93fafe..b9999bda 100644
--- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/PomUpdater.java
+++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/PomUpdater.java
@@ -170,18 +170,11 @@ class PomUpdater {
private List updateParentIfPossible(ModelWrapper wrapper, Versions versions,
Model model, List sourceChanges) {
String rootProjectName = wrapper.projectName();
- String rootProjectGroupId = wrapper.groupId();
List changes = new ArrayList<>(sourceChanges);
if (model.getParent() == null || isEmpty(model.getParent().getVersion())) {
log.debug("Can't set the value for parent... Will return {}", sourceChanges);
return changes;
}
- boolean skipDeployment = hasSkipDeployment(model);
- if (!skipDeployment && model.getGroupId() != null && !model.getGroupId().equals(rootProjectGroupId)) {
- log.info("Will not update the project's [{}] parent [{}] since its group id [{}] is not equal the parent group id [{}]",
- model.getArtifactId(), model.getParent().getArtifactId(), model.getGroupId(), rootProjectGroupId);
- return changes;
- }
String parentGroupId = model.getParent().getGroupId();
String parentArtifactId = model.getParent().getArtifactId();
log.debug("Searching for a version of parent [{}:{}]", parentGroupId, parentArtifactId);
diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/ProjectPomUpdater.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/ProjectPomUpdater.java
index e0b53281..4f8b3d94 100644
--- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/ProjectPomUpdater.java
+++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/ProjectPomUpdater.java
@@ -38,7 +38,7 @@ import org.springframework.cloud.release.internal.git.ProjectGitHandler;
*/
public class ProjectPomUpdater {
- private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+ private static final Logger log = LoggerFactory.getLogger(ProjectPomUpdater.class);
private final ReleaserProperties properties;
private final ProjectGitHandler gitRepo;
diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/ProjectVersion.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/ProjectVersion.java
index eac58003..9bcb75da 100644
--- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/ProjectVersion.java
+++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/ProjectVersion.java
@@ -1,6 +1,7 @@
package org.springframework.cloud.release.internal.pom;
import java.io.File;
+import java.util.Objects;
import org.apache.maven.model.Model;
import org.springframework.util.StringUtils;
@@ -85,4 +86,17 @@ public class ProjectVersion {
@Override public String toString() {
return this.version;
}
+
+ @Override public boolean equals(Object o) {
+ if (this == o)
+ return true;
+ if (o == null || getClass() != o.getClass())
+ return false;
+ ProjectVersion that = (ProjectVersion) o;
+ return Objects.equals(this.projectName, that.projectName);
+ }
+
+ @Override public int hashCode() {
+ return Objects.hash(this.projectName);
+ }
}
diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/Projects.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/Projects.java
index f5d1a1d0..6b51710d 100644
--- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/Projects.java
+++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/Projects.java
@@ -3,7 +3,9 @@ package org.springframework.cloud.release.internal.pom;
import java.io.File;
import java.util.Arrays;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
+import java.util.stream.Collectors;
/**
* Abstraction over collection of projects
@@ -21,6 +23,14 @@ public class Projects extends HashSet {
addAll(new HashSet<>(Arrays.asList(versions)));
}
+ public static Projects forRollback(Projects projects, ProjectVersion originalVersion) {
+ Projects newProjects = new Projects();
+ newProjects.add(new ProjectVersion(originalVersion.projectName, originalVersion.bumpedVersion()));
+ newProjects.addAll(projects.forNameStartingWith(SpringCloudConstants.SPRING_BOOT));
+ newProjects.add(projects.forName(SpringCloudConstants.BUILD_ARTIFACT_ID));
+ return newProjects;
+ }
+
public void remove(String projectName) {
ProjectVersion projectVersion = forName(projectName);
remove(projectVersion);
@@ -34,8 +44,20 @@ public class Projects extends HashSet {
}
private static IllegalStateException exception(String projectName) {
- return new IllegalStateException("Project with name [" + projectName + "] is not present. "
- + "Either put it in the Spring Cloud Release project or set it via the [--releaser.fixed-versions[" + projectName + "]=1.0.0.RELEASE] property");
+ return new IllegalStateException(
+ "Project with name [" + projectName + "] is not present. "
+ + additionalErrorMessage(projectName));
+ }
+
+ private static IllegalStateException exceptionStartingWithName(String projectName) {
+ return new IllegalStateException(
+ "Project starting with name [" + projectName + "] is not present. "
+ + additionalErrorMessage(projectName));
+ }
+
+ private static String additionalErrorMessage(String projectName) {
+ return "Either put it in the Spring Cloud Release project or set it via the [--releaser.fixed-versions["
+ + projectName + "]=1.0.0.RELEASE] property";
}
public ProjectVersion forName(String projectName) {
@@ -44,6 +66,11 @@ public class Projects extends HashSet {
.orElseThrow(() -> exception(projectName));
}
+ public List forNameStartingWith(String projectName) {
+ return this.stream().filter(projectVersion -> projectVersion.projectName.startsWith(projectName))
+ .collect(Collectors.toList());
+ }
+
public boolean containsSnapshots() {
return this.stream().anyMatch(ProjectVersion::isSnapshot);
}
diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/SCReleasePomParser.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/SCReleasePomParser.java
index 77d134a8..f54cf491 100644
--- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/SCReleasePomParser.java
+++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/SCReleasePomParser.java
@@ -75,8 +75,9 @@ class SCReleasePomParser {
Model model = pom(this.bootPom);
String bootArtifactId = model.getParent().getArtifactId();
log.debug("Boot artifact id is equal to [{}]", bootArtifactId);
- if (!SpringCloudConstants.BOOT_STARTER_ARTIFACT_ID.equals(bootArtifactId)) {
- throw new IllegalStateException("The pom doesn't have a [" + SpringCloudConstants.BOOT_STARTER_ARTIFACT_ID + "] artifact id");
+ if (!SpringCloudConstants.BOOT_STARTER_PARENT_ARTIFACT_ID.equals(bootArtifactId)) {
+ throw new IllegalStateException("The pom doesn't have a [" + SpringCloudConstants.BOOT_STARTER_PARENT_ARTIFACT_ID
+ + "] artifact id");
}
String bootVersion = model.getParent().getVersion();
log.debug("Boot version is equal to [{}]", bootVersion);
diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/SpringCloudConstants.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/SpringCloudConstants.java
index b607722e..a06a2927 100644
--- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/SpringCloudConstants.java
+++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/SpringCloudConstants.java
@@ -20,7 +20,9 @@ package org.springframework.cloud.release.internal.pom;
* @author Marcin Grzejszczak
*/
final class SpringCloudConstants {
- static final String BOOT_STARTER_ARTIFACT_ID = "spring-boot-starter-parent";
+ static final String SPRING_BOOT = "spring-boot";
+ static final String BOOT_STARTER_ARTIFACT_ID = "spring-boot-starter";
+ static final String BOOT_STARTER_PARENT_ARTIFACT_ID = BOOT_STARTER_ARTIFACT_ID + "-parent";
static final String BOOT_DEPENDENCIES_ARTIFACT_ID = "spring-boot-dependencies";
static final String CLOUD_DEPENDENCIES_ARTIFACT_ID = "spring-cloud-dependencies-parent";
static final String BUILD_ARTIFACT_ID = "spring-cloud-build";
diff --git a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/Versions.java b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/Versions.java
index cad89b4d..a48edeac 100644
--- a/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/Versions.java
+++ b/spring-cloud-release-tools-core/src/main/java/org/springframework/cloud/release/internal/pom/Versions.java
@@ -21,7 +21,7 @@ import java.util.Set;
import java.util.stream.Collectors;
import static org.springframework.cloud.release.internal.pom.SpringCloudConstants.BOOT_DEPENDENCIES_ARTIFACT_ID;
-import static org.springframework.cloud.release.internal.pom.SpringCloudConstants.BOOT_STARTER_ARTIFACT_ID;
+import static org.springframework.cloud.release.internal.pom.SpringCloudConstants.BOOT_STARTER_PARENT_ARTIFACT_ID;
import static org.springframework.cloud.release.internal.pom.SpringCloudConstants.BUILD_ARTIFACT_ID;
import static org.springframework.cloud.release.internal.pom.SpringCloudConstants.CLOUD_DEPENDENCIES_ARTIFACT_ID;
@@ -42,7 +42,7 @@ class Versions {
Versions(String bootVersion) {
this.bootVersion = bootVersion;
this.projects.add(new Project(SPRING_BOOT_PROJECT_NAME, bootVersion));
- this.projects.add(new Project(BOOT_STARTER_ARTIFACT_ID, bootVersion));
+ this.projects.add(new Project(BOOT_STARTER_PARENT_ARTIFACT_ID, bootVersion));
this.projects.add(new Project(BOOT_DEPENDENCIES_ARTIFACT_ID, bootVersion));
}
@@ -57,7 +57,7 @@ class Versions {
this.bootVersion = bootVersion;
this.scBuildVersion = scBuildVersion;
this.projects.add(new Project(SPRING_BOOT_PROJECT_NAME, bootVersion));
- this.projects.add(new Project(BOOT_STARTER_ARTIFACT_ID, bootVersion));
+ this.projects.add(new Project(BOOT_STARTER_PARENT_ARTIFACT_ID, bootVersion));
this.projects.add(new Project(BOOT_DEPENDENCIES_ARTIFACT_ID, bootVersion));
this.projects.add(new Project(BUILD_ARTIFACT_ID, scBuildVersion));
this.projects.add(new Project(CLOUD_DEPENDENCIES_ARTIFACT_ID, scBuildVersion));
@@ -101,25 +101,30 @@ class Versions {
if (project.name.equals(projectName)) {
return true;
}
- boolean containsParent = projectName.endsWith("-parent");
- if (!containsParent) {
+ boolean parent = nameWithSuffix(projectName, "-parent", project);
+ return parent || nameWithSuffix(projectName, "-dependencies", project);
+ }
+
+ private boolean nameWithSuffix(String projectName, String suffix, Project project) {
+ boolean containsSuffix = projectName.endsWith(suffix);
+ if (!containsSuffix) {
return false;
}
- String withoutParent = projectName.substring(0, projectName.indexOf("-parent"));
- return project.name.equals(withoutParent);
+ String withoutSuffix = projectName.substring(0, projectName.indexOf(suffix));
+ return project.name.equals(withoutSuffix);
}
Versions setVersion(String projectName, String version) {
switch (projectName) {
case SPRING_BOOT_PROJECT_NAME:
- case BOOT_STARTER_ARTIFACT_ID:
+ case BOOT_STARTER_PARENT_ARTIFACT_ID:
case BOOT_DEPENDENCIES_ARTIFACT_ID:
this.bootVersion = version;
remove(SPRING_BOOT_PROJECT_NAME);
remove(BOOT_DEPENDENCIES_ARTIFACT_ID);
- remove(BOOT_STARTER_ARTIFACT_ID);
+ remove(BOOT_STARTER_PARENT_ARTIFACT_ID);
this.projects.add(new Project(SPRING_BOOT_PROJECT_NAME, version));
- this.projects.add(new Project(BOOT_STARTER_ARTIFACT_ID, version));
+ this.projects.add(new Project(BOOT_STARTER_PARENT_ARTIFACT_ID, version));
this.projects.add(new Project(BOOT_DEPENDENCIES_ARTIFACT_ID, version));
break;
case BUILD_ARTIFACT_ID:
diff --git a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/ReleaserTests.java b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/ReleaserTests.java
index dc47eef2..93e24a99 100644
--- a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/ReleaserTests.java
+++ b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/ReleaserTests.java
@@ -90,7 +90,9 @@ public class ReleaserTests {
ProjectVersion scReleaseVersion = new ProjectVersion("changed", "1.0.0.RELEASE");
releaser(() -> new ProjectVersion("original", "1.0.0.BUILD-SNAPSHOT"))
.rollbackReleaseVersion(this.pom,
- new Projects(new ProjectVersion("changed", "1.0.0.RELEASE")),
+ new Projects(new ProjectVersion("changed", "1.0.0.RELEASE"),
+ new ProjectVersion("spring-cloud-build", "2.0.0.RELEASE"),
+ new ProjectVersion("spring-boot-starter", "3.0.0.RELEASE")),
scReleaseVersion);
BDDAssertions.then(this.outputCapture.toString())
diff --git a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/pom/PomUpdaterTests.java b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/pom/PomUpdaterTests.java
index e7696e69..53c117b2 100644
--- a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/pom/PomUpdaterTests.java
+++ b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/pom/PomUpdaterTests.java
@@ -172,6 +172,23 @@ public class PomUpdaterTests {
.containsEntry("foo.version", "1.2.0.BUILD-SNAPSHOT");
}
+ @Test
+ public void should_update_the_parent_from_properties_even_if_group_ids_dont_match() throws Exception {
+ File originalPom = pom("/projects/project/children", "pom_different_group_boot_parent.xml");
+ File pomInTemp = tmpFile("/project/children/pom_different_group_boot_parent.xml");
+ ModelWrapper rootPom = model("spring-cloud-sleuth", "org.springframework.cloud");
+ ModelWrapper model = this.pomUpdater.updateModel(rootPom, pomInTemp, this.versions);
+
+ File storedPom = this.pomUpdater.overwritePomIfDirty(model, this.versions, pomInTemp);
+
+ BDDAssertions.then(asString(storedPom)).isNotEqualTo(asString(originalPom));
+ Model overriddenPomModel = this.pomReader.readPom(storedPom);
+ BDDAssertions.then(overriddenPomModel.getVersion()).isEqualTo("0.0.3.BUILD-SNAPSHOT");
+ BDDAssertions.then(overriddenPomModel.getParent().getVersion()).isEqualTo("0.0.1");
+ BDDAssertions.then(overriddenPomModel.getProperties())
+ .containsEntry("spring-cloud-sleuth.version", "0.0.3.BUILD-SNAPSHOT");
+ }
+
@Test
public void should_only_update_the_properties_section_when_group_ids_dont_match_and_there_is_no_skip_deployment() throws Exception {
File originalPom = pom("/projects/project/children", "pom_different_group.xml");
@@ -245,7 +262,7 @@ public class PomUpdaterTests {
}
@Test
- public void should_not_update_the_project_if_group_doesnt_match() throws Exception {
+ public void should_update_boot_parent_even_if_the_project_group_doesnt_match() throws Exception {
File originalPom = pom("/projects/project/children", "pom_case_from_contract.xml");
File pomInTemp = tmpFile("/project/children/pom_case_from_contract.xml");
ModelWrapper rootPom = model("spring-cloud-contract", "org.springframework.cloud");
@@ -253,7 +270,10 @@ public class PomUpdaterTests {
File storedPom = this.pomUpdater.overwritePomIfDirty(model, this.versions, pomInTemp);
- BDDAssertions.then(asString(storedPom)).isEqualTo(asString(originalPom));
+ BDDAssertions.then(asString(storedPom)).isNotEqualTo(asString(originalPom));
+ Model overriddenPomModel = this.pomReader.readPom(storedPom);
+ BDDAssertions.then(overriddenPomModel.getParent().getVersion()).isEqualTo("0.0.1");
+
}
@Test
diff --git a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/pom/ProjectsTests.java b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/pom/ProjectsTests.java
index 9e3ed744..93ee42fc 100644
--- a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/pom/ProjectsTests.java
+++ b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/pom/ProjectsTests.java
@@ -35,6 +35,36 @@ public class ProjectsTests {
then(projects.forName("spring-cloud-starter-build").version).isEqualTo("1.0.0");
}
+ @Test
+ public void should_find_projects_starting_with_name() {
+ Set projectVersions = new HashSet<>();
+ projectVersions.add(new ProjectVersion("spring-boot-starter-build", "1.0.0"));
+ Projects projects = new Projects(projectVersions);
+
+ then(projects.forNameStartingWith("spring-boot").get(0).version).isEqualTo("1.0.0");
+ }
+
+ @Test
+ public void should_create_project_with_bumped_original_version_and_original_parent_versions() {
+ Set projectVersions = new HashSet<>();
+ ProjectVersion build = new ProjectVersion("spring-cloud-build", "1.0.0");
+ projectVersions.add(build);
+ ProjectVersion boot = new ProjectVersion("spring-boot-starter", "2.0.0");
+ projectVersions.add(boot);
+ ProjectVersion bootDeps = new ProjectVersion("spring-boot-dependencies", "2.0.0");
+ projectVersions.add(bootDeps);
+ ProjectVersion original = new ProjectVersion("spring-cloud-starter-foo", "3.0.0.BUILD-SNAPSHOT");
+ projectVersions.add(original);
+ Projects projects = new Projects(projectVersions);
+
+ Projects forRollback = Projects.forRollback(projects, original);
+
+ then(forRollback.forName("spring-cloud-build").version).isEqualTo("1.0.0");
+ then(forRollback.forName("spring-boot-starter").version).isEqualTo("2.0.0");
+ then(forRollback.forName("spring-boot-dependencies").version).isEqualTo("2.0.0");
+ then(forRollback.forName("spring-cloud-starter-foo").version).isEqualTo("3.0.1.BUILD-SNAPSHOT");
+ }
+
@Test
public void should_remove_a_project_by_name() {
Set projectVersions = new HashSet<>();
@@ -88,6 +118,15 @@ public class ProjectsTests {
.hasMessageContaining("Project with name [spring-cloud-starter-build] is not present");
}
+ @Test
+ public void should_return_empty_list_when_project_is_not_present_when_searching_by_starting_with_name() {
+ Set projectVersions = new HashSet<>();
+ projectVersions.add(new ProjectVersion("foo-bar-baz", "1.0.0"));
+ Projects projects = new Projects(projectVersions);
+
+ then(projects.forNameStartingWith("asd")).isEmpty();
+ }
+
private File file(String relativePath) {
try {
return new File(ProjectsTests.class.getResource(relativePath).toURI());
diff --git a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/pom/VersionsTests.java b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/pom/VersionsTests.java
index cea26ddd..0b0a2270 100644
--- a/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/pom/VersionsTests.java
+++ b/spring-cloud-release-tools-core/src/test/java/org/springframework/cloud/release/internal/pom/VersionsTests.java
@@ -51,6 +51,11 @@ public class VersionsTests {
then(this.versions.shouldBeUpdated("foo-parent")).isTrue();
}
+ @Test
+ public void should_return_true_when_project_has_a_dependencies_suffix_and_project_is_on_the_list() {
+ then(this.versions.shouldBeUpdated("foo-dependencies")).isTrue();
+ }
+
@Test
public void should_return_false_when_project_is_not_on_the_list() {
then(this.versions.shouldBeUpdated("missing")).isFalse();
diff --git a/spring-cloud-release-tools-core/src/test/resources/projects/project/children/pom_different_group.xml b/spring-cloud-release-tools-core/src/test/resources/projects/project/children/pom_different_group.xml
index 1607f71b..26555ecc 100644
--- a/spring-cloud-release-tools-core/src/test/resources/projects/project/children/pom_different_group.xml
+++ b/spring-cloud-release-tools-core/src/test/resources/projects/project/children/pom_different_group.xml
@@ -28,8 +28,8 @@
Spring Cloud Contract Verifier Http Server Sample
- org.springframework.boot
- spring-boot-starter-parent
+ org.foo.bar
+ foo-bar1.5.8.RELEASE
diff --git a/spring-cloud-release-tools-core/src/test/resources/projects/project/children/pom_different_group_boot_parent.xml b/spring-cloud-release-tools-core/src/test/resources/projects/project/children/pom_different_group_boot_parent.xml
new file mode 100644
index 00000000..63c881c8
--- /dev/null
+++ b/spring-cloud-release-tools-core/src/test/resources/projects/project/children/pom_different_group_boot_parent.xml
@@ -0,0 +1,37 @@
+
+
+
+
+ 4.0.0
+
+ org.springframework.cloud
+ spring-cloud-sleuth
+ 1.3.1.BUILD-SNAPSHOT
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 1.5.8.RELEASE
+
+
+
+
+ 1.3.1.BUILD-SNAPSHOT
+
+
diff --git a/spring-cloud-release-tools-spring/src/test/java/org/springframework/cloud/release/internal/pom/TestUtils.java b/spring-cloud-release-tools-spring/src/test/java/org/springframework/cloud/release/internal/pom/TestUtils.java
index 7e9cb4e7..f2fc8151 100644
--- a/spring-cloud-release-tools-spring/src/test/java/org/springframework/cloud/release/internal/pom/TestUtils.java
+++ b/spring-cloud-release-tools-spring/src/test/java/org/springframework/cloud/release/internal/pom/TestUtils.java
@@ -11,6 +11,7 @@ public class TestUtils {
prepareLocalRepo("target/test-classes/projects/", "spring-cloud-release");
prepareLocalRepo("target/test-classes/projects/", "spring-cloud-release-with-snapshot");
prepareLocalRepo("target/test-classes/projects/", "spring-cloud-consul");
+ prepareLocalRepo("target/test-classes/projects/", "spring-cloud-build");
}
private static void prepareLocalRepo(String buildDir, String repoPath) throws IOException {
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 99a30747..5e222745 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
@@ -57,10 +57,11 @@ public class AcceptanceTests {
public void should_fail_to_perform_a_release_of_consul_when_sc_release_contains_snapshots() throws Exception {
File origin = GitTestUtils.clonedProject(this.tmp.newFolder(), this.springCloudConsulProject);
pomVersionIsEqualTo(origin, "1.2.0.BUILD-SNAPSHOT");
- pomParentVersionIsEqualTo(origin, "1.2.0.BUILD-SNAPSHOT");
+ consulPomParentVersionIsEqualTo(origin, "1.2.0.BUILD-SNAPSHOT");
File project = GitTestUtils.clonedProject(this.tmp.newFolder(), tmpFile("spring-cloud-consul"));
GitTestUtils.setOriginOnProjectToTmp(origin, project);
- SpringReleaser releaser = releaserWithSnapshotScRelease(project, "vCamden.SR5.BROKEN", "1.1.2.RELEASE");
+ SpringReleaser releaser = releaserWithSnapshotScRelease(project, "spring-cloud-consul",
+ "vCamden.SR5.BROKEN", "1.1.2.RELEASE");
BDDAssertions.thenThrownBy(releaser::release)
.hasMessageContaining("there is at least one SNAPSHOT library version in the Spring Cloud Release project");
@@ -70,10 +71,10 @@ public class AcceptanceTests {
public void should_perform_a_release_of_consul() throws Exception {
File origin = GitTestUtils.clonedProject(this.tmp.newFolder(), this.springCloudConsulProject);
pomVersionIsEqualTo(origin, "1.2.0.BUILD-SNAPSHOT");
- pomParentVersionIsEqualTo(origin, "1.2.0.BUILD-SNAPSHOT");
+ consulPomParentVersionIsEqualTo(origin, "1.2.0.BUILD-SNAPSHOT");
File project = GitTestUtils.clonedProject(this.tmp.newFolder(), tmpFile("spring-cloud-consul"));
GitTestUtils.setOriginOnProjectToTmp(origin, project);
- SpringReleaser releaser = releaser(project, "vCamden.SR5", "1.1.2.RELEASE");
+ SpringReleaser releaser = releaser(project, "spring-cloud-consul","vCamden.SR5", "1.1.2.RELEASE");
releaser.release();
@@ -84,7 +85,7 @@ public class AcceptanceTests {
commitIsPresent(iterator, "Going back to snapshots");
commitIsPresent(iterator, "Update SNAPSHOT to 1.1.2.RELEASE");
pomVersionIsEqualTo(project, "1.2.1.BUILD-SNAPSHOT");
- pomParentVersionIsEqualTo(project, "1.2.1.BUILD-SNAPSHOT");
+ consulPomParentVersionIsEqualTo(project, "1.2.1.BUILD-SNAPSHOT");
then(this.gitHandler.closedMilestones).isTrue();
then(emailTemplate()).exists();
then(emailTemplateContents())
@@ -105,14 +106,49 @@ public class AcceptanceTests {
BDDMockito.then(this.saganClient).should().deleteRelease("spring-cloud-consul", "1.1.2.BUILD-SNAPSHOT");
}
+ // issue #74
+ @Test
+ public void should_perform_a_release_of_sc_build() throws Exception {
+ File origin = GitTestUtils.clonedProject(this.tmp.newFolder(),
+ new File(AcceptanceTests.class.getResource("/projects/spring-cloud-build").toURI()));
+ pomVersionIsEqualTo(origin, "1.3.7.BUILD-SNAPSHOT");
+ pomParentVersionIsEqualTo(origin, "spring-cloud-build-dependencies", "1.5.9.RELEASE");
+ File project = GitTestUtils.clonedProject(this.tmp.newFolder(), tmpFile("spring-cloud-build"));
+ GitTestUtils.setOriginOnProjectToTmp(origin, project);
+ SpringReleaser releaser = releaser(project, "spring-cloud-build",
+ "vCamden.SR5", "1.2.2.RELEASE");
+
+ releaser.release();
+
+ Iterable commits = listOfCommits(project);
+ Iterator iterator = commits.iterator();
+ tagIsPresentInOrigin(origin, "v1.2.2.RELEASE");
+ // we're running against camden sc-release
+ commitIsPresent(iterator, "Bumping versions to 1.3.8.BUILD-SNAPSHOT after release");
+ commitIsPresent(iterator, "Going back to snapshots");
+ commitIsPresent(iterator, "Update SNAPSHOT to 1.2.2.RELEASE");
+ pomVersionIsEqualTo(project, "1.3.8.BUILD-SNAPSHOT");
+ pomParentVersionIsEqualTo(project, "spring-cloud-build-dependencies", "1.4.4.RELEASE");
+ then(this.gitHandler.closedMilestones).isTrue();
+ then(emailTemplate()).exists();
+ then(blogTemplate()).exists();
+ then(releaseNotesTemplate()).exists();
+ // once for updating GA
+ // second time to update SNAPSHOT
+ BDDMockito.then(this.saganClient).should(BDDMockito.times(2)).updateRelease(BDDMockito.eq("spring-cloud-build"),
+ BDDMockito.anyList());
+ BDDMockito.then(this.saganClient).should()
+ .deleteRelease("spring-cloud-build", "1.2.2.BUILD-SNAPSHOT");
+ }
+
@Test
public void should_perform_a_release_of_consul_rc1() throws Exception {
File origin = GitTestUtils.clonedProject(this.tmp.newFolder(), this.springCloudConsulProject);
pomVersionIsEqualTo(origin, "1.2.0.BUILD-SNAPSHOT");
- pomParentVersionIsEqualTo(origin, "1.2.0.BUILD-SNAPSHOT");
+ consulPomParentVersionIsEqualTo(origin, "1.2.0.BUILD-SNAPSHOT");
File project = GitTestUtils.clonedProject(this.tmp.newFolder(), tmpFile("spring-cloud-consul"));
GitTestUtils.setOriginOnProjectToTmp(origin, project);
- SpringReleaser releaser = releaser(project, "Dalston.RC1", "1.2.0.RC1");
+ SpringReleaser releaser = releaser(project, "spring-cloud-consul", "Dalston.RC1", "1.2.0.RC1");
releaser.release();
@@ -123,7 +159,7 @@ public class AcceptanceTests {
commitIsPresent(iterator, "Going back to snapshots");
commitIsPresent(iterator, "Update SNAPSHOT to 1.2.0.RC1");
pomVersionIsEqualTo(project, "1.2.0.BUILD-SNAPSHOT");
- pomParentVersionIsEqualTo(project, "1.2.0.BUILD-SNAPSHOT");
+ consulPomParentVersionIsEqualTo(project, "1.2.0.BUILD-SNAPSHOT");
then(this.gitHandler.closedMilestones).isTrue();
then(emailTemplate()).exists();
then(emailTemplateContents())
@@ -148,10 +184,10 @@ public class AcceptanceTests {
public void should_generate_templates_only() throws Exception {
File origin = GitTestUtils.clonedProject(this.tmp.newFolder(), this.springCloudConsulProject);
pomVersionIsEqualTo(origin, "1.2.0.BUILD-SNAPSHOT");
- pomParentVersionIsEqualTo(origin, "1.2.0.BUILD-SNAPSHOT");
+ consulPomParentVersionIsEqualTo(origin, "1.2.0.BUILD-SNAPSHOT");
File project = GitTestUtils.clonedProject(this.tmp.newFolder(), tmpFile("spring-cloud-consul"));
GitTestUtils.setOriginOnProjectToTmp(origin, project);
- SpringReleaser releaser = templateOnlyReleaser(project, "Dalston.RC1", "1.2.0.RC1");
+ SpringReleaser releaser = templateOnlyReleaser(project, "spring-cloud-consul","Dalston.RC1", "1.2.0.RC1");
releaser.release();
@@ -179,11 +215,15 @@ public class AcceptanceTests {
return GitTestUtils.openGitProject(project).log().call();
}
- private void pomParentVersionIsEqualTo(File project, String expected) {
- then(pom(new File(project, "spring-cloud-starter-consul")).getParent()
+ private void pomParentVersionIsEqualTo(File project, String child, String expected) {
+ then(pom(new File(project, child)).getParent()
.getVersion()).isEqualTo(expected);
}
+ private void consulPomParentVersionIsEqualTo(File project, String expected) {
+ pomParentVersionIsEqualTo(project, "spring-cloud-starter-consul", expected);
+ }
+
private void pomVersionIsEqualTo(File project, String expected) {
then(pom(project).getVersion()).isEqualTo(expected);
}
@@ -242,14 +282,15 @@ public class AcceptanceTests {
return new String(Files.readAllBytes(releaseNotesTemplate().toPath()));
}
- private SpringReleaser releaser(File projectFile, String branch, String expectedVersion) throws Exception {
+ private SpringReleaser releaser(File projectFile, String projectName,
+ String branch, String expectedVersion) throws Exception {
ReleaserProperties properties = releaserProperties(projectFile, branch);
- return releaserWithFullDeployment(expectedVersion, properties);
+ return releaserWithFullDeployment(expectedVersion, projectName, properties);
}
private SpringReleaser releaserWithFullDeployment(String expectedVersion,
- ReleaserProperties properties) throws Exception {
- Releaser releaser = defaultReleaser(expectedVersion, properties);
+ String projectName, ReleaserProperties properties) throws Exception {
+ Releaser releaser = defaultReleaser(expectedVersion, projectName, properties);
return new SpringReleaser(releaser, properties, new OptionsProcessor(releaser, properties) {
@Override String chosenOption() {
return "0";
@@ -257,14 +298,15 @@ public class AcceptanceTests {
});
}
- private SpringReleaser releaserWithSnapshotScRelease(File projectFile, String branch, String expectedVersion) throws Exception {
+ private SpringReleaser releaserWithSnapshotScRelease(File projectFile, String projectName,
+ String branch, String expectedVersion) throws Exception {
ReleaserProperties properties = snapshotScReleaseReleaserProperties(projectFile, branch);
- return releaserWithFullDeployment(expectedVersion, properties);
+ return releaserWithFullDeployment(expectedVersion, projectName, properties);
}
- private SpringReleaser templateOnlyReleaser(File projectFile, String branch, String expectedVersion) throws Exception {
+ private SpringReleaser templateOnlyReleaser(File projectFile, String projectName, String branch, String expectedVersion) throws Exception {
ReleaserProperties properties = releaserProperties(projectFile, branch);
- Releaser releaser = defaultReleaser(expectedVersion, properties);
+ Releaser releaser = defaultReleaser(expectedVersion, projectName, properties);
return new SpringReleaser(releaser, properties, new OptionsProcessor(releaser, properties) {
@Override String chosenOption() {
return "10";
@@ -272,11 +314,12 @@ public class AcceptanceTests {
});
}
- private Releaser defaultReleaser(String expectedVersion, ReleaserProperties properties) throws Exception {
+ private Releaser defaultReleaser(String expectedVersion, String projectName,
+ ReleaserProperties properties) throws Exception {
ProjectPomUpdater pomUpdater = new ProjectPomUpdater(properties);
ProjectBuilder projectBuilder = new ProjectBuilder(properties);
TestProjectGitHandler handler = new TestProjectGitHandler(properties,
- expectedVersion);
+ expectedVersion, projectName);
TemplateGenerator templateGenerator = new TemplateGenerator(properties, handler);
GradleUpdater gradleUpdater = new GradleUpdater(properties);
SaganUpdater saganUpdater = new SaganUpdater(this.saganClient);
@@ -307,15 +350,17 @@ public class AcceptanceTests {
boolean closedMilestones = false;
final String expectedVersion;
+ final String projectName;
public TestProjectGitHandler(ReleaserProperties properties,
- String expectedVersion) {
+ String expectedVersion, String projectName) {
super(properties);
this.expectedVersion = expectedVersion;
+ this.projectName = projectName;
}
@Override public void closeMilestone(ProjectVersion releaseVersion) {
- then(releaseVersion.projectName).isEqualTo("spring-cloud-consul");
+ then(releaseVersion.projectName).isEqualTo(this.projectName);
then(releaseVersion.version).isEqualTo(this.expectedVersion);
this.closedMilestones = true;
}
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/.gitignore b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/.gitignore
new file mode 100644
index 00000000..665c6e92
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/.gitignore
@@ -0,0 +1,18 @@
+*~
+#*
+*#
+.#*
+.classpath
+.project
+.settings
+.springBeans
+.gradle
+build
+bin
+target/
+asciidoctor.css
+_site/
+*.swp
+.idea
+*.iml
+.factorypath
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/.settings.xml b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/.settings.xml
new file mode 100644
index 00000000..6c355129
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/.settings.xml
@@ -0,0 +1,66 @@
+
+
+
+
+ repo.spring.io
+ ${env.CI_DEPLOY_USERNAME}
+ ${env.CI_DEPLOY_PASSWORD}
+
+
+
+
+
+ spring
+ true
+
+
+ spring-snapshots
+ Spring Snapshots
+ http://repo.spring.io/libs-snapshot-local
+
+ true
+
+
+
+ spring-milestones
+ Spring Milestones
+ http://repo.spring.io/libs-milestone-local
+
+ false
+
+
+
+ spring-releases
+ Spring Releases
+ http://repo.spring.io/release
+
+ false
+
+
+
+
+
+ spring-snapshots
+ Spring Snapshots
+ http://repo.spring.io/libs-snapshot-local
+
+ true
+
+
+
+ spring-milestones
+ Spring Milestones
+ http://repo.spring.io/libs-milestone-local
+
+ false
+
+
+
+
+
+
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/.travis.yml b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/.travis.yml
new file mode 100644
index 00000000..f8d83069
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/.travis.yml
@@ -0,0 +1,26 @@
+sudo: false
+language: java
+before_install:
+ - echo Using MVN_GOAL=${MVN_GOAL} for SPRING_CLOUD_BUILD=${SPRING_CLOUD_BUILD}
+ - git config user.name "$GIT_NAME"
+ - git config user.email "$GIT_EMAIL"
+ - git config credential.helper "store --file=.git/credentials"
+ - echo "https://$GH_TOKEN:@github.com" > .git/credentials
+ - gem install asciidoctor
+install:
+- ./mvnw install -P docs -q -U -DskipTests=true -Dmaven.test.redirectTestOutputToFile=true
+- '[ "${MVN_GOAL}" == "deploy" ] && ./docs/src/main/asciidoc/ghpages.sh || echo "Not updating docs"'
+script:
+- './mvnw -s .settings.xml $MVN_GOAL $MVN_PROFILE -nsu -Dmaven.test.redirectTestOutputToFile=true'
+env:
+ global:
+ - GIT_NAME="Dave Syer"
+ - GIT_EMAIL=dsyer@pivotal.io
+ - CI_DEPLOY_USERNAME=buildmaster
+ - FEATURE_BRANCH=$(echo ${TRAVIS_BRANCH} | grep "^.*/.*$" && echo true || echo false)
+ - SPRING_CLOUD_BUILD=$(echo ${TRAVIS_REPO_SLUG} | grep -q "^spring-cloud/.*$" && echo true || echo false)
+ - MVN_GOAL=$([ "${TRAVIS_PULL_REQUEST}" == "false" -a "${TRAVIS_TAG}" == "" -a "${FEATURE_BRANCH}" == "false" -a "${SPRING_CLOUD_BUILD}" == "true" ] && echo deploy || echo install)
+ - VERSION=$(mvn validate | grep Building | head -1 | sed -e 's/.* //')
+ - MILESTONE=$(echo ${VERSION} | egrep 'M|RC' && echo true || echo false)
+ - MVN_PROFILE=$([ "${MILESTONE}" == "true" ] && echo -P milestone)
+ - secure: "KRJQg6soMWudREJ11ocGK8I4OuhIehvy/ehTjBxvyATEwL6rXA9dKPGfb0OAscEgIpNxW1cezH8vUSaSZGFhx6LF5VnJ9Mh39pi9uYm9GMjQ61B4d5GaRjbGj/fXBd8kGubDO8kmjkDGGgkjWXfYZa/WIQ4kVWCIB5dVV9XJ0Lw="
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/LICENSE.txt b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/LICENSE.txt
new file mode 100644
index 00000000..d6456956
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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
+
+ http://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.
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/README.adoc b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/README.adoc
new file mode 100644
index 00000000..ea497299
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/README.adoc
@@ -0,0 +1,131 @@
+// Do not edit this file (e.g. go instead to src/main/asciidoc)
+
+image:https://circleci.com/gh/spring-cloud/spring-cloud-build.svg?style=svg[link="https://travis-ci.org/spring-cloud/spring-cloud-build"]
+
+Spring Cloud Build is a common utility project for Spring Cloud
+to use for plugin and dependency management.
+
+== Building and Deploying
+
+To install locally:
+
+----
+
+$ mvn install -s .settings.xml
+----
+
+and to deploy snapshots to repo.spring.io:
+
+----
+$ mvn deploy -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local
+----
+
+for a RELEASE build use
+
+----
+$ mvn deploy -DaltReleaseDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-release-local
+----
+
+and for jcenter use
+
+----
+$ mvn deploy -DaltReleaseDeploymentRepository=bintray::default::https://api.bintray.com/maven/spring/jars/org.springframework.cloud:build
+----
+
+and for Maven Central use
+
+----
+$ mvn deploy -P central -DaltReleaseDeploymentRepository=sonatype-nexus-staging::default::https://oss.sonatype.org/service/local/staging/deploy/maven2
+----
+
+(the "central" profile is available for all projects in Spring Cloud and it sets up the gpg jar signing, and the repository has to be specified separately for this project because it is a parent of the starter parent which users in turn have as their own parent).
+
+== Contributing
+
+Spring Cloud is released under the non-restrictive Apache 2.0 license,
+and follows a very standard Github development process, using Github
+tracker for issues and merging pull requests into master. If you want
+to contribute even something trivial please do not hesitate, but
+follow the guidelines below.
+
+=== Sign the Contributor License Agreement
+Before we accept a non-trivial patch or pull request we will need you to sign the
+https://cla.pivotal.io/sign/spring[Contributor License Agreement].
+Signing the contributor's agreement does not grant anyone commit rights to the main
+repository, but it does mean that we can accept your contributions, and you will get an
+author credit if we do. Active contributors might be asked to join the core team, and
+given the ability to merge pull requests.
+
+=== Code of Conduct
+This project adheres to the Contributor Covenant https://github.com/spring-cloud/spring-cloud-build/blob/master/docs/src/main/asciidoc/code-of-conduct.adoc[code of
+conduct]. By participating, you are expected to uphold this code. Please report
+unacceptable behavior to spring-code-of-conduct@pivotal.io.
+
+=== Code Conventions and Housekeeping
+None of these is essential for a pull request, but they will all help. They can also be
+added after the original pull request but before a merge.
+
+* Use the Spring Framework code format conventions. If you use Eclipse
+ you can import formatter settings using the
+ `eclipse-code-formatter.xml` file from the
+ https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml[Spring
+ Cloud Build] project. If using IntelliJ, you can use the
+ http://plugins.jetbrains.com/plugin/6546[Eclipse Code Formatter
+ Plugin] to import the same file.
+* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
+ `@author` tag identifying you, and preferably at least a paragraph on what the class is
+ for.
+* Add the ASF license header comment to all new `.java` files (copy from existing files
+ in the project)
+* Add yourself as an `@author` to the .java files that you modify substantially (more
+ than cosmetic changes).
+* Add some Javadocs and, if you change the namespace, some XSD doc elements.
+* A few unit tests would help a lot as well -- someone has to do it.
+* If no-one else is using your branch, please rebase it against the current master (or
+ other target branch in the main project).
+* When writing a commit message please follow http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions],
+ if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
+ message (where XXXX is the issue number).
+
+== Reusing the documentation
+
+Spring Cloud Build publishes its `spring-cloud-build-docs` module that contains
+helpful scripts (e.g. README generation ruby script) and css, xslt and images
+for the Spring Cloud documentation. If you want to follow the same convention
+approach of generating documentation just add these plugins to your `docs` module
+
+[source,xml]
+----
+
+
+ docs
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin <1>
+
+
+ org.asciidoctor
+ asciidoctor-maven-plugin <2>
+
+
+ com.agilejava.docbkx
+ docbkx-maven-plugin <3>
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin <4>
+ false
+
+
+
+
+
+----
+<1> This plugin downloads and unpacks the resources of the `spring-cloud-build-docs` module
+<2> This plugin is required to parse the Asciidoctor documentation
+<3> This plugin converts the Asciidoctor documentation into single and multi page docs
+<4> This plugin is required to copy resources into proper final destinations and to generate main README.adoc
+
+IMPORTANT: The order of plugin declaration is important!
\ No newline at end of file
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/circle.yml b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/circle.yml
new file mode 100644
index 00000000..97a07c1c
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/circle.yml
@@ -0,0 +1,20 @@
+general:
+ branches:
+ ignore:
+ - gh-pages # list of branches to ignore
+machine:
+ java:
+ version: openjdk8 #Open JDK has the JCE extentions installed by default
+ environment:
+ _JAVA_OPTIONS: "-Xms1024m -Xmx2048m"
+dependencies:
+ override:
+ - ./mvnw -s .settings.xml -U --fail-never dependency:go-offline || true
+test:
+ override:
+ - ./mvnw -s .settings.xml clean install org.jacoco:jacoco-maven-plugin:prepare-agent install -U -P sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
+ post:
+ - find . -type f -regex ".*/spring-cloud-*.*/target/*.*" | cpio -pdm $CIRCLE_ARTIFACTS
+ - mkdir -p $CIRCLE_TEST_REPORTS/junit/
+ - find . -type f -regex ".*/target/.*-reports/.*" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
+ - bash <(curl -s https://codecov.io/bash)
\ No newline at end of file
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/pom.xml b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/pom.xml
new file mode 100644
index 00000000..ae5b14c7
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/pom.xml
@@ -0,0 +1,55 @@
+
+
+ 4.0.0
+ spring-cloud-build-docs
+ spring-cloud-build-docs
+ jar
+ Spring Cloud Build Docs
+
+ org.springframework.cloud
+ spring-cloud-build
+ 1.3.7.BUILD-SNAPSHOT
+
+
+ spring-cloud-build
+
+ 1.2.x,1.3.x
+ ${basedir}/..
+ ${basedir}/src/main
+
+
+
+
+ src/main
+
+
+
+
+ maven-deploy-plugin
+ 2.8.2
+
+
+
+
+
+ docs
+
+
+
+ org.asciidoctor
+ asciidoctor-maven-plugin
+
+
+ com.agilejava.docbkx
+ docbkx-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin
+
+
+
+
+
+
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/README.adoc b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/README.adoc
new file mode 100644
index 00000000..27561297
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/README.adoc
@@ -0,0 +1,86 @@
+image:https://circleci.com/gh/spring-cloud/spring-cloud-build.svg?style=svg[link="https://travis-ci.org/spring-cloud/spring-cloud-build"]
+
+Spring Cloud Build is a common utility project for Spring Cloud
+to use for plugin and dependency management.
+
+== Building and Deploying
+
+To install locally:
+
+----
+
+$ mvn install -s .settings.xml
+----
+
+and to deploy snapshots to repo.spring.io:
+
+----
+$ mvn deploy -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local
+----
+
+for a RELEASE build use
+
+----
+$ mvn deploy -DaltReleaseDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-release-local
+----
+
+and for jcenter use
+
+----
+$ mvn deploy -DaltReleaseDeploymentRepository=bintray::default::https://api.bintray.com/maven/spring/jars/org.springframework.cloud:build
+----
+
+and for Maven Central use
+
+----
+$ mvn deploy -P central -DaltReleaseDeploymentRepository=sonatype-nexus-staging::default::https://oss.sonatype.org/service/local/staging/deploy/maven2
+----
+
+(the "central" profile is available for all projects in Spring Cloud and it sets up the gpg jar signing, and the repository has to be specified separately for this project because it is a parent of the starter parent which users in turn have as their own parent).
+
+== Contributing
+
+include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing.adoc[]
+
+== Reusing the documentation
+
+Spring Cloud Build publishes its `spring-cloud-build-docs` module that contains
+helpful scripts (e.g. README generation ruby script) and css, xslt and images
+for the Spring Cloud documentation. If you want to follow the same convention
+approach of generating documentation just add these plugins to your `docs` module
+
+[source,xml]
+----
+
+
+ docs
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin <1>
+
+
+ org.asciidoctor
+ asciidoctor-maven-plugin <2>
+
+
+ com.agilejava.docbkx
+ docbkx-maven-plugin <3>
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin <4>
+ false
+
+
+
+
+
+----
+<1> This plugin downloads and unpacks the resources of the `spring-cloud-build-docs` module
+<2> This plugin is required to parse the Asciidoctor documentation
+<3> This plugin converts the Asciidoctor documentation into single and multi page docs
+<4> This plugin is required to copy resources into proper final destinations and to generate main README.adoc
+
+IMPORTANT: The order of plugin declaration is important!
\ No newline at end of file
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/building-base.adoc b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/building-base.adoc
new file mode 100644
index 00000000..4f7c41f6
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/building-base.adoc
@@ -0,0 +1,86 @@
+=== Basic Compile and Test
+
+To build the source you will need to install JDK {jdkversion}.
+
+Spring Cloud uses Maven for most build-related activities, and you
+should be able to get off the ground quite quickly by cloning the
+project you are interested in and typing
+
+----
+$ ./mvnw install
+----
+
+NOTE: You can also install Maven (>=3.3.3) yourself and run the `mvn` command
+in place of `./mvnw` in the examples below. If you do that you also
+might need to add `-P spring` if your local Maven settings do not
+contain repository declarations for spring pre-release artifacts.
+
+NOTE: Be aware that you might need to increase the amount of memory
+available to Maven by setting a `MAVEN_OPTS` environment variable with
+a value like `-Xmx512m -XX:MaxPermSize=128m`. We try to cover this in
+the `.mvn` configuration, so if you find you have to do it to make a
+build succeed, please raise a ticket to get the settings added to
+source control.
+
+For hints on how to build the project look in `.travis.yml` if there
+is one. There should be a "script" and maybe "install" command. Also
+look at the "services" section to see if any services need to be
+running locally (e.g. mongo or rabbit). Ignore the git-related bits
+that you might find in "before_install" since they're related to setting git
+credentials and you already have those.
+
+The projects that require middleware generally include a
+`docker-compose.yml`, so consider using
+http://compose.docker.io/[Docker Compose] to run the middeware servers
+in Docker containers. See the README in the
+https://github.com/spring-cloud-samples/scripts[scripts demo
+repository] for specific instructions about the common cases of mongo,
+rabbit and redis.
+
+NOTE: If all else fails, build with the command from `.travis.yml` (usually
+`./mvnw install`).
+
+=== Documentation
+
+The spring-cloud-build module has a "docs" profile, and if you switch
+that on it will try to build asciidoc sources from
+`src/main/asciidoc`. As part of that process it will look for a
+`README.adoc` and process it by loading all the includes, but not
+parsing or rendering it, just copying it to `${main.basedir}`
+(defaults to `${basedir}`, i.e. the root of the project). If there are
+any changes in the README it will then show up after a Maven build as
+a modified file in the correct place. Just commit it and push the change.
+
+=== Working with the code
+If you don't have an IDE preference we would recommend that you use
+http://www.springsource.com/developer/sts[Spring Tools Suite] or
+http://eclipse.org[Eclipse] when working with the code. We use the
+http://eclipse.org/m2e/[m2eclipse] eclipse plugin for maven support. Other IDEs and tools
+should also work without issue as long as they use Maven 3.3.3 or better.
+
+==== Importing into eclipse with m2eclipse
+We recommend the http://eclipse.org/m2e/[m2eclipse] eclipse plugin when working with
+eclipse. If you don't already have m2eclipse installed it is available from the "eclipse
+marketplace".
+
+NOTE: Older versions of m2e do not support Maven 3.3, so once the
+projects are imported into Eclipse you will also need to tell
+m2eclipse to use the right profile for the projects. If you
+see many different errors related to the POMs in the projects, check
+that you have an up to date installation. If you can't upgrade m2e,
+add the "spring" profile to your `settings.xml`. Alternatively you can
+copy the repository settings from the "spring" profile of the parent
+pom into your `settings.xml`.
+
+==== Importing into eclipse without m2eclipse
+If you prefer not to use m2eclipse you can generate eclipse project metadata using the
+following command:
+
+[indent=0]
+----
+ $ ./mvnw eclipse:eclipse
+----
+
+The generated eclipse projects can be imported by selecting `import existing projects`
+from the `file` menu.
+
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/building-jdk8.adoc b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/building-jdk8.adoc
new file mode 100644
index 00000000..ef990612
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/building-jdk8.adoc
@@ -0,0 +1,4 @@
+:jdkversion: 1.8
+
+include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/building-base.adoc[]
+
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/building-lombok.adoc b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/building-lombok.adoc
new file mode 100644
index 00000000..a06b6f9c
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/building-lombok.adoc
@@ -0,0 +1,33 @@
+==== Adding Project Lombok Agent
+
+Spring Cloud uses http://projectlombok.org/features/index.html[Project Lombok]
+to generate getters and setters etc. Compiling from the command line this
+shouldn't cause any problems, but in an IDE you need to add an agent
+to the JVM. Full instructions can be found in the Lombok website. The
+sign that you need to do this is a lot of compiler errors to do with
+missing methods and fields, e.g.
+
+[indent=0]
+----
+The method getInitialStatus() is undefined for the type EurekaInstanceConfigBean EurekaDiscoveryClientConfiguration.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka line 120 Java Problem
+The method getInitialStatus() is undefined for the type EurekaInstanceConfigBean EurekaDiscoveryClientConfiguration.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka line 121 Java Problem
+The method setNonSecurePort(int) is undefined for the type EurekaInstanceConfigBean EurekaDiscoveryClientConfiguration.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka line 112 Java Problem
+The type EurekaInstanceConfigBean.IdentifyingDataCenterInfo must implement the inherited abstract method DataCenterInfo.getName() EurekaInstanceConfigBean.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka line 131 Java Problem
+The method getId() is undefined for the type ProxyRouteLocator.ProxyRouteSpec PreDecorationFilter.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/pre line 60 Java Problem
+The method getLocation() is undefined for the type ProxyRouteLocator.ProxyRouteSpec PreDecorationFilter.java /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/pre line 55 Java Problem
+----
+
+==== Importing into Intellij
+Spring Cloud projects use annotation processing, particularly Lombok, which requires configuration
+or you will encounter compile problems. It also needs a specific version of maven and a profile
+enabled. Intellij 14.1+ requires some configuration to ensure these are setup properly.
+
+ 1. Click Preferences, Plugins. *Ensure Lombok is installed*
+ 2. Click New, Project from Existing Sources, choose your spring-cloud project directory
+ 3. Choose Maven, and select Environment Settings. *Ensure you are using Maven 3.3.3*
+ 4. In the next screen, *Select the profile `spring`* click Next until Finish.
+ 5. Click Preferences, "Build, Execution, Deployment", Compiler, Annotation Processors. *Click Enable Annotation Processing*
+ 6. Click Build, Rebuild Project, and you are ready to go!
+
+==== Importing into other IDEs
+Maven is well supported by most Java IDEs. Refer to you vendor documentation.
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/building.adoc b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/building.adoc
new file mode 100644
index 00000000..0375a590
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/building.adoc
@@ -0,0 +1,3 @@
+:jdkversion: 1.7
+
+include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/building-base.adoc[]
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/code-of-conduct.adoc b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/code-of-conduct.adoc
new file mode 100644
index 00000000..091e220b
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/code-of-conduct.adoc
@@ -0,0 +1,45 @@
+
+= Contributor Code of Conduct
+
+As contributors and maintainers of this project, and in the interest of fostering an open
+and welcoming community, we pledge to respect all people who contribute through reporting
+issues, posting feature requests, updating documentation, submitting pull requests or
+patches, and other activities.
+
+We are committed to making participation in this project a harassment-free experience for
+everyone, regardless of level of experience, gender, gender identity and expression,
+sexual orientation, disability, personal appearance, body size, race, ethnicity, age,
+religion, or nationality.
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery
+* Personal attacks
+* Trolling or insulting/derogatory comments
+* Public or private harassment
+* Publishing other's private information, such as physical or electronic addresses,
+ without explicit permission
+* Other unethical or unprofessional conduct
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments,
+commits, code, wiki edits, issues, and other contributions that are not aligned to this
+Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors
+that they deem inappropriate, threatening, offensive, or harmful.
+
+By adopting this Code of Conduct, project maintainers commit themselves to fairly and
+consistently applying these principles to every aspect of managing this project. Project
+maintainers who do not follow or enforce the Code of Conduct may be permanently removed
+from the project team.
+
+This Code of Conduct applies both within project spaces and in public spaces when an
+individual is representing the project or its community.
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
+contacting a project maintainer at spring-code-of-conduct@pivotal.io . All complaints will
+be reviewed and investigated and will result in a response that is deemed necessary and
+appropriate to the circumstances. Maintainers are obligated to maintain confidentiality
+with regard to the reporter of an incident.
+
+This Code of Conduct is adapted from the
+http://contributor-covenant.org[Contributor Covenant], version 1.3.0, available at
+http://contributor-covenant.org/version/1/3/0/[contributor-covenant.org/version/1/3/0/]
\ No newline at end of file
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/contributing-docs.adoc b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/contributing-docs.adoc
new file mode 100644
index 00000000..6851cced
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/contributing-docs.adoc
@@ -0,0 +1 @@
+NOTE: Spring Cloud is released under the non-restrictive Apache 2.0 license. If you would like to contribute to this section of the documentation or if you find an error, please find the source code and issue trackers in the project at {docslink}[github].
\ No newline at end of file
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/contributing.adoc b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/contributing.adoc
new file mode 100644
index 00000000..ac8bd575
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/contributing.adoc
@@ -0,0 +1,44 @@
+Spring Cloud is released under the non-restrictive Apache 2.0 license,
+and follows a very standard Github development process, using Github
+tracker for issues and merging pull requests into master. If you want
+to contribute even something trivial please do not hesitate, but
+follow the guidelines below.
+
+=== Sign the Contributor License Agreement
+Before we accept a non-trivial patch or pull request we will need you to sign the
+https://cla.pivotal.io/sign/spring[Contributor License Agreement].
+Signing the contributor's agreement does not grant anyone commit rights to the main
+repository, but it does mean that we can accept your contributions, and you will get an
+author credit if we do. Active contributors might be asked to join the core team, and
+given the ability to merge pull requests.
+
+=== Code of Conduct
+This project adheres to the Contributor Covenant https://github.com/spring-cloud/spring-cloud-build/blob/master/docs/src/main/asciidoc/code-of-conduct.adoc[code of
+conduct]. By participating, you are expected to uphold this code. Please report
+unacceptable behavior to spring-code-of-conduct@pivotal.io.
+
+=== Code Conventions and Housekeeping
+None of these is essential for a pull request, but they will all help. They can also be
+added after the original pull request but before a merge.
+
+* Use the Spring Framework code format conventions. If you use Eclipse
+ you can import formatter settings using the
+ `eclipse-code-formatter.xml` file from the
+ https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-dependencies-parent/eclipse-code-formatter.xml[Spring
+ Cloud Build] project. If using IntelliJ, you can use the
+ http://plugins.jetbrains.com/plugin/6546[Eclipse Code Formatter
+ Plugin] to import the same file.
+* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
+ `@author` tag identifying you, and preferably at least a paragraph on what the class is
+ for.
+* Add the ASF license header comment to all new `.java` files (copy from existing files
+ in the project)
+* Add yourself as an `@author` to the .java files that you modify substantially (more
+ than cosmetic changes).
+* Add some Javadocs and, if you change the namespace, some XSD doc elements.
+* A few unit tests would help a lot as well -- someone has to do it.
+* If no-one else is using your branch, please rebase it against the current master (or
+ other target branch in the main project).
+* When writing a commit message please follow http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[these conventions],
+ if you are fixing an existing issue please add `Fixes gh-XXXX` at the end of the commit
+ message (where XXXX is the issue number).
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/ghpages.sh b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/ghpages.sh
new file mode 100755
index 00000000..09435af1
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/ghpages.sh
@@ -0,0 +1,360 @@
+#!/bin/bash -x
+
+# Usage: (cd ; ghpages.sh -v -b -c)
+
+set -e
+
+# Set default props like MAVEN_PATH, ROOT_FOLDER etc.
+function set_default_props() {
+ # The script should be executed from the root folder
+ ROOT_FOLDER=`pwd`
+ echo "Current folder is ${ROOT_FOLDER}"
+
+ if [[ ! -e "${ROOT_FOLDER}/.git" ]]; then
+ echo "You're not in the root folder of the project!"
+ exit 1
+ fi
+
+ # Prop that will let commit the changes
+ COMMIT_CHANGES="no"
+ MAVEN_PATH=${MAVEN_PATH:-}
+ if [ -e "${ROOT_FOLDER}/mvnw" ]; then
+ MAVEN_EXEC="$ROOT_FOLDER/mvnw"
+ else
+ MAVEN_EXEC="${MAVEN_PATH}mvn"
+ fi
+ echo "Path to Maven is [${MAVEN_EXEC}]"
+ if [ -z $REPO_NAME ]; then
+ REPO_NAME=$(git remote -v | grep origin | head -1 | sed -e 's!.*/!!' -e 's/ .*//' -e 's/\.git.*//')
+ fi
+ echo "Repo name is [${REPO_NAME}]"
+ SPRING_CLOUD_STATIC_REPO=${SPRING_CLOUD_STATIC_REPO:-git@github.com:spring-cloud/spring-cloud-static.git}
+ echo "Spring Cloud Static repo is [${SPRING_CLOUD_STATIC_REPO}"
+}
+
+# Check if gh-pages exists and docs have been built
+function check_if_anything_to_sync() {
+ git remote set-url --push origin `git config remote.origin.url | sed -e 's/^git:/https:/'`
+
+ if ! (git remote set-branches --add origin gh-pages && git fetch -q) && [[ "${RELEASE_TRAIN}" != "yes" ]] ; then
+ echo "No gh-pages, so not syncing"
+ exit 0
+ fi
+
+ if ! [ -d docs/target/generated-docs ] && ! [ "${BUILD}" == "yes" ]; then
+ echo "No gh-pages sources in docs/target/generated-docs, so not syncing"
+ exit 0
+ fi
+}
+
+function retrieve_current_branch() {
+ # Code getting the name of the current branch. For master we want to publish as we did until now
+ # http://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch
+ # If there is a branch already passed will reuse it - otherwise will try to find it
+ CURRENT_BRANCH=${BRANCH}
+ if [[ -z "${CURRENT_BRANCH}" ]] ; then
+ CURRENT_BRANCH=$(git symbolic-ref -q HEAD)
+ CURRENT_BRANCH=${CURRENT_BRANCH##refs/heads/}
+ CURRENT_BRANCH=${CURRENT_BRANCH:-HEAD}
+ fi
+ echo "Current branch is [${CURRENT_BRANCH}]"
+ git checkout ${CURRENT_BRANCH} || echo "Failed to check the branch... continuing with the script"
+ PREVIOUS_BRANCH=${CURRENT_BRANCH}
+}
+
+# Switches to the provided value of the release version. We always prefix it with `v`
+function switch_to_tag() {
+ if [[ "${RELEASE_TRAIN}" != "yes" ]] ; then
+ git checkout v${VERSION}
+ fi
+}
+
+# Build the docs if switch is on
+function build_docs_if_applicable() {
+ if [[ "${BUILD}" == "yes" ]] ; then
+ ./mvnw clean install -P docs -pl docs -DskipTests
+ fi
+}
+
+# Get the name of the `docs.main` property
+# Get whitelisted branches - assumes that a `docs` module is available under `docs` profile
+function retrieve_doc_properties() {
+ MAIN_ADOC_VALUE=$("${MAVEN_EXEC}" -q \
+ -Dexec.executable="echo" \
+ -Dexec.args='${docs.main}' \
+ org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \
+ -P docs \
+ -pl docs | tail -1 )
+ echo "Extracted 'main.adoc' from Maven build [${MAIN_ADOC_VALUE}]"
+
+
+ WHITELIST_PROPERTY=${WHITELIST_PROPERTY:-"docs.whitelisted.branches"}
+ WHITELISTED_BRANCHES_VALUE=$("${MAVEN_EXEC}" -q \
+ -Dexec.executable="echo" \
+ -Dexec.args="\${${WHITELIST_PROPERTY}}" \
+ org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \
+ -P docs \
+ -pl docs | tail -1 )
+ echo "Extracted '${WHITELIST_PROPERTY}' from Maven build [${WHITELISTED_BRANCHES_VALUE}]"
+}
+
+# Stash any outstanding changes
+function stash_changes() {
+ git diff-index --quiet HEAD && dirty=$? || (echo "Failed to check if the current repo is dirty. Assuming that it is." && dirty="1")
+ if [ "$dirty" != "0" ]; then git stash; fi
+}
+
+# Switch to gh-pages branch to sync it with current branch
+function add_docs_from_target() {
+ local DESTINATION_REPO_FOLDER
+ if [[ -z "${DESTINATION}" && -z "${CLONE}" ]] ; then
+ DESTINATION_REPO_FOLDER=${ROOT_FOLDER}
+ elif [[ "${CLONE}" == "yes" ]]; then
+ mkdir -p ${ROOT_FOLDER}/target
+ local clonedStatic=${ROOT_FOLDER}/target/spring-cloud-static
+ if [[ ! -e "${clonedStatic}/.git" ]]; then
+ echo "Cloning Spring Cloud Static to target"
+ git clone ${SPRING_CLOUD_STATIC_REPO} ${clonedStatic} && cd ${clonedStatic} && git checkout gh-pages
+ else
+ echo "Spring Cloud Static already cloned - will pull changes"
+ cd ${clonedStatic} && git checkout gh-pages && git pull origin gh-pages
+ fi
+ if [[ -z "${RELEASE_TRAIN}" ]] ; then
+ DESTINATION_REPO_FOLDER=${clonedStatic}/${REPO_NAME}
+ else
+ DESTINATION_REPO_FOLDER=${clonedStatic}
+ fi
+ mkdir -p ${DESTINATION_REPO_FOLDER}
+ else
+ if [[ ! -e "${DESTINATION}/.git" ]]; then
+ echo "[${DESTINATION}] is not a git repository"
+ exit 1
+ fi
+ if [[ -z "${RELEASE_TRAIN}" ]] ; then
+ DESTINATION_REPO_FOLDER=${DESTINATION}/${REPO_NAME}
+ else
+ DESTINATION_REPO_FOLDER=${DESTINATION}
+ fi
+ mkdir -p ${DESTINATION_REPO_FOLDER}
+ echo "Destination was provided [${DESTINATION}]"
+ fi
+ cd ${DESTINATION_REPO_FOLDER}
+ git checkout gh-pages
+ git pull origin gh-pages
+
+ # Add git branches
+ ###################################################################
+ if [[ -z "${VERSION}" && -z "${RELEASE_TRAIN}" ]] ; then
+ copy_docs_for_current_version
+ else
+ copy_docs_for_provided_version
+ fi
+ commit_changes_if_applicable
+}
+
+
+# Copies the docs by using the retrieved properties from Maven build
+function copy_docs_for_current_version() {
+ if [[ "${CURRENT_BRANCH}" == "master" ]] ; then
+ echo -e "Current branch is master - will copy the current docs only to the root folder"
+ for f in docs/target/generated-docs/*; do
+ file=${f#docs/target/generated-docs/*}
+ if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then
+ # Not ignored...
+ cp -rf $f ${ROOT_FOLDER}/
+ fi
+ done
+ git add -A ${ROOT_FOLDER}
+ COMMIT_CHANGES="yes"
+ else
+ echo -e "Current branch is [${CURRENT_BRANCH}]"
+ # http://stackoverflow.com/questions/29300806/a-bash-script-to-check-if-a-string-is-present-in-a-comma-separated-list-of-strin
+ if [[ ",${WHITELISTED_BRANCHES_VALUE}," = *",${CURRENT_BRANCH},"* ]] ; then
+ mkdir -p ${ROOT_FOLDER}/${CURRENT_BRANCH}
+ echo -e "Branch [${CURRENT_BRANCH}] is whitelisted! Will copy the current docs to the [${CURRENT_BRANCH}] folder"
+ for f in docs/target/generated-docs/*; do
+ file=${f#docs/target/generated-docs/*}
+ if ! git ls-files -i -o --exclude-standard --directory | grep -q ^$file$; then
+ # Not ignored...
+ # We want users to access 1.0.0.RELEASE/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html
+ if [[ "${file}" == "${MAIN_ADOC_VALUE}.html" ]] ; then
+ # We don't want to copy the spring-cloud-sleuth.html
+ # we want it to be converted to index.html
+ cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html
+ git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/index.html
+ else
+ cp -rf $f ${ROOT_FOLDER}/${CURRENT_BRANCH}
+ git add -A ${ROOT_FOLDER}/${CURRENT_BRANCH}/$file || echo "Failed to add the file [$file]"
+ fi
+ fi
+ done
+ COMMIT_CHANGES="yes"
+ else
+ echo -e "Branch [${CURRENT_BRANCH}] is not on the white list! Check out the Maven [${WHITELIST_PROPERTY}] property in
+ [docs] module available under [docs] profile. Won't commit any changes to gh-pages for this branch."
+ fi
+ fi
+}
+
+# Copies the docs by using the explicitly provided version
+function copy_docs_for_provided_version() {
+ local FOLDER=${DESTINATION_REPO_FOLDER}/${VERSION}
+ mkdir -p ${FOLDER}
+ echo -e "Current tag is [v${VERSION}] Will copy the current docs to the [${FOLDER}] folder"
+ for f in ${ROOT_FOLDER}/docs/target/generated-docs/*; do
+ file=${f#${ROOT_FOLDER}/docs/target/generated-docs/*}
+ copy_docs_for_branch ${file} ${FOLDER}
+ done
+ COMMIT_CHANGES="yes"
+ CURRENT_BRANCH="v${VERSION}"
+}
+
+# Copies the docs from target to the provided destination
+# Params:
+# $1 - file from target
+# $2 - destination to which copy the files
+function copy_docs_for_branch() {
+ local file=$1
+ local destination=$2
+ if ! git ls-files -i -o --exclude-standard --directory | grep -q ^${file}$; then
+ # Not ignored...
+ # We want users to access 1.0.0.RELEASE/ instead of 1.0.0.RELEASE/spring-cloud.sleuth.html
+ if [[ ("${file}" == "${MAIN_ADOC_VALUE}.html") || ("${file}" == "${REPO_NAME}.html") ]] ; then
+ # We don't want to copy the spring-cloud-sleuth.html
+ # we want it to be converted to index.html
+ cp -rf $f ${destination}/index.html
+ else
+ cp -rf $f ${destination}
+ fi
+ git add -A ${destination}
+ fi
+}
+
+function commit_changes_if_applicable() {
+ if [[ "${COMMIT_CHANGES}" == "yes" ]] ; then
+ COMMIT_SUCCESSFUL="no"
+ git commit -a -m "Sync docs from ${CURRENT_BRANCH} to gh-pages" && COMMIT_SUCCESSFUL="yes" || echo "Failed to commit changes"
+
+ # Uncomment the following push if you want to auto push to
+ # the gh-pages branch whenever you commit to master locally.
+ # This is a little extreme. Use with care!
+ ###################################################################
+ if [[ "${COMMIT_SUCCESSFUL}" == "yes" ]] ; then
+ git push origin gh-pages
+ fi
+ fi
+}
+
+# Switch back to the previous branch and exit block
+function checkout_previous_branch() {
+ # If -version was provided we need to come back to root project
+ cd ${ROOT_FOLDER}
+ git checkout ${PREVIOUS_BRANCH} || echo "Failed to check the branch... continuing with the script"
+ if [ "$dirty" != "0" ]; then git stash pop; fi
+ exit 0
+}
+
+# Assert if properties have been properly passed
+function assert_properties() {
+echo "VERSION [${VERSION}], RELEASE_TRAIN [${RELEASE_TRAIN}], DESTINATION [${DESTINATION}], CLONE [${CLONE}]"
+if [[ "${VERSION}" != "" && (-z "${DESTINATION}" && -z "${CLONE}") ]] ; then echo "Version was set but destination / clone was not!"; exit 1;fi
+if [[ ("${DESTINATION}" != "" && "${CLONE}" != "") && -z "${VERSION}" ]] ; then echo "Destination / clone was set but version was not!"; exit 1;fi
+if [[ "${DESTINATION}" != "" && "${CLONE}" == "yes" ]] ; then echo "Destination and clone was set. Pick one!"; exit 1;fi
+if [[ "${RELEASE_TRAIN}" != "" && -z "${VERSION}" ]] ; then echo "Release train was set but no version was passed!"; exit 1;fi
+}
+
+# Prints the usage
+function print_usage() {
+cat </`
+- if the destination switch is passed (-d) then the script will check if the provided dir is a git repo and then will
+ switch to gh-pages of that repo and copy the generated docs to `docs//`
+- if the release train switch is passed (-r) then the script will check if the provided dir is a git repo and then will
+ switch to gh-pages of that repo and copy the generated docs to `docs/`
+
+USAGE:
+
+You can use the following options:
+
+-v|--version - the script will apply the whole procedure for a particular library version
+-r|--releasetrain - instead of nesting the docs under the project_name/version folder the docs will end up in version
+-d|--destination - the root of destination folder where the docs should be copied. You have to use the full path.
+ E.g. point to spring-cloud-static folder. Can't be used with (-c)
+-b|--build - will run the standard build process after checking out the branch
+-c|--clone - will automatically clone the spring-cloud-static repo instead of providing the destination.
+ Obviously can't be used with (-d)
+
+EOF
+}
+
+
+# ==========================================
+# ____ ____ _____ _____ _____ _______
+# / ____|/ ____| __ \|_ _| __ \__ __|
+# | (___ | | | |__) | | | | |__) | | |
+# \___ \| | | _ / | | | ___/ | |
+# ____) | |____| | \ \ _| |_| | | |
+# |_____/ \_____|_| \_\_____|_| |_|
+#
+# ==========================================
+
+while [[ $# > 0 ]]
+do
+key="$1"
+case ${key} in
+ -v|--version)
+ VERSION="$2"
+ shift # past argument
+ ;;
+ -r|--releasetrain)
+ RELEASE_TRAIN="yes"
+ ;;
+ -d|--destination)
+ DESTINATION="$2"
+ shift # past argument
+ ;;
+ -b|--build)
+ BUILD="yes"
+ ;;
+ -c|--clone)
+ CLONE="yes"
+ ;;
+ -h|--help)
+ print_usage
+ exit 0
+ ;;
+ *)
+ echo "Invalid option: [$1]"
+ print_usage
+ exit 1
+ ;;
+esac
+shift # past argument or value
+done
+
+assert_properties
+set_default_props
+check_if_anything_to_sync
+retrieve_current_branch
+if echo $VERSION | egrep -q 'SNAPSHOT' || [[ -z "${VERSION}" ]]; then
+ CLONE=""
+ VERSION=""
+ echo "You've provided a version variable but it's a snapshot one. Due to this will not clone spring-cloud-static and publish docs over there"
+else
+ switch_to_tag
+fi
+build_docs_if_applicable
+retrieve_doc_properties
+stash_changes
+add_docs_from_target
+checkout_previous_branch
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/spring-cloud-build.adoc b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/spring-cloud-build.adoc
new file mode 100644
index 00000000..ba98d967
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/asciidoc/spring-cloud-build.adoc
@@ -0,0 +1,3 @@
+= Spring Cloud Build
+
+include::README.adoc[]
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/bash/sync_ghpages.sh b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/bash/sync_ghpages.sh
new file mode 100755
index 00000000..37c9ec0d
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/bash/sync_ghpages.sh
@@ -0,0 +1,211 @@
+#!/bin/bash
+
+set -e
+
+# Either clones or pulls the repo for given project
+# Params:
+# $1 organization e.g. spring-cloud
+# $2 repo name e.g. spring-cloud-sleuth
+function clone_or_pull() {
+ if [ "$#" -ne 2 ]
+ then
+ echo "You haven't provided 2 args... \$1 organization e.g. spring-cloud; \$2 repo name e.g. spring-cloud-sleuth"
+ exit 1
+ fi
+ if [[ "${JUST_PUSH}" == "yes" ]] ; then
+ echo "Skipping cloning since the option to just push was provided"
+ exit 0
+ fi
+ local ORGANIZATION=$1
+ local REPO_NAME=$2
+ local LOCALREPO_VC_DIR=${REPO_NAME}/.git
+ if [ ! -d ${LOCALREPO_VC_DIR} ]
+ then
+ echo "Repo [${REPO_NAME}] doesn't exist - will clone it!"
+ git clone git@github.com:${ORGANIZATION}/${REPO_NAME}.git
+ else
+ echo "Repo [${REPO_NAME}] exists - will pull the changes"
+ cd ${REPO_NAME} && git pull || echo "Not pulling since repo is up to date"
+ cd ${ROOT_FOLDER}
+ fi
+}
+
+# For the given branch updates the docs/src/main/asciidoc/ghpages.sh
+# with the one from spring-cloud-build. Then commits and pushes the change
+# Params:
+# $1 repo name e.g. spring-cloud-sleuth
+# $2 branch name
+function update_ghpages_script() {
+ if [ "$#" -ne 2 ]
+ then
+ echo "You haven't provided 2 args... \$1 repo name e.g. spring-cloud-sleuth; \$2 branch name e.g. master"
+ exit 1
+ fi
+ local REPO_NAME=$1
+ local BRANCH_NAME=$2
+ echo "Updating ghpages script for [${REPO_NAME}] and branch [${BRANCH_NAME}]"
+ cd ${REPO_NAME}
+ echo "Checking out [${BRANCH_NAME}]"
+ git checkout ${BRANCH_NAME}
+ echo "Resetting the repo and pulling before commiting"
+ git reset --hard origin/${BRANCH_NAME} && git pull origin ${BRANCH_NAME}
+ # If the user wants to just push we will not copy / add / commit files
+ if [[ "${JUST_PUSH}" != "yes" ]] ; then
+ echo "Copying [${GHPAGES_DOWNLOAD_PATH}] to [${GHPAGES_IN_REPO_PATH}]"
+ cp -rf ${GHPAGES_DOWNLOAD_PATH} ${GHPAGES_IN_REPO_PATH}
+ echo "Adding and committing [${GHPAGES_IN_REPO_PATH}] with message [${COMMIT_MESSAGE}]"
+ git add ${GHPAGES_IN_REPO_PATH}
+ git commit -m "${COMMIT_MESSAGE}" || echo "Proceeding to the next repo"
+ fi
+ if [[ "${AUTO_PUSH}" == "yes" ]] ; then
+ echo "Pushing the branch [${BRANCH_NAME}]"
+ wait_if_manual_proceed
+ git push origin ${BRANCH_NAME}
+ fi
+ cd ${ROOT_FOLDER}
+}
+
+# Downloads ghpages.sh
+function download_ghpages() {
+ rm -rf ${GHPAGES_DOWNLOAD_PATH}
+ echo "Downloading ghpages.sh from [${GHPAGES_URL}] to [${GHPAGES_DOWNLOAD_PATH}]"
+ curl ${GHPAGES_URL} -o ${GHPAGES_DOWNLOAD_PATH}
+ chmod +x ${GHPAGES_DOWNLOAD_PATH}
+}
+
+# Either clones or pulls the repo for given project and then updates gh-pages for the given project
+# Params:
+# $1 organization e.g. spring-cloud
+# $2 repo name e.g. spring-cloud-sleuth
+# $3 branch name e.g. master
+function clone_and_update_ghpages() {
+ if [ "$#" -ne 3 ]
+ then
+ echo "You haven't provided 3 args... \$1 organization e.g. spring-cloud; \$2 repo name e.g. spring-cloud-sleuth; \$3 branch name e.g. master"
+ exit 1
+ fi
+ local ORGANIZATION=$1
+ local REPO_NAME=$2
+ local BRANCH_NAME=$3
+ local VAR
+ echo -e "\n\nWill clone the repo and update scripts for org [${ORGANIZATION}], repo [${REPO_NAME}] and branch [${BRANCH_NAME}]\n\n"
+ clone_or_pull ${ORGANIZATION} ${REPO_NAME}
+ update_ghpages_script ${REPO_NAME} ${BRANCH_NAME}
+ echo "Proceeding to next project"
+ wait_if_manual_proceed
+}
+
+function wait_if_manual_proceed() {
+ if [[ "${AUTO_PROCEED}" != "yes" ]] ; then
+ echo -n "Press [ENTER] to continue..."
+ read VAR
+ fi
+}
+
+# Prints the provided parameters
+function print_parameters() {
+cat < 0 ]]
+do
+key="$1"
+case ${key} in
+ -p|--nopush)
+ AUTO_PUSH="no"
+ ;;
+ -m|--manualproceed)
+ AUTO_PROCEED="no"
+ ;;
+ -x|--justpush)
+ JUST_PUSH="yes"
+ ;;
+ -h|--help)
+ print_usage
+ exit 0
+ ;;
+ *)
+ echo "Invalid option: [$1]"
+ print_usage
+ exit 1
+ ;;
+esac
+shift # past argument or value
+done
+
+export GHPAGES_URL=${GHPAGES_URL:-https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/ghpages.sh}
+export GHPAGES_DOWNLOAD_PATH=${GHPAGES_DOWNLOAD_PATH:-/tmp/ghpages.sh}
+export COMMIT_MESSAGE=${COMMIT_MESSAGE:-Updating ghpages for all projects}
+export GHPAGES_IN_REPO_PATH=${GHPAGES_IN_REPO_PATH:-docs/src/main/asciidoc/ghpages.sh}
+export AUTO_PROCEED=${AUTO_PROCEED:-yes}
+export AUTO_PUSH=${AUTO_PUSH:-yes}
+export JUST_PUSH=${JUST_PUSH:-no}
+export ROOT_FOLDER=`pwd`
+
+
+print_parameters
+download_ghpages
+clone_and_update_ghpages spring-cloud spring-cloud-aws master
+clone_and_update_ghpages spring-cloud spring-cloud-aws 1.0.x
+clone_and_update_ghpages spring-cloud spring-cloud-aws 1.2.x
+clone_and_update_ghpages spring-cloud spring-cloud-bus master
+clone_and_update_ghpages spring-cloud spring-cloud-cli 1.0.x
+clone_and_update_ghpages spring-cloud spring-cloud-cli 1.1.x
+clone_and_update_ghpages spring-cloud spring-cloud-cli master
+clone_and_update_ghpages spring-cloud spring-cloud-cloudfoundry master
+clone_and_update_ghpages spring-cloud spring-cloud-cluster master
+clone_and_update_ghpages spring-cloud spring-cloud-commons master
+clone_and_update_ghpages spring-cloud spring-cloud-config master
+clone_and_update_ghpages spring-cloud spring-cloud-config 1.1.x
+clone_and_update_ghpages spring-cloud spring-cloud-consul 1.0.x
+clone_and_update_ghpages spring-cloud spring-cloud-consul master
+clone_and_update_ghpages spring-cloud spring-cloud-contract master
+clone_and_update_ghpages spring-cloud spring-cloud-netflix 1.0.x
+clone_and_update_ghpages spring-cloud spring-cloud-netflix 1.1.x
+clone_and_update_ghpages spring-cloud spring-cloud-netflix master
+clone_and_update_ghpages spring-cloud spring-cloud-security master
+clone_and_update_ghpages spring-cloud spring-cloud-sleuth 1.0.x
+clone_and_update_ghpages spring-cloud spring-cloud-sleuth master
+clone_and_update_ghpages spring-cloud spring-cloud-starters Brixton
+clone_and_update_ghpages spring-cloud spring-cloud-starters master
+clone_and_update_ghpages spring-cloud-incubator spring-cloud-vault-config master
+clone_and_update_ghpages spring-cloud spring-cloud-zookeeper master
\ No newline at end of file
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/css/highlight.css b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/css/highlight.css
new file mode 100644
index 00000000..ffefef72
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/css/highlight.css
@@ -0,0 +1,35 @@
+/*
+ code highlight CSS resemblign the Eclipse IDE default color schema
+ @author Costin Leau
+*/
+
+.hl-keyword {
+ color: #7F0055;
+ font-weight: bold;
+}
+
+.hl-comment {
+ color: #3F5F5F;
+ font-style: italic;
+}
+
+.hl-multiline-comment {
+ color: #3F5FBF;
+ font-style: italic;
+}
+
+.hl-tag {
+ color: #3F7F7F;
+}
+
+.hl-attribute {
+ color: #7F007F;
+}
+
+.hl-value {
+ color: #2A00FF;
+}
+
+.hl-string {
+ color: #2A00FF;
+}
\ No newline at end of file
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/css/manual-multipage.css b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/css/manual-multipage.css
new file mode 100644
index 00000000..0c484531
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/css/manual-multipage.css
@@ -0,0 +1,9 @@
+@IMPORT url("manual.css");
+
+body.firstpage {
+ background: url("../images/background.png") no-repeat center top;
+}
+
+div.part h1 {
+ border-top: none;
+}
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/css/manual-singlepage.css b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/css/manual-singlepage.css
new file mode 100644
index 00000000..4a7fd140
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/css/manual-singlepage.css
@@ -0,0 +1,6 @@
+@IMPORT url("manual.css");
+
+body {
+ background: url("../images/background.png") no-repeat center top;
+}
+
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/css/manual.css b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/css/manual.css
new file mode 100644
index 00000000..0ecbe2e8
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/css/manual.css
@@ -0,0 +1,344 @@
+@IMPORT url("highlight.css");
+
+html {
+ padding: 0pt;
+ margin: 0pt;
+}
+
+body {
+ color: #333333;
+ margin: 15px 30px;
+ font-family: Helvetica, Arial, Freesans, Clean, Sans-serif;
+ line-height: 1.6;
+ -webkit-font-smoothing: antialiased;
+}
+
+code {
+ font-size: 16px;
+ font-family: Consolas, "Liberation Mono", Courier, monospace;
+}
+
+:not(a)>code {
+ color: #6D180B;
+}
+
+:not(pre)>code {
+ background-color: #F2F2F2;
+ border: 1px solid #CCCCCC;
+ border-radius: 4px;
+ padding: 1px 3px 0;
+ text-shadow: none;
+ white-space: nowrap;
+}
+
+body>*:first-child {
+ margin-top: 0 !important;
+}
+
+div {
+ margin: 0pt;
+}
+
+hr {
+ border: 1px solid #CCCCCC;
+ background: #CCCCCC;
+}
+
+h1,h2,h3,h4,h5,h6 {
+ color: #000000;
+ cursor: text;
+ font-weight: bold;
+ margin: 30px 0 10px;
+ padding: 0;
+}
+
+h1,h2,h3 {
+ margin: 40px 0 10px;
+}
+
+h1 {
+ margin: 70px 0 30px;
+ padding-top: 20px;
+}
+
+div.part h1 {
+ border-top: 1px dotted #CCCCCC;
+}
+
+h1,h1 code {
+ font-size: 32px;
+}
+
+h2,h2 code {
+ font-size: 24px;
+}
+
+h3,h3 code {
+ font-size: 20px;
+}
+
+h4,h1 code,h5,h5 code,h6,h6 code {
+ font-size: 18px;
+}
+
+div.book,div.chapter,div.appendix,div.part,div.preface {
+ min-width: 300px;
+ max-width: 1200px;
+ margin: 0 auto;
+}
+
+p.releaseinfo {
+ font-weight: bold;
+ margin-bottom: 40px;
+ margin-top: 40px;
+}
+
+div.authorgroup {
+ line-height: 1;
+}
+
+p.copyright {
+ line-height: 1;
+ margin-bottom: -5px;
+}
+
+.legalnotice p {
+ font-style: italic;
+ font-size: 14px;
+ line-height: 1;
+}
+
+div.titlepage+p,div.titlepage+p {
+ margin-top: 0;
+}
+
+pre {
+ line-height: 1.0;
+ color: black;
+}
+
+a {
+ color: #4183C4;
+ text-decoration: none;
+}
+
+p {
+ margin: 15px 0;
+ text-align: left;
+}
+
+ul,ol {
+ padding-left: 30px;
+}
+
+li p {
+ margin: 0;
+}
+
+div.table {
+ margin: 1em;
+ padding: 0.5em;
+ text-align: center;
+}
+
+div.table table,div.informaltable table {
+ display: table;
+ width: 100%;
+}
+
+div.table td {
+ padding-left: 7px;
+ padding-right: 7px;
+}
+
+.sidebar {
+ line-height: 1.4;
+ padding: 0 20px;
+ background-color: #F8F8F8;
+ border: 1px solid #CCCCCC;
+ border-radius: 3px 3px 3px 3px;
+}
+
+.sidebar p.title {
+ color: #6D180B;
+}
+
+pre.programlisting,pre.screen {
+ font-size: 15px;
+ padding: 6px 10px;
+ background-color: #F8F8F8;
+ border: 1px solid #CCCCCC;
+ border-radius: 3px 3px 3px 3px;
+ clear: both;
+ overflow: auto;
+ line-height: 1.4;
+ font-family: Consolas, "Liberation Mono", Courier, monospace;
+}
+
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+ border: 1px solid #DDDDDD !important;
+ border-radius: 4px !important;
+ border-collapse: separate !important;
+ line-height: 1.6;
+}
+
+table thead {
+ background: #F5F5F5;
+}
+
+table tr {
+ border: none;
+ border-bottom: none;
+}
+
+table th {
+ font-weight: bold;
+}
+
+table th,table td {
+ border: none !important;
+ padding: 6px 13px;
+}
+
+table tr:nth-child(2n) {
+ background-color: #F8F8F8;
+}
+
+td p {
+ margin: 0 0 15px 0;
+}
+
+div.table-contents td p {
+ margin: 0;
+}
+
+div.important *,div.note *,div.tip *,div.warning *,div.navheader *,div.navfooter *,div.calloutlist *
+ {
+ border: none !important;
+ background: none !important;
+ margin: 0;
+}
+
+div.important p,div.note p,div.tip p,div.warning p {
+ color: #6F6F6F;
+ line-height: 1.6;
+}
+
+div.important code,div.note code,div.tip code,div.warning code {
+ background-color: #F2F2F2 !important;
+ border: 1px solid #CCCCCC !important;
+ border-radius: 4px !important;
+ padding: 1px 3px 0 !important;
+ text-shadow: none !important;
+ white-space: nowrap !important;
+}
+
+.note th,.tip th,.warning th {
+ display: none;
+}
+
+.note tr:first-child td,.tip tr:first-child td,.warning tr:first-child td
+ {
+ border-right: 1px solid #CCCCCC !important;
+ padding-top: 10px;
+}
+
+div.calloutlist p,div.calloutlist td {
+ padding: 0;
+ margin: 0;
+}
+
+div.calloutlist>table>tbody>tr>td:first-child {
+ padding-left: 10px;
+ width: 30px !important;
+}
+
+div.important,div.note,div.tip,div.warning {
+ margin-left: 0px !important;
+ margin-right: 20px !important;
+ margin-top: 20px;
+ margin-bottom: 20px;
+ padding-top: 10px;
+ padding-bottom: 10px;
+}
+
+div.toc {
+ line-height: 1.2;
+}
+
+dl,dt {
+ margin-top: 1px;
+ margin-bottom: 0;
+}
+
+div.toc>dl>dt {
+ font-size: 32px;
+ font-weight: bold;
+ margin: 30px 0 10px 0;
+ display: block;
+}
+
+div.toc>dl>dd>dl>dt {
+ font-size: 24px;
+ font-weight: bold;
+ margin: 20px 0 10px 0;
+ display: block;
+}
+
+div.toc>dl>dd>dl>dd>dl>dt {
+ font-weight: bold;
+ font-size: 20px;
+ margin: 10px 0 0 0;
+}
+
+tbody.footnotes * {
+ border: none !important;
+}
+
+div.footnote p {
+ margin: 0;
+ line-height: 1;
+}
+
+div.footnote p sup {
+ margin-right: 6px;
+ vertical-align: middle;
+}
+
+div.navheader {
+ border-bottom: 1px solid #CCCCCC;
+}
+
+div.navfooter {
+ border-top: 1px solid #CCCCCC;
+}
+
+.title {
+ margin-left: -1em;
+ padding-left: 1em;
+}
+
+.title>a {
+ position: absolute;
+ visibility: hidden;
+ display: block;
+ font-size: 0.85em;
+ margin-top: 0.05em;
+ margin-left: -1em;
+ vertical-align: text-top;
+ color: black;
+}
+
+.title>a:before {
+ content: "\00A7";
+}
+
+.title:hover>a,.title>a:hover,.title:hover>a:hover {
+ visibility: visible;
+}
+
+.title:focus>a,.title>a:focus,.title:focus>a:focus {
+ outline: 0;
+}
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/background.png b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/background.png
new file mode 100644
index 00000000..15dca6fb
Binary files /dev/null and b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/background.png differ
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/caution.png b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/caution.png
new file mode 100644
index 00000000..8a5e4fca
Binary files /dev/null and b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/caution.png differ
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/important.png b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/important.png
new file mode 100644
index 00000000..ec54df65
Binary files /dev/null and b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/important.png differ
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/logo.png b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/logo.png
new file mode 100644
index 00000000..ade2ce6e
Binary files /dev/null and b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/logo.png differ
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/note.png b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/note.png
new file mode 100644
index 00000000..88d997b1
Binary files /dev/null and b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/note.png differ
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/sts_exception.png b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/sts_exception.png
new file mode 100644
index 00000000..8607c38a
Binary files /dev/null and b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/sts_exception.png differ
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/tip.png b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/tip.png
new file mode 100644
index 00000000..6530abb4
Binary files /dev/null and b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/tip.png differ
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/warning.png b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/warning.png
new file mode 100644
index 00000000..0d5b5244
Binary files /dev/null and b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/warning.png differ
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/web-selected.png b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/web-selected.png
new file mode 100644
index 00000000..aa6b2da6
Binary files /dev/null and b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/images/web-selected.png differ
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/xsl/common.xsl b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/xsl/common.xsl
new file mode 100644
index 00000000..157bf9d8
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/xsl/common.xsl
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+
+
+ images/
+ .png
+
+
+ book toc,title
+ 3
+
+
+
+
+
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/xsl/epub.xsl b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/xsl/epub.xsl
new file mode 100644
index 00000000..031406ca
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/xsl/epub.xsl
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/xsl/html-multipage.xsl b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/xsl/html-multipage.xsl
new file mode 100644
index 00000000..be9cc52d
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/xsl/html-multipage.xsl
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+ css/manual-multipage.css
+
+ '5'
+ '1'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ firstpage
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/xsl/html-singlepage.xsl b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/xsl/html-singlepage.xsl
new file mode 100644
index 00000000..6bd4ac81
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/xsl/html-singlepage.xsl
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+ css/manual-singlepage.css
+
+
diff --git a/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/xsl/html.xsl b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/xsl/html.xsl
new file mode 100644
index 00000000..fd96f9a7
--- /dev/null
+++ b/spring-cloud-release-tools-spring/src/test/resources/projects/spring-cloud-build/docs/src/main/docbook/xsl/html.xsl
@@ -0,0 +1,141 @@
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+ 1
+
+
+
+ 120
+ images/callouts/
+ .png
+
+
+ text/css
+
+ text-align: left
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ,
+
+
+
+
+
+
+
+