Releaser -> spring-cloud-release-tools

This commit is contained in:
Marcin Grzejszczak
2017-03-07 22:28:44 +01:00
parent 8ce08e992e
commit 36383b14bf
222 changed files with 29 additions and 27 deletions

View File

@@ -0,0 +1,190 @@
/*
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*/
package org.springframework.cloud.release.internal;
import java.io.File;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.net.URI;
import java.util.List;
import org.eclipse.jgit.api.CheckoutCommand;
import org.eclipse.jgit.api.CloneCommand;
import org.eclipse.jgit.api.CreateBranchCommand;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.ListBranchCommand;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.util.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Abstraction over a Git repo. Can clonea repo from a given location
* and check its branch.
*
* @author Marcin Grzejszczak
*/
class GitProjectRepo {
private static final Logger log = LoggerFactory
.getLogger(MethodHandles.lookup().lookupClass());
private final GitProjectRepo.JGitFactory gitFactory;
private final File basedir;
GitProjectRepo(File basedir) {
this.basedir = basedir;
this.gitFactory = new GitProjectRepo.JGitFactory();
}
GitProjectRepo(File basedir, GitProjectRepo.JGitFactory factory) {
this.basedir = basedir;
this.gitFactory = factory;
}
/**
* Clones the project
* @param projectUri - URI of the project
* @return file where the project was cloned
*/
File cloneProject(URI projectUri) {
try {
log.info("Cloning repo from [{}] to [{}]", projectUri, this.basedir);
Git git = cloneToBasedir(projectUri, this.basedir);
if (git != null) {
git.close();
}
File clonedRepo = git.getRepository().getWorkTree();
log.info("Cloned repo to [{}]", clonedRepo);
return clonedRepo;
}
catch (Exception e) {
throw new IllegalStateException("Exception occurred while cloning repo", e);
}
}
/**
* Checks out a branch for a project
* @param project - a Git project
* @param branch - branch to check out
*/
void checkout(File project, String branch) {
try {
log.info("Checking out branch [{}] for repo [{}] to [{}]", this.basedir, branch);
checkoutBranch(project, branch);
log.info("Successfully checked out the branch [{}]", branch);
}
catch (Exception e) {
throw new IllegalStateException(e);
}
}
private Git cloneToBasedir(URI projectUrl, File destinationFolder)
throws GitAPIException {
CloneCommand command = this.gitFactory.getCloneCommandByCloneRepository()
.setURI(projectUrl.toString() + ".git").setDirectory(destinationFolder);
try {
return command.call();
}
catch (GitAPIException e) {
deleteBaseDirIfExists();
throw e;
}
}
private Ref checkoutBranch(File projectDir, String branch)
throws GitAPIException {
Git git = this.gitFactory.open(projectDir);
CheckoutCommand command = git.checkout().setName(branch);
try {
if (shouldTrack(git, branch)) {
trackBranch(command, branch);
}
return command.call();
}
catch (GitAPIException e) {
deleteBaseDirIfExists();
throw e;
} finally {
git.close();
}
}
private boolean shouldTrack(Git git, String label) throws GitAPIException {
return isBranch(git, label) && !isLocalBranch(git, label);
}
private void trackBranch(CheckoutCommand checkout, String label) {
checkout.setCreateBranch(true).setName(label)
.setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.TRACK)
.setStartPoint("origin/" + label);
}
private boolean isBranch(Git git, String label) throws GitAPIException {
return containsBranch(git, label, ListBranchCommand.ListMode.ALL);
}
private boolean isLocalBranch(Git git, String label) throws GitAPIException {
return containsBranch(git, label, null);
}
private boolean containsBranch(Git git, String label, ListBranchCommand.ListMode listMode)
throws GitAPIException {
ListBranchCommand command = git.branchList();
if (listMode != null) {
command.setListMode(listMode);
}
List<Ref> branches = command.call();
for (Ref ref : branches) {
if (ref.getName().endsWith("/" + label)) {
return true;
}
}
return false;
}
private void deleteBaseDirIfExists() {
if (this.basedir.exists()) {
try {
FileUtils.delete(this.basedir, FileUtils.RECURSIVE);
}
catch (IOException e) {
throw new IllegalStateException("Failed to initialize base directory", e);
}
}
}
/**
* Wraps the static method calls to {@link org.eclipse.jgit.api.Git} and
* {@link org.eclipse.jgit.api.CloneCommand} allowing for easier unit testing.
*/
static class JGitFactory {
CloneCommand getCloneCommandByCloneRepository() {
return Git.cloneRepository();
}
Git open(File file) {
try {
return Git.open(file);
}
catch (IOException e) {
throw new IllegalStateException(e);
}
}
}
}

View File

@@ -0,0 +1,44 @@
/*
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*/
package org.springframework.cloud.release.internal;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import org.apache.maven.model.Model;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
/**
* @author Marcin Grzejszczak
*/
class PomReader {
/**
* Returns a parsed POM
*/
Model readPom(File pom) {
try(Reader reader = new FileReader(pom)) {
MavenXpp3Reader xpp3Reader = new MavenXpp3Reader();
return xpp3Reader.read(reader);
}
catch (XmlPullParserException | IOException e) {
throw new IllegalStateException("Failed to read file", e);
}
}
}

View File

@@ -0,0 +1,403 @@
/*
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*/
package org.springframework.cloud.release.internal;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import org.apache.maven.model.Model;
import org.apache.maven.plugin.logging.Log;
import org.codehaus.mojo.versions.api.PomHelper;
import org.codehaus.mojo.versions.change.AbstractVersionChanger;
import org.codehaus.mojo.versions.change.VersionChange;
import org.codehaus.mojo.versions.change.VersionChanger;
import org.codehaus.mojo.versions.change.VersionChangerFactory;
import org.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader;
import org.codehaus.stax2.XMLInputFactory2;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;
/**
* @author Marcin Grzejszczak
*/
class PomUpdater {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private final PomReader pomReader = new PomReader();
private final PomWriter pomWriter = new PomWriter();
/**
* Basing on the contents of the root pom and the versions will decide whether
* the project should be updated or not.
*
* @param rootFolder - root folder of the project
* @param versions - list of dependencies to be updated
* @return {@code true} if the project is on the list of projects to be updated
*/
boolean shouldProjectBeUpdated(File rootFolder, Versions versions) {
File rootPom = rootPom(rootFolder);
Model model = this.pomReader.readPom(rootPom);
String artifactId = artifactId(model);
if (!versions.shouldBeUpdated(artifactId)) {
log.info("Skipping project [{}] since it's not on the list of projects to update", model.getArtifactId());
return false;
}
log.info("Project [{}] will have its dependencies updated", model.getArtifactId());
return true;
}
private File rootPom(File rootFolder) {
if (rootFolder.getName().endsWith(".xml")) {
return rootFolder;
}
return new File(rootFolder, "pom.xml");
}
private String artifactId(Model model) {
boolean parent = model.getArtifactId().endsWith("-parent");
if (!parent) {
return model.getArtifactId();
}
return model.getArtifactId().substring(0, model.getArtifactId().indexOf("-parent"));
}
ModelWrapper readModel(File pom) {
return new ModelWrapper(this.pomReader.readPom(pom));
}
/**q
* Updates the root / child module model
*
* @param rootProject - root project model
* @param pom - file with the pom
* @param versions - versions to update
* @return updated model
*/
ModelWrapper updateModel(ModelWrapper rootProject, File pom, Versions versions) {
Model model = this.pomReader.readPom(pom);
List<VersionChange> sourceChanges = new ArrayList<>();
sourceChanges = updateParentIfPossible(rootProject, versions, model, sourceChanges);
sourceChanges = updateVersionIfPossible(rootProject, versions, model, sourceChanges);
return new ModelWrapper(model, sourceChanges, versions);
}
/**
* Overwrites the pom.xml with data from {@link ModelWrapper} only if there were
* any changes in the model.
*
* @return - the pom file
*/
File overwritePomIfDirty(ModelWrapper wrapper, Versions versions, File pom) {
if (wrapper.isDirty()) {
log.debug("There were changes in the pom so file will be overridden");
this.pomWriter.write(wrapper, versions, pom);
log.info("Successfully stored [{}]", pom);
}
return pom;
}
private List<VersionChange> updateParentIfPossible(ModelWrapper wrapper, Versions versions,
Model model, List<VersionChange> sourceChanges) {
String rootProjectName = wrapper.projectName();
List<VersionChange> changes = new ArrayList<>(sourceChanges);
if (model.getParent() == null || StringUtils.isEmpty(model.getParent().getVersion())) {
return changes;
}
String parentGroupId = model.getParent().getGroupId();
String parentArtifactId = model.getParent().getArtifactId();
log.debug("Searching for a version of parent [{}:{}]", parentGroupId, parentArtifactId);
String oldVersion = model.getParent().getVersion();
String version = versions.versionForProject(parentArtifactId);
log.debug("Found version is [{}]", version);
if (StringUtils.isEmpty(version)) {
if (StringUtils.hasText(model.getParent().getRelativePath())) {
version = versions.versionForProject(rootProjectName);
} else {
log.warn("There is no info on the [{}:{}] version", parentGroupId, parentArtifactId);
return changes;
}
}
if (oldVersion.equals(version)) {
log.debug("Won't update the version of [{}:{}] since you're already using the proper one", parentGroupId, parentArtifactId);
return changes;
}
log.info("Setting version of parent [{}] to [{}] for module [{}]", parentArtifactId,
version, model.getArtifactId());
changes.add(new VersionChange(parentGroupId, parentArtifactId, oldVersion, version));
return changes;
}
private List<VersionChange> updateVersionIfPossible(ModelWrapper wrapper, Versions versions,
Model model, List<VersionChange> sourceChanges) {
String rootProjectName = wrapper.projectName();
List<VersionChange> changes = new ArrayList<>(sourceChanges);
String groupId = groupId(model);
String artifactId = model.getArtifactId();
log.debug("Searching for a version [{}:{}]", groupId, artifactId);
String oldVersion = model.getVersion();
String version = versions.versionForProject(rootProjectName);
log.debug("Found version is [{}]", version);
if (StringUtils.isEmpty(version) || StringUtils.isEmpty(model.getVersion())) {
log.debug("There was no version set for project [{}], skipping version setting for module [{}]", rootProjectName, model.getArtifactId());
return changes;
}
if (oldVersion.equals(version)) {
log.debug("Won't update the version of [{}]:[{}] since you're already using the proper one", groupId, artifactId);
return changes;
}
log.info("Setting [{}] version to [{}]", artifactId, version);
changes.add(new VersionChange(groupId, artifactId, oldVersion, version));
return changes;
}
private String groupId(Model model) {
if (StringUtils.hasText(model.getGroupId())) {
return model.getGroupId();
}
if (model.getParent() != null) {
return model.getParent().getGroupId();
}
return "";
}
}
class ModelWrapper {
final Model model;
final Versions versions;
final List<VersionChange> sourceChanges = new ArrayList<>();
ModelWrapper(Model model, List<VersionChange> sourceChanges, Versions versions) {
this.model = model;
this.versions = versions;
this.sourceChanges.addAll(sourceChanges);
}
ModelWrapper(Model model) {
this.model = model;
this.versions = Versions.EMPTY_VERSION;
}
String projectName() {
return this.model.getArtifactId();
}
boolean isDirty() {
return !this.sourceChanges.isEmpty() || this.versions.shouldSetProperty(this.model.getProperties());
}
}
class PomWriter {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
void write(ModelWrapper wrapper, Versions versions, File pom) {
try {
VersionChangerFactory versionChangerFactory = new VersionChangerFactory();
StringBuilder input = PomHelper.readXmlFile(pom);
ModifiedPomXMLEventReader parsedPom = newModifiedPomXER(input);
versionChangerFactory.setPom(parsedPom);
LoggerToMavenLog loggerToMavenLog = new LoggerToMavenLog(PomWriter.log);
versionChangerFactory.setLog(loggerToMavenLog);
versionChangerFactory.setModel(wrapper.model);
log.info("Applying version / parent / plugin / project changes to the pom [{}]", pom);
VersionChanger changer = versionChangerFactory.newVersionChanger( true,
true, true, true);
for (VersionChange versionChange : wrapper.sourceChanges) {
changer.apply(versionChange);
}
log.debug("Applying properties changes to the pom [{}]", pom);
new PropertyVersionChanger(wrapper, versions, parsedPom, loggerToMavenLog)
.apply(null);
try (BufferedWriter bw = new BufferedWriter(new FileWriter(pom))) {
bw.write(input.toString());
}
log.debug("Flushed changes to the pom file [{}]", pom);
} catch (Exception e) {
log.error("Exception occurred while trying to apply changes to the POM", e);
}
}
/**
* Creates a {@link org.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader} from a StringBuilder.
*
* @param input The XML to read and modify.
* @return The {@link org.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader}.
*/
private ModifiedPomXMLEventReader newModifiedPomXER(StringBuilder input) {
ModifiedPomXMLEventReader newPom = null;
try {
XMLInputFactory inputFactory = XMLInputFactory2.newInstance();
inputFactory.setProperty(XMLInputFactory2.P_PRESERVE_LOCATION, Boolean.TRUE);
newPom = new ModifiedPomXMLEventReader(input, inputFactory);
}
catch (XMLStreamException e) {
log.error("Exception occurred while trying to parse pom", e);
}
return newPom;
}
}
class PropertyVersionChanger extends AbstractVersionChanger {
private final Versions versions;
private final PropertyStorer propertyStorer;
PropertyVersionChanger(ModelWrapper wrapper, Versions versions, ModifiedPomXMLEventReader pom, Log log) {
super(wrapper.model, pom, log);
this.versions = versions;
this.propertyStorer = new PropertyStorer(log, pom);
}
PropertyVersionChanger(ModelWrapper wrapper, Versions versions, ModifiedPomXMLEventReader pom, Log log, PropertyStorer propertyStorer) {
super(wrapper.model, pom, log);
this.versions = versions;
this.propertyStorer = propertyStorer;
}
@Override public void apply(final VersionChange versionChange) throws XMLStreamException {
this.versions.projects
.stream()
.filter(project -> {
Properties properties = getModel().getProperties();
String projectVersionKey = propertyName(project);
if (!properties.containsKey(projectVersionKey)) {
return false;
}
String version = properties.getProperty(projectVersionKey);
return !version.equals(project.version);
})
.forEach(this.propertyStorer::setPropertyVersionIfApplicable);
}
private String propertyName(Project project) {
return project.name + ".version";
}
}
class PropertyStorer {
private final Log log;
private final ModifiedPomXMLEventReader pom;
PropertyStorer(Log log, ModifiedPomXMLEventReader pom) {
this.log = log;
this.pom = pom;
}
void setPropertyVersionIfApplicable(Project project) {
String propertyName = propertyName(project);
if (setPropertyVersion(propertyName, project.version)) {
log.info(" Updating property " + propertyName);
log.info(" to version " + project.version);
}
}
private String propertyName(Project project) {
return project.name + ".version";
}
private boolean setPropertyVersion(String propertyName, String version) {
try {
return PomHelper.setPropertyVersion(this.pom, null, propertyName, version);
}
catch (XMLStreamException e) {
this.log.error("Exception occurred while trying to set property version", e);
return false;
}
}
}
class LoggerToMavenLog implements Log {
private final Logger logger;
LoggerToMavenLog(Logger logger) {
this.logger = logger;
}
@Override public boolean isDebugEnabled() {
return this.logger.isDebugEnabled();
}
@Override public void debug(CharSequence content) {
this.logger.debug(content.toString());
}
@Override public void debug(CharSequence content, Throwable error) {
this.logger.debug(content.toString(), error);
}
@Override public void debug(Throwable error) {
this.debug("Exception occurred", error);
}
@Override public boolean isInfoEnabled() {
return this.logger.isInfoEnabled();
}
@Override public void info(CharSequence content) {
this.logger.info(content.toString());
}
@Override public void info(CharSequence content, Throwable error) {
this.logger.info(content.toString(), error);
}
@Override public void info(Throwable error) {
this.info("Exception occurred", error);
}
@Override public boolean isWarnEnabled() {
return this.logger.isWarnEnabled();
}
@Override public void warn(CharSequence content) {
this.logger.warn(content.toString());
}
@Override public void warn(CharSequence content, Throwable error) {
this.logger.warn(content.toString(), error);
}
@Override public void warn(Throwable error) {
this.warn("Exception occurred", error);
}
@Override public boolean isErrorEnabled() {
return this.logger.isErrorEnabled();
}
@Override public void error(CharSequence content) {
this.logger.error(content.toString());
}
@Override public void error(CharSequence content, Throwable error) {
this.logger.error(content.toString(), error);
}
@Override public void error(Throwable error) {
this.error("Exception occurred", error);
}
}

View File

@@ -0,0 +1,125 @@
/*
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*/
package org.springframework.cloud.release.internal;
import java.io.File;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.net.URI;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Marcin Grzejszczak
*/
public class ProjectUpdater {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private final File destinationDir;
private final ReleaserProperties properties;
private final GitProjectRepo gitProjectRepo;
private final PomUpdater pomUpdater = new PomUpdater();
public ProjectUpdater(ReleaserProperties properties) {
try {
this.destinationDir = properties.getCloneDestinationDir() != null ?
new File(properties.getCloneDestinationDir()) :
Files.createTempDirectory("releaser").toFile();
this.properties = properties;
this.gitProjectRepo = new GitProjectRepo(this.destinationDir);
}
catch (IOException e) {
throw new IllegalStateException("Failed to create a temporary folder", e);
}
}
/**
* For the given root folder (typically the working directory) performs the whole
* flow of updating {@code pom.xml} with values from Spring Cloud Release project.
*
* @param projectRoot - root folder with project to update
*/
public void updateProject(File projectRoot) {
File clonedScRelease = this.gitProjectRepo.cloneProject(
URI.create(this.properties.getSpringCloudReleaseGitUrl()));
this.gitProjectRepo.checkout(clonedScRelease, this.properties.getBranch());
SCReleasePomParser sCReleasePomParser = new SCReleasePomParser(clonedScRelease);
Versions versions = sCReleasePomParser.allVersions();
log.info("Retrieved the following versions\n{}", versions);
if (!this.pomUpdater.shouldProjectBeUpdated(projectRoot, versions)) {
log.info("Skipping project updating");
return;
}
File rootPom = new File(projectRoot, "pom.xml");
ModelWrapper rootPomModel = this.pomUpdater.readModel(rootPom);
processAllPoms(projectRoot, new PomWalker(rootPomModel, versions, this.pomUpdater,
properties));
}
private void processAllPoms(File projectRoot, PomWalker pomWalker) {
try {
Files.walkFileTree(projectRoot.toPath(), pomWalker);
}
catch (IOException e) {
throw new IllegalStateException(e);
}
}
private class PomWalker extends SimpleFileVisitor<Path> {
private static final String POM_XML = "pom.xml";
private final ModelWrapper rootPom;
private final Versions versions;
private final PomUpdater pomUpdater;
private final ReleaserProperties properties;
private PomWalker(ModelWrapper rootPom, Versions versions, PomUpdater pomUpdater,
ReleaserProperties properties) {
this.rootPom = rootPom;
this.versions = versions;
this.pomUpdater = pomUpdater;
this.properties = properties;
}
@Override
public FileVisitResult visitFile(Path path, BasicFileAttributes attr) {
File file = path.toFile();
if (POM_XML.equals(file.getName())) {
if (pathIgnored(file)) {
log.debug("Ignoring file [{}] since it's on a list of patterns to ignore", file);
return FileVisitResult.CONTINUE;
}
ModelWrapper model = this.pomUpdater.updateModel(this.rootPom, file, this.versions);
this.pomUpdater.overwritePomIfDirty(model, this.versions, file);
}
return FileVisitResult.CONTINUE;
}
private boolean pathIgnored(File file) {
String path = file.getPath();
return this.properties.getIgnoredPomRegex().stream().anyMatch(path::matches);
}
}
}

View File

@@ -0,0 +1,85 @@
/*
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*/
package org.springframework.cloud.release.internal;
import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties;
import edu.emory.mathcs.backport.java.util.Arrays;
/**
* @author Marcin Grzejszczak
*/
@ConfigurationProperties("releaser")
public class ReleaserProperties {
/**
* URL to Spring Cloud Release Git repository
*/
private String springCloudReleaseGitUrl = "https://github.com/spring-cloud/spring-cloud-release";
/**
* Where should the Spring Cloud Release repo get cloned to. If {@code null} defaults to a temporary directory
*/
private String cloneDestinationDir;
/**
* List of regular expressions of ignored poms. Defaults to test projects and samples.
*/
@SuppressWarnings("unchecked")
private List<String> ignoredPomRegex = Arrays.asList(new String[] {
"^.*spring-cloud-contract-maven-plugin/src/test/projects/.*$",
"^.*samples/standalone.*$"
});
/**
* Which branch of Spring Cloud Release should be checked out. Defaults to {@code master}
*/
private String branch = "master";
public String getSpringCloudReleaseGitUrl() {
return this.springCloudReleaseGitUrl;
}
public void setSpringCloudReleaseGitUrl(String springCloudReleaseGitUrl) {
this.springCloudReleaseGitUrl = springCloudReleaseGitUrl;
}
public String getCloneDestinationDir() {
return this.cloneDestinationDir;
}
public void setCloneDestinationDir(String cloneDestinationDir) {
this.cloneDestinationDir = cloneDestinationDir;
}
public String getBranch() {
return this.branch;
}
public void setBranch(String branch) {
this.branch = branch;
}
public List<String> getIgnoredPomRegex() {
return this.ignoredPomRegex;
}
public void setIgnoredPomRegex(List<String> ignoredPomRegex) {
this.ignoredPomRegex = ignoredPomRegex;
}
}

View File

@@ -0,0 +1,128 @@
/*
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*/
package org.springframework.cloud.release.internal;
import java.io.File;
import java.lang.invoke.MethodHandles;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.apache.maven.model.Model;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Parses the poms for a given project and populates versions from Spring Cloud Release
*
* @author Marcin Grzejszczak
*/
class SCReleasePomParser {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private static final String STARTER_POM = "spring-cloud-starter-parent/pom.xml";
private static final String DEPENDENCIES_POM = "spring-cloud-dependencies/pom.xml";
private static final Pattern SC_VERSION_PATTERN = Pattern.compile("^(spring-cloud-.*)\\.version$");
private final File springCloudReleaseDir;
private final String bootPom;
private final String dependenciesPom;
private final PomReader pomReader = new PomReader();
SCReleasePomParser(File springCloudReleaseDir) {
this(springCloudReleaseDir, STARTER_POM, DEPENDENCIES_POM);
}
SCReleasePomParser(File springCloudReleaseDir, String bootPom, String dependenciesPom) {
this.springCloudReleaseDir = springCloudReleaseDir;
this.bootPom = bootPom;
this.dependenciesPom = dependenciesPom;
}
Versions allVersions() {
Versions boot = bootVersion();
Versions cloud = springCloudVersions();
return new Versions(boot.bootVersion, cloud.scBuildVersion, allProjects(boot, cloud));
}
private Set<Project> allProjects(Versions boot, Versions cloud) {
Set<Project> allProjects = new HashSet<>();
allProjects.addAll(boot.projects);
allProjects.addAll(cloud.projects);
return allProjects;
}
Versions bootVersion() {
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");
}
String bootVersion = model.getParent().getVersion();
log.debug("Boot version is equal to [{}]", bootVersion);
return new Versions(bootVersion);
}
private Model pom(String pom) {
if (pom == null) {
throw new IllegalStateException("Pom is not present");
}
File pomFile = new File(this.springCloudReleaseDir, pom);
if (!pomFile.exists()) {
throw new IllegalStateException("Pom is not present");
}
return this.pomReader.readPom(pomFile);
}
Versions springCloudVersions() {
Model model = pom(this.dependenciesPom);
String buildArtifact = model.getParent().getArtifactId();
log.debug("[{}] artifact id is equal to [{}]", SpringCloudConstants.CLOUD_DEPENDENCIES_ARTIFACT_ID, buildArtifact);
if (!SpringCloudConstants.CLOUD_DEPENDENCIES_ARTIFACT_ID.equals(buildArtifact)) {
throw new IllegalStateException("The pom doesn't have a [" + SpringCloudConstants.CLOUD_DEPENDENCIES_ARTIFACT_ID + "] artifact id");
}
String buildVersion = model.getParent().getVersion();
log.debug("Spring Cloud Build version is equal to [{}]", buildVersion);
Set<Project> projects = model.getProperties().entrySet()
.stream()
.filter(propertyMatchesSCPattern())
.map(toProject())
.collect(Collectors.toSet());
return new Versions(buildVersion, projects);
}
private Predicate<Map.Entry<Object, Object>> propertyMatchesSCPattern() {
return entry -> SC_VERSION_PATTERN.matcher(entry.getKey().toString()).matches();
}
private Function<Map.Entry<Object, Object>, Project> toProject() {
return entry -> {
Matcher matcher = SC_VERSION_PATTERN.matcher(entry.getKey().toString());
// you have to first match to get info about the group
matcher.matches();
String name = matcher.group(1);
return new Project(name, entry.getValue().toString());
};
}
}

View File

@@ -0,0 +1,31 @@
/*
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*/
package org.springframework.cloud.release.internal;
/**
* @author Marcin Grzejszczak
*/
final class SpringCloudConstants {
static final String BOOT_STARTER_ARTIFACT_ID = "spring-boot-starter-parent";
static final String CLOUD_DEPENDENCIES_ARTIFACT_ID = "spring-cloud-dependencies-parent";
static final String BUILD_ARTIFACT_ID = "spring-cloud-build";
private SpringCloudConstants() {
throw new IllegalStateException("Don't instantiate a utility class");
}
}

View File

@@ -0,0 +1,136 @@
/*
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*/
package org.springframework.cloud.release.internal;
import java.util.HashSet;
import java.util.Properties;
import java.util.Set;
import java.util.stream.Collectors;
import static org.springframework.cloud.release.internal.SpringCloudConstants.BOOT_STARTER_ARTIFACT_ID;
import static org.springframework.cloud.release.internal.SpringCloudConstants.BUILD_ARTIFACT_ID;
import static org.springframework.cloud.release.internal.SpringCloudConstants.CLOUD_DEPENDENCIES_ARTIFACT_ID;
/**
* Represents versions taken out from Spring Cloud Release pom
*
* @author Marcin Grzejszczak
*/
class Versions {
private static final String SPRING_BOOT_PROJECT_NAME = "spring-boot";
static final Versions EMPTY_VERSION = new Versions("");
String bootVersion;
String scBuildVersion;
Set<Project> projects = new HashSet<>();
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));
}
Versions(String scBuildVersion, Set<Project> projects) {
this.scBuildVersion = scBuildVersion;
this.projects.add(new Project(BUILD_ARTIFACT_ID, scBuildVersion));
this.projects.add(new Project(CLOUD_DEPENDENCIES_ARTIFACT_ID, scBuildVersion));
this.projects.addAll(projects);
}
Versions(String bootVersion, String scBuildVersion, Set<Project> projects) {
this.bootVersion = bootVersion;
this.scBuildVersion = scBuildVersion;
this.projects.add(new Project(BUILD_ARTIFACT_ID, scBuildVersion));
this.projects.add(new Project(CLOUD_DEPENDENCIES_ARTIFACT_ID, scBuildVersion));
this.projects.addAll(projects);
}
String versionForProject(String projectName) {
return this.projects.stream()
.filter(project -> nameMatches(projectName, project))
.findFirst()
.orElse(Project.EMPTY_PROJECT)
.version;
}
boolean shouldBeUpdated(String projectName) {
return this.projects.stream()
.anyMatch(project -> nameMatches(projectName, project));
}
boolean shouldSetProperty(Properties properties) {
return this.projects.stream()
.anyMatch(project -> properties.containsKey(project.name + ".version"));
}
private boolean nameMatches(String projectName, Project project) {
if (project.name.equals(projectName)) {
return true;
}
boolean containsParent = projectName.endsWith("-parent");
if (!containsParent) {
return false;
}
String withoutParent = projectName.substring(0, projectName.indexOf("-parent"));
return project.name.equals(withoutParent);
}
@Override public String toString() {
return "Spring Boot Version=[" + this.bootVersion + ']' + "\nSpring Cloud Build Version=["
+ this.scBuildVersion + ']' + "\nProjects=\n\t" + this.projects.stream().map(Object::toString).collect(
Collectors.joining("\n\t"));
}
}
/**
* @author Marcin Grzejszczak
*/
class Project {
static Project EMPTY_PROJECT = new Project("", "");
final String name;
final String version;
Project(String name, String version) {
this.name = name;
this.version = version;
}
@Override public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Project project = (Project) o;
if (this.name != null ? !this.name.equals(project.name) : project.name != null)
return false;
return this.version != null ?
this.version.equals(project.version) :
project.version == null;
}
@Override public int hashCode() {
int result = this.name != null ? this.name.hashCode() : 0;
result = 31 * result + (this.version != null ? this.version.hashCode() : 0);
return result;
}
@Override public String toString() {
return "name=[" + this.name + "], version=[" + this.version + ']';
}
}

View File

@@ -0,0 +1,95 @@
package org.springframework.cloud.release;
import static org.assertj.core.api.BDDAssertions.then;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import org.apache.maven.model.Model;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.springframework.cloud.release.internal.ProjectUpdater;
import org.springframework.cloud.release.internal.ReleaserProperties;
import org.springframework.cloud.release.internal.TestPomReader;
import org.springframework.cloud.release.internal.TestUtils;
import org.springframework.util.FileSystemUtils;
/**
* @author Marcin Grzejszczak
*/
public class AcceptanceTests {
@Rule public TemporaryFolder tmp = new TemporaryFolder();
TestPomReader testPomReader = new TestPomReader();
File temporaryFolder;
@Before
public void setup() throws Exception {
this.temporaryFolder = this.tmp.newFolder();
TestUtils.prepareLocalRepo();
FileSystemUtils.copyRecursively(file("/projects/"), this.temporaryFolder);
}
@Test
public void should_update_all_versions_for_a_release_train() throws Exception {
ReleaserProperties releaserProperties = releaserProperties();
ProjectUpdater projectUpdater = new ProjectUpdater(releaserProperties);
projectUpdater.updateProject(new File(this.temporaryFolder, "/spring-cloud-sleuth"));
then(this.temporaryFolder).exists();
Model rootPom = this.testPomReader.readPom(tmpFile("/spring-cloud-sleuth/pom.xml"));
Model depsPom = this.testPomReader.readPom(tmpFile("/spring-cloud-sleuth/spring-cloud-sleuth-dependencies/pom.xml"));
Model corePom = this.testPomReader.readPom(tmpFile("/spring-cloud-sleuth/spring-cloud-sleuth-core/pom.xml"));
Model zipkinStreamPom = this.testPomReader.readPom(tmpFile("/spring-cloud-sleuth/spring-cloud-sleuth-samples/spring-cloud-sleuth-sample-zipkin-stream/pom.xml"));
then(rootPom.getVersion()).isEqualTo("1.2.0.BUILD-SNAPSHOT");
then(rootPom.getProperties())
.containsEntry("spring-cloud-build.version","1.3.1.BUILD-SNAPSHOT")
.containsEntry("spring-cloud-commons.version","1.2.0.BUILD-SNAPSHOT")
.containsEntry("spring-cloud-stream.version","Chelsea.BUILD-SNAPSHOT")
.containsEntry("spring-cloud-netflix.version","1.3.0.BUILD-SNAPSHOT");
then(depsPom.getVersion()).isEqualTo("1.2.0.BUILD-SNAPSHOT");
then(depsPom.getParent().getVersion()).isEqualTo("1.3.1.BUILD-SNAPSHOT");
then(corePom.getParent().getVersion()).isEqualTo("1.2.0.BUILD-SNAPSHOT");
then(zipkinStreamPom.getParent().getVersion()).isEqualTo("1.2.0.BUILD-SNAPSHOT");
}
@Test
public void should_not_update_a_project_that_is_not_on_the_list() throws Exception {
ReleaserProperties releaserProperties = releaserProperties();
ProjectUpdater projectUpdater = new ProjectUpdater(releaserProperties);
File beforeProcessing = pom("/projects/project/");
projectUpdater.updateProject(new File(this.temporaryFolder, "/project/"));
then(this.temporaryFolder).exists();
File afterProcessing = tmpFile("/project/pom.xml");
then(asString(beforeProcessing)).isEqualTo(asString(afterProcessing));
}
private ReleaserProperties releaserProperties() throws URISyntaxException {
ReleaserProperties releaserProperties = new ReleaserProperties();
releaserProperties.setSpringCloudReleaseGitUrl(file("/projects/spring-cloud-release/").toURI().getPath());
return releaserProperties;
}
private File tmpFile(String relativePath) {
return new File(this.temporaryFolder, relativePath);
}
private File file(String relativePath) throws URISyntaxException {
return new File(AcceptanceTests.class.getResource(relativePath).toURI());
}
private File pom(String relativePath) throws URISyntaxException {
return new File(new File(AcceptanceTests.class.getResource(relativePath).toURI()), "pom.xml");
}
private String asString(File file) throws IOException {
return new String(Files.readAllBytes(file.toPath()));
}
}

View File

@@ -0,0 +1,102 @@
package org.springframework.cloud.release.internal;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import org.eclipse.jgit.api.CloneCommand;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import static org.assertj.core.api.Assertions.fail;
import static org.assertj.core.api.BDDAssertions.then;
import static org.assertj.core.api.BDDAssertions.thenThrownBy;
/**
* @author Marcin Grzejszczak
*/
public class GitProjectRepoTests {
@Rule public TemporaryFolder tmp = new TemporaryFolder();
File springCloudReleaseProject;
File tmpFolder;
GitProjectRepo gitProjectRepo;
@Before
public void setup() throws IOException, URISyntaxException {
this.tmpFolder = this.tmp.newFolder();
this.springCloudReleaseProject = new File(GitProjectRepoTests.class.getResource("/projects/spring-cloud-release").toURI());
TestUtils.prepareLocalRepo();
this.gitProjectRepo = new GitProjectRepo(this.tmpFolder);
}
@Test
public void should_clone_the_project_from_a_given_location() throws IOException {
this.gitProjectRepo.cloneProject(this.springCloudReleaseProject.toURI());
then(new File(this.tmpFolder, ".git")).exists();
}
@Test
public void should_throw_exception_when_there_is_no_repo() throws IOException, URISyntaxException {
thenThrownBy(() -> this.gitProjectRepo
.cloneProject(GitProjectRepoTests.class.getResource("/projects/").toURI()))
.isInstanceOf(IllegalStateException.class)
.hasMessageContaining("Exception occurred while cloning repo");
}
@Test
public void should_throw_an_exception_when_failed_to_initialize_the_repo() throws IOException {
thenThrownBy(() -> new GitProjectRepo(this.tmpFolder, new ExceptionThrowingJGitFactory()).cloneProject(this.springCloudReleaseProject.toURI()))
.isInstanceOf(IllegalStateException.class)
.hasMessageContaining("Exception occurred while cloning repo")
.hasCauseInstanceOf(CustomException.class);
}
@Test
public void should_check_out_a_branch_on_cloned_repo() throws IOException {
File project = this.gitProjectRepo.cloneProject(this.springCloudReleaseProject.toURI());
this.gitProjectRepo.checkout(project, "vCamden.SR3");
File pom = new File(this.tmpFolder, "pom.xml");
then(pom).exists();
then(Files.lines(pom.toPath()).anyMatch(s -> s.contains("<version>Camden.SR3</version>"))).isTrue();
}
@Test
public void should_check_out_a_branch_on_cloned_repo2() throws IOException {
File project = this.gitProjectRepo.cloneProject(this.springCloudReleaseProject.toURI());
this.gitProjectRepo.checkout(project, "Camden.x");
File pom = new File(this.tmpFolder, "pom.xml");
then(pom).exists();
then(Files.lines(pom.toPath()).anyMatch(s -> s.contains("<version>Camden.BUILD-SNAPSHOT</version>"))).isTrue();
}
@Test
public void should_throw_an_exception_when_checking_out_nonexisting_branch() throws IOException {
File project = this.gitProjectRepo.cloneProject(this.springCloudReleaseProject.toURI());
try {
this.gitProjectRepo.checkout(project, "nonExistingBranch");
fail("should throw an exception");
} catch (IllegalStateException e) {
then(e).hasMessageContaining("Ref nonExistingBranch can not be resolved");
}
}
}
class ExceptionThrowingJGitFactory extends GitProjectRepo.JGitFactory {
@Override CloneCommand getCloneCommandByCloneRepository() {
throw new CustomException("foo");
}
}
class CustomException extends RuntimeException {
public CustomException(String message) {
super(message);
}
}

View File

@@ -0,0 +1,118 @@
package org.springframework.cloud.release.internal;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.slf4j.Logger;
import static org.mockito.BDDMockito.then;
/**
* @author Marcin Grzejszczak
*/
@RunWith(MockitoJUnitRunner.class)
public class LoggerToMavenLogTests {
@Mock Logger logger;
@InjectMocks LoggerToMavenLog loggerToMavenLog;
RuntimeException exception = new RuntimeException();
@Test public void isDebugEnabled() throws Exception {
this.loggerToMavenLog.isDebugEnabled();
then(this.logger).should().isDebugEnabled();
}
@Test public void debug() throws Exception {
this.loggerToMavenLog.debug("foo");
then(this.logger).should().debug("foo");
}
@Test public void debug1() throws Exception {
this.loggerToMavenLog.debug("foo", this.exception);
then(this.logger).should().debug("foo", this.exception);
}
@Test public void debug2() throws Exception {
this.loggerToMavenLog.debug(exception);
then(this.logger).should().debug("Exception occurred", this.exception);
}
@Test public void isInfoEnabled() throws Exception {
this.loggerToMavenLog.isInfoEnabled();
then(this.logger).should().isInfoEnabled();
}
@Test public void info() throws Exception {
this.loggerToMavenLog.info("foo");
then(this.logger).should().info("foo");
}
@Test public void info1() throws Exception {
this.loggerToMavenLog.info("foo", this.exception);
then(this.logger).should().info("foo", this.exception);
}
@Test public void info2() throws Exception {
this.loggerToMavenLog.info(exception);
then(this.logger).should().info("Exception occurred", this.exception);
}
@Test public void isWarnEnabled() throws Exception {
this.loggerToMavenLog.isWarnEnabled();
then(this.logger).should().isWarnEnabled();
}
@Test public void warn() throws Exception {
this.loggerToMavenLog.warn("foo");
then(this.logger).should().warn("foo");
}
@Test public void warn1() throws Exception {
this.loggerToMavenLog.warn("foo", this.exception);
then(this.logger).should().warn("foo", this.exception);
}
@Test public void warn2() throws Exception {
this.loggerToMavenLog.warn(exception);
then(this.logger).should().warn("Exception occurred", this.exception);
}
@Test public void isErrorEnabled() throws Exception {
this.loggerToMavenLog.isErrorEnabled();
then(this.logger).should().isErrorEnabled();
}
@Test public void error() throws Exception {
this.loggerToMavenLog.error("foo");
then(this.logger).should().error("foo");
}
@Test public void error1() throws Exception {
this.loggerToMavenLog.error("foo", this.exception);
then(this.logger).should().error("foo", this.exception);
}
@Test public void error2() throws Exception {
this.loggerToMavenLog.error(exception);
then(this.logger).should().error("Exception occurred", this.exception);
}
}

View File

@@ -0,0 +1,69 @@
/*
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*/
package org.springframework.cloud.release.internal;
import static org.assertj.core.api.BDDAssertions.then;
import static org.assertj.core.api.BDDAssertions.thenThrownBy;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import org.apache.maven.model.Model;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.junit.Before;
import org.junit.Test;
/**
* @author Marcin Grzejszczak
*/
public class PomReaderTests {
PomReader pomReader = new PomReader();
File springCloudReleaseProject;
File licenseFile;
@Before
public void setup() throws URISyntaxException {
URI scRelease = GitProjectRepoTests.class.getResource("/projects/spring-cloud-release").toURI();
this.springCloudReleaseProject = new File(scRelease.getPath(), "pom.xml");
this.licenseFile = new File(scRelease.getPath(), "LICENSE.txt");
}
@Test
public void should_parse_a_valid_pom() {
Model pom = this.pomReader.readPom(this.springCloudReleaseProject);
then(pom).isNotNull();
then(pom.getArtifactId()).isEqualTo("spring-cloud-starter-build");
}
@Test
public void should_throw_exception_when_file_is_missing() {
thenThrownBy(() -> this.pomReader.readPom(new File("foo/bar")))
.hasMessage("Failed to read file")
.hasCauseInstanceOf(IOException.class);
}
@Test
public void should_throw_exception_when_file_is_invalid() {
thenThrownBy(() -> this.pomReader.readPom(this.licenseFile))
.hasMessage("Failed to read file")
.hasCauseInstanceOf(XmlPullParserException.class);
}
}

View File

@@ -0,0 +1,246 @@
/*
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*/
package org.springframework.cloud.release.internal;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.util.HashSet;
import java.util.Set;
import org.apache.maven.model.Model;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.springframework.util.FileSystemUtils;
import static org.springframework.cloud.release.internal.VersionChangeAssertions.then;
/**
* @author Marcin Grzejszczak
*/
public class PomUpdaterTests {
Versions versions = new Versions("0.0.1", "0.0.2", projects());
PomUpdater pomUpdater = new PomUpdater();
@Rule public TemporaryFolder tmp = new TemporaryFolder();
File temporaryFolder;
@Before
public void setup() throws IOException {
this.temporaryFolder = this.tmp.newFolder();
}
@Test
public void should_not_update_pom_when_project_is_not_on_the_versions_list() throws Exception {
File springCloudReleasePom = file("/projects/spring-cloud-release");
then(this.pomUpdater.shouldProjectBeUpdated(springCloudReleasePom, this.versions)).isFalse();
}
@Test
public void should_not_update_pom_when_project_with_parent_suffix_is_not_on_the_versions_list() throws Exception {
File springCloud = pom("/projects/project", "pom_with_parent_suffix.xml");
then(this.pomUpdater.shouldProjectBeUpdated(springCloud, this.versions)).isFalse();
}
@Test
public void should_update_pom_for_project_with_suffix_when_project_is_on_the_versions_list() throws Exception {
File springCloud = pom("/projects/project", "pom_matching_with_parent_suffix.xml");
then(this.pomUpdater.shouldProjectBeUpdated(springCloud, this.versions)).isTrue();
}
@Test
public void should_update_pom_when_project_is_not_on_the_versions_list() throws Exception {
File springCloudSleuthPom = file("/projects/spring-cloud-sleuth");
then(this.pomUpdater.shouldProjectBeUpdated(springCloudSleuthPom, this.versions)).isTrue();
}
@Test
public void should_not_update_the_model_if_no_changes_were_made() throws Exception {
File nonMatchingPom = pom("/projects/project");
ModelWrapper model = this.pomUpdater.updateModel(model("foo"), nonMatchingPom, this.versions);
then(model.isDirty()).isFalse();
}
@Test
public void should_update_the_model_if_only_artifact_id_is_matched_in_the_root_pom() throws Exception {
File matchingArtifactId = pom("/projects/project", "pom_matching_artifact.xml");
ModelWrapper model = this.pomUpdater.updateModel(model("spring-cloud-sleuth"), matchingArtifactId, this.versions);
then(model.isDirty()).isTrue();
then(new ListOfChanges(model))
.newParentVersionIsEqualTo("parentGroup", "spring-cloud-sleuth", "0.0.3.BUILD-SNAPSHOT");
}
@Test
public void should_update_the_model_if_parent_is_matched_via_sc_build() throws Exception {
File matchingArtifactId = pom("/projects/project", "pom_matching_parent_v2.xml");
ModelWrapper model = this.pomUpdater.updateModel(model("spring-cloud-sleuth"), matchingArtifactId, this.versions);
then(model.isDirty()).isTrue();
then(new ListOfChanges(model))
.newParentVersionIsEqualTo("org.springframework.cloud", "spring-cloud-sleuth", "0.0.3.BUILD-SNAPSHOT")
.newParentVersionIsEqualTo("org.springframework.cloud", "spring-cloud-build", "0.0.2");
}
@Test
public void should_update_the_model_if_parent_is_matched_via_sc_dependencies_parent() throws Exception {
File matchingArtifactId = pom("/projects/project", "pom_matching_parent.xml");
ModelWrapper model = this.pomUpdater.updateModel(model("spring-cloud-sleuth"), matchingArtifactId, this.versions);
then(model.isDirty()).isTrue();
then(new ListOfChanges(model))
.newParentVersionIsEqualTo("org.springframework.cloud", "spring-cloud-sleuth", "0.0.3.BUILD-SNAPSHOT")
.newParentVersionIsEqualTo("org.springframework.cloud", "spring-cloud-build", "0.0.2");
}
@Test
public void should_not_update_child_pom_when_project_is_not_on_the_versions_list() throws Exception {
File springCloudReleasePom = file("/projects/spring-cloud-release");
then(this.pomUpdater.shouldProjectBeUpdated(springCloudReleasePom, this.versions)).isFalse();
}
@Test
public void should_update_child_pom_when_project_is_not_on_the_versions_list() throws Exception {
File springCloudSleuthPom = file("/projects/spring-cloud-sleuth");
then(this.pomUpdater.shouldProjectBeUpdated(springCloudSleuthPom, this.versions)).isTrue();
}
@Test
public void should_update_the_child_model_if_parent_is_matched_via_sc_build() throws Exception {
File matchingArtifactId = pom("/projects/project/children", "pom_matching_parent_v2.xml");
ModelWrapper model = this.pomUpdater.updateModel(model("spring-cloud-sleuth"), matchingArtifactId, this.versions);
then(model.isDirty()).isTrue();
then(new ListOfChanges(model))
.newParentVersionIsEqualTo("org.springframework.cloud", "spring-cloud-sleuth", "0.0.3.BUILD-SNAPSHOT");
// the rest is the same
then(model.model.getProperties())
.containsEntry("spring-cloud-foo.version", "1.3.1.BUILD-SNAPSHOT")
.containsEntry("foo.version", "1.2.0.BUILD-SNAPSHOT");
}
@Test
public void should_update_the_child_model_if_parent_is_matched_via_sc_dependencies_parent() throws Exception {
File matchingArtifactId = pom("/projects/project/children", "pom_matching_parent.xml");
ModelWrapper model = this.pomUpdater.updateModel(model("spring-cloud-sleuth"), matchingArtifactId, this.versions);
then(model.isDirty()).isTrue();
then(new ListOfChanges(model))
.newParentVersionIsEqualTo("org.springframework.cloud", "spring-cloud-sleuth", "0.0.3.BUILD-SNAPSHOT");
// the rest is the same
then(model.model.getProperties())
.containsEntry("spring-cloud-foo.version", "1.3.1.BUILD-SNAPSHOT")
.containsEntry("foo.version", "1.2.0.BUILD-SNAPSHOT");
}
@Test
public void should_update_the_child_model_if_properties_are_matched() throws Exception {
File matchingArtifactId = pom("/projects/project/children", "pom_matching_properties.xml");
ModelWrapper model = this.pomUpdater.updateModel(model("spring-cloud-sleuth"), matchingArtifactId, this.versions);
then(model.isDirty()).isTrue();
then(new ListOfChanges(model))
.newParentVersionIsEqualTo("org.springframework.cloud", "spring-cloud-sleuth", "0.0.3.BUILD-SNAPSHOT");
}
@Test
public void should_override_a_pom_when_there_was_a_change_in_the_model() throws Exception {
FileSystemUtils.copyRecursively(file("/projects/project"), this.temporaryFolder);
File beforeProcessing = pom("/projects/project/children", "pom_matching_properties.xml");
File afterProcessing = new File(this.temporaryFolder, "/children/pom_matching_properties.xml");
ModelWrapper model = this.pomUpdater.updateModel(model("spring-cloud-sleuth"), afterProcessing, this.versions);
File processedPom = this.pomUpdater.overwritePomIfDirty(model, Versions.EMPTY_VERSION, afterProcessing);
then(processedPom).isSameAs(afterProcessing);
String processedPomText = asString(processedPom);
String beforeProcessingText = asString(beforeProcessing);
then(processedPomText).isNotEqualTo(beforeProcessingText);
}
@Test
public void should_not_override_a_pom_when_there_was_no_change_in_the_model() throws Exception {
FileSystemUtils.copyRecursively(file("/projects/project"), this.temporaryFolder);
File beforeProcessing = pom("/projects/project/");
File afterProcessing = new File(this.temporaryFolder, "/pom.xml");
ModelWrapper model = this.pomUpdater.updateModel(model("foo"), afterProcessing, this.versions);
File processedPom = this.pomUpdater.overwritePomIfDirty(model, Versions.EMPTY_VERSION, afterProcessing);
then(processedPom).isSameAs(afterProcessing);
then(asString(processedPom)).isEqualTo(asString(beforeProcessing));
}
@Test
public void should_update_the_model_when_root_project_has_parent_suffix() throws Exception {
File pom = pom("/projects/spring-cloud-contract");
ModelWrapper model = this.pomUpdater.updateModel(model("spring-cloud-contract-parent"), pom, this.versions);
then(model.isDirty()).isTrue();
then(new ListOfChanges(model))
.newParentVersionIsEqualTo("org.springframework.cloud", "spring-cloud-contract-parent", "0.0.2.BUILD-SNAPSHOT");
}
Set<Project> projects() {
Set<Project> projects = new HashSet<>();
projects.add(new Project("spring-cloud-contract", "0.0.2.BUILD-SNAPSHOT"));
projects.add(new Project("spring-cloud-sleuth", "0.0.3.BUILD-SNAPSHOT"));
projects.add(new Project("spring-cloud-vault", "0.0.4.BUILD-SNAPSHOT"));
return projects;
}
private ModelWrapper model(String projectName) {
Model parent = new Model();
parent.setArtifactId(projectName);
return new ModelWrapper(parent);
}
private File file(String relativePath) throws URISyntaxException {
return new File(GitProjectRepoTests.class.getResource(relativePath).toURI());
}
private File pom(String relativePath) throws URISyntaxException {
return pom(relativePath, "pom.xml");
}
private File pom(String relativePath, String pomName) throws URISyntaxException {
return new File(new File(GitProjectRepoTests.class.getResource(relativePath).toURI()), pomName);
}
private String asString(File file) throws IOException {
return new String(Files.readAllBytes(file.toPath()));
}
}

View File

@@ -0,0 +1,105 @@
package org.springframework.cloud.release.internal;
import java.util.HashSet;
import java.util.Properties;
import java.util.Set;
import org.apache.maven.model.Model;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import edu.emory.mathcs.backport.java.util.Arrays;
import static org.mockito.BDDMockito.then;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.never;
/**
* @author Marcin Grzejszczak
*/
@RunWith(MockitoJUnitRunner.class)
public class PropertyVersionChangerTests {
@Mock PropertyStorer propertyStorer;
@Test
public void should_set_version_when_project_matches_property_name() throws Exception {
PropertyVersionChanger changer = new PropertyVersionChanger(model(), versions(), null, null, this.propertyStorer);
changer.apply(null);
then(this.propertyStorer).should().setPropertyVersionIfApplicable(project("spring-cloud-sleuth", "1.2.0.BUILD-SNAPSHOT"));
}
@Test
public void should_not_set_version_when_project_doesnt_match_property_name() throws Exception {
PropertyVersionChanger changer = new PropertyVersionChanger(nonMatchingModel(), versions(), null, null, this.propertyStorer);
changer.apply(null);
then(this.propertyStorer).should(never()).setPropertyVersionIfApplicable(any(Project.class));
}
@Test
public void should_not_set_version_when_project_matches_property_name_and_versions_are_the_same() throws Exception {
PropertyVersionChanger changer = new PropertyVersionChanger(modelWithSameValues(), versions(), null, null, this.propertyStorer);
changer.apply(null);
then(this.propertyStorer).should(never()).setPropertyVersionIfApplicable(any(Project.class));
}
Versions versions() {
return new Versions("", "", allProjects());
}
@SuppressWarnings("unchecked")
private Set<Project> allProjects() {
return new HashSet<>(Arrays.asList(new Project[] {
project("spring-cloud-aws", "1.2.0.BUILD-SNAPSHOT"),
project("spring-cloud-sleuth", "1.2.0.BUILD-SNAPSHOT")
}));
}
Project project(String name, String value) {
return new Project(name, value);
}
ModelWrapper model() {
Model model = new Model();
model.setProperties(properties());
return new ModelWrapper(model);
}
Properties properties() {
Properties properties = new Properties();
properties.setProperty("spring-cloud-sleuth.version", "1.0.0.RELEASE");
return properties;
}
ModelWrapper modelWithSameValues() {
Model model = new Model();
model.setProperties(propertiesWithSameValues());
return new ModelWrapper(model);
}
Properties propertiesWithSameValues() {
Properties properties = new Properties();
properties.setProperty("spring-cloud-sleuth.version", "1.2.0.BUILD-SNAPSHOT");
return properties;
}
ModelWrapper nonMatchingModel() {
Model model = new Model();
model.setProperties(nonMatchingProperties());
return new ModelWrapper(model);
}
Properties nonMatchingProperties() {
Properties properties = new Properties();
properties.setProperty("spring-cloud-non-matching.version", "1.0.0.RELEASE");
return properties;
}
}

View File

@@ -0,0 +1,129 @@
package org.springframework.cloud.release.internal;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.BDDAssertions.then;
import static org.assertj.core.api.BDDAssertions.thenThrownBy;
/**
* @author Marcin Grzejszczak
*/
public class SCReleasePomParserTests {
File springCloudReleaseProject;
@Before
public void setup() throws IOException, URISyntaxException {
this.springCloudReleaseProject = new File(GitProjectRepoTests.class.getResource("/projects/spring-cloud-release").toURI());
}
@Test
public void should_throw_exception_when_boot_pom_is_missing() {
SCReleasePomParser parser = new SCReleasePomParser(new File("."));
thenThrownBy(parser::bootVersion)
.isInstanceOf(IllegalStateException.class)
.hasMessageContaining("Pom is not present");
}
@Test
public void should_throw_exception_when_null_is_passed_to_boot() {
SCReleasePomParser parser = new SCReleasePomParser(this.springCloudReleaseProject, null, null);
thenThrownBy(parser::bootVersion)
.isInstanceOf(IllegalStateException.class)
.hasMessageContaining("Pom is not present");
}
@Test
public void should_throw_exception_when_boot_version_is_missing_in_pom() {
SCReleasePomParser parser = new SCReleasePomParser(this.springCloudReleaseProject, "pom.xml", null);
thenThrownBy(parser::bootVersion)
.isInstanceOf(IllegalStateException.class)
.hasMessageContaining("The pom doesn't have a [spring-boot-starter-parent] artifact id");
}
@Test
public void should_populate_boot_version() {
SCReleasePomParser parser = new SCReleasePomParser(this.springCloudReleaseProject);
String bootVersion = parser.bootVersion().bootVersion;
then(bootVersion).isEqualTo("1.5.1.BUILD-SNAPSHOT");
}
@Test
public void should_throw_exception_when_cloud_pom_is_missing() {
SCReleasePomParser parser = new SCReleasePomParser(new File("."));
thenThrownBy(parser::springCloudVersions)
.isInstanceOf(IllegalStateException.class)
.hasMessageContaining("Pom is not present");
}
@Test
public void should_throw_exception_when_null_is_passed_to_cloud() {
SCReleasePomParser parser = new SCReleasePomParser(this.springCloudReleaseProject, null, null);
thenThrownBy(parser::springCloudVersions)
.isInstanceOf(IllegalStateException.class)
.hasMessageContaining("Pom is not present");
}
@Test
public void should_throw_exception_when_cloud_version_is_missing_in_pom() {
SCReleasePomParser parser = new SCReleasePomParser(this.springCloudReleaseProject, null, "pom.xml");
thenThrownBy(parser::springCloudVersions)
.isInstanceOf(IllegalStateException.class)
.hasMessageContaining("The pom doesn't have a [spring-cloud-dependencies-parent] artifact id");
}
@Test
public void should_populate_cloud_version() {
SCReleasePomParser parser = new SCReleasePomParser(this.springCloudReleaseProject);
Versions cloudVersions = parser.springCloudVersions();
then(cloudVersions.scBuildVersion).isEqualTo("1.3.1.BUILD-SNAPSHOT");
then(cloudVersions.projects).contains(allProjects());
}
@Test
public void should_populate_boot_and_cloud_version() {
SCReleasePomParser parser = new SCReleasePomParser(this.springCloudReleaseProject);
Versions cloudVersions = parser.allVersions();
then(cloudVersions.bootVersion).isEqualTo("1.5.1.BUILD-SNAPSHOT");
then(cloudVersions.scBuildVersion).isEqualTo("1.3.1.BUILD-SNAPSHOT");
then(cloudVersions.projects).contains(allProjects());
}
private Project[] allProjects() {
return new Project[] { project("spring-cloud-aws", "1.2.0.BUILD-SNAPSHOT"),
project("spring-cloud-bus", "1.3.0.BUILD-SNAPSHOT"),
project("spring-cloud-contract", "1.1.0.BUILD-SNAPSHOT"),
project("spring-cloud-cloudfoundry", "1.1.0.BUILD-SNAPSHOT"),
project("spring-cloud-commons", "1.2.0.BUILD-SNAPSHOT"),
project("spring-cloud-config", "1.3.0.BUILD-SNAPSHOT"),
project("spring-cloud-netflix", "1.3.0.BUILD-SNAPSHOT"),
project("spring-cloud-security", "1.2.0.BUILD-SNAPSHOT"),
project("spring-cloud-consul", "1.2.0.BUILD-SNAPSHOT"),
project("spring-cloud-sleuth", "1.2.0.BUILD-SNAPSHOT"),
project("spring-cloud-stream", "Chelsea.BUILD-SNAPSHOT"),
project("spring-cloud-task", "1.1.2.BUILD-SNAPSHOT"),
project("spring-cloud-vault", "1.0.0.BUILD-SNAPSHOT"),
project("spring-cloud-zookeeper", "1.1.0.BUILD-SNAPSHOT") };
}
Project project(String name, String value) {
return new Project(name, value);
}
}

View File

@@ -0,0 +1,17 @@
package org.springframework.cloud.release.internal;
import java.io.File;
import org.apache.maven.model.Model;
/**
* @author Marcin Grzejszczak
*/
public class TestPomReader {
PomReader pomReader = new PomReader();
public Model readPom(File pom) {
return this.pomReader.readPom(pom);
}
}

View File

@@ -0,0 +1,25 @@
package org.springframework.cloud.release.internal;
import java.io.File;
import java.io.IOException;
import org.eclipse.jgit.util.FileUtils;
public class TestUtils {
public static void prepareLocalRepo() throws IOException {
prepareLocalRepo("target/test-classes/projects/", "spring-cloud-release");
}
private static void prepareLocalRepo(String buildDir, String repoPath) throws IOException {
File dotGit = new File(buildDir + repoPath + "/.git");
File git = new File(buildDir + repoPath + "/git");
if (git.exists()) {
if (dotGit.exists()) {
FileUtils.delete(dotGit, FileUtils.RECURSIVE);
}
}
git.renameTo(dotGit);
}
}

View File

@@ -0,0 +1,58 @@
package org.springframework.cloud.release.internal;
import java.util.ArrayList;
import java.util.List;
import org.assertj.core.api.AbstractAssert;
import org.assertj.core.api.BDDAssertions;
import org.codehaus.mojo.versions.change.VersionChange;
/**
* @author Marcin Grzejszczak
*/
class VersionChangeAssertions extends BDDAssertions {
public static VersionChangeAssert then(ListOfChanges actual) {
return assertThat(actual);
}
public static VersionChangeAssert assertThat(ListOfChanges actual) {
return new VersionChangeAssert(actual);
}
}
class ListOfChanges {
final List<VersionChange> changes;
ListOfChanges(ModelWrapper model) {
this.changes = new ArrayList<>(model.sourceChanges);
}
}
class VersionChangeAssert extends
AbstractAssert<VersionChangeAssert, ListOfChanges> {
public VersionChangeAssert(ListOfChanges actual) {
super(actual, VersionChangeAssert.class);
}
VersionChangeAssert newParentVersionIsEqualTo(String groupId, String artifactId, String newVersion) {
boolean matches = false;
for (VersionChange change : actual.changes) {
if (newVersion.equals(change.getNewVersion())
&& groupId.equals(change.getGroupId())
&& artifactId.equals(change.getArtifactId())) {
matches = true;
break;
}
}
if (matches) {
return this;
}
failWithMessage("There is no change with that parent coordinates");
return this;
}
}

View File

@@ -0,0 +1,95 @@
/*
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*/
package org.springframework.cloud.release.internal;
import java.util.HashSet;
import java.util.Properties;
import java.util.Set;
import org.junit.Test;
import static org.assertj.core.api.BDDAssertions.then;
/**
* @author Marcin Grzejszczak
*/
public class VersionsTests {
Versions versions = new Versions("", projects());
@Test
public void should_add_boot_to_versions_when_version_is_created() {
then(new Versions("1.2.3.RELEASE").projects)
.contains(
new Project("spring-boot", "1.2.3.RELEASE"),
new Project("spring-boot-starter-parent", "1.2.3.RELEASE")
);
}
@Test
public void should_return_true_when_project_is_on_the_list() {
then(this.versions.shouldBeUpdated("foo")).isTrue();
}
@Test
public void should_return_true_when_project_has_a_parent_suffix_and_project_is_on_the_list() {
then(this.versions.shouldBeUpdated("foo-parent")).isTrue();
}
@Test
public void should_return_false_when_project_is_not_on_the_list() {
then(this.versions.shouldBeUpdated("missing")).isFalse();
}
@Test
public void should_return_version_for_present_project() {
then(this.versions.versionForProject("foo")).isEqualTo("bar");
}
@Test
public void should_return_empty_string_for_missing_project() {
then(this.versions.versionForProject("missing")).isEmpty();
}
@Test
public void should_return_true_if_properties_contains_project_key() {
then(this.versions.shouldSetProperty(validProps())).isTrue();
}
@Test
public void should_return_false_if_properties_does_not_contain_project_key() {
then(this.versions.shouldSetProperty(missingProps())).isFalse();
}
Set<Project> projects() {
Set<Project> projects = new HashSet<>();
projects.add(new Project("foo", "bar"));
return projects;
}
Properties validProps() {
Properties properties = new Properties();
properties.setProperty("foo.version", "1.0.0");
return properties;
}
Properties missingProps() {
Properties properties = new Properties();
properties.setProperty("missing.version", "1.0.0");
return properties;
}
}

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2013-2017 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>foo</artifactId>
<version>1.2.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>foo</name>
<description>foo</description>
<parent>
<groupId>parentGroup</groupId>
<artifactId>parentArtifactId</artifactId>
<version>1.3.1.BUILD-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<properties>
<spring-cloud-foo.version>1.3.1.BUILD-SNAPSHOT</spring-cloud-foo.version>
<foo.version>1.2.0.BUILD-SNAPSHOT</foo.version>
</properties>
</project>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2013-2017 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-cloud-sleuth-child</artifactId>
<version>1.2.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>foo</name>
<description>foo</description>
<parent>
<groupId>parentGroup</groupId>
<artifactId>parentArtifactId</artifactId>
<version>1.3.1.BUILD-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<properties>
<spring-cloud-foo.version>1.3.1.BUILD-SNAPSHOT</spring-cloud-foo.version>
<foo.version>1.2.0.BUILD-SNAPSHOT</foo.version>
</properties>
</project>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2013-2017 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-cloud-sleuth-child</artifactId>
<version>1.2.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>foo</name>
<description>foo</description>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth</artifactId>
<version>1.3.1.BUILD-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<properties>
<spring-cloud-foo.version>1.3.1.BUILD-SNAPSHOT</spring-cloud-foo.version>
<foo.version>1.2.0.BUILD-SNAPSHOT</foo.version>
</properties>
</project>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2013-2017 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-cloud-sleuth-child</artifactId>
<version>1.2.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>foo</name>
<description>foo</description>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth</artifactId>
<version>1.3.1.BUILD-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<properties>
<spring-cloud-foo.version>1.3.1.BUILD-SNAPSHOT</spring-cloud-foo.version>
<foo.version>1.2.0.BUILD-SNAPSHOT</foo.version>
</properties>
</project>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2013-2017 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-cloud-sleuth-child</artifactId>
<version>1.2.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>foo</name>
<description>foo</description>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth</artifactId>
<version>1.3.1.BUILD-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<properties>
<spring-cloud-sleuth.version>1.3.1.BUILD-SNAPSHOT</spring-cloud-sleuth.version>
<spring-cloud-vault.version>1.2.0.BUILD-SNAPSHOT</spring-cloud-vault.version>
</properties>
</project>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2013-2017 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>foo</artifactId>
<version>1.2.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>foo</name>
<description>foo</description>
<parent>
<groupId>parentGroup</groupId>
<artifactId>parentArtifactId</artifactId>
<version>1.3.1.BUILD-SNAPSHOT</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<spring-cloud-foo.version>1.3.1.BUILD-SNAPSHOT</spring-cloud-foo.version>
<foo.version>1.2.0.BUILD-SNAPSHOT</foo.version>
</properties>
</project>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2013-2017 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-cloud-sleuth</artifactId>
<version>1.2.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>foo</name>
<description>foo</description>
<parent>
<groupId>parentGroup</groupId>
<artifactId>parentArtifactId</artifactId>
<version>1.3.1.BUILD-SNAPSHOT</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<spring-cloud-foo.version>1.3.1.BUILD-SNAPSHOT</spring-cloud-foo.version>
<foo.version>1.2.0.BUILD-SNAPSHOT</foo.version>
</properties>
</project>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2013-2017 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-cloud-sleuth</artifactId>
<version>1.2.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>foo</name>
<description>foo</description>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build</artifactId>
<version>1.3.1.BUILD-SNAPSHOT</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<spring-cloud-foo.version>1.3.1.BUILD-SNAPSHOT</spring-cloud-foo.version>
<foo.version>1.2.0.BUILD-SNAPSHOT</foo.version>
</properties>
</project>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2013-2017 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-cloud-sleuth</artifactId>
<version>1.2.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>foo</name>
<description>foo</description>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build</artifactId>
<version>1.3.1.BUILD-SNAPSHOT</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<spring-cloud-foo.version>1.3.1.BUILD-SNAPSHOT</spring-cloud-foo.version>
<foo.version>1.2.0.BUILD-SNAPSHOT</foo.version>
</properties>
</project>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2013-2017 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-cloud-sleuth</artifactId>
<version>1.2.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>foo</name>
<description>foo</description>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build</artifactId>
<version>1.3.1.BUILD-SNAPSHOT</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<spring-cloud-sleuth.version>1.3.1.BUILD-SNAPSHOT</spring-cloud-sleuth.version>
<spring-cloud-vault.version>1.2.0.BUILD-SNAPSHOT</spring-cloud-vault.version>
</properties>
</project>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2013-2017 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-cloud-sleuth-parent</artifactId>
<version>1.2.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>foo</name>
<description>foo</description>
<parent>
<groupId>parentGroup</groupId>
<artifactId>parentArtifactId</artifactId>
<version>1.3.1.BUILD-SNAPSHOT</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<spring-cloud-foo.version>1.3.1.BUILD-SNAPSHOT</spring-cloud-foo.version>
<foo.version>1.2.0.BUILD-SNAPSHOT</foo.version>
</properties>
</project>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2013-2017 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>foo-parent</artifactId>
<version>1.2.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>foo</name>
<description>foo</description>
<parent>
<groupId>parentGroup</groupId>
<artifactId>parentArtifactId</artifactId>
<version>1.3.1.BUILD-SNAPSHOT</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<spring-cloud-foo.version>1.3.1.BUILD-SNAPSHOT</spring-cloud-foo.version>
<foo.version>1.2.0.BUILD-SNAPSHOT</foo.version>
</properties>
</project>

View File

@@ -0,0 +1,440 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build</artifactId>
<version>1.3.1.BUILD-SNAPSHOT</version>
<relativePath/>
</parent>
<artifactId>spring-cloud-contract-parent</artifactId>
<packaging>pom</packaging>
<version>1.1.0.BUILD-SNAPSHOT</version>
<name>Spring Cloud Contract</name>
<description>Spring Cloud Contract</description>
<url>https://github.com/spring-cloud/spring-cloud-contract</url>
<inceptionYear>2016</inceptionYear>
<properties>
<activemq.version>5.12.1</activemq.version>
<camel.version>2.17.0</camel.version>
<spring-boot.version>1.5.2.BUILD-SNAPSHOT</spring-boot.version>
<checkstyle.version>2.17</checkstyle.version>
<spring-cloud-build.version>1.3.1.BUILD-SNAPSHOT</spring-cloud-build.version>
<spring-cloud-zookeeper.version>1.1.0.BUILD-SNAPSHOT</spring-cloud-zookeeper.version>
<spring-cloud-stream.version>Chelsea.BUILD-SNAPSHOT</spring-cloud-stream.version>
<spring-cloud-netflix.version>1.3.0.BUILD-SNAPSHOT</spring-cloud-netflix.version>
<spring-cloud-consul.version>1.2.0.BUILD-SNAPSHOT</spring-cloud-consul.version>
<spring-cloud-commons.version>1.2.0.BUILD-SNAPSHOT</spring-cloud-commons.version>
</properties>
<modules>
<module>spring-cloud-contract-dependencies</module>
<module>docs</module>
<module>spring-cloud-contract-wiremock</module>
<module>spring-cloud-contract-verifier</module>
<module>spring-cloud-contract-spec</module>
<module>spring-cloud-contract-stub-runner</module>
<module>spring-cloud-contract-starters</module>
<module>spring-cloud-contract-tools</module>
<module>tests</module>
<module>samples</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-commons-dependencies</artifactId>
<version>${spring-cloud-commons.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jackson</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-camel</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-pool</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>net.sf.jopt-simple</groupId>
<artifactId>jopt-simple</artifactId>
<version>4.9</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>3.2.4</version>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-spring</artifactId>
<version>1.0-groovy-2.4</version>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>1.0-groovy-2.4</version>
</dependency>
<dependency>
<groupId>info.solidsoft.spock</groupId>
<artifactId>spock-global-unroll</artifactId>
<version>0.5.0</version>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit</artifactId>
<version>1.6.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.10.19</version>
</dependency>
<dependency>
<groupId>io.specto</groupId>
<artifactId>hoverfly-junit</artifactId>
<version>0.1.8</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>au.com.dius</groupId>
<artifactId>pact-jvm-model</artifactId>
<version>2.4.18</version>
</dependency>
<dependency>
<groupId>com.github.jknack</groupId>
<artifactId>handlebars</artifactId>
<version>4.0.6</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-dependencies</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-dependencies</artifactId>
<version>${spring-cloud-netflix.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-dependencies</artifactId>
<version>${spring-cloud-stream.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-zookeeper-dependencies</artifactId>
<version>${spring-cloud-zookeeper.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-consul-dependencies</artifactId>
<version>${spring-cloud-consul.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<prerequisites>
<maven>[3.2.1,)</maven>
</prerequisites>
<organization>
<name>Spring</name>
<url>https://spring.io/</url>
</organization>
<developers>
<developer>
<id>mariuszs</id>
<name>Mariusz Smykula</name>
<email>mariuszs@gmail.com</email>
</developer>
<developer>
<id>marcingrzejszczak</id>
<name>Marcin Grzejszczak</name>
<email>mgrzejszczak@pivotal.io</email>
</developer>
<developer>
<id>dsyer</id>
<name>David Syer</name>
<email>dsyer@pivotal.io</email>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/spring-cloud/spring-cloud-contract.git</connection>
<developerConnection>scm:git:git@github.com:spring-cloud/spring-cloud-contract.git</developerConnection>
<url>https://github.com/spring-cloud/spring-cloud-contract</url>
<tag>HEAD</tag>
</scm>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/spring-cloud/spring-cloud-contract/issues</url>
</issueManagement>
<ciManagement>
<system>CircleCi</system>
<url>https://circleci.com/gh/spring-cloud/spring-cloud-contract</url>
</ciManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*Spec.*</include>
<include>**/*Tests.*</include>
<include>**/*Test.*</include>
</includes>
<reportFormat>plain</reportFormat>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-metadata</artifactId>
<version>1.6</version>
</plugin>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<version>${maven.plugin.plugin.version}</version>
</plugin>
<plugin>
<groupId>io.takari.maven.plugins</groupId>
<artifactId>takari-lifecycle-plugin</artifactId>
<version>1.12.0</version>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>4.1.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>1.5</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<filesets>
<fileset>
<directory>target</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.version}</version>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build-tools</artifactId>
<version>${spring-cloud-build.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<headerLocation>LICENSE.txt</headerLocation>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<excludes>${project.build.directory}/**</excludes>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.version}</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<headerLocation>LICENSE.txt</headerLocation>
<excludes>${project.build.directory}/**</excludes>
</configuration>
</plugin>
</plugins>
</reporting>
<profiles>
<profile>
<id>spring</id>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/libs-release-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>sonar</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<propertyName>surefireArgLine</propertyName>
<destFile>${project.build.directory}/jacoco.exec</destFile>
</configuration>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution data. -->
<dataFile>${project.build.directory}/jacoco.exec</dataFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Sets the VM argument line used when unit tests are run. -->
<argLine>${surefireArgLine}</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@@ -0,0 +1,233 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>spring-cloud-dependencies-parent</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>1.3.1.BUILD-SNAPSHOT</version>
<relativePath/>
</parent>
<artifactId>spring-cloud-contract-dependencies</artifactId>
<version>1.1.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>spring-cloud-contract-dependencies</name>
<description>Spring Cloud Contract Dependencies</description>
<properties>
<wiremock.version>2.5.1</wiremock.version>
<jsonassert.version>0.4.8</jsonassert.version>
<aether.version>1.0.2.v20150114</aether.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-wiremock</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-spec</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-verifier</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-converters</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-spec-pact</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-stub-runner</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-contract-verifier</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-contract-stub-runner-jetty</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-gradle-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock</artifactId>
<version>${wiremock.version}</version>
<exclusions>
<exclusion>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
</exclusion>
<exclusion>
<groupId>net.sf.jopt-simple</groupId>
<artifactId>jopt-simple</artifactId>
</exclusion>
<exclusion>
<artifactId>jetty-server</artifactId>
<groupId>org.eclipse.jetty</groupId>
</exclusion>
<exclusion>
<artifactId>jetty-servlet</artifactId>
<groupId>org.eclipse.jetty</groupId>
</exclusion>
<exclusion>
<artifactId>jetty-servlets</artifactId>
<groupId>org.eclipse.jetty</groupId>
</exclusion>
<exclusion>
<artifactId>jetty-webapp</artifactId>
<groupId>org.eclipse.jetty</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.toomuchcoding.jsonassert</groupId>
<artifactId>jsonassert</artifactId>
<version>${jsonassert.version}</version>
</dependency>
<dependency>
<groupId>com.jayway.restassured</groupId>
<artifactId>spring-mock-mvc</artifactId>
<version>2.9.0</version>
<exclusions>
<exclusion>
<artifactId>spring-web</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-webmvc</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-test</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-api</artifactId>
<version>${aether.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-impl</artifactId>
<version>${aether.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-transport-file</artifactId>
<version>${aether.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-transport-http</artifactId>
<version>${aether.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-connector-basic</artifactId>
<version>${aether.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-aether-provider</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings-builder</artifactId>
<version>3.2.1</version>
</dependency>
</dependencies>
</dependencyManagement>
<profiles>
<profile>
<id>spring</id>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</project>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-parent</artifactId>
<version></version>
<relativePath>..</relativePath>
</parent>
<artifactId>spring-cloud-contract-tools</artifactId>
<packaging>pom</packaging>
<name>Spring Cloud Contract Tools</name>
<description>Spring Cloud Contract Tools</description>
<modules>
<module>spring-cloud-contract-converters</module>
<module>spring-cloud-contract-spec-pact</module>
<module>spring-cloud-contract-maven-plugin</module>
<module>spring-cloud-contract-gradle-plugin</module>
</modules>
</project>

View File

@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-tools</artifactId>
<version></version>
<relativePath>..</relativePath>
</parent>
<artifactId>spring-cloud-contract-converters</artifactId>
<packaging>jar</packaging>
<name>Spring Cloud Contract Converters</name>
<description>Spring Cloud Contract Converters</description>
<properties><java.version>1.8</java.version></properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-spec</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-verifier</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-nio</artifactId>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock</artifactId>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.solidsoft.spock</groupId>
<artifactId>spock-global-unroll</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>addSources</goal>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,17 @@
*~
#*
*#
.#*
.classpath
.project
.settings
.springBeans
.gradle
build
bin
target/
.idea
*.iml
*.ipr
*.iws
.factorypath

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<servers>
<server>
<id>repo.spring.io</id>
<username>${env.CI_DEPLOY_USERNAME}</username>
<password>${env.CI_DEPLOY_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<!--
N.B. this profile is only here to support users and IDEs that do not use Maven 3.3.
It isn't needed on the command line if you use the wrapper script (mvnw) or if you use
a native Maven with the right version. Eclipse users should points their Maven tooling to
this settings file, or copy the profile into their ~/.m2/settings.xml.
-->
<id>spring</id>
<activation><activeByDefault>true</activeByDefault></activation>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>

View File

@@ -0,0 +1,9 @@
sudo: false
cache:
directories:
- $HOME/.m2
language: java
before_install:
- gem install asciidoctor
script:
- ./mvnw clean install -P docs -q -U -Dmaven.test.redirectTestOutputToFile=true

View File

@@ -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.

View File

@@ -0,0 +1,85 @@
// Do not edit this file (e.g. go instead to src/main/asciidoc)
Spring Cloud Release Train is a curated set of dependencies across a
range of Spring Cloud projects. You consume it by using the
spring-cloud-dependencies POM to manage dependencies in Maven or
Gradle. The release trains have names, not versions, to avoid
confusion with the sub-projects. The names are an alphabetic sequence
(so you can sort them chronologically) with names of London Tube
stations ("Angel" is the first release, "Brixton" is the second).
== 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).
== Building and Deploying
Since there is no code to compile in the starters they should do not need to compile, but a compiler has to be available because they are built and deployed as JAR artifacts. To install locally:
----
$ mvn install -s .settings.xml
----
and to deploy snapshots to repo.spring.io:
----
$ mvn install -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local
----
for a.BUILD-SNAPSHOT build use
----
$ mvn install -DaltReleaseDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-release-local
----
and for Maven Central use
----
$ mvn install -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).

View File

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-docs</artifactId>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-build</artifactId>
<version>Dalston.BUILD-SNAPSHOT</version>
</parent>
<packaging>pom</packaging>
<name>Spring Cloud Starter Docs</name>
<description>Spring Cloud Docs</description>
<properties>
<docs.main>spring-cloud-starters</docs.main>
<main.basedir>${basedir}/..</main.basedir>
<docs.whitelisted.branches>Brixton,Camden,Dalston</docs.whitelisted.branches>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>docs</id>
<build>
<plugins>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<inherited>false</inherited>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<inherited>false</inherited>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<inherited>false</inherited>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@@ -0,0 +1,34 @@
include::intro.adoc[]
== Contributing
include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing.adoc[]
== Building and Deploying
Since there is no code to compile in the starters they should do not need to compile, but a compiler has to be available because they are built and deployed as JAR artifacts. To install locally:
----
$ mvn install -s .settings.xml
----
and to deploy snapshots to repo.spring.io:
----
$ mvn install -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local
----
for a.BUILD-SNAPSHOT build use
----
$ mvn install -DaltReleaseDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-release-local
----
and for Maven Central use
----
$ mvn install -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).

View File

@@ -0,0 +1,330 @@
#!/bin/bash -x
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:-}
echo "Path to Maven is [${MAVEN_PATH}]"
REPO_NAME=${PWD##*/}
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); 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"
}
# Switches to the provided value of the release version. We always prefix it with `v`
function switch_to_tag() {
git checkout v${VERSION}
}
# 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_PATH}"mvn -q \
-Dexec.executable="echo" \
-Dexec.args='${docs.main}' \
--non-recursive \
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
echo "Extracted 'main.adoc' from Maven build [${MAIN_ADOC_VALUE}]"
WHITELIST_PROPERTY=${WHITELIST_PROPERTY:-"docs.whitelisted.branches"}
WHITELISTED_BRANCHES_VALUE=$("${MAVEN_PATH}"mvn -q \
-Dexec.executable="echo" \
-Dexec.args="\${${WHITELIST_PROPERTY}}" \
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \
-P docs \
-pl docs)
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} && 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
DESTINATION_REPO_FOLDER=${clonedStatic}/${REPO_NAME}
mkdir -p ${DESTINATION_REPO_FOLDER}
else
if [[ ! -e "${DESTINATION}/.git" ]]; then
echo "[${DESTINATION}] is not a git repository"
exit 1
fi
DESTINATION_REPO_FOLDER=${DESTINATION}/${REPO_NAME}
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}" ]] ; 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}/
git add -A ${ROOT_FOLDER}/$file
fi
done
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.BUILD-SNAPSHOT/ 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
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.BUILD-SNAPSHOT/ 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
git add -A ${destination}/index.html
else
cp -rf $f ${destination}
git add -A ${destination}/$file
fi
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 ${CURRENT_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}], 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
}
# Prints the usage
function print_usage() {
cat <<EOF
The idea of this script is to update gh-pages branch with the generated docs. Without any options
the script will work in the following manner:
- if there's no gh-pages / target for docs module then the script ends
- for master branch the generated docs are copied to the root of gh-pages branch
- for any other branch (if that branch is whitelisted) a subfolder with branch name is created
and docs are copied there
- if the version switch is passed (-v) then a tag with (v) prefix will be retrieved and a folder
with that version number will be created in the gh-pages branch. WARNING! No whitelist verification will take place
- 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/<project-name>/<version>`
- 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/<project-name>/<version>`
USAGE:
You can use the following options:
-v|--version - the script will apply the whole procedure for a particular library 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
;;
-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
if [[ -z "${VERSION}" ]] ; then
retrieve_current_branch
else
switch_to_tag
fi
build_docs_if_applicable
retrieve_doc_properties
stash_changes
add_docs_from_target
checkout_previous_branch

View File

@@ -0,0 +1,7 @@
Spring Cloud Release Train is a curated set of dependencies across a
range of Spring Cloud projects. You consume it by using the
spring-cloud-dependencies POM to manage dependencies in Maven or
Gradle. The release trains have names, not versions, to avoid
confusion with the sub-projects. The names are an alphabetic sequence
(so you can sort them chronologically) with names of London Tube
stations ("Angel" is the first release, "Brixton" is the second).

View File

@@ -0,0 +1,65 @@
:github: https://github.com/spring-cloud/spring-cloud-release
:githubmaster: {github}/tree/master
:docslink: {githubmaster}/docs/src/main/asciidoc
:springcloudversion: Dalston.BUILD-SNAPSHOT
:springioplatformversion: Brussels-BUILD-SNAPSHOT
:springBootVersion: 1.5.0.BUILD-SNAPSHOT
= Spring Cloud Release Train
include::intro.adoc[]
== Using Spring Cloud Dependencies with Spring IO Platform
The Spring IO Platform is a modular, enterprise-grade curated set of dependencies. To use the Spring Cloud Starters with Spring IO Platform, you must import the Spring Cloud Dependencies bill of materials (BOM) first.
To use version {springioplatformversion} of the Spring IO Platform and Spring Cloud Release Train {springcloudversion} with Maven, update the pom.xml as follows:
[source,xml,indent=0,subs="verbatim,attributes"]
----
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>{springcloudversion}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.spring.platform</groupId>
<artifactId>platform-bom</artifactId>
<version>{springioplatformversion}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
----
NOTE: The Spring Cloud Dependencies BOM must go first, so that its dependencies have precedence of the Spring IO Platform dependencies.
For gradle, update the build.gradle as follows:
[source,groovy,indent=0,subs="verbatim,attributes"]
----
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:{springBootVersion}")
}
}
apply plugin: 'spring-boot'
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:{springcloudversion}"
mavenBom 'io.spring.platform:platform-bom:{springioplatformversion}'
}
}
----
include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing-docs.adoc[]

View File

@@ -0,0 +1,37 @@
#!/usr/bin/env ruby
base_dir = File.join(File.dirname(__FILE__),'../../..')
src_dir = File.join(base_dir, "/src/main/asciidoc")
require 'asciidoctor'
require 'optparse'
options = {}
file = "#{src_dir}/README.adoc"
OptionParser.new do |o|
o.on('-o OUTPUT_FILE', 'Output file (default is stdout)') { |file| options[:to_file] = file unless file=='-' }
o.on('-h', '--help') { puts o; exit }
o.parse!
end
file = ARGV[0] if ARGV.length>0
# Copied from https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/scripts/asciidoc-coalescer.rb
doc = Asciidoctor.load_file file, safe: :unsafe, header_only: true, attributes: options[:attributes]
header_attr_names = (doc.instance_variable_get :@attributes_modified).to_a
header_attr_names.each {|k| doc.attributes[%(#{k}!)] = '' unless doc.attr? k }
attrs = doc.attributes
attrs['allow-uri-read'] = true
puts attrs
out = "// Do not edit this file (e.g. go instead to src/main/asciidoc)\n\n"
doc = Asciidoctor.load_file file, safe: :unsafe, parse: false, attributes: attrs
out << doc.reader.read
unless options[:to_file]
puts out
else
File.open(options[:to_file],'w+') do |file|
file.write(out)
end
end

View File

@@ -0,0 +1,14 @@
320597b84bb0312c15228c4d42f46c189b86ed90 branch 'master' of github.com:spring-cloud/spring-cloud-release
fb730db9b3999e45c350015c6cf83be35910a159 not-for-merge branch '1.0.0.M2' of github.com:spring-cloud/spring-cloud-release
474b03693496665434ab2615d6500bbb0b575a5b not-for-merge branch '1.0.0.M3' of github.com:spring-cloud/spring-cloud-release
7fdc875cb2b1620e8bc87ef8a27da2858eef7cd1 not-for-merge branch '1.0.0.RC1' of github.com:spring-cloud/spring-cloud-release
75d0bc7cc0995ac76b6cfad962ea54d05262a664 not-for-merge branch '1.0.0.RELEASE' of github.com:spring-cloud/spring-cloud-release
8e8a2d41b4beb8985919bc5a2bca2aa66374bdbb not-for-merge branch '1.0.1.RELEASE' of github.com:spring-cloud/spring-cloud-release
59414747ee8c095753a0b8c5641b328f80d47d33 not-for-merge branch '1.0.2.RELEASE' of github.com:spring-cloud/spring-cloud-release
73ec179d7ce96d5a98c2acd5697cd81c49dfd7d5 not-for-merge branch '1.0.x' of github.com:spring-cloud/spring-cloud-release
08c95747e807212c605d758bbb360f6d671b2932 not-for-merge branch 'Angel.SR3' of github.com:spring-cloud/spring-cloud-release
6882449721e48f955b102606ae3fc2535ebbd4cb not-for-merge branch 'Brixton' of github.com:spring-cloud/spring-cloud-release
7745834b138ffe1f647b14dd3c7d4d71eee8aac3 not-for-merge branch 'Brixton.M1' of github.com:spring-cloud/spring-cloud-release
f2036f13515dc6aa997cc15827919acec634eaae not-for-merge branch 'Brixton.M2' of github.com:spring-cloud/spring-cloud-release
928e0d8389dcee60189d6c0eb737ab9376e87f54 not-for-merge branch 'Camden.RC1' of github.com:spring-cloud/spring-cloud-release
b566ab3bea0506bccaa10f83784a41673606d6ee not-for-merge branch 'Camden.x' of github.com:spring-cloud/spring-cloud-release

View File

@@ -0,0 +1 @@
ref: refs/heads/master

View File

@@ -0,0 +1 @@
32ebcd2c317339400d65ad43999d4e5ddc05bd30

View File

@@ -0,0 +1,7 @@
[core]
repositoryformatversion = 0
filemode = true
bare = true
logallrefupdates = true
[branch "master"]
[branch "Camden.x"]

View File

@@ -0,0 +1 @@
Unnamed repository; edit this file 'description' to name the repository.

View File

@@ -0,0 +1,12 @@
0000000000000000000000000000000000000000 e1248f716b5656af04ded489b481db45ad3dfc8f Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1473364042 +0200 clone: from git@github.com:spring-cloud/spring-cloud-release.git
e1248f716b5656af04ded489b481db45ad3dfc8f 1ab978f42299811efa4953b98a923699c95f6776 Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1474826109 +0200 checkout: moving from master to vCamden.RELEASE
1ab978f42299811efa4953b98a923699c95f6776 e1248f716b5656af04ded489b481db45ad3dfc8f Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1474826610 +0200 checkout: moving from 1ab978f42299811efa4953b98a923699c95f6776 to master
e1248f716b5656af04ded489b481db45ad3dfc8f b05cdc5318cbc5c049a391fe67ac4a8cf763689d Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1486373153 +0100 checkout: moving from master to Camden.x
b05cdc5318cbc5c049a391fe67ac4a8cf763689d 25af4f2162cdf0642c78ea8e63c1744158b6ad1b Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1486377649 +0100 commit: Bumping versions before release
25af4f2162cdf0642c78ea8e63c1744158b6ad1b a29f784a15fc3d039d4dfec619ebcddaf0ef8b8a Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1486378936 +0100 revert: Going back to snapshots
a29f784a15fc3d039d4dfec619ebcddaf0ef8b8a b566ab3bea0506bccaa10f83784a41673606d6ee Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1486379057 +0100 commit (amend): Going back to snapshots
b566ab3bea0506bccaa10f83784a41673606d6ee e1248f716b5656af04ded489b481db45ad3dfc8f Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1486379087 +0100 checkout: moving from Camden.x to master
e1248f716b5656af04ded489b481db45ad3dfc8f 32ebcd2c317339400d65ad43999d4e5ddc05bd30 Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1486379095 +0100 pull --rebase origin master: checkout 32ebcd2c317339400d65ad43999d4e5ddc05bd30
32ebcd2c317339400d65ad43999d4e5ddc05bd30 32ebcd2c317339400d65ad43999d4e5ddc05bd30 Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1486379095 +0100 rebase finished: returning to refs/heads/master
32ebcd2c317339400d65ad43999d4e5ddc05bd30 320597b84bb0312c15228c4d42f46c189b86ed90 Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1488827673 +0100 pull --rebase origin master: checkout 320597b84bb0312c15228c4d42f46c189b86ed90
320597b84bb0312c15228c4d42f46c189b86ed90 320597b84bb0312c15228c4d42f46c189b86ed90 Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1488827673 +0100 rebase finished: returning to refs/heads/master

View File

@@ -0,0 +1,4 @@
0000000000000000000000000000000000000000 b05cdc5318cbc5c049a391fe67ac4a8cf763689d Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1486373153 +0100 branch: Created from refs/remotes/origin/Camden.x
b05cdc5318cbc5c049a391fe67ac4a8cf763689d 25af4f2162cdf0642c78ea8e63c1744158b6ad1b Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1486377649 +0100 commit: Bumping versions before release
25af4f2162cdf0642c78ea8e63c1744158b6ad1b a29f784a15fc3d039d4dfec619ebcddaf0ef8b8a Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1486378936 +0100 revert: Going back to snapshots
a29f784a15fc3d039d4dfec619ebcddaf0ef8b8a b566ab3bea0506bccaa10f83784a41673606d6ee Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1486379057 +0100 commit (amend): Going back to snapshots

View File

@@ -0,0 +1,3 @@
0000000000000000000000000000000000000000 e1248f716b5656af04ded489b481db45ad3dfc8f Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1473364042 +0200 clone: from git@github.com:spring-cloud/spring-cloud-release.git
e1248f716b5656af04ded489b481db45ad3dfc8f 32ebcd2c317339400d65ad43999d4e5ddc05bd30 Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1486379095 +0100 rebase finished: refs/heads/master onto 32ebcd2c317339400d65ad43999d4e5ddc05bd30
32ebcd2c317339400d65ad43999d4e5ddc05bd30 320597b84bb0312c15228c4d42f46c189b86ed90 Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1488827673 +0100 rebase finished: refs/heads/master onto 320597b84bb0312c15228c4d42f46c189b86ed90

View File

@@ -0,0 +1,2 @@
ccc57368d5e766e493c57f44333deae7eca6d864 7ac1649d4b941fdc03f877ab7d929a52018a1f75 Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1474826096 +0200 fetch: fast-forward
7ac1649d4b941fdc03f877ab7d929a52018a1f75 6882449721e48f955b102606ae3fc2535ebbd4cb Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1486372922 +0100 fetch: fast-forward

View File

@@ -0,0 +1 @@
0000000000000000000000000000000000000000 928e0d8389dcee60189d6c0eb737ab9376e87f54 Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1474826096 +0200 fetch: storing head

View File

@@ -0,0 +1,2 @@
0000000000000000000000000000000000000000 b05cdc5318cbc5c049a391fe67ac4a8cf763689d Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1486372922 +0100 fetch: storing head
b05cdc5318cbc5c049a391fe67ac4a8cf763689d b566ab3bea0506bccaa10f83784a41673606d6ee Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1486379066 +0100 update by push

View File

@@ -0,0 +1 @@
0000000000000000000000000000000000000000 e1248f716b5656af04ded489b481db45ad3dfc8f Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1473364042 +0200 clone: from git@github.com:spring-cloud/spring-cloud-release.git

View File

@@ -0,0 +1,3 @@
e1248f716b5656af04ded489b481db45ad3dfc8f 530a739b2abeaae75c267dec70ba03d507afe81b Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1474826096 +0200 fetch: fast-forward
530a739b2abeaae75c267dec70ba03d507afe81b 32ebcd2c317339400d65ad43999d4e5ddc05bd30 Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1486372922 +0100 fetch: fast-forward
32ebcd2c317339400d65ad43999d4e5ddc05bd30 320597b84bb0312c15228c4d42f46c189b86ed90 Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1488827673 +0100 pull --rebase origin master: fast-forward

View File

@@ -0,0 +1 @@
0000000000000000000000000000000000000000 dd40ebe950c0a0cd5de542e3d0e7a0e1ac4e70aa Marcin Grzejszczak <mgrzejszczak@pivotal.io> 1474826091 +0200 WIP on master: e1248f7 Revert to snapshots

View File

@@ -0,0 +1 @@
x<01>ν<0E>0@a<>><3E><>ML<4D><4C>M<EFBFBD>qsr<73>.<2E>-<2D>PH<50><48><EFBFBD><EFBFBD><1F><> _<0E><><EFBFBD>F<>J<01>tG<74>ZFWk<57><6B>V<><10><>JFC\<5C><>9<EFBFBD>l<EFBFBD>R<01><><EFBFBD><01>qd<71>qJ<71><4A><1D><><EFBFBD><EFBFBD><EFBFBD>QEk<45>f<EFBFBD>*<2A>1<EFBFBD>

View File

@@ -0,0 +1,3 @@
x+)JMU013g040031Q<31>K<EFBFBD>,<2C>L<EFBFBD><4C>/JeK<>a<EFBFBD>*~<7E>9<EFBFBD><39>vf<76><66><EFBFBD><EFBFBD><EFBFBD>]<5D><>M <0C>@A/<2F>,<2C>a<EFBFBD><61>q]~<7E>Y,|\8<>y<EFBFBD>0D<30>Z<
fHqjIIf^z<>^EnC<>i<EFBFBD><69><EFBFBD>7Kʹ<4B>N<>t<EFBFBD>ٴ<EFBFBD><D9B4>ϧ0<CFA7>%E<>e<EFBFBD><65>z<EFBFBD>@e<>_ygo<67><6F>P<EFBFBD><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD>g<EFBFBD>'<27><17><>*<2A><>tv<74> v<>+<2B>(a<><61><EFBFBD>Vl2<6C><32><EFBFBD><EFBFBD><EFBFBD>uNƺ\<5C><>|<7C>C<EFBFBD><05>:<3A><><EFBFBD><EFBFBD>%<25><>'3H<33><79>@<40>ٓ<7F><D993>1Qu<15>מ<EFBFBD> q<P<><50><EFBFBD><EFBFBD><EFBFBD>'<><7F><4D>S
<EFBFBD>V<EFBFBD>|Vp<56><70><1B>sSS<05><><EFBFBD><19>j<EFBFBD><>3<EFBFBD><33><EFBFBD><EFBFBD>re<72>

View File

@@ -0,0 +1,7 @@
x<01><54>X<10>5_q<5F><71>g… <0B>f<EFBFBD><0F><>"IoGB<> <20><><07>[oܻ<6F>ݧS<DDA7><53><EFBFBD>{<<3C><19>$E<>5<EFBFBD>Y"&<26>RD<52>Œ <09><><EFBFBD>" <20>B<EFBFBD><42>9<EFBFBD><39>Y<EFBFBD><59>,<2C>Fi<46><69>ј<EFBFBD>3<EFBFBD><33><EFBFBD>D{Gr$<24><>ƐAyN<79>$cs<02><><EFBFBD><EFBFBD><EFBFBD>4Ţe.<2E><11>}<7D>&<26><08>*<2A><><EFBFBD><EFBFBD>/<2F>_<EFBFBD><5F>o<EFBFBD><6F>/ iҐF<D290>",<2C>9<EFBFBD><39>3<EFBFBD><33>Y<EFBFBD><59>T<15><EFBFBD>r2<72><32><EFBFBD><EFBFBD>=)<29><><EFBFBD><17><>A6NU<4E>~J<><4A>
nD<EFBFBD>b+X) <1C><><EFBFBD><EFBFBD>{<7B>V<EFBFBD><56>k&<26><01>y<EFBFBD><79><EFBFBD>8<EFBFBD><17><EFBFBD><7F>uc<75> T<>)A<<16>":ڕ<><DA95>I:MV<4D>S<EFBFBD>ZB<5A><42>%U<>l<EFBFBD>r<EFBFBD><72>L<02>L<EFBFBD><4C><EFBFBD><12><><EFBFBD>Y磄<59><E7A384><EFBFBD>(4/r<>Mx<t<>ʈ<EFBFBD>.<2E><>[<5B>l<EFBFBD>pT%}<7D>\<5C>.<2E>M<1F>ڸJWVݸ<56>88z`@<40><><R5o<35><6F><EFBFBD>9jl<6A><6C>ǸT<C7B8><05>[ <20><>%\<5C>ӄ)s<>L<EFBFBD>t<EFBFBD>` <0E>k~s}D<> <06>u<EFBFBD>-g|
^<5E><><EFBFBD>Է +<2B>ϫ<>Pry<72><>]<06>8<EFBFBD><38>EO<45><4F>x<EFBFBD>S<EFBFBD>Û/<07><>vK0@<40>t<EFBFBD>\<5C>L/<1A>-<1A>R<EFBFBD><52>kdї<64>/<15>` <0C><><EFBFBD><EFBFBD>S<><53>a<EFBFBD>̯<EFBFBD><CCAF>[<5B>n!U<>a<EFBFBD>c@<40><>6<EFBFBD><36>;<3B>h¶ḽ<6C><19>
]]M <0C>s<EFBFBD>Z\H<>!׎!<21><><0F>X
<EFBFBD>N<EFBFBD><EFBFBD>H<EFBFBD>'o<>1<10><>d1<64><31><EFBFBD>ŝ<EFBFBD><C59D><EFBFBD><03><>+g@J<><4A>ι<EFBFBD><CEB9>o<EFBFBD>n6<6E>hw<68><77>|<7C><>lE<>2 <0C>ir1ID<><44>MU<4D>_Cxz^<5E>@<40>.Vg<56><67><EFBFBD> <0B><><EFBFBD>u-<1C><19>
݅
<EFBFBD><EFBFBD><EFBFBD>

View File

@@ -0,0 +1 @@
xm<>MJ<4D>@<10>a<EFBFBD>9E]`<60><><EFBFBD><EFBFBD><EFBFBD>ADEpQ!<21><01>]g<>I<EFBFBD>Le<4C><65>

View File

@@ -0,0 +1 @@
x<01><>Kj<4B>0@<40><>)f(<28>X<EFBFBD><58>P<EFBFBD><50> <09><13><>#bh"#O

View File

@@ -0,0 +1,4 @@
x<01>Y<EFBFBD>o<EFBFBD>6ޫ<>WhF_%<25>m1d<01><>?2<>@<40>q[<5B><><EFBFBD>h<EFBFBD><68>D
$<15>-<2D><><EFBFBD>HI,%<25>q"t<><74> "y<><79><EFBFBD>u<>;/3<> ~{<7B><><EFBFBD>/<2F><>}<7D>wT*&<26><>tͦ<01><>H_<>O?}<7D>#<<3C><><EFBFBD>Op!<21><>4<EFBFBD>Hsu><3E>h]<5D>!<21><>;<3B>#R<>dC#!<21><><EFBFBD><EFBFBD>z<19> <0C><><<3C>W<EFBFBD>Io<49><6F>h<EFBFBD><68><EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>s2<>4<EFBFBD> <09><>L@<40>L<EFBFBD><4C>K<EFBFBD>mOut<75><74><EFBFBD>ĽJ<C4BD>C<EFBFBD><43>T<11><><EFBFBD><EFBFBD><04>"<22><><EFBFBD><EFBFBD>ul<75>0j́LA$<24><1A>'x-EY<45>Oc<4F><18>B<EFBFBD>mV<6D><56>t+<2B>m<EFBFBD>d<EFBFBD>L1jD<6A>8<EFBFBD><38><EFBFBD>H<EFBFBD>A<EFBFBD><41><0E>P<EFBFBD>҂<EFBFBD><14>˨
+x<><a<>[<5B>"<22>G<EFBFBD><47><EFBFBD>7<17><17>5<>FD<46> sG<73><47><EFBFBD> <20><06><>>j<>Ξn˷$<24><>Eo><3E><>|.<2E>z}<7D><><EFBFBD><EFBFBD>G<6B>aJ<18>u8PJU"Ya<59>/<2F><><EFBFBD><EFBFBD><EFBFBD>L<EFBFBD>;<3B><18>b<EFBFBD><62><EFBFBD>-Y<>q<EFBFBD>B<EFBFBD><42>T34kR<14>J<EFBFBD>uHN<18><><44><D194>ٷ<EFBFBD><D9B7>;<3B>"<22>W<><57><EFBFBD>d-7<><37><EFBFBD>{Σy<CEA3><79>G<EFBFBD><47>xkY<6B>X<EFBFBD>e]<5D><><EFBFBD>|<7C>V"<22><>pm<70><6D><EFBFBD><EFBFBD><EFBFBD>0`O<><4F>j <0C>%O宅<?<3F><>O<EFBFBD><4F>.<2E>\p<>G<><47>tT<74>`<60>[{g=jV<6A><56><EFBFBD><EFBFBD>C<EFBFBD>T<EFBFBD>2v<32>ȮJ<53>L<EFBFBD>65<36><35><1B><>{O<>T<>y'<27>P|<7C>Am<41><1E><>h<EFBFBD>7<1E>,:}<18><><EFBFBD><47><D492>!<21><>B<EFBFBD>f<EFBFBD>~<7E>hSo+<2B>@5Q<35>Ґ>dÖ`<0F>+<2B><>Bt<42><1D><5F><C7BE><EFBFBD>~<7E><>XV<07><><15>dM<64>&)<29><>*(<05><1F>5 <0C><><EFBFBD>= :<3A>
<EFBFBD>f<> ƒ%

Some files were not shown because too many files have changed in this diff Show More