mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Merge branch '4.0.x' into 4.1.x
This commit is contained in:
+11
-38
@@ -19,13 +19,11 @@ package org.springframework.boot.build.antora;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.TreeMap;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.gradle.api.Project;
|
||||
|
||||
@@ -36,7 +34,6 @@ import org.springframework.boot.build.bom.Library.Link;
|
||||
import org.springframework.boot.build.bom.Library.LinkType;
|
||||
import org.springframework.boot.build.bom.Library.LinkedVersion;
|
||||
import org.springframework.boot.build.bom.ResolvedBom;
|
||||
import org.springframework.boot.build.bom.ResolvedBom.Id;
|
||||
import org.springframework.boot.build.bom.ResolvedBom.ResolvedLibrary;
|
||||
import org.springframework.boot.build.properties.BuildProperties;
|
||||
import org.springframework.boot.build.properties.BuildType;
|
||||
@@ -114,11 +111,7 @@ public class AntoraAsciidocAttributes {
|
||||
}
|
||||
|
||||
private void addVersionAttributes(Map<String, String> attributes, Map<String, String> internal) {
|
||||
this.libraries.forEach((library) -> {
|
||||
String name = "version-" + library.getLinkRootName();
|
||||
String value = library.getVersion().toString();
|
||||
attributes.put(name, value);
|
||||
});
|
||||
this.libraries.forEach((library) -> addVersionAttributes(attributes, library));
|
||||
attributes.put("version-native-build-tools", (String) this.projectProperties.get("nativeBuildToolsVersion"));
|
||||
attributes.put("version-graal", (String) this.projectProperties.get("graalVersion"));
|
||||
attributes.put("version-protobuf-gradle-plugin",
|
||||
@@ -129,35 +122,16 @@ public class AntoraAsciidocAttributes {
|
||||
addDependencyVersion(attributes, "jackson-databind", "tools.jackson.core:jackson-databind");
|
||||
addDependencyVersion(attributes, "jackson-dataformat-xml", "tools.jackson.dataformat:jackson-dataformat-xml");
|
||||
addDependencyVersion(attributes, "jackson2-databind", "com.fasterxml.jackson.core:jackson-databind");
|
||||
addSpringDataDependencyVersion(attributes, internal, "spring-data-commons");
|
||||
addSpringDataDependencyVersion(attributes, internal, "spring-data-couchbase");
|
||||
addSpringDataDependencyVersion(attributes, internal, "spring-data-cassandra");
|
||||
addSpringDataDependencyVersion(attributes, internal, "spring-data-elasticsearch");
|
||||
addSpringDataDependencyVersion(attributes, internal, "spring-data-jdbc");
|
||||
addSpringDataDependencyVersion(attributes, internal, "spring-data-jpa");
|
||||
addSpringDataDependencyVersion(attributes, internal, "spring-data-mongodb");
|
||||
addSpringDataDependencyVersion(attributes, internal, "spring-data-neo4j");
|
||||
addSpringDataDependencyVersion(attributes, internal, "spring-data-r2dbc");
|
||||
addSpringDataDependencyVersion(attributes, internal, "spring-data-redis");
|
||||
addSpringDataDependencyVersion(attributes, internal, "spring-data-rest", "spring-data-rest-core");
|
||||
addSpringDataDependencyVersion(attributes, internal, "spring-data-ldap");
|
||||
addDependencyVersion(attributes, "pulsar-client-api", "org.apache.pulsar:pulsar-client-api");
|
||||
}
|
||||
|
||||
private void addSpringDataDependencyVersion(Map<String, String> attributes, Map<String, String> internal,
|
||||
String artifactId) {
|
||||
addSpringDataDependencyVersion(attributes, internal, artifactId, artifactId);
|
||||
}
|
||||
|
||||
private void addSpringDataDependencyVersion(Map<String, String> attributes, Map<String, String> internal,
|
||||
String name, String artifactId) {
|
||||
String groupAndArtifactId = "org.springframework.data:" + artifactId;
|
||||
addDependencyVersion(attributes, name, groupAndArtifactId);
|
||||
String version = getVersion(groupAndArtifactId);
|
||||
String majorMinor = Arrays.stream(version.split("\\.")).limit(2).collect(Collectors.joining("."));
|
||||
String antoraVersion = version.endsWith(DASH_SNAPSHOT) ? majorMinor + DASH_SNAPSHOT : majorMinor;
|
||||
internal.put("antoraversion-" + name, antoraVersion);
|
||||
internal.put("dotxversion-" + name, majorMinor + ".x");
|
||||
private void addVersionAttributes(Map<String, String> attributes, Library library) {
|
||||
attributes.put("version-" + library.getLinkRootName(), library.getVersion().toString());
|
||||
ResolvedLibrary resolvedLibrary = this.resolvedBom.library(library);
|
||||
library.getModuleLinks().forEach((module, links) -> {
|
||||
String moduleVersion = resolvedLibrary.moduleVersion(module);
|
||||
attributes.put("version-" + module.rootName(), moduleVersion);
|
||||
});
|
||||
}
|
||||
|
||||
private void addDependencyVersion(Map<String, String> attributes, String name, String groupAndArtifactId) {
|
||||
@@ -231,10 +205,9 @@ public class AntoraAsciidocAttributes {
|
||||
LinkedVersion libraryVersion = new LinkedVersion(library.getVersion());
|
||||
String libraryName = library.getLinkRootName();
|
||||
library.getLinks().forEachLink((type, link) -> addLinkAttributes(libraryName, type, link, libraryVersion));
|
||||
library.getModuleLinks().forEach((moduleName, links) -> {
|
||||
Id resolvedModule = resolvedLibrary.module(moduleName);
|
||||
LinkedVersion moduleVersion = new LinkedVersion(resolvedModule.version());
|
||||
links.forEachLink((type, link) -> addLinkAttributes(moduleName, type, link, moduleVersion));
|
||||
library.getModuleLinks().forEach((module, links) -> {
|
||||
LinkedVersion moduleVersion = new LinkedVersion(resolvedLibrary.moduleVersion(module));
|
||||
links.forEachLink((type, link) -> addLinkAttributes(module.rootName(), type, link, moduleVersion));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ import org.springframework.boot.build.bom.Library.Group;
|
||||
import org.springframework.boot.build.bom.Library.ImportedBom;
|
||||
import org.springframework.boot.build.bom.Library.Link;
|
||||
import org.springframework.boot.build.bom.Library.LinkType;
|
||||
import org.springframework.boot.build.bom.Library.LinkedModule;
|
||||
import org.springframework.boot.build.bom.Library.LinkedVersion;
|
||||
import org.springframework.boot.build.bom.Library.Links;
|
||||
import org.springframework.boot.build.bom.Library.Module;
|
||||
@@ -233,7 +234,7 @@ public class BomExtension {
|
||||
|
||||
private Links links;
|
||||
|
||||
private Map<String, Links> moduleLinks;
|
||||
private Map<LinkedModule, Links> moduleLinks;
|
||||
|
||||
@Inject
|
||||
public LibraryHandler(Project project, String version) {
|
||||
@@ -611,24 +612,23 @@ public class BomExtension {
|
||||
|
||||
public static class LibraryLinksHandler extends LinksHandler {
|
||||
|
||||
private final Map<String, Map<LinkType, List<Link>>> moduleLinks = new HashMap<>();
|
||||
private final Map<LinkedModule, Map<LinkType, List<Link>>> moduleLinks = new HashMap<>();
|
||||
|
||||
public Map<String, Map<LinkType, List<Link>>> moduleLinks() {
|
||||
Map<LinkedModule, Map<LinkType, List<Link>>> moduleLinks() {
|
||||
return this.moduleLinks;
|
||||
}
|
||||
|
||||
public void module(String moduleName, Closure<ModuleLinksHandler> closure) {
|
||||
module(moduleName, List.of(moduleName), closure);
|
||||
}
|
||||
|
||||
public void module(String rootName, List<String> moduleNames, Closure<ModuleLinksHandler> closure) {
|
||||
ModuleLinksHandler handler = new ModuleLinksHandler();
|
||||
closure.setDelegate(handler);
|
||||
closure.setResolveStrategy(Closure.DELEGATE_FIRST);
|
||||
closure.call(handler);
|
||||
this.moduleLinks.computeIfAbsent(moduleName, (key) -> new HashMap<>()).putAll(handler.links());
|
||||
}
|
||||
|
||||
public void module(String moduleName, Action<ModuleLinksHandler> action) {
|
||||
ModuleLinksHandler handler = new ModuleLinksHandler();
|
||||
action.execute(handler);
|
||||
this.moduleLinks.computeIfAbsent(moduleName, (key) -> new HashMap<>()).putAll(handler.links());
|
||||
this.moduleLinks.computeIfAbsent(new LinkedModule(rootName, moduleNames), (key) -> new HashMap<>())
|
||||
.putAll(handler.links());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public abstract class CheckLinks extends DefaultTask {
|
||||
library.getLinks().forEachLink((type, link) -> check(restClient, type, link, libraryName, libraryVersion));
|
||||
library.getModuleLinks().forEach((module, links) -> {
|
||||
String moduleName = "%s (%s)".formatted(library.getName(), module);
|
||||
String moduleVersion = resolvedLibrary.module(module).version();
|
||||
String moduleVersion = resolvedLibrary.moduleVersion(module);
|
||||
links.forEachLink((type, link) -> check(restClient, type, link, moduleName, moduleVersion));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public class Library {
|
||||
|
||||
private final Links links;
|
||||
|
||||
private final Map<String, Links> moduleLinks;
|
||||
private final Map<LinkedModule, Links> moduleLinks;
|
||||
|
||||
/**
|
||||
* Create a new {@code Library} with the given {@code name}, {@code version}, and
|
||||
@@ -109,7 +109,7 @@ public class Library {
|
||||
public Library(String name, String calendarName, DependencyVersion version, List<Group> groups,
|
||||
UpgradePolicy upgradePolicy, List<ProhibitedVersion> prohibitedVersions, FirstParty firstParty,
|
||||
VersionAlignment versionAlignment, BomAlignment bomAlignment, String linkRootName, Links links,
|
||||
Map<String, Links> moduleLinks) {
|
||||
Map<LinkedModule, Links> moduleLinks) {
|
||||
this.name = name;
|
||||
this.calendarName = (calendarName != null) ? calendarName : name;
|
||||
this.version = version;
|
||||
@@ -182,7 +182,7 @@ public class Library {
|
||||
return this.links;
|
||||
}
|
||||
|
||||
public Map<String, Links> getModuleLinks() {
|
||||
public Map<LinkedModule, Links> getModuleLinks() {
|
||||
return this.moduleLinks;
|
||||
}
|
||||
|
||||
@@ -752,6 +752,21 @@ public class Library {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* A linked module.
|
||||
*
|
||||
* @param rootName the root name for the module
|
||||
* @param moduleNames the names of the linked modules that all share the same version
|
||||
* number and links.
|
||||
*/
|
||||
public record LinkedModule(String rootName, List<String> moduleNames) {
|
||||
|
||||
public static LinkedModule of(String moduleName) {
|
||||
return new LinkedModule(moduleName, List.of(moduleName));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* A version used when resolving a {@link Link}.
|
||||
*
|
||||
|
||||
@@ -24,12 +24,15 @@ import java.io.Writer;
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import tools.jackson.databind.json.JsonMapper;
|
||||
|
||||
import org.springframework.boot.build.bom.Library.LinkedModule;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -84,11 +87,15 @@ public record ResolvedBom(Id id, List<ResolvedLibrary> libraries) {
|
||||
public record ResolvedLibrary(String name, String version, String versionProperty, List<Id> managedDependencies,
|
||||
List<Bom> importedBoms, Links links) {
|
||||
|
||||
public Id module(String name) {
|
||||
List<Id> matching = allDependencies().filter((candidate) -> candidate.artifactId().equals(name)).toList();
|
||||
Assert.state(!matching.isEmpty(), () -> "No module found with name '%s'".formatted(name));
|
||||
Assert.state(matching.size() == 1, () -> "Multiple artifacts found with name '%s'".formatted(name));
|
||||
return matching.get(0);
|
||||
public String moduleVersion(LinkedModule linkedModule) {
|
||||
Set<String> matching = allDependencies()
|
||||
.filter((candidate) -> linkedModule.moduleNames().contains(candidate.artifactId()))
|
||||
.map((candidate) -> candidate.version())
|
||||
.collect(Collectors.toCollection(TreeSet::new));
|
||||
Assert.state(!matching.isEmpty(), () -> "No module found with name '%s'".formatted(this.name));
|
||||
Assert.state(matching.size() == 1,
|
||||
() -> "Multiple artifacts versions found with name '%s'".formatted(this.name));
|
||||
return matching.iterator().next();
|
||||
}
|
||||
|
||||
public Stream<Id> allDependencies() {
|
||||
|
||||
-51
@@ -40,43 +40,6 @@ url-protobuf-docs-gradle-plugin=https://github.com/google/protobuf-gradle-plugin
|
||||
url-pulsar-client-api-javadoc=https://javadoc.io/doc/org.apache.pulsar/pulsar-client-api/{version-pulsar-client-api}
|
||||
url-spring-boot-for-apache-geode-docs=https://docs.spring.io/spring-boot-data-geode-build/2.0.x/reference/html5
|
||||
url-spring-boot-for-apache-geode-site=https://github.com/spring-projects/spring-boot-data-geode
|
||||
url-spring-data-cassandra-docs=https://docs.spring.io/spring-data/cassandra/reference/{antoraversion-spring-data-cassandra}
|
||||
url-spring-data-cassandra-site=https://spring.io/projects/spring-data-cassandra
|
||||
url-spring-data-cassandra-javadoc=https://docs.spring.io/spring-data/cassandra/docs/{dotxversion-spring-data-cassandra}/api
|
||||
url-spring-data-commons-javadoc=https://docs.spring.io/spring-data/commons/docs/{dotxversion-spring-data-commons}/api
|
||||
url-spring-data-couchbase-docs=https://docs.spring.io/spring-data/couchbase/reference/{antoraversion-spring-data-couchbase}
|
||||
url-spring-data-couchbase-site=https://spring.io/projects/spring-data-couchbase
|
||||
url-spring-data-couchbase-javadoc=https://docs.spring.io/spring-data/couchbase/docs/{dotxversion-spring-data-couchbase}/api
|
||||
url-spring-data-elasticsearch-docs=https://docs.spring.io/spring-data/elasticsearch/reference/{antoraversion-spring-data-elasticsearch}
|
||||
url-spring-data-elasticsearch-site=https://spring.io/projects/spring-data-elasticsearch
|
||||
url-spring-data-elasticsearch-javadoc=https://docs.spring.io/spring-data/elasticsearch/docs/{dotxversion-spring-data-elasticsearch}/api
|
||||
url-spring-data-envers-site=https://spring.io/projects/spring-data-envers
|
||||
url-spring-data-geode-site=https://spring.io/projects/spring-data-geode
|
||||
url-spring-data-jdbc-docs=https://docs.spring.io/spring-data/relational/reference/{antoraversion-spring-data-jdbc}
|
||||
url-spring-data-jdbc-site=https://spring.io/projects/spring-data-jdbc
|
||||
url-spring-data-jdbc-javadoc=https://docs.spring.io/spring-data/jdbc/docs/{dotxversion-spring-data-jdbc}/api
|
||||
url-spring-data-jpa-docs=https://docs.spring.io/spring-data/jpa/reference/{antoraversion-spring-data-jpa}
|
||||
url-spring-data-jpa-site=https://spring.io/projects/spring-data-jpa
|
||||
url-spring-data-jpa-javadoc=https://docs.spring.io/spring-data/jpa/docs/{dotxversion-spring-data-jpa}/api
|
||||
url-spring-data-ldap-docs=https://docs.spring.io/spring-data/ldap/reference/{antoraversion-spring-data-ldap}
|
||||
url-spring-data-ldap-site=https://spring.io/projects/spring-data-ldap
|
||||
url-spring-data-ldap-javadoc=https://docs.spring.io/spring-data/ldap/docs/{dotxversion-spring-data-ldap}/api
|
||||
url-spring-data-mongodb-docs=https://docs.spring.io/spring-data/mongodb/reference/{antoraversion-spring-data-mongodb}
|
||||
url-spring-data-mongodb-site=https://spring.io/projects/spring-data-mongodb
|
||||
url-spring-data-mongodb-javadoc=https://docs.spring.io/spring-data/mongodb/docs/{dotxversion-spring-data-mongodb}/api
|
||||
url-spring-data-neo4j-docs=https://docs.spring.io/spring-data/neo4j/reference/{antoraversion-spring-data-neo4j}
|
||||
url-spring-data-neo4j-site=https://spring.io/projects/spring-data-neo4j
|
||||
url-spring-data-neo4j-javadoc=https://docs.spring.io/spring-data/neo4j/docs/{dotxversion-spring-data-neo4j}/api
|
||||
url-spring-data-r2dbc-docs=https://docs.spring.io/spring-data/relational/reference/{antoraversion-spring-data-r2dbc}
|
||||
url-spring-data-r2dbc-site=https://spring.io/projects/spring-data-r2dbc
|
||||
url-spring-data-r2dbc-javadoc=https://docs.spring.io/spring-data/r2dbc/docs/{dotxversion-spring-data-r2dbc}/api
|
||||
url-spring-data-redis-docs=https://docs.spring.io/spring-data/redis/reference/{antoraversion-spring-data-redis}
|
||||
url-spring-data-redis-site=https://spring.io/projects/spring-data-redis
|
||||
url-spring-data-redis-javadoc=https://docs.spring.io/spring-data/redis/docs/{dotxversion-spring-data-redis}/api
|
||||
url-spring-data-rest-docs=https://docs.spring.io/spring-data/rest/reference/{antoraversion-spring-data-rest}
|
||||
url-spring-data-rest-site=https://spring.io/projects/spring-data-rest
|
||||
url-spring-data-rest-javadoc=https://docs.spring.io/spring-data/rest/docs/{dotxversion-spring-data-rest}/api
|
||||
url-spring-data-site=https://spring.io/projects/spring-data
|
||||
url-jackson-annotations-javadoc=https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-annotations/{version-jackson-annotations}
|
||||
url-jackson-core-javadoc=https://javadoc.io/doc/tools.jackson.core/jackson-core/{version-jackson-core}
|
||||
url-jackson-databind-javadoc=https://javadoc.io/doc/tools.jackson.core/jackson-databind/{version-jackson-databind}
|
||||
@@ -90,20 +53,6 @@ https://javadoc.io/doc/io.grpc/grpc-api/latest/io/grpc/package-summary.html
|
||||
javadoc-location-com-fasterxml-jackson-annotation={url-jackson-annotations-javadoc}
|
||||
javadoc-location-com-fasterxml-jackson-databind={url-jackson2-databind-javadoc}
|
||||
javadoc-location-org-apache-pulsar-client-api={url-pulsar-client-api-javadoc}
|
||||
javadoc-location-org-springframework-data-cassandra={url-spring-data-cassandra-javadoc}
|
||||
javadoc-location-org-springframework-data-convert={url-spring-data-commons-javadoc}
|
||||
javadoc-location-org-springframework-data-querydsl={url-spring-data-commons-javadoc}
|
||||
javadoc-location-org-springframework-data-repository={url-spring-data-commons-javadoc}
|
||||
javadoc-location-org-springframework-data-couchbase={url-spring-data-couchbase-javadoc}
|
||||
javadoc-location-org-springframework-data-elasticsearch={url-spring-data-elasticsearch-javadoc}
|
||||
javadoc-location-org-springframework-data-jdbc={url-spring-data-jdbc-javadoc}
|
||||
javadoc-location-org-springframework-data-jpa={url-spring-data-jpa-javadoc}
|
||||
javadoc-location-org-springframework-data-ldap={url-spring-data-ldap-javadoc}
|
||||
javadoc-location-org-springframework-data-mongodb={url-spring-data-mongodb-javadoc}
|
||||
javadoc-location-org-springframework-data-neo4j={url-spring-data-neo4j-javadoc}
|
||||
javadoc-location-org-springframework-data-r2dbc={url-spring-data-r2dbc-javadoc}
|
||||
javadoc-location-org-springframework-data-redis={url-spring-data-redis-javadoc}
|
||||
javadoc-location-org-springframework-data-rest={url-spring-data-rest-javadoc}
|
||||
javadoc-location-tools-jackson-core={url-jackson-core-javadoc}
|
||||
javadoc-location-tools-jackson-databind={url-jackson-databind-javadoc}
|
||||
javadoc-location-tools-jackson-dataformat-xml={url-jackson-dataformat-xml-javadoc}
|
||||
|
||||
+8
-32
@@ -35,12 +35,12 @@ import org.springframework.boot.build.bom.Library.FirstParty;
|
||||
import org.springframework.boot.build.bom.Library.Group;
|
||||
import org.springframework.boot.build.bom.Library.Link;
|
||||
import org.springframework.boot.build.bom.Library.LinkType;
|
||||
import org.springframework.boot.build.bom.Library.LinkedModule;
|
||||
import org.springframework.boot.build.bom.Library.LinkedVersion;
|
||||
import org.springframework.boot.build.bom.Library.Links;
|
||||
import org.springframework.boot.build.bom.Library.ProhibitedVersion;
|
||||
import org.springframework.boot.build.bom.Library.VersionAlignment;
|
||||
import org.springframework.boot.build.bom.ResolvedBom;
|
||||
import org.springframework.boot.build.bom.ResolvedBom.Id;
|
||||
import org.springframework.boot.build.bom.ResolvedBom.ResolvedLibrary;
|
||||
import org.springframework.boot.build.bom.bomr.version.DependencyVersion;
|
||||
import org.springframework.boot.build.properties.BuildType;
|
||||
@@ -108,28 +108,6 @@ class AntoraAsciidocAttributesTests {
|
||||
assertThat(attributes.get()).containsEntry("version-spring-framework", "1.2.3");
|
||||
}
|
||||
|
||||
@Test
|
||||
void versionReferenceFromSpringDataDependencyReleaseVersion() {
|
||||
AntoraAsciidocAttributes attributes = attributes("1.2.3", true, BuildType.OPEN_SOURCE, null,
|
||||
mockDependencyVersions("3.2.5"), null);
|
||||
assertThat(attributes.get()).containsEntry("version-spring-data-mongodb", "3.2.5");
|
||||
assertThat(attributes.get()).containsEntry("url-spring-data-mongodb-docs",
|
||||
"https://docs.spring.io/spring-data/mongodb/reference/3.2");
|
||||
assertThat(attributes.get()).containsEntry("url-spring-data-mongodb-javadoc",
|
||||
"https://docs.spring.io/spring-data/mongodb/docs/3.2.x/api");
|
||||
}
|
||||
|
||||
@Test
|
||||
void versionReferenceFromSpringDataDependencySnapshotVersion() {
|
||||
AntoraAsciidocAttributes attributes = attributes("1.2.3", true, BuildType.OPEN_SOURCE, null,
|
||||
mockDependencyVersions("3.2.0-SNAPSHOT"), null);
|
||||
assertThat(attributes.get()).containsEntry("version-spring-data-mongodb", "3.2.0-SNAPSHOT");
|
||||
assertThat(attributes.get()).containsEntry("url-spring-data-mongodb-docs",
|
||||
"https://docs.spring.io/spring-data/mongodb/reference/3.2-SNAPSHOT");
|
||||
assertThat(attributes.get()).containsEntry("url-spring-data-mongodb-javadoc",
|
||||
"https://docs.spring.io/spring-data/mongodb/docs/3.2.x/api");
|
||||
}
|
||||
|
||||
@Test
|
||||
void versionNativeBuildTools() {
|
||||
AntoraAsciidocAttributes attributes = attributes("1.2.3", true, BuildType.OPEN_SOURCE, null,
|
||||
@@ -227,8 +205,8 @@ class AntoraAsciidocAttributesTests {
|
||||
@Test
|
||||
void urlLinksFromLibraryModule() {
|
||||
Links links = new Links(Map.of(LinkType.SITE, singleLink((version) -> "https://example.com/site/" + version)));
|
||||
Map<String, Links> moduleLinks = new LinkedHashMap<>();
|
||||
moduleLinks.put("example-module", new Links(Map.of(LinkType.JAVADOC,
|
||||
Map<LinkedModule, Links> moduleLinks = new LinkedHashMap<>();
|
||||
moduleLinks.put(LinkedModule.of("example-module"), new Links(Map.of(LinkType.JAVADOC,
|
||||
singleLink((version) -> "https://example.com/moduleapi/" + version, "com.example"))));
|
||||
Library library = mockLibrary(links, moduleLinks);
|
||||
Map<String, String> dependencyVersions = mockDependencyVersions();
|
||||
@@ -251,8 +229,7 @@ class AntoraAsciidocAttributesTests {
|
||||
mockDependencyVersions(), null)
|
||||
.get();
|
||||
assertThat(attributes).containsEntry("include-java", "ROOT:example$java/org/springframework/boot/docs");
|
||||
assertThat(attributes).containsEntry("url-spring-data-cassandra-site",
|
||||
"https://spring.io/projects/spring-data-cassandra");
|
||||
assertThat(attributes).containsEntry("url-github-wiki", "https://github.com/{github-repo}/wiki");
|
||||
List<String> keys = new ArrayList<>(attributes.keySet());
|
||||
assertThat(keys.indexOf("include-java")).isLessThan(keys.indexOf("code-spring-boot-latest"));
|
||||
}
|
||||
@@ -278,10 +255,9 @@ class AntoraAsciidocAttributesTests {
|
||||
given(resolvedBom.dependencyVersions()).willReturn(dependencyVersions);
|
||||
ResolvedLibrary resolvedLibrary = mock();
|
||||
given(resolvedBom.library(any())).willReturn(resolvedLibrary);
|
||||
given(resolvedLibrary.module(any())).willAnswer((invocation) -> {
|
||||
String moduleName = invocation.getArgument(0);
|
||||
String moduleVersion = dependencyVersions.get(moduleName);
|
||||
return new Id("com.example", moduleName, moduleVersion, null);
|
||||
given(resolvedLibrary.moduleVersion(any())).willAnswer((invocation) -> {
|
||||
LinkedModule module = invocation.getArgument(0);
|
||||
return dependencyVersions.get(module.moduleNames().get(0));
|
||||
});
|
||||
return new AntoraAsciidocAttributes(project, dependencyBom, resolvedBom);
|
||||
}
|
||||
@@ -290,7 +266,7 @@ class AntoraAsciidocAttributesTests {
|
||||
return mockLibrary(new Links(links), Collections.emptyMap());
|
||||
}
|
||||
|
||||
private Library mockLibrary(Links links, Map<String, Links> moduleLinks) {
|
||||
private Library mockLibrary(Links links, Map<LinkedModule, Links> moduleLinks) {
|
||||
String name = "Spring Framework";
|
||||
String calendarName = null;
|
||||
DependencyVersion version = DependencyVersion.parse("1.2.3");
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.build.bom.Library.BomAlignment;
|
||||
import org.springframework.boot.build.bom.Library.FirstParty;
|
||||
import org.springframework.boot.build.bom.Library.Group;
|
||||
import org.springframework.boot.build.bom.Library.LinkedModule;
|
||||
import org.springframework.boot.build.bom.Library.LinkedVersion;
|
||||
import org.springframework.boot.build.bom.Library.Links;
|
||||
import org.springframework.boot.build.bom.Library.ProhibitedVersion;
|
||||
@@ -53,7 +54,7 @@ class LibraryTests {
|
||||
BomAlignment alignsWithBom = null;
|
||||
String linkRootName = null;
|
||||
Links links = null;
|
||||
Map<String, Links> moduleLinks = null;
|
||||
Map<LinkedModule, Links> moduleLinks = null;
|
||||
Library library = new Library(name, calendarName, version, groups, null, prohibitedVersion, firstParty,
|
||||
versionAlignment, alignsWithBom, linkRootName, links, moduleLinks);
|
||||
assertThat(library.getLinkRootName()).isEqualTo("spring-framework");
|
||||
@@ -71,7 +72,7 @@ class LibraryTests {
|
||||
BomAlignment alignsWithBom = null;
|
||||
String linkRootName = "spring-data";
|
||||
Links links = null;
|
||||
Map<String, Links> moduleLinks = null;
|
||||
Map<LinkedModule, Links> moduleLinks = null;
|
||||
Library library = new Library(name, calendarName, version, groups, null, prohibitedVersion, firstParty,
|
||||
versionAlignment, alignsWithBom, linkRootName, links, moduleLinks);
|
||||
assertThat(library.getLinkRootName()).isEqualTo("spring-data");
|
||||
|
||||
@@ -2602,6 +2602,123 @@ bom {
|
||||
site("https://spring.io/projects/spring-data")
|
||||
github("https://github.com/spring-projects/spring-data-bom")
|
||||
releaseNotes("https://github.com/spring-projects/spring-data-bom/releases/tag/{version}")
|
||||
module("spring-data-cassandra") {
|
||||
site("https://spring.io/projects/spring-data-cassandra")
|
||||
github("https://github.com/spring-projects/spring-data-cassandra")
|
||||
javadoc(version -> "https://docs.spring.io/spring-data-cassandra/docs/%s/api"
|
||||
.formatted(version.forMajorMinorGeneration()), "org.springframework.data.cassandra")
|
||||
docs(version -> "https://docs.spring.io/spring-data-cassandra/reference/%s"
|
||||
.formatted(version.forAntora()))
|
||||
releaseNotes("https://github.com/spring-projects/spring-data-cassandra/releases/tag/{version}")
|
||||
}
|
||||
module("spring-data-commons") {
|
||||
site("https://spring.io/projects/spring-data-commons")
|
||||
github("https://github.com/spring-projects/spring-data-commons")
|
||||
javadoc(version -> "https://docs.spring.io/spring-data-commons/docs/%s/api"
|
||||
.formatted(version.forMajorMinorGeneration()), "org.springframework.data.[convert|querydsl|repository]")
|
||||
docs(version -> "https://docs.spring.io/spring-data-commons/reference/%s"
|
||||
.formatted(version.forAntora()))
|
||||
releaseNotes("https://github.com/spring-projects/spring-data-commons/releases/tag/{version}")
|
||||
}
|
||||
module("spring-data-couchbase") {
|
||||
site("https://spring.io/projects/spring-data-couchbase")
|
||||
github("https://github.com/spring-projects/spring-data-couchbase")
|
||||
javadoc(version -> "https://docs.spring.io/spring-data-couchbase/docs/%s/api"
|
||||
.formatted(version.forMajorMinorGeneration()), "org.springframework.data.couchbase")
|
||||
docs(version -> "https://docs.spring.io/spring-data-couchbase/reference/%s"
|
||||
.formatted(version.forAntora()))
|
||||
releaseNotes("https://github.com/spring-projects/spring-data-couchbase/releases/tag/{version}")
|
||||
}
|
||||
module("spring-data-elasticsearch") {
|
||||
site("https://spring.io/projects/spring-data-elasticsearch")
|
||||
github("https://github.com/spring-projects/spring-data-elasticsearch")
|
||||
javadoc(version -> "https://docs.spring.io/spring-data-elasticsearch/docs/%s/api"
|
||||
.formatted(version.forMajorMinorGeneration()), "org.springframework.data.elasticsearch")
|
||||
docs(version -> "https://docs.spring.io/spring-data-elasticsearch/reference/%s"
|
||||
.formatted(version.forAntora()))
|
||||
releaseNotes("https://github.com/spring-projects/spring-data-elasticsearch/releases/tag/{version}")
|
||||
}
|
||||
module("spring-data-envers") {
|
||||
site("https://spring.io/projects/spring-data-envers")
|
||||
github("https://github.com/spring-projects/spring-data-envers")
|
||||
javadoc(version -> "https://docs.spring.io/spring-data-envers/docs/%s/api"
|
||||
.formatted(version.forMajorMinorGeneration()), "org.springframework.data.envers")
|
||||
docs(version -> "https://docs.spring.io/spring-data-envers/reference/%s"
|
||||
.formatted(version.forAntora()))
|
||||
releaseNotes("https://github.com/spring-projects/spring-data-envers/releases/tag/{version}")
|
||||
}
|
||||
module("spring-data-jdbc") {
|
||||
site("https://spring.io/projects/spring-data-jdbc")
|
||||
github("https://github.com/spring-projects/spring-data-jdbc")
|
||||
javadoc(version -> "https://docs.spring.io/spring-data-jdbc/docs/%s/api"
|
||||
.formatted(version.forMajorMinorGeneration()), "org.springframework.data.jdbc")
|
||||
docs(version -> "https://docs.spring.io/spring-data-jdbc/reference/%s"
|
||||
.formatted(version.forAntora()))
|
||||
releaseNotes("https://github.com/spring-projects/spring-data-jdbc/releases/tag/{version}")
|
||||
}
|
||||
module("spring-data-jpa") {
|
||||
site("https://spring.io/projects/spring-data-jpa")
|
||||
github("https://github.com/spring-projects/spring-data-jpa")
|
||||
javadoc(version -> "https://docs.spring.io/spring-data-jpa/docs/%s/api"
|
||||
.formatted(version.forMajorMinorGeneration()), "org.springframework.data.jpa")
|
||||
docs(version -> "https://docs.spring.io/spring-data-jpa/reference/%s"
|
||||
.formatted(version.forAntora()))
|
||||
releaseNotes("https://github.com/spring-projects/spring-data-jpa/releases/tag/{version}")
|
||||
}
|
||||
module("spring-data-ldap") {
|
||||
site("https://spring.io/projects/spring-data-ldap")
|
||||
github("https://github.com/spring-projects/spring-data-ldap")
|
||||
javadoc(version -> "https://docs.spring.io/spring-data-ldap/docs/%s/api"
|
||||
.formatted(version.forMajorMinorGeneration()), "org.springframework.data.ldap")
|
||||
docs(version -> "https://docs.spring.io/spring-data-ldap/reference/%s"
|
||||
.formatted(version.forAntora()))
|
||||
releaseNotes("https://github.com/spring-projects/spring-data-ldap/releases/tag/{version}")
|
||||
}
|
||||
module("spring-data-mongodb") {
|
||||
site("https://spring.io/projects/spring-data-mongodb")
|
||||
github("https://github.com/spring-projects/spring-data-mongodb")
|
||||
javadoc(version -> "https://docs.spring.io/spring-data-mongodb/docs/%s/api"
|
||||
.formatted(version.forMajorMinorGeneration()), "org.springframework.data.mongodb")
|
||||
docs(version -> "https://docs.spring.io/spring-data-mongodb/reference/%s"
|
||||
.formatted(version.forAntora()))
|
||||
releaseNotes("https://github.com/spring-projects/spring-data-mongodb/releases/tag/{version}")
|
||||
}
|
||||
module("spring-data-neo4j") {
|
||||
site("https://spring.io/projects/spring-data-neo4j")
|
||||
github("https://github.com/spring-projects/spring-data-neo4j")
|
||||
javadoc(version -> "https://docs.spring.io/spring-data-neo4j/docs/%s/api"
|
||||
.formatted(version.forMajorMinorGeneration()), "org.springframework.data.neo4j")
|
||||
docs(version -> "https://docs.spring.io/spring-data-neo4j/reference/%s"
|
||||
.formatted(version.forAntora()))
|
||||
releaseNotes("https://github.com/spring-projects/spring-data-neo4j/releases/tag/{version}")
|
||||
}
|
||||
module("spring-data-r2dbc") {
|
||||
site("https://spring.io/projects/spring-data-r2dbc")
|
||||
github("https://github.com/spring-projects/spring-data-r2dbc")
|
||||
javadoc(version -> "https://docs.spring.io/spring-data-r2dbc/docs/%s/api"
|
||||
.formatted(version.forMajorMinorGeneration()), "org.springframework.data.r2dbc")
|
||||
docs(version -> "https://docs.spring.io/spring-data-r2dbc/reference/%s"
|
||||
.formatted(version.forAntora()))
|
||||
releaseNotes("https://github.com/spring-projects/spring-data-r2dbc/releases/tag/{version}")
|
||||
}
|
||||
module("spring-data-redis") {
|
||||
site("https://spring.io/projects/spring-data-redis")
|
||||
github("https://github.com/spring-projects/spring-data-redis")
|
||||
javadoc(version -> "https://docs.spring.io/spring-data-redis/docs/%s/api"
|
||||
.formatted(version.forMajorMinorGeneration()), "org.springframework.data.redis")
|
||||
docs(version -> "https://docs.spring.io/spring-data-redis/reference/%s"
|
||||
.formatted(version.forAntora()))
|
||||
releaseNotes("https://github.com/spring-projects/spring-data-redis/releases/tag/{version}")
|
||||
}
|
||||
module("spring-data-rest", ["spring-data-rest-core", "spring-data-rest-webmvc"]) {
|
||||
site("https://spring.io/projects/spring-data-rest")
|
||||
github("https://github.com/spring-projects/spring-data-rest")
|
||||
javadoc(version -> "https://docs.spring.io/spring-data-rest/docs/%s/api"
|
||||
.formatted(version.forMajorMinorGeneration()), "org.springframework.data.rest")
|
||||
docs(version -> "https://docs.spring.io/spring-data-rest/reference/%s"
|
||||
.formatted(version.forAntora()))
|
||||
releaseNotes("https://github.com/spring-projects/spring-data-rest/releases/tag/{version}")
|
||||
}
|
||||
}
|
||||
}
|
||||
library("Spring Framework", "${springFrameworkVersion}") {
|
||||
|
||||
Reference in New Issue
Block a user