Merge branch '3.2.x' into 3.3.x
This commit is contained in:
commit
ec615f631c
@ -32,6 +32,8 @@ import org.gradle.api.Project;
|
|||||||
import org.springframework.boot.build.artifacts.ArtifactRelease;
|
import org.springframework.boot.build.artifacts.ArtifactRelease;
|
||||||
import org.springframework.boot.build.bom.BomExtension;
|
import org.springframework.boot.build.bom.BomExtension;
|
||||||
import org.springframework.boot.build.bom.Library;
|
import org.springframework.boot.build.bom.Library;
|
||||||
|
import org.springframework.boot.build.properties.BuildProperties;
|
||||||
|
import org.springframework.boot.build.properties.BuildType;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,6 +49,8 @@ public class AntoraAsciidocAttributes {
|
|||||||
|
|
||||||
private final boolean latestVersion;
|
private final boolean latestVersion;
|
||||||
|
|
||||||
|
private final BuildType buildType;
|
||||||
|
|
||||||
private final ArtifactRelease artifactRelease;
|
private final ArtifactRelease artifactRelease;
|
||||||
|
|
||||||
private final List<Library> libraries;
|
private final List<Library> libraries;
|
||||||
@ -59,16 +63,18 @@ public class AntoraAsciidocAttributes {
|
|||||||
Map<String, String> dependencyVersions) {
|
Map<String, String> dependencyVersions) {
|
||||||
this.version = String.valueOf(project.getVersion());
|
this.version = String.valueOf(project.getVersion());
|
||||||
this.latestVersion = Boolean.parseBoolean(String.valueOf(project.findProperty("latestVersion")));
|
this.latestVersion = Boolean.parseBoolean(String.valueOf(project.findProperty("latestVersion")));
|
||||||
|
this.buildType = BuildProperties.get(project).buildType();
|
||||||
this.artifactRelease = ArtifactRelease.forProject(project);
|
this.artifactRelease = ArtifactRelease.forProject(project);
|
||||||
this.libraries = dependencyBom.getLibraries();
|
this.libraries = dependencyBom.getLibraries();
|
||||||
this.dependencyVersions = dependencyVersions;
|
this.dependencyVersions = dependencyVersions;
|
||||||
this.projectProperties = project.getProperties();
|
this.projectProperties = project.getProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
AntoraAsciidocAttributes(String version, boolean latestVersion, List<Library> libraries,
|
AntoraAsciidocAttributes(String version, boolean latestVersion, BuildType buildType, List<Library> libraries,
|
||||||
Map<String, String> dependencyVersions, Map<String, ?> projectProperties) {
|
Map<String, String> dependencyVersions, Map<String, ?> projectProperties) {
|
||||||
this.version = version;
|
this.version = version;
|
||||||
this.latestVersion = latestVersion;
|
this.latestVersion = latestVersion;
|
||||||
|
this.buildType = buildType;
|
||||||
this.artifactRelease = ArtifactRelease.forVersion(version);
|
this.artifactRelease = ArtifactRelease.forVersion(version);
|
||||||
this.libraries = (libraries != null) ? libraries : Collections.emptyList();
|
this.libraries = (libraries != null) ? libraries : Collections.emptyList();
|
||||||
this.dependencyVersions = (dependencyVersions != null) ? dependencyVersions : Collections.emptyMap();
|
this.dependencyVersions = (dependencyVersions != null) ? dependencyVersions : Collections.emptyMap();
|
||||||
@ -77,6 +83,7 @@ public class AntoraAsciidocAttributes {
|
|||||||
|
|
||||||
public Map<String, String> get() {
|
public Map<String, String> get() {
|
||||||
Map<String, String> attributes = new LinkedHashMap<>();
|
Map<String, String> attributes = new LinkedHashMap<>();
|
||||||
|
addBuildTypeAttribute(attributes);
|
||||||
addGitHubAttributes(attributes);
|
addGitHubAttributes(attributes);
|
||||||
addVersionAttributes(attributes);
|
addVersionAttributes(attributes);
|
||||||
addArtifactAttributes(attributes);
|
addArtifactAttributes(attributes);
|
||||||
@ -86,6 +93,10 @@ public class AntoraAsciidocAttributes {
|
|||||||
return attributes;
|
return attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void addBuildTypeAttribute(Map<String, String> attributes) {
|
||||||
|
attributes.put("build-type", this.buildType.toIdentifier());
|
||||||
|
}
|
||||||
|
|
||||||
private void addGitHubAttributes(Map<String, String> attributes) {
|
private void addGitHubAttributes(Map<String, String> attributes) {
|
||||||
attributes.put("github-repo", "spring-projects/spring-boot");
|
attributes.put("github-repo", "spring-projects/spring-boot");
|
||||||
attributes.put("github-ref", determineGitHubRef());
|
attributes.put("github-ref", determineGitHubRef());
|
||||||
@ -152,6 +163,8 @@ public class AntoraAsciidocAttributes {
|
|||||||
private void addArtifactAttributes(Map<String, String> attributes) {
|
private void addArtifactAttributes(Map<String, String> attributes) {
|
||||||
attributes.put("url-artifact-repository", this.artifactRelease.getDownloadRepo());
|
attributes.put("url-artifact-repository", this.artifactRelease.getDownloadRepo());
|
||||||
attributes.put("artifact-release-type", this.artifactRelease.getType());
|
attributes.put("artifact-release-type", this.artifactRelease.getType());
|
||||||
|
attributes.put("build-and-artifact-release-type",
|
||||||
|
this.buildType.toIdentifier() + "-" + this.artifactRelease.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addUrlJava(Map<String, String> attributes) {
|
private void addUrlJava(Map<String, String> attributes) {
|
||||||
@ -177,8 +190,7 @@ public class AntoraAsciidocAttributes {
|
|||||||
};
|
};
|
||||||
try (InputStream in = getClass().getResourceAsStream("antora-asciidoc-attributes.properties")) {
|
try (InputStream in = getClass().getResourceAsStream("antora-asciidoc-attributes.properties")) {
|
||||||
properties.load(in);
|
properties.load(in);
|
||||||
}
|
} catch (IOException ex) {
|
||||||
catch (IOException ex) {
|
|
||||||
throw new UncheckedIOException(ex);
|
throw new UncheckedIOException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,10 @@ public enum BuildType {
|
|||||||
/**
|
/**
|
||||||
* A commercial build.
|
* A commercial build.
|
||||||
*/
|
*/
|
||||||
COMMERCIAL
|
COMMERCIAL;
|
||||||
|
|
||||||
|
public String toIdentifier() {
|
||||||
|
return toString().replace("_", "").toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ import org.springframework.boot.build.bom.Library.LibraryVersion;
|
|||||||
import org.springframework.boot.build.bom.Library.ProhibitedVersion;
|
import org.springframework.boot.build.bom.Library.ProhibitedVersion;
|
||||||
import org.springframework.boot.build.bom.Library.VersionAlignment;
|
import org.springframework.boot.build.bom.Library.VersionAlignment;
|
||||||
import org.springframework.boot.build.bom.bomr.version.DependencyVersion;
|
import org.springframework.boot.build.bom.bomr.version.DependencyVersion;
|
||||||
|
import org.springframework.boot.build.properties.BuildType;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
@ -42,45 +43,59 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
*/
|
*/
|
||||||
class AntoraAsciidocAttributesTests {
|
class AntoraAsciidocAttributesTests {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void buildTypeWhenOpenSource() {
|
||||||
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.OPEN_SOURCE, null,
|
||||||
|
mockDependencyVersions(), null);
|
||||||
|
assertThat(attributes.get()).containsEntry("build-type", "opensource");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void buildTypeWhenCommercial() {
|
||||||
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.COMMERCIAL, null,
|
||||||
|
mockDependencyVersions(), null);
|
||||||
|
assertThat(attributes.get()).containsEntry("build-type", "commercial");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void githubRefWhenReleasedVersionIsTag() {
|
void githubRefWhenReleasedVersionIsTag() {
|
||||||
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, null,
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.OPEN_SOURCE, null,
|
||||||
mockDependencyVersions(), null);
|
mockDependencyVersions(), null);
|
||||||
assertThat(attributes.get()).containsEntry("github-ref", "v1.2.3");
|
assertThat(attributes.get()).containsEntry("github-ref", "v1.2.3");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void githubRefWhenLatestSnapshotVersionIsMainBranch() {
|
void githubRefWhenLatestSnapshotVersionIsMainBranch() {
|
||||||
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, null,
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true,
|
||||||
mockDependencyVersions(), null);
|
BuildType.OPEN_SOURCE, null, mockDependencyVersions(), null);
|
||||||
assertThat(attributes.get()).containsEntry("github-ref", "main");
|
assertThat(attributes.get()).containsEntry("github-ref", "main");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void githubRefWhenOlderSnapshotVersionIsBranch() {
|
void githubRefWhenOlderSnapshotVersionIsBranch() {
|
||||||
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", false, null,
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", false,
|
||||||
mockDependencyVersions(), null);
|
BuildType.OPEN_SOURCE, null, mockDependencyVersions(), null);
|
||||||
assertThat(attributes.get()).containsEntry("github-ref", "1.2.x");
|
assertThat(attributes.get()).containsEntry("github-ref", "1.2.x");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void githubRefWhenOlderSnapshotHotFixVersionIsBranch() {
|
void githubRefWhenOlderSnapshotHotFixVersionIsBranch() {
|
||||||
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3.1-SNAPSHOT", false, null,
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3.1-SNAPSHOT", false,
|
||||||
mockDependencyVersions(), null);
|
BuildType.OPEN_SOURCE, null, mockDependencyVersions(), null);
|
||||||
assertThat(attributes.get()).containsEntry("github-ref", "1.2.3.x");
|
assertThat(attributes.get()).containsEntry("github-ref", "1.2.3.x");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void versionReferenceFromLibrary() {
|
void versionReferenceFromLibrary() {
|
||||||
Library library = mockLibrary(Collections.emptyMap());
|
Library library = mockLibrary(Collections.emptyMap());
|
||||||
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3.1-SNAPSHOT", false, List.of(library),
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3.1-SNAPSHOT", false,
|
||||||
mockDependencyVersions(), null);
|
BuildType.OPEN_SOURCE, List.of(library), mockDependencyVersions(), null);
|
||||||
assertThat(attributes.get()).containsEntry("version-spring-framework", "1.2.3");
|
assertThat(attributes.get()).containsEntry("version-spring-framework", "1.2.3");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void versionReferenceFromSpringDataDependencyReleaseVersion() {
|
void versionReferenceFromSpringDataDependencyReleaseVersion() {
|
||||||
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, null,
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.OPEN_SOURCE, null,
|
||||||
mockDependencyVersions("3.2.5"), null);
|
mockDependencyVersions("3.2.5"), null);
|
||||||
assertThat(attributes.get()).containsEntry("version-spring-data-mongodb-docs", "3.2");
|
assertThat(attributes.get()).containsEntry("version-spring-data-mongodb-docs", "3.2");
|
||||||
assertThat(attributes.get()).containsEntry("version-spring-data-mongodb-javadoc", "3.2.x");
|
assertThat(attributes.get()).containsEntry("version-spring-data-mongodb-javadoc", "3.2.x");
|
||||||
@ -88,7 +103,7 @@ class AntoraAsciidocAttributesTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void versionReferenceFromSpringDataDependencySnapshotVersion() {
|
void versionReferenceFromSpringDataDependencySnapshotVersion() {
|
||||||
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, null,
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.OPEN_SOURCE, null,
|
||||||
mockDependencyVersions("3.2.0-SNAPSHOT"), null);
|
mockDependencyVersions("3.2.0-SNAPSHOT"), null);
|
||||||
assertThat(attributes.get()).containsEntry("version-spring-data-mongodb-docs", "3.2-SNAPSHOT");
|
assertThat(attributes.get()).containsEntry("version-spring-data-mongodb-docs", "3.2-SNAPSHOT");
|
||||||
assertThat(attributes.get()).containsEntry("version-spring-data-mongodb-javadoc", "3.2.x");
|
assertThat(attributes.get()).containsEntry("version-spring-data-mongodb-javadoc", "3.2.x");
|
||||||
@ -96,51 +111,78 @@ class AntoraAsciidocAttributesTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void versionNativeBuildTools() {
|
void versionNativeBuildTools() {
|
||||||
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, null,
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.OPEN_SOURCE, null,
|
||||||
mockDependencyVersions(), Map.of("nativeBuildToolsVersion", "3.4.5"));
|
mockDependencyVersions(), Map.of("nativeBuildToolsVersion", "3.4.5"));
|
||||||
assertThat(attributes.get()).containsEntry("version-native-build-tools", "3.4.5");
|
assertThat(attributes.get()).containsEntry("version-native-build-tools", "3.4.5");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void urlArtifactRepositoryWhenRelease() {
|
void urlArtifactRepositoryWhenRelease() {
|
||||||
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, null,
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.OPEN_SOURCE, null,
|
||||||
mockDependencyVersions(), null);
|
mockDependencyVersions(), null);
|
||||||
assertThat(attributes.get()).containsEntry("url-artifact-repository", "https://repo.maven.apache.org/maven2");
|
assertThat(attributes.get()).containsEntry("url-artifact-repository", "https://repo.maven.apache.org/maven2");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void urlArtifactRepositoryWhenMilestone() {
|
void urlArtifactRepositoryWhenMilestone() {
|
||||||
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-M1", true, null,
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-M1", true, BuildType.OPEN_SOURCE,
|
||||||
mockDependencyVersions(), null);
|
null, mockDependencyVersions(), null);
|
||||||
assertThat(attributes.get()).containsEntry("url-artifact-repository", "https://repo.spring.io/milestone");
|
assertThat(attributes.get()).containsEntry("url-artifact-repository", "https://repo.spring.io/milestone");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void urlArtifactRepositoryWhenSnapshot() {
|
void urlArtifactRepositoryWhenSnapshot() {
|
||||||
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, null,
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true,
|
||||||
mockDependencyVersions(), null);
|
BuildType.OPEN_SOURCE, null, mockDependencyVersions(), null);
|
||||||
assertThat(attributes.get()).containsEntry("url-artifact-repository", "https://repo.spring.io/snapshot");
|
assertThat(attributes.get()).containsEntry("url-artifact-repository", "https://repo.spring.io/snapshot");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void artifactReleaseTypeWhenRelease() {
|
void artifactReleaseTypeWhenOpenSourceRelease() {
|
||||||
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, null,
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.OPEN_SOURCE, null,
|
||||||
mockDependencyVersions(), null);
|
mockDependencyVersions(), null);
|
||||||
assertThat(attributes.get()).containsEntry("artifact-release-type", "release");
|
assertThat(attributes.get()).containsEntry("artifact-release-type", "release");
|
||||||
|
assertThat(attributes.get()).containsEntry("build-and-artifact-release-type", "opensource-release");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void artifactReleaseTypeWhenMilestone() {
|
void artifactReleaseTypeWhenOpenSourceMilestone() {
|
||||||
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-M1", true, null,
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-M1", true, BuildType.OPEN_SOURCE,
|
||||||
|
null, mockDependencyVersions(), null);
|
||||||
|
assertThat(attributes.get()).containsEntry("artifact-release-type", "milestone");
|
||||||
|
assertThat(attributes.get()).containsEntry("build-and-artifact-release-type", "opensource-milestone");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void artifactReleaseTypeWhenOpenSourceSnapshot() {
|
||||||
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true,
|
||||||
|
BuildType.OPEN_SOURCE, null, mockDependencyVersions(), null);
|
||||||
|
assertThat(attributes.get()).containsEntry("artifact-release-type", "snapshot");
|
||||||
|
assertThat(attributes.get()).containsEntry("build-and-artifact-release-type", "opensource-snapshot");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void artifactReleaseTypeWhenCommercialRelease() {
|
||||||
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3", true, BuildType.COMMERCIAL, null,
|
||||||
|
mockDependencyVersions(), null);
|
||||||
|
assertThat(attributes.get()).containsEntry("artifact-release-type", "release");
|
||||||
|
assertThat(attributes.get()).containsEntry("build-and-artifact-release-type", "commercial-release");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void artifactReleaseTypeWhenCommercialMilestone() {
|
||||||
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-M1", true, BuildType.COMMERCIAL, null,
|
||||||
mockDependencyVersions(), null);
|
mockDependencyVersions(), null);
|
||||||
assertThat(attributes.get()).containsEntry("artifact-release-type", "milestone");
|
assertThat(attributes.get()).containsEntry("artifact-release-type", "milestone");
|
||||||
|
assertThat(attributes.get()).containsEntry("build-and-artifact-release-type", "commercial-milestone");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void artifactReleaseTypeWhenSnapshot() {
|
void artifactReleaseTypeWhenCommercialSnapshot() {
|
||||||
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, null,
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, BuildType.COMMERCIAL,
|
||||||
mockDependencyVersions(), null);
|
null, mockDependencyVersions(), null);
|
||||||
assertThat(attributes.get()).containsEntry("artifact-release-type", "snapshot");
|
assertThat(attributes.get()).containsEntry("artifact-release-type", "snapshot");
|
||||||
|
assertThat(attributes.get()).containsEntry("build-and-artifact-release-type", "commercial-snapshot");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -149,16 +191,16 @@ class AntoraAsciidocAttributesTests {
|
|||||||
links.put("site", (version) -> "https://example.com/site/" + version);
|
links.put("site", (version) -> "https://example.com/site/" + version);
|
||||||
links.put("docs", (version) -> "https://example.com/docs/" + version);
|
links.put("docs", (version) -> "https://example.com/docs/" + version);
|
||||||
Library library = mockLibrary(links);
|
Library library = mockLibrary(links);
|
||||||
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3.1-SNAPSHOT", false, List.of(library),
|
AntoraAsciidocAttributes attributes = new AntoraAsciidocAttributes("1.2.3.1-SNAPSHOT", false,
|
||||||
mockDependencyVersions(), null);
|
BuildType.OPEN_SOURCE, List.of(library), mockDependencyVersions(), null);
|
||||||
assertThat(attributes.get()).containsEntry("url-spring-framework-site", "https://example.com/site/1.2.3")
|
assertThat(attributes.get()).containsEntry("url-spring-framework-site", "https://example.com/site/1.2.3")
|
||||||
.containsEntry("url-spring-framework-docs", "https://example.com/docs/1.2.3");
|
.containsEntry("url-spring-framework-docs", "https://example.com/docs/1.2.3");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void linksFromProperties() {
|
void linksFromProperties() {
|
||||||
Map<String, String> attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, null,
|
Map<String, String> attributes = new AntoraAsciidocAttributes("1.2.3-SNAPSHOT", true, BuildType.OPEN_SOURCE,
|
||||||
mockDependencyVersions(), null)
|
null, mockDependencyVersions(), null)
|
||||||
.get();
|
.get();
|
||||||
assertThat(attributes).containsEntry("include-java", "ROOT:example$java/org/springframework/boot/docs");
|
assertThat(attributes).containsEntry("include-java", "ROOT:example$java/org/springframework/boot/docs");
|
||||||
assertThat(attributes).containsEntry("url-spring-data-cassandra-site",
|
assertThat(attributes).containsEntry("url-spring-data-cassandra-site",
|
||||||
|
@ -100,34 +100,61 @@ Open your favorite text editor and add the following:
|
|||||||
|
|
||||||
<!-- Additional lines to be added here... -->
|
<!-- Additional lines to be added here... -->
|
||||||
|
|
||||||
ifeval::["{artifact-release-type}" != "release"]
|
ifeval::["{build-and-artifact-release-type}" == "opensource-milestone"]
|
||||||
<!-- (you only need this if you are using a milestone or snapshot version) -->
|
<!-- (you don't need this if you are using a release version) -->
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>spring-snapshots</id>
|
<id>spring-milestones</id>
|
||||||
<url>https://repo.spring.io/snapshot</url>
|
<url>https://repo.spring.io/milestone</url>
|
||||||
<snapshots><enabled>true</enabled></snapshots>
|
</repository>
|
||||||
</repository>
|
</repositories>
|
||||||
<repository>
|
<pluginRepositories>
|
||||||
<id>spring-milestones</id>
|
<pluginRepository>
|
||||||
<url>https://repo.spring.io/milestone</url>
|
<id>spring-milestones</id>
|
||||||
</repository>
|
<url>https://repo.spring.io/milestone</url>
|
||||||
</repositories>
|
</pluginRepository>
|
||||||
<pluginRepositories>
|
</pluginRepositories>
|
||||||
<pluginRepository>
|
endif::[]
|
||||||
<id>spring-snapshots</id>
|
ifeval::["{build-and-artifact-release-type}" == "opensource-snapshot"]
|
||||||
<url>https://repo.spring.io/snapshot</url>
|
<!-- (you don't need this if you are using a release version) -->
|
||||||
</pluginRepository>
|
<repositories>
|
||||||
<pluginRepository>
|
<repository>
|
||||||
<id>spring-milestones</id>
|
<id>spring-snapshots</id>
|
||||||
<url>https://repo.spring.io/milestone</url>
|
<url>https://repo.spring.io/snapshot</url>
|
||||||
</pluginRepository>
|
<snapshots><enabled>true</enabled></snapshots>
|
||||||
</pluginRepositories>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>spring-milestones</id>
|
||||||
|
<url>https://repo.spring.io/milestone</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
<pluginRepositories>
|
||||||
|
<pluginRepository>
|
||||||
|
<id>spring-snapshots</id>
|
||||||
|
<url>https://repo.spring.io/snapshot</url>
|
||||||
|
</pluginRepository>
|
||||||
|
<pluginRepository>
|
||||||
|
<id>spring-milestones</id>
|
||||||
|
<url>https://repo.spring.io/milestone</url>
|
||||||
|
</pluginRepository>
|
||||||
|
</pluginRepositories>
|
||||||
endif::[]
|
endif::[]
|
||||||
</project>
|
</project>
|
||||||
----
|
----
|
||||||
|
|
||||||
|
ifeval::["{build-type}" == "opensource"]
|
||||||
The preceding listing should give you a working build.
|
The preceding listing should give you a working build.
|
||||||
|
endif::[]
|
||||||
|
|
||||||
|
ifeval::["{build-type}" == "commercial"]
|
||||||
|
You will also have to configure your build to access the Spring Commercial repository.
|
||||||
|
This is usual done through a local artifact repository that mirrors the content of the Spring Commercial repository.
|
||||||
|
Alternatively, while it is not recommended, the Spring Commercial repository can also be accessed directly.
|
||||||
|
In either case, see https://docs.vmware.com/en/Tanzu-Spring-Runtime/Commercial/Tanzu-Spring-Runtime/spring-enterprise-subscription.html[the Tanzu Spring Runtime documentation] for further details.
|
||||||
|
|
||||||
|
With the addition of the necessary repository configuration, the preceding listing should give you a working build.
|
||||||
|
endif::[]
|
||||||
|
|
||||||
You can test it by running `mvn package` (for now, you can ignore the "`jar will be empty - no content was marked for inclusion!`" warning).
|
You can test it by running `mvn package` (for now, you can ignore the "`jar will be empty - no content was marked for inclusion!`" warning).
|
||||||
|
|
||||||
NOTE: At this point, you could import the project into an IDE (most modern Java IDEs include built-in support for Maven).
|
NOTE: At this point, you could import the project into an IDE (most modern Java IDEs include built-in support for Maven).
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
plugins {
|
||||||
|
id 'org.springframework.boot' version '{gradle-project-version}'
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
plugins {
|
||||||
|
id("org.springframework.boot") version "{gradle-project-version}"
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
plugins {
|
||||||
|
id 'org.springframework.boot' version '{gradle-project-version}' apply false
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
plugins {
|
||||||
|
id("org.springframework.boot") version "{gradle-project-version}" apply false
|
||||||
|
}
|
@ -3,7 +3,34 @@
|
|||||||
|
|
||||||
To get started with the plugin it needs to be applied to your project.
|
To get started with the plugin it needs to be applied to your project.
|
||||||
|
|
||||||
ifeval::["{artifact-release-type}" == "release"]
|
ifeval::["{build-type}" == "commercial"]
|
||||||
|
The plugin is published to the Spring Commercial repository.
|
||||||
|
You will have to configure your build to access this repository.
|
||||||
|
This is usual done through a local artifact repository that mirrors the content of the Spring Commercial repository.
|
||||||
|
Alternatively, while it is not recommended, the Spring Commercial repository can also be accessed directly.
|
||||||
|
In either case, see https://docs.vmware.com/en/Tanzu-Spring-Runtime/Commercial/Tanzu-Spring-Runtime/spring-enterprise-subscription.html[the Tanzu Spring Runtime documentation] for further details.
|
||||||
|
|
||||||
|
With access to the Spring Commercial repository configured in `settings.gradle` or `settings.gradle.kts`, the plugin can be applied using the `plugins` block:
|
||||||
|
|
||||||
|
[tabs]
|
||||||
|
======
|
||||||
|
Groovy::
|
||||||
|
+
|
||||||
|
[source,groovy,indent=0,subs="verbatim,attributes"]
|
||||||
|
----
|
||||||
|
include::example$getting-started/apply-plugin-commercial.gradle[]
|
||||||
|
----
|
||||||
|
Kotlin::
|
||||||
|
+
|
||||||
|
[source,kotlin,indent=0,subs="verbatim,attributes"]
|
||||||
|
----
|
||||||
|
include::example$getting-started/apply-plugin-commercial.gradle.kts[]
|
||||||
|
----
|
||||||
|
======
|
||||||
|
endif::[]
|
||||||
|
|
||||||
|
|
||||||
|
ifeval::["{build-and-artifact-release-type}" == "opensource-release"]
|
||||||
The plugin is https://plugins.gradle.org/plugin/org.springframework.boot[published to Gradle's plugin portal] and can be applied using the `plugins` block:
|
The plugin is https://plugins.gradle.org/plugin/org.springframework.boot[published to Gradle's plugin portal] and can be applied using the `plugins` block:
|
||||||
|
|
||||||
[tabs]
|
[tabs]
|
||||||
@ -23,7 +50,7 @@ include::example$getting-started/apply-plugin-release.gradle.kts[]
|
|||||||
======
|
======
|
||||||
endif::[]
|
endif::[]
|
||||||
|
|
||||||
ifeval::["{artifact-release-type}" == "milestone"]
|
ifeval::["{build-and-artifact-release-type}" == "opensource-milestone"]
|
||||||
The plugin is published to the Spring milestones repository.
|
The plugin is published to the Spring milestones repository.
|
||||||
Gradle can be configured to use the milestones repository and the plugin can then be applied using the `plugins` block.
|
Gradle can be configured to use the milestones repository and the plugin can then be applied using the `plugins` block.
|
||||||
To configure Gradle to use the milestones repository, add the following to your `settings.gradle` (Groovy) or `settings.gradle.kts` (Kotlin):
|
To configure Gradle to use the milestones repository, add the following to your `settings.gradle` (Groovy) or `settings.gradle.kts` (Kotlin):
|
||||||
@ -63,7 +90,7 @@ include::example$getting-started/apply-plugin-release.gradle.kts[]
|
|||||||
======
|
======
|
||||||
endif::[]
|
endif::[]
|
||||||
|
|
||||||
ifeval::["{artifact-release-type}" == "snapshot"]
|
ifeval::["{build-and-artifact-release-type}" == "opensource-snapshot"]
|
||||||
The plugin is published to the Spring snapshots repository.
|
The plugin is published to the Spring snapshots repository.
|
||||||
Gradle can be configured to use the snapshots repository and the plugin can then be applied using the `plugins` block.
|
Gradle can be configured to use the snapshots repository and the plugin can then be applied using the `plugins` block.
|
||||||
To configure Gradle to use the snapshots repository, add the following to your `settings.gradle` (Groovy) or `settings.gradle.kts` (Kotlin):
|
To configure Gradle to use the snapshots repository, add the following to your `settings.gradle` (Groovy) or `settings.gradle.kts` (Kotlin):
|
||||||
|
@ -70,7 +70,25 @@ The `SpringBootPlugin` class provides a `BOM_COORDINATES` constant that can be u
|
|||||||
|
|
||||||
First, configure the project to depend on the Spring Boot plugin but do not apply it:
|
First, configure the project to depend on the Spring Boot plugin but do not apply it:
|
||||||
|
|
||||||
ifeval::["{artifact-release-type}" == "release"]
|
ifeval::["{build-type}" == "commercial"]
|
||||||
|
[tabs]
|
||||||
|
======
|
||||||
|
Groovy::
|
||||||
|
+
|
||||||
|
[source,groovy,indent=0,subs="verbatim,attributes"]
|
||||||
|
----
|
||||||
|
include::example$managing-dependencies/depend-on-plugin-commercial.gradle[]
|
||||||
|
----
|
||||||
|
Kotlin::
|
||||||
|
+
|
||||||
|
[source,kotlin,indent=0,subs="verbatim,attributes"]
|
||||||
|
----
|
||||||
|
include::example$managing-dependencies/depend-on-plugin-commercial.gradle.kts[]
|
||||||
|
----
|
||||||
|
======
|
||||||
|
endif::[]
|
||||||
|
|
||||||
|
ifeval::["{build-and-artifact-release-type}" == "opensource-release"]
|
||||||
[tabs]
|
[tabs]
|
||||||
======
|
======
|
||||||
Groovy::
|
Groovy::
|
||||||
@ -88,7 +106,7 @@ include::example$managing-dependencies/depend-on-plugin-release.gradle.kts[]
|
|||||||
======
|
======
|
||||||
endif::[]
|
endif::[]
|
||||||
|
|
||||||
ifeval::["{artifact-release-type}" == "milestone"]
|
ifeval::["{build-and-artifact-release-type}" == "opensource-milestone"]
|
||||||
[tabs]
|
[tabs]
|
||||||
======
|
======
|
||||||
Groovy::
|
Groovy::
|
||||||
@ -106,7 +124,7 @@ include::example$managing-dependencies/depend-on-plugin-release.gradle.kts[]
|
|||||||
======
|
======
|
||||||
endif::[]
|
endif::[]
|
||||||
|
|
||||||
ifeval::["{artifact-release-type}" == "snapshot"]
|
ifeval::["{build-and-artifact-release-type}" == "opensource-snapshot"]
|
||||||
[tabs]
|
[tabs]
|
||||||
======
|
======
|
||||||
Groovy::
|
Groovy::
|
||||||
|
@ -8,9 +8,19 @@ To use the Spring Boot Maven Plugin, include the appropriate XML in the `plugins
|
|||||||
include::example$getting-started/pom.xml[tags=getting-started]
|
include::example$getting-started/pom.xml[tags=getting-started]
|
||||||
----
|
----
|
||||||
|
|
||||||
|
ifeval::["{build-type}" == "commercial"]
|
||||||
|
The plugin is published to the Spring Commercial repository.
|
||||||
|
You will have to configure your build to access this repository.
|
||||||
|
This is usually done through a local artifact repository that mirrors the content of the Spring Commercial repository.
|
||||||
|
Alternatively, while it is not recommended, the Spring Commercial repository can also be accessed directly.
|
||||||
|
In either case, see https://docs.vmware.com/en/Tanzu-Spring-Runtime/Commercial/Tanzu-Spring-Runtime/spring-enterprise-subscription.html[the Tanzu Spring Runtime documentation] for further details.
|
||||||
|
endif::[]
|
||||||
|
|
||||||
|
ifeval::["{build-type}" == "opensource"]
|
||||||
If you use a milestone or snapshot release, you also need to add the appropriate `pluginRepository` elements, as shown in the following listing:
|
If you use a milestone or snapshot release, you also need to add the appropriate `pluginRepository` elements, as shown in the following listing:
|
||||||
|
|
||||||
[source,xml,indent=0,subs="verbatim,attributes"]
|
[source,xml,indent=0,subs="verbatim,attributes"]
|
||||||
----
|
----
|
||||||
include::example$getting-started/plugin-repositories-pom.xml[tags=plugin-repositories]
|
include::example$getting-started/plugin-repositories-pom.xml[tags=plugin-repositories]
|
||||||
----
|
----
|
||||||
|
endif::[]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user