diff --git a/.bomr/bomr.yaml b/.bomr/bomr.yaml deleted file mode 100644 index a9ac945f30f9..000000000000 --- a/.bomr/bomr.yaml +++ /dev/null @@ -1,28 +0,0 @@ -bomr: - bom: spring-boot-project/spring-boot-dependencies/pom.xml - upgrade: - github: - organization: spring-projects - repository: spring-boot - issue-labels: - - 'type: dependency-upgrade' - policy: same-major-version - prohibited: - - project: derby - versions: - # 10.15 requires Java 9 - - '[10.15,)' - verify: - ignored-dependencies: - # Avoid conflicting transitive requirements for - # io.grpc:grpc-core:jar:[1.0.1,1.0.1] (Jetty), - # io.grpc:grpc-core:jar:[1.14.0,1.14.0] (Micrometer's Azure Registry), and - # io.grpc:grpc-core:jar:[1.15.0,1.15.0] (Micrometer's Stackdriver Registry) - - 'io.micrometer:micrometer-registry-azure-monitor' - - 'org.eclipse.jetty.gcloud:jetty-gcloud-session-manager' - - 'org.eclipse.jetty:jetty-home' - repositories: - # Caffeine Simulator's dependencies - - 'https://maven.imagej.net/content/repositories/public/' - # Spring Data GemFire's GemFire dependencies - - 'https://repo.spring.io/gemstone-release-pivotal-cache' diff --git a/.gitignore b/.gitignore index 4dbf2657a90a..d37eb49a80be 100644 --- a/.gitignore +++ b/.gitignore @@ -22,12 +22,16 @@ MANIFEST.MF _site/ activemq-data bin +build +!/**/src/**/bin +!/**/src/**/build build.log dependency-reduced-pom.xml dump.rdb interpolated*.xml lib/ manifest.yml +out overridedb.* target transaction-logs diff --git a/.mvn/jvm.config b/.mvn/jvm.config deleted file mode 100644 index f432c9602236..000000000000 --- a/.mvn/jvm.config +++ /dev/null @@ -1 +0,0 @@ --Xmx1536m \ No newline at end of file diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar deleted file mode 100755 index e89f07c229cb..000000000000 Binary files a/.mvn/wrapper/maven-wrapper.jar and /dev/null differ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties deleted file mode 100755 index a84b7ef2d6ab..000000000000 --- a/.mvn/wrapper/maven-wrapper.properties +++ /dev/null @@ -1,2 +0,0 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip -wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.3/maven-wrapper-0.5.3.jar diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index 6c3c7c551b1d..04a4ef94b701 100755 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -49,11 +49,13 @@ added after the original pull request but before a merge. * We use the https://github.com/spring-io/spring-javaformat/[Spring JavaFormat] project to apply code formatting conventions. If you use Eclipse and you follow the '`Importing into eclipse`' instructions below you should get project specific formatting - automatically. You can also install the https://github.com/spring-io/spring-javaformat/#intellij-idea[Spring JavaFormat IntelliJ Plugin] - or format the code from the Maven build by running - `./mvnw io.spring.javaformat:spring-javaformat-maven-plugin:apply`. + automatically. You can also install the + https://github.com/spring-io/spring-javaformat/#intellij-idea[Spring JavaFormat IntelliJ + Plugin] or format the code from the Gradle build by running + `./gradlew format`. * The build includes checkstyle rules for many of our code conventions. Run - `./mvnw validate` if you want to check you changes are compliant. + `./gradlew checkstyleMain checkstyleTest` if you want to check you changes are + compliant. * 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. @@ -75,65 +77,24 @@ added after the original pull request but before a merge. If you don't have an IDE preference we would recommend that you use https://spring.io/tools/sts[Spring Tools Suite] or https://eclipse.org[Eclipse] when working with the code. We use the -https://eclipse.org/m2e/[M2Eclipse] eclipse plugin for maven support. Other IDEs and tools -should also work without issue. +https://projects.eclipse.org/projects/tools.buildship[Buildship] Eclipse plugin for Gradle +support. Other IDEs and tools should also work without issue. === Building from Source -Spring Boot source can be built from the command line using -https://maven.apache.org/run-maven/index.html[Apache Maven] on JDK 1.8 or above. We -include '`Maven Wrapper`' scripts (`./mvnw` or `mvnw.bat`) that you can run rather than -needing to install Maven locally. +Spring Boot source can be built from the command line using https://gradle.org[Gradle] on +JDK 1.8 or above. We include https://docs.gradle.org/current/userguide/gradle_wrapper.html[Gradle's +wrapper scripts] (`./gradlew` or `gradlew.bat`) that you can run rather than needing to +install Gradle locally. - - -==== Default Build -The project can be built from the root directory using the standard Maven command: - -[indent=0] ----- - $ ./mvnw clean install ----- - -NOTE: You may need to increase the amount of memory available to Maven by setting -a `MAVEN_OPTS` environment variable with the value `-Xmx512m` - -If you are rebuilding often, you might also want to skip the tests and the execution of -checkstyle until you are ready to submit a pull request: - -[indent=0] ----- - $ ./mvnw clean install -DskipTests -Pfast ----- - - - -==== Full Build -You can run a full build using the following command: +The project can be built from the root directory using the standard Gradle command: [indent=0] ---- - $ ./mvnw -Pfull clean install + $ ./gradlew build ---- -NOTE: As for the standard build, you may need to increase the amount of memory available -to Maven by setting a `MAVEN_OPTS` environment variable with the value `-Xmx512m`. We -generate more artifacts when running the full build (such as Javadoc jars), so you may -find the process a little slower than the standard build. - -[TIP] -==== -If you want to run a build without the smoke tests and integration tests, building the -`spring-boot-project` module is enough. You can cd there and run the same command, or you -can run this from the top-level directory: - -[indent=0] ----- - $ ./mvnw -f spring-boot-project -Pfull clean install ----- -==== - === Importing into Eclipse @@ -141,9 +102,6 @@ You can import the Spring Boot code into any Eclipse 2019-09-based distribution. easiest way to setup a new environment is to use the Eclipse Installer with the provided `spring-boot-project.setup` file (in the `/eclipse` folder). -NOTE: Due to m2e issue https://bugs.eclipse.org/bugs/show_bug.cgi?id=548652[#548652] you need to be running m2e 1.14.0 or higher. -An early milestone is available from https://download.eclipse.org/technology/m2e/milestones/1.14/. - ==== Using the Eclipse Installer @@ -169,9 +127,6 @@ Once complete you should find that a local workspace has been provisioned comple all required Eclipse plugins. Projects will be grouped into working-sets to make the code easier to navigate. -If you want to work on the `spring-boot-gradle-plugin` you should remove the imported Maven -project and reimport it as a Gradle project. - TIP: If you see import errors with `com.sun` packages make sure you have setup a valid `JavaSE-1.8` environment. From preferences select "`Java`", "`Installed JREs`", "`Execution Environments`" and make sure "`JavaSE-1.8`" points to a Java 1.8 @@ -179,13 +134,13 @@ install (we use AdoptOpenJDK on our CI). -==== Manual Installation with M2Eclipse +==== Manual Installation with Buildship If you prefer to install Eclipse yourself you should use the -https://eclipse.org/m2e/[M2Eclipse] eclipse plugin. If you don't already have m2eclipse -installed it is available from the "`Eclipse marketplace`". +https://projects.eclipse.org/projects/tools.buildship[Buildship] Eclipse plugin. If you +don't already have Buildship installed it is available from the "`Eclipse marketplace`". Spring Boot includes project specific source formatting settings, in order to have these -work with m2eclipse, we provide an additional Eclipse plugin that you can install: +work with Buildship, we provide an additional Eclipse plugin that you can install: @@ -197,21 +152,13 @@ work with m2eclipse, we provide an additional Eclipse plugin that you can instal NOTE: The plugin is optional. Projects can be imported without the plugins, your code changes just won't be automatically formatted. -With the requisite eclipse plugins installed you can select -`import existing maven projects` from the `file` menu to import the code. You will -need to import the root `spring-boot` pom and the `spring-boot-smoke-tests` pom separately. +With the requisite Eclipse plugins installed you can select +`Gradle -> Existing Gradle project` from the `File -> Import…` menu to import the code. === Importing into IntelliJ IDEA -**Please, do this first!** -Go to `Preferences | Build, Execution, Deployment | Build Tools | Maven | Importing` -and set `VM options for importer` to `-Xmx2g` to allocate sufficient memory for IDEA's -Maven import process to parse the Spring Boot project structure. _Not doing so could -mean the import fails silently, leaving the project setup incomplete._ - -For the actual import use "`File`" -> "`Open`" and select the root `pom.xml`, or the -`spring-boot-project/pom.xml` if you only want the Spring Boot project sources. +Use "`File`" -> "`Open`" and then select the root `build.gradle` file to import the code. @@ -239,16 +186,8 @@ needs to be added. === Importing into Other IDEs -Maven is well supported by most Java IDEs. Refer to your vendor documentation. - - +Gradle is well supported by most Java IDEs. Refer to your vendor documentation. -== Integration Tests -The smoke tests run as part of the build when you `./mvnw install`. -Due to the fact that they make use of the `spring-boot-maven-plugin` -they cannot be called directly, and so instead are launched via the -`maven-invoker-plugin`. If you encounter build failures running the integration tests, -check the `build.log` file in the appropriate smoke test directory. == Cloning the git repository on Windows diff --git a/build.gradle b/build.gradle new file mode 100644 index 000000000000..bc35a69d006c --- /dev/null +++ b/build.gradle @@ -0,0 +1,20 @@ +plugins { + id 'org.jetbrains.kotlin.jvm' apply false // https://youtrack.jetbrains.com/issue/KT-30276 +} + +description = 'Spring Boot Build' + +allprojects { + group 'org.springframework.boot' + + repositories { + mavenCentral() + maven { url 'https://repo.spring.io/milestone' } + maven { url 'https://repo.spring.io/snapshot' } + } + + configurations.all { + resolutionStrategy.cacheChangingModulesFor 60, 'minutes' + } + +} diff --git a/buildSrc/README.adoc b/buildSrc/README.adoc new file mode 100644 index 000000000000..44c7bc7f4325 --- /dev/null +++ b/buildSrc/README.adoc @@ -0,0 +1,26 @@ += BOM Plugin + +Allows one to publish a BOM from Gradle. +Properties, dependencies, and other BOMs are applied to the `bom {}` extension. + +This plugin applies the `java-platform` and `maven-publish` plugins to the Project it's applied to. + +== Usage + +[source,groovy,indent=0] +---- +plugins { + id 'org.springframework.boot.bom' +} + +bom { + property 'logback.version', '1.2.3' + property 'junit-jupiter.version', '5.3.2' + + dependency 'ch.qos.logback', 'logback-classic', '${logback.version}' + dependency 'ch.qos.logback', 'logback-core', '${logback.version}' + + bomImport 'org.junit', 'junit-bom', '${junit-jupiter.version}' +} +---- + diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle new file mode 100644 index 000000000000..b0587d4d33e7 --- /dev/null +++ b/buildSrc/build.gradle @@ -0,0 +1,84 @@ +plugins { + id 'java-gradle-plugin' + id 'io.spring.javaformat' version '0.0.18-SNAPSHOT' + id 'checkstyle' +} + +repositories { + mavenCentral() + gradlePluginPortal() + maven { url 'https://repo.spring.io/release' } +} + +sourceCompatibility = 1.8 +targetCompatibility = 1.8 + +dependencies { + checkstyle 'io.spring.javaformat:spring-javaformat-checkstyle:0.0.15' + implementation 'com.fasterxml.jackson.core:jackson-databind:2.10.0' + implementation 'commons-codec:commons-codec:1.13' + implementation 'org.apache.maven:maven-embedder:3.6.2' + implementation 'org.asciidoctor:asciidoctor-gradle-jvm:2.4.0' + implementation 'org.springframework:spring-core:5.2.2.RELEASE' + implementation 'org.springframework:spring-web:5.2.2.RELEASE' + implementation 'com.google.code.gson:gson:2.8.5' + implementation 'io.spring.javaformat:spring-javaformat-gradle-plugin:0.0.15' + testImplementation 'org.assertj:assertj-core:3.11.1' + testImplementation 'org.apache.logging.log4j:log4j-core:2.12.1' + testImplementation 'org.junit.jupiter:junit-jupiter:5.5.2' +} + +checkstyle { + def archive = configurations.checkstyle.filter { it.name.startsWith('spring-javaformat-checkstyle')} + config = resources.text.fromArchiveEntry(archive, 'io/spring/javaformat/checkstyle/checkstyle.xml') + toolVersion = 8.11 +} + +gradlePlugin { + plugins { + autoConfigurationPlugin { + id = "org.springframework.boot.auto-configuration" + implementationClass = "org.springframework.boot.build.autoconfigure.AutoConfigurationPlugin" + } + bomPlugin { + id = "org.springframework.boot.bom" + implementationClass = "org.springframework.boot.build.bom.BomPlugin" + } + configurationPropertiesPlugin { + id = "org.springframework.boot.configuration-properties" + implementationClass = "org.springframework.boot.build.context.properties.ConfigurationPropertiesPlugin" + } + conventionsPlugin { + id = "org.springframework.boot.conventions" + implementationClass = "org.springframework.boot.build.ConventionsPlugin" + } + deployedPlugin { + id = "org.springframework.boot.deployed" + implementationClass = "org.springframework.boot.build.DeployedPlugin" + } + integrationTestPlugin { + id = "org.springframework.boot.integration-test" + implementationClass = "org.springframework.boot.build.test.IntegrationTestPlugin" + } + mavenPluginPlugin { + id = "org.springframework.boot.maven-plugin" + implementationClass = "org.springframework.boot.build.mavenplugin.MavenPluginPlugin" + } + mavenRepositoryPlugin { + id = "org.springframework.boot.maven-repository" + implementationClass = "org.springframework.boot.build.MavenRepositoryPlugin" + } + optionalDependenciesPlugin { + id = "org.springframework.boot.optional-dependencies" + implementationClass = "org.springframework.boot.build.optional.OptionalDependenciesPlugin" + } + starterPlugin { + id = "org.springframework.boot.starter" + implementationClass = "org.springframework.boot.build.starters.StarterPlugin" + } + } +} + +test { + useJUnitPlatform() +} diff --git a/buildSrc/settings.gradle b/buildSrc/settings.gradle new file mode 100644 index 000000000000..ce6d3a43daec --- /dev/null +++ b/buildSrc/settings.gradle @@ -0,0 +1,16 @@ +pluginManagement { + repositories { + mavenCentral() + gradlePluginPortal() + maven { url 'https://repo.spring.io/snapshot' } + } + resolutionStrategy { + eachPlugin { + if (requested.id.id == 'io.spring.javaformat') { + useModule "io.spring.javaformat:spring-javaformat-gradle-plugin:${requested.version}" + } + } + } +} + +apply from: new File(settingsDir, '../gradle/build-cache-settings.gradle') diff --git a/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java b/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java new file mode 100644 index 000000000000..132940f68553 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java @@ -0,0 +1,213 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build; + +import java.io.File; +import java.net.URI; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +import org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask; +import org.asciidoctor.gradle.jvm.AsciidoctorJExtension; +import org.asciidoctor.gradle.jvm.AsciidoctorJPlugin; +import org.asciidoctor.gradle.jvm.AsciidoctorTask; +import org.gradle.api.Action; +import org.gradle.api.DefaultTask; +import org.gradle.api.Project; +import org.gradle.api.Task; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.file.FileCollection; +import org.gradle.api.tasks.InputFiles; +import org.gradle.api.tasks.OutputDirectory; +import org.gradle.api.tasks.Sync; +import org.gradle.api.tasks.TaskAction; + +import org.springframework.util.StringUtils; + +/** + * Conventions that are applied in the presence of the {@link AsciidoctorJPlugin}. When + * the plugin is applied: + * + * + * + * @author Andy Wilkinson + */ +class AsciidoctorConventions { + + void apply(Project project) { + project.getPlugins().withType(AsciidoctorJPlugin.class, (asciidoctorPlugin) -> { + configureDocResourcesRepository(project); + makeAllWarningsFatal(project); + UnzipDocumentationResources unzipResources = createUnzipDocumentationResourcesTask(project); + project.getTasks().withType(AbstractAsciidoctorTask.class, (asciidoctorTask) -> { + configureCommonAttributes(project, asciidoctorTask); + configureOptions(asciidoctorTask); + asciidoctorTask.baseDirFollowsSourceDir(); + Sync syncSource = createSyncDocumentationSourceTask(project, asciidoctorTask); + if (asciidoctorTask instanceof AsciidoctorTask) { + configureHtmlOnlyAttributes(project, asciidoctorTask); + syncSource.from(unzipResources, (resources) -> resources.into("asciidoc")); + asciidoctorTask.doFirst(new Action() { + + @Override + public void execute(Task task) { + project.copy((spec) -> { + spec.from(asciidoctorTask.getSourceDir()); + spec.into(asciidoctorTask.getOutputDir()); + spec.include("css/**", "js/**"); + }); + } + + }); + } + }); + }); + } + + private void configureDocResourcesRepository(Project project) { + project.getRepositories().maven((mavenRepo) -> { + mavenRepo.setUrl(URI.create("https://repo.spring.io/release")); + mavenRepo.mavenContent((mavenContent) -> mavenContent.includeGroup("io.spring.docresources")); + }); + } + + private void makeAllWarningsFatal(Project project) { + project.getExtensions().getByType(AsciidoctorJExtension.class).fatalWarnings(".*"); + } + + private UnzipDocumentationResources createUnzipDocumentationResourcesTask(Project project) { + Configuration documentationResources = project.getConfigurations().maybeCreate("documentationResources"); + documentationResources.getDependencies() + .add(project.getDependencies().create("io.spring.docresources:spring-doc-resources:0.1.3.RELEASE")); + UnzipDocumentationResources unzipResources = project.getTasks().create("unzipDocumentationResources", + UnzipDocumentationResources.class); + unzipResources.setResources(documentationResources); + unzipResources.setOutputDir(new File(project.getBuildDir(), "docs/resources")); + return unzipResources; + } + + private Sync createSyncDocumentationSourceTask(Project project, AbstractAsciidoctorTask asciidoctorTask) { + Sync syncDocumentationSource = project.getTasks() + .create("syncDocumentationSourceFor" + StringUtils.capitalize(asciidoctorTask.getName()), Sync.class); + File syncedSource = new File(project.getBuildDir(), "docs/src/" + asciidoctorTask.getName()); + syncDocumentationSource.setDestinationDir(syncedSource); + syncDocumentationSource.from("src/docs/"); + asciidoctorTask.dependsOn(syncDocumentationSource); + asciidoctorTask.setSourceDir(project.relativePath(new File(syncedSource, "asciidoc/"))); + return syncDocumentationSource; + } + + private void configureOptions(AbstractAsciidoctorTask asciidoctorTask) { + asciidoctorTask.options(Collections.singletonMap("doctype", "book")); + } + + private void configureHtmlOnlyAttributes(Project project, AbstractAsciidoctorTask asciidoctorTask) { + Map attributes = new HashMap<>(); + attributes.put("highlightjsdir", "js/highlight"); + attributes.put("highlightjs-theme", "github"); + attributes.put("linkcss", true); + attributes.put("icons", "font"); + attributes.put("stylesheet", "css/spring.css"); + asciidoctorTask.attributes(attributes); + } + + private void configureCommonAttributes(Project project, AbstractAsciidoctorTask asciidoctorTask) { + Map attributes = new HashMap<>(); + attributes.put("attribute-missing", "warn"); + attributes.put("github-tag", determineGitHubTag(project)); + attributes.put("spring-boot-artifactory-repo", determineArtifactoryRepo(project)); + attributes.put("version", "{gradle-project-version}"); + asciidoctorTask.attributes(attributes); + } + + private String determineArtifactoryRepo(Project project) { + String version = project.getVersion().toString(); + String type = version.substring(version.lastIndexOf('.')); + if (type.equals("RELEASE")) { + return "release"; + } + if (type.startsWith("M") || type.startsWith("RC")) { + return "milestone"; + } + return "snapshot"; + } + + private String determineGitHubTag(Project project) { + String version = "v" + project.getVersion(); + return (version.endsWith("-SNAPSHOT")) ? "master" : version; + } + + /** + * {@link Task} for unzipping the documentation resources. + */ + public static class UnzipDocumentationResources extends DefaultTask { + + private FileCollection resources; + + private File outputDir; + + @InputFiles + public FileCollection getResources() { + return this.resources; + } + + public void setResources(FileCollection resources) { + this.resources = resources; + } + + @OutputDirectory + public File getOutputDir() { + return this.outputDir; + } + + public void setOutputDir(File outputDir) { + this.outputDir = outputDir; + } + + @TaskAction + void syncDocumentationResources() { + getProject().sync((copySpec) -> { + copySpec.into(this.outputDir); + for (File resource : this.resources) { + copySpec.from(getProject().zipTree(resource)); + } + }); + } + + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/ConventionsPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/ConventionsPlugin.java new file mode 100644 index 000000000000..30aa02b72679 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/ConventionsPlugin.java @@ -0,0 +1,207 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build; + +import java.util.Map; +import java.util.TreeMap; + +import io.spring.javaformat.gradle.SpringJavaFormatPlugin; +import org.apache.maven.artifact.repository.MavenArtifactRepository; +import org.asciidoctor.gradle.jvm.AsciidoctorJPlugin; +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.artifacts.DependencySet; +import org.gradle.api.plugins.JavaPlugin; +import org.gradle.api.plugins.JavaPluginExtension; +import org.gradle.api.plugins.quality.CheckstyleExtension; +import org.gradle.api.plugins.quality.CheckstylePlugin; +import org.gradle.api.publish.PublishingExtension; +import org.gradle.api.publish.maven.MavenPom; +import org.gradle.api.publish.maven.MavenPomDeveloperSpec; +import org.gradle.api.publish.maven.MavenPomIssueManagement; +import org.gradle.api.publish.maven.MavenPomLicenseSpec; +import org.gradle.api.publish.maven.MavenPomOrganization; +import org.gradle.api.publish.maven.MavenPomScm; +import org.gradle.api.publish.maven.MavenPublication; +import org.gradle.api.publish.maven.plugins.MavenPublishPlugin; +import org.gradle.api.tasks.bundling.Jar; +import org.gradle.api.tasks.compile.JavaCompile; +import org.gradle.api.tasks.javadoc.Javadoc; +import org.gradle.api.tasks.testing.Test; + +/** + * Plugin to apply conventions to projects that are part of Spring Boot's build. + * Conventions are applied in response to various plugins being applied. + * + *

+ * + * When the {@link JavaPlugin Java plugin} is applied: + * + *

    + *
  • {@code sourceCompatibility} is set to {@code 1.8} + *
  • Spring Java Format and Checkstyle plugins are applied + *
  • {@link Test} tasks are configured to use JUnit Platform and use a max heap of 1024M + *
  • {@link JavaCompile} tasks are configured to use UTF-8 encoding + *
  • {@link Javadoc} tasks are configured to use UTF-8 encoding + *
  • {@link Jar} tasks are configured to have the following manifest entries: + *
      + *
    • {@code Automatic-Module-Name} + *
    • {@code Build-Jdk-Spec} + *
    • {@code Built-By} + *
    • {@code Implementation-Title} + *
    • {@code Implementation-Version} + *
    + *
+ * + *

+ * + * When the {@link MavenPublishPlugin Maven Publish plugin} is applied: + * + *

    + *
  • If the {@code deploymentRepository} property has been set, a + * {@link MavenArtifactRepository Maven artifact repository} is configured to publish to + * it. + *
  • The poms of all {@link MavenPublication Maven publications} are customized to meet + * Maven Central's requirements. + *
  • If the {@link JavaPlugin Java plugin} has also been applied, creation of Javadoc + * and source jars is enabled. + *
+ * + *

+ * + * When the {@link AsciidoctorJPlugin} is applied, the conventions in + * {@link AsciidoctorConventions} are applied. + * + * @author Andy Wilkinson + */ +public class ConventionsPlugin implements Plugin { + + @Override + public void apply(Project project) { + applyJavaConventions(project); + applyAsciidoctorConventions(project); + applyMavenPublishingConventions(project); + } + + private void applyJavaConventions(Project project) { + project.getPlugins().withType(JavaPlugin.class, (java) -> { + configureSpringJavaFormat(project); + project.setProperty("sourceCompatibility", "1.8"); + project.getTasks().withType(JavaCompile.class, (compile) -> compile.getOptions().setEncoding("UTF-8")); + project.getTasks().withType(Javadoc.class, + (javadoc) -> javadoc.getOptions().source("1.8").encoding("UTF-8")); + project.getTasks().withType(Test.class, (test) -> { + test.useJUnitPlatform(); + test.setMaxHeapSize("1024M"); + }); + project.getTasks().withType(Jar.class, (jar) -> { + project.afterEvaluate((evaluated) -> { + jar.manifest((manifest) -> { + Map attributes = new TreeMap<>(); + attributes.put("Automatic-Module-Name", project.getName().replace("-", ".")); + attributes.put("Build-Jdk-Spec", project.property("sourceCompatibility")); + attributes.put("Built-By", "Spring"); + attributes.put("Implementation-Title", project.getDescription()); + attributes.put("Implementation-Version", project.getVersion()); + manifest.attributes(attributes); + }); + }); + }); + }); + } + + private void configureSpringJavaFormat(Project project) { + project.getPlugins().apply(SpringJavaFormatPlugin.class); + project.getPlugins().apply(CheckstylePlugin.class); + CheckstyleExtension checkstyle = project.getExtensions().getByType(CheckstyleExtension.class); + checkstyle.setToolVersion("8.22"); + checkstyle.getConfigDirectory().set(project.getRootProject().file("src/checkstyle")); + String version = SpringJavaFormatPlugin.class.getPackage().getImplementationVersion(); + DependencySet checkstyleDependencies = project.getConfigurations().getByName("checkstyle").getDependencies(); + checkstyleDependencies + .add(project.getDependencies().create("io.spring.javaformat:spring-javaformat-checkstyle:" + version)); + checkstyleDependencies + .add(project.getDependencies().create("io.spring.nohttp:nohttp-checkstyle:0.0.3.RELEASE")); + } + + private void applyAsciidoctorConventions(Project project) { + new AsciidoctorConventions().apply(project); + } + + private void applyMavenPublishingConventions(Project project) { + project.getPlugins().withType(MavenPublishPlugin.class).all((mavenPublish) -> { + PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class); + if (project.hasProperty("deploymentRepository")) { + publishing.getRepositories().maven((mavenRepository) -> { + mavenRepository.setUrl(project.property("deploymentRepository")); + mavenRepository.setName("deployment"); + }); + } + publishing.getPublications().withType(MavenPublication.class) + .all((mavenPublication) -> customizePom(mavenPublication.getPom(), project)); + project.getPlugins().withType(JavaPlugin.class).all((javaPlugin) -> { + JavaPluginExtension extension = project.getExtensions().getByType(JavaPluginExtension.class); + extension.withJavadocJar(); + extension.withSourcesJar(); + }); + }); + } + + private void customizePom(MavenPom pom, Project project) { + pom.getUrl().set("https://projects.spring.io/spring-boot/#"); + pom.getDescription().set(project.provider(project::getDescription)); + pom.organization(this::customizeOrganization); + pom.licenses(this::customizeLicences); + pom.developers(this::customizeDevelopers); + pom.scm(this::customizeScm); + pom.issueManagement(this::customizeIssueManagement); + } + + private void customizeOrganization(MavenPomOrganization organization) { + organization.getName().set("Pivotal Software, Inc."); + organization.getUrl().set("https://spring.io"); + } + + private void customizeLicences(MavenPomLicenseSpec licences) { + licences.license((licence) -> { + licence.getName().set("Apache License, Version 2.0"); + licence.getUrl().set("http://www.apache.org/licenses/LICENSE-2.0"); + }); + } + + private void customizeDevelopers(MavenPomDeveloperSpec developers) { + developers.developer((developer) -> { + developer.getName().set("Pivotal"); + developer.getEmail().set("info@pivotal.io"); + developer.getOrganization().set("Pivotal Software, Inc."); + developer.getOrganizationUrl().set("https://www.spring.io"); + }); + } + + private void customizeScm(MavenPomScm scm) { + scm.getConnection().set("scm:git:git://github.com/spring-projects/spring-boot.git"); + scm.getDeveloperConnection().set("scm:git:ssh://git@github.com/spring-projects/spring-boot.git"); + scm.getUrl().set("https://github.com/spring-projects/spring-boot"); + + } + + private void customizeIssueManagement(MavenPomIssueManagement issueManagement) { + issueManagement.getSystem().set("GitHub"); + issueManagement.getUrl().set("https://github.com/spring-projects/spring-boot/issues"); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/DeployedPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/DeployedPlugin.java new file mode 100644 index 000000000000..30dc9d3db1c0 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/DeployedPlugin.java @@ -0,0 +1,54 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build; + +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.plugins.JavaPlatformPlugin; +import org.gradle.api.plugins.JavaPlugin; +import org.gradle.api.publish.PublishingExtension; +import org.gradle.api.publish.maven.MavenPublication; +import org.gradle.api.publish.maven.plugins.MavenPublishPlugin; + +/** + * A plugin applied to a project that should be deployed. + * + * @author Andy Wilkinson + */ +public class DeployedPlugin implements Plugin { + + /** + * Name of the task that generates the deployed pom file. + */ + public static final String GENERATE_POM_TASK_NAME = "generatePomFileForMavenPublication"; + + @Override + public void apply(Project project) { + project.getPlugins().apply(MavenPublishPlugin.class); + project.getPlugins().apply(MavenRepositoryPlugin.class); + PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class); + MavenPublication mavenPublication = publishing.getPublications().create("maven", MavenPublication.class); + project.getPlugins().withType(JavaPlugin.class) + .all((javaPlugin) -> project.getComponents().matching((component) -> component.getName().equals("java")) + .all((javaComponent) -> mavenPublication.from(javaComponent))); + project.getPlugins().withType(JavaPlatformPlugin.class) + .all((javaPlugin) -> project.getComponents() + .matching((component) -> component.getName().equals("javaPlatform")) + .all((javaComponent) -> mavenPublication.from(javaComponent))); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/MavenRepositoryPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/MavenRepositoryPlugin.java new file mode 100644 index 000000000000..d7fcbfdcbc20 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/MavenRepositoryPlugin.java @@ -0,0 +1,111 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; + +import org.gradle.api.Action; +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.Task; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.artifacts.DependencySet; +import org.gradle.api.artifacts.ProjectDependency; +import org.gradle.api.plugins.JavaLibraryPlugin; +import org.gradle.api.plugins.JavaPlatformPlugin; +import org.gradle.api.plugins.JavaPlugin; +import org.gradle.api.publish.PublishingExtension; +import org.gradle.api.publish.maven.plugins.MavenPublishPlugin; + +/** + * A plugin to make a project's {@code deployment} publication available as a Maven + * repository. The repository can be consumed by depending upon the project using the + * {@code mavenRepository} configuration. + * + * @author Andy Wilkinson + */ +public class MavenRepositoryPlugin implements Plugin { + + /** + * Name of the {@code mavenRepository} configuration. + */ + public static final String MAVEN_REPOSITORY_CONFIGURATION_NAME = "mavenRepository"; + + /** + * Name of the task that publishes to the project repository. + */ + public static final String PUBLISH_TO_PROJECT_REPOSITORY_TASK_NAME = "publishMavenPublicationToProjectRepository"; + + @Override + public void apply(Project project) { + project.getPlugins().apply(MavenPublishPlugin.class); + PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class); + File repositoryLocation = new File(project.getBuildDir(), "maven-repository"); + publishing.getRepositories().maven((mavenRepository) -> { + mavenRepository.setName("project"); + mavenRepository.setUrl(repositoryLocation.toURI()); + }); + project.getTasks().matching((task) -> task.getName().equals(PUBLISH_TO_PROJECT_REPOSITORY_TASK_NAME)) + .all((task) -> setUpProjectRepository(project, task, repositoryLocation)); + project.getTasks().matching((task) -> task.getName().equals("publishPluginMavenPublicationToProjectRepository")) + .all((task) -> setUpProjectRepository(project, task, repositoryLocation)); + } + + private void setUpProjectRepository(Project project, Task publishTask, File repositoryLocation) { + publishTask.doFirst(new CleanAction(repositoryLocation)); + Configuration projectRepository = project.getConfigurations().create(MAVEN_REPOSITORY_CONFIGURATION_NAME); + project.getArtifacts().add(projectRepository.getName(), repositoryLocation, + (artifact) -> artifact.builtBy(publishTask)); + DependencySet target = projectRepository.getDependencies(); + project.getPlugins().withType(JavaPlugin.class).all((javaPlugin) -> addMavenRepositoryDependencies(project, + JavaPlugin.IMPLEMENTATION_CONFIGURATION_NAME, target)); + project.getPlugins().withType(JavaLibraryPlugin.class) + .all((javaLibraryPlugin) -> addMavenRepositoryDependencies(project, JavaPlugin.API_CONFIGURATION_NAME, + target)); + project.getPlugins().withType(JavaPlatformPlugin.class) + .all((javaPlugin) -> addMavenRepositoryDependencies(project, JavaPlatformPlugin.API_CONFIGURATION_NAME, + target)); + } + + private void addMavenRepositoryDependencies(Project project, String sourceConfigurationName, DependencySet target) { + project.getConfigurations().getByName(sourceConfigurationName).getDependencies() + .withType(ProjectDependency.class).all((dependency) -> { + Map dependencyDescriptor = new HashMap<>(); + dependencyDescriptor.put("path", dependency.getDependencyProject().getPath()); + dependencyDescriptor.put("configuration", MAVEN_REPOSITORY_CONFIGURATION_NAME); + target.add(project.getDependencies().project(dependencyDescriptor)); + }); + } + + private static final class CleanAction implements Action { + + private final File location; + + private CleanAction(File location) { + this.location = location; + } + + @Override + public void execute(Task task) { + task.getProject().delete(this.location); + } + + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/autoconfigure/AutoConfigurationMetadata.java b/buildSrc/src/main/java/org/springframework/boot/build/autoconfigure/AutoConfigurationMetadata.java new file mode 100644 index 000000000000..c4664062b46f --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/autoconfigure/AutoConfigurationMetadata.java @@ -0,0 +1,93 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.autoconfigure; + +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.Reader; +import java.util.Properties; +import java.util.concurrent.Callable; + +import org.gradle.api.Task; +import org.gradle.api.internal.AbstractTask; +import org.gradle.api.tasks.OutputFile; +import org.gradle.api.tasks.SourceSet; +import org.gradle.api.tasks.TaskAction; + +/** + * A {@link Task} for generating metadata describing a project's auto-configuration + * classes. + * + * @author Andy Wilkinson + */ +public class AutoConfigurationMetadata extends AbstractTask { + + private SourceSet sourceSet; + + private File outputFile; + + public AutoConfigurationMetadata() { + getInputs().file((Callable) () -> new File(this.sourceSet.getOutput().getResourcesDir(), + "META-INF/spring.factories")); + dependsOn((Callable) () -> this.sourceSet.getProcessResourcesTaskName()); + getProject().getConfigurations() + .maybeCreate(AutoConfigurationPlugin.AUTO_CONFIGURATION_METADATA_CONFIGURATION_NAME); + } + + public void setSourceSet(SourceSet sourceSet) { + this.sourceSet = sourceSet; + } + + @OutputFile + public File getOutputFile() { + return this.outputFile; + } + + public void setOutputFile(File outputFile) { + this.outputFile = outputFile; + } + + @TaskAction + void documentAutoConfiguration() throws IOException { + Properties autoConfiguration = readAutoConfiguration(); + getOutputFile().getParentFile().mkdirs(); + try (FileWriter writer = new FileWriter(getOutputFile())) { + autoConfiguration.store(writer, null); + } + } + + private Properties readAutoConfiguration() throws IOException { + Properties autoConfiguration = new Properties(); + Properties springFactories = readSpringFactories( + new File(this.sourceSet.getOutput().getResourcesDir(), "META-INF/spring.factories")); + autoConfiguration.setProperty("autoConfigurationClassNames", + springFactories.getProperty("org.springframework.boot.autoconfigure.EnableAutoConfiguration")); + autoConfiguration.setProperty("module", getProject().getName()); + return autoConfiguration; + } + + private Properties readSpringFactories(File file) throws IOException { + Properties springFactories = new Properties(); + try (Reader in = new FileReader(file)) { + springFactories.load(in); + } + return springFactories; + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/autoconfigure/AutoConfigurationPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/autoconfigure/AutoConfigurationPlugin.java new file mode 100644 index 000000000000..7c2c77b4d212 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/autoconfigure/AutoConfigurationPlugin.java @@ -0,0 +1,78 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.autoconfigure; + +import java.io.File; +import java.util.Collections; +import java.util.concurrent.Callable; + +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.plugins.JavaPlugin; +import org.gradle.api.plugins.JavaPluginConvention; +import org.gradle.api.tasks.SourceSet; + +import org.springframework.boot.build.DeployedPlugin; +import org.springframework.boot.build.context.properties.ConfigurationPropertiesPlugin; + +/** + * {@link Plugin} for projects that define auto-configuration. When applied, the plugin + * applies the {@link DeployedPlugin}. Additionally, it reacts to the presence of the + * {@link JavaPlugin} by: + * + *

    + *
  • Applying the {@link ConfigurationPropertiesPlugin}. + *
  • Adding a dependency on the auto-configuration annotation processor. + *
  • Defining a task that produces metadata describing the auto-configuration. The + * metadata is made available as an artifact in the + *
+ * + * @author Andy Wilkinson + */ +public class AutoConfigurationPlugin implements Plugin { + + /** + * Name of the {@link Configuration} that holds the auto-configuration metadata + * artifact. + */ + public static final String AUTO_CONFIGURATION_METADATA_CONFIGURATION_NAME = "autoConfigurationMetadata"; + + @Override + public void apply(Project project) { + project.getPlugins().apply(DeployedPlugin.class); + project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> { + project.getPlugins().apply(ConfigurationPropertiesPlugin.class); + Configuration annotationProcessors = project.getConfigurations() + .getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME); + annotationProcessors.getDependencies() + .add(project.getDependencies().project(Collections.singletonMap("path", + ":spring-boot-project:spring-boot-tools:spring-boot-autoconfigure-processor"))); + annotationProcessors.getDependencies() + .add(project.getDependencies().project(Collections.singletonMap("path", + ":spring-boot-project:spring-boot-tools:spring-boot-configuration-processor"))); + project.getTasks().create("autoConfigurationMetadata", AutoConfigurationMetadata.class, (task) -> { + task.setSourceSet(project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets() + .getByName(SourceSet.MAIN_SOURCE_SET_NAME)); + task.setOutputFile(new File(project.getBuildDir(), "auto-configuration-metadata.properties")); + project.getArtifacts().add(AutoConfigurationPlugin.AUTO_CONFIGURATION_METADATA_CONFIGURATION_NAME, + project.provider((Callable) task::getOutputFile), (artifact) -> artifact.builtBy(task)); + }); + }); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/autoconfigure/DocumentAutoConfigurationClasses.java b/buildSrc/src/main/java/org/springframework/boot/build/autoconfigure/DocumentAutoConfigurationClasses.java new file mode 100644 index 000000000000..6302342dd756 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/autoconfigure/DocumentAutoConfigurationClasses.java @@ -0,0 +1,136 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.autoconfigure; + +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.Reader; +import java.util.Properties; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; +import java.util.stream.Collectors; + +import org.gradle.api.Task; +import org.gradle.api.file.FileCollection; +import org.gradle.api.internal.AbstractTask; +import org.gradle.api.tasks.InputFiles; +import org.gradle.api.tasks.OutputDirectory; +import org.gradle.api.tasks.TaskAction; + +import org.springframework.util.StringUtils; + +/** + * {@link Task} used to document auto-configuration classes. + * + * @author Andy Wilkinson + */ +public class DocumentAutoConfigurationClasses extends AbstractTask { + + private FileCollection autoConfiguration; + + private File outputDir; + + @InputFiles + public FileCollection getAutoConfiguration() { + return this.autoConfiguration; + } + + public void setAutoConfiguration(FileCollection autoConfiguration) { + this.autoConfiguration = autoConfiguration; + } + + @OutputDirectory + public File getOutputDir() { + return this.outputDir; + } + + public void setOutputDir(File outputDir) { + this.outputDir = outputDir; + } + + @TaskAction + void documentAutoConfigurationClasses() throws IOException { + for (File metadataFile : this.autoConfiguration) { + Properties metadata = new Properties(); + try (Reader reader = new FileReader(metadataFile)) { + metadata.load(reader); + } + AutoConfiguration autoConfiguration = new AutoConfiguration(metadata.getProperty("module"), new TreeSet<>( + StringUtils.commaDelimitedListToSet(metadata.getProperty("autoConfigurationClassNames")))); + writeTable(autoConfiguration); + } + } + + private void writeTable(AutoConfiguration autoConfigurationClasses) throws IOException { + this.outputDir.mkdirs(); + try (PrintWriter writer = new PrintWriter( + new FileWriter(new File(this.outputDir, autoConfigurationClasses.module + ".adoc")))) { + writer.println("[cols=\"4,1\"]"); + writer.println("|==="); + writer.println("| Configuration Class | Links"); + + for (AutoConfigurationClass autoConfigurationClass : autoConfigurationClasses.classes) { + writer.println(); + writer.printf("| {spring-boot-code}/spring-boot-project/%s/src/main/java/%s.java[`%s`]%n", + autoConfigurationClasses.module, autoConfigurationClass.path, autoConfigurationClass.name); + writer.printf("| {spring-boot-api}/%s.html[javadoc]%n", autoConfigurationClass.path); + } + + writer.println("|==="); + } + } + + private static final class AutoConfiguration { + + private final String module; + + private final SortedSet classes; + + private AutoConfiguration(String module, Set classNames) { + this.module = module; + this.classes = classNames.stream().map((className) -> { + String path = className.replace('.', '/'); + String name = className.substring(className.lastIndexOf('.') + 1); + return new AutoConfigurationClass(name, path); + }).collect(Collectors.toCollection(TreeSet::new)); + } + + } + + private static final class AutoConfigurationClass implements Comparable { + + private final String name; + + private final String path; + + private AutoConfigurationClass(String name, String path) { + this.name = name; + this.path = path; + } + + @Override + public int compareTo(AutoConfigurationClass other) { + return this.name.compareTo(other.name); + } + + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/BomExtension.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/BomExtension.java new file mode 100644 index 000000000000..e524749a0da6 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/BomExtension.java @@ -0,0 +1,297 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import groovy.lang.Closure; +import groovy.lang.GroovyObjectSupport; +import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; +import org.apache.maven.artifact.versioning.VersionRange; +import org.gradle.api.InvalidUserCodeException; +import org.gradle.api.InvalidUserDataException; +import org.gradle.api.artifacts.dsl.DependencyHandler; +import org.gradle.util.ConfigureUtil; + +import org.springframework.boot.build.bom.Library.Exclusion; +import org.springframework.boot.build.bom.Library.Group; +import org.springframework.boot.build.bom.Library.Module; +import org.springframework.boot.build.bom.Library.ProhibitedVersion; +import org.springframework.boot.build.bom.bomr.version.DependencyVersion; + +/** + * DSL extensions for {@link BomPlugin}. + * + * @author Andy Wilkinson + */ +public class BomExtension { + + private final Map properties = new LinkedHashMap<>(); + + private final Map artifactVersionProperties = new HashMap<>(); + + private final List libraries = new ArrayList(); + + private final DependencyHandler dependencyHandler; + + private final UpgradeHandler upgradeHandler = new UpgradeHandler(); + + public BomExtension(DependencyHandler dependencyHandler) { + this.dependencyHandler = dependencyHandler; + } + + public List getLibraries() { + return this.libraries; + } + + public void upgrade(Closure closure) { + ConfigureUtil.configure(closure, this.upgradeHandler); + } + + public Upgrade getUpgrade() { + return new Upgrade(this.upgradeHandler.upgradePolicy, new GitHub(this.upgradeHandler.gitHub.organization, + this.upgradeHandler.gitHub.repository, this.upgradeHandler.gitHub.issueLabels)); + } + + public void library(String name, String version, Closure closure) { + LibraryHandler libraryHandler = new LibraryHandler(); + ConfigureUtil.configure(closure, libraryHandler); + addLibrary(new Library(name, DependencyVersion.parse(version), libraryHandler.groups, + libraryHandler.prohibitedVersions)); + } + + private String createDependencyNotation(String groupId, String artifactId, DependencyVersion version) { + return groupId + ":" + artifactId + ":" + version; + } + + Map getProperties() { + return this.properties; + } + + String getArtifactVersionProperty(String groupId, String artifactId) { + String coordinates = groupId + ":" + artifactId; + return this.artifactVersionProperties.get(coordinates); + } + + private void putArtifactVersionProperty(String groupId, String artifactId, String versionProperty) { + String coordinates = groupId + ":" + artifactId; + String existing = this.artifactVersionProperties.putIfAbsent(coordinates, versionProperty); + if (existing != null) { + throw new InvalidUserDataException("Cannot put version property for '" + coordinates + + "'. Version property '" + existing + "' has already been stored."); + } + } + + private void addLibrary(Library library) { + this.libraries.add(library); + this.properties.put(library.getVersionProperty(), library.getVersion()); + for (Group group : library.getGroups()) { + for (Module module : group.getModules()) { + this.putArtifactVersionProperty(group.getId(), module.getName(), library.getVersionProperty()); + this.dependencyHandler.getConstraints().add("api", + createDependencyNotation(group.getId(), module.getName(), library.getVersion())); + } + for (String bomImport : group.getBoms()) { + this.putArtifactVersionProperty(group.getId(), bomImport, library.getVersionProperty()); + this.dependencyHandler.add("api", this.dependencyHandler + .enforcedPlatform(createDependencyNotation(group.getId(), bomImport, library.getVersion()))); + } + } + } + + public static class LibraryHandler { + + private final List groups = new ArrayList<>(); + + private final List prohibitedVersions = new ArrayList<>(); + + public void group(String id, Closure closure) { + GroupHandler groupHandler = new GroupHandler(id); + ConfigureUtil.configure(closure, groupHandler); + this.groups + .add(new Group(groupHandler.id, groupHandler.modules, groupHandler.plugins, groupHandler.imports)); + } + + public void prohibit(String range, Closure closure) { + ProhibitedVersionHandler prohibitedVersionHandler = new ProhibitedVersionHandler(); + ConfigureUtil.configure(closure, prohibitedVersionHandler); + try { + this.prohibitedVersions.add(new ProhibitedVersion(VersionRange.createFromVersionSpec(range), + prohibitedVersionHandler.reason)); + } + catch (InvalidVersionSpecificationException ex) { + throw new InvalidUserCodeException("Invalid version range", ex); + } + } + + public static class ProhibitedVersionHandler { + + private String reason; + + public void because(String because) { + this.reason = because; + } + + } + + public class GroupHandler extends GroovyObjectSupport { + + private final String id; + + private List modules = new ArrayList<>(); + + private List imports = new ArrayList<>(); + + private List plugins = new ArrayList<>(); + + public GroupHandler(String id) { + this.id = id; + } + + public void setModules(List modules) { + this.modules = modules.stream() + .map((input) -> (input instanceof Module) ? (Module) input : new Module((String) input)) + .collect(Collectors.toList()); + } + + public void setImports(List imports) { + this.imports = imports; + } + + public void setPlugins(List plugins) { + this.plugins = plugins; + } + + public Object methodMissing(String name, Object args) { + if (args instanceof Object[] && ((Object[]) args).length == 1) { + Object arg = ((Object[]) args)[0]; + if (arg instanceof Closure) { + ExclusionHandler exclusionHandler = new ExclusionHandler(); + ConfigureUtil.configure((Closure) arg, exclusionHandler); + return new Module(name, exclusionHandler.exclusions); + } + } + throw new InvalidUserDataException("Invalid exclusion configuration for module '" + name + "'"); + } + + public class ExclusionHandler { + + private final List exclusions = new ArrayList<>(); + + public void exclude(Map exclusion) { + this.exclusions.add(new Exclusion(exclusion.get("group"), exclusion.get("module"))); + } + + } + + } + + } + + public static class UpgradeHandler { + + private UpgradePolicy upgradePolicy; + + private final GitHubHandler gitHub = new GitHubHandler(); + + public void setPolicy(UpgradePolicy upgradePolicy) { + this.upgradePolicy = upgradePolicy; + } + + public void gitHub(Closure closure) { + ConfigureUtil.configure(closure, this.gitHub); + } + + } + + public static final class Upgrade { + + private final UpgradePolicy upgradePolicy; + + private final GitHub gitHub; + + private Upgrade(UpgradePolicy upgradePolicy, GitHub gitHub) { + this.upgradePolicy = upgradePolicy; + this.gitHub = gitHub; + } + + public UpgradePolicy getPolicy() { + return this.upgradePolicy; + } + + public GitHub getGitHub() { + return this.gitHub; + } + + } + + public static class GitHubHandler { + + private String organization = "spring-projects"; + + private String repository = "spring-boot"; + + private List issueLabels; + + public void setOrganization(String organization) { + this.organization = organization; + } + + public void setRepository(String repository) { + this.repository = repository; + } + + public void setIssueLabels(List issueLabels) { + this.issueLabels = issueLabels; + } + + } + + public static final class GitHub { + + private String organization = "spring-projects"; + + private String repository = "spring-boot"; + + private List issueLabels; + + private GitHub(String organization, String repository, List issueLabels) { + this.organization = organization; + this.repository = repository; + this.issueLabels = issueLabels; + } + + public String getOrganization() { + return this.organization; + } + + public String getRepository() { + return this.repository; + } + + public List getIssueLabels() { + return this.issueLabels; + } + + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java new file mode 100644 index 000000000000..9b08ede52d1e --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/BomPlugin.java @@ -0,0 +1,295 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom; + +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.stream.Collectors; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + +import groovy.util.Node; +import groovy.xml.QName; +import org.gradle.api.Action; +import org.gradle.api.GradleException; +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.Task; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.plugins.JavaPlatformExtension; +import org.gradle.api.plugins.JavaPlatformPlugin; +import org.gradle.api.plugins.PluginContainer; +import org.gradle.api.publish.PublishingExtension; +import org.gradle.api.publish.maven.MavenPom; +import org.gradle.api.publish.maven.MavenPublication; +import org.gradle.api.publish.maven.tasks.GenerateMavenPom; +import org.gradle.api.tasks.Sync; +import org.gradle.api.tasks.TaskExecutionException; +import org.w3c.dom.Document; +import org.w3c.dom.NodeList; + +import org.springframework.boot.build.DeployedPlugin; +import org.springframework.boot.build.MavenRepositoryPlugin; +import org.springframework.boot.build.bom.Library.Group; +import org.springframework.boot.build.bom.bomr.UpgradeBom; +import org.springframework.boot.build.mavenplugin.MavenExec; +import org.springframework.util.FileCopyUtils; + +/** + * {@link Plugin} for defining a bom. Dependencies are added as constraints in the + * {@code api} configuration. Imported boms are added as enforced platforms in the + * {@code api} configuration. + * + * @author Andy Wilkinson + */ +public class BomPlugin implements Plugin { + + @Override + public void apply(Project project) { + PluginContainer plugins = project.getPlugins(); + plugins.apply(DeployedPlugin.class); + plugins.apply(MavenRepositoryPlugin.class); + plugins.apply(JavaPlatformPlugin.class); + JavaPlatformExtension javaPlatform = project.getExtensions().getByType(JavaPlatformExtension.class); + javaPlatform.allowDependencies(); + BomExtension bom = project.getExtensions().create("bom", BomExtension.class, project.getDependencies()); + project.getTasks().create("bomrCheck", CheckBom.class, bom); + project.getTasks().create("bomrUpgrade", UpgradeBom.class, bom); + new PublishingCustomizer(project, bom).customize(); + Configuration effectiveBomConfiguration = project.getConfigurations().create("effectiveBom"); + project.getTasks().matching((task) -> task.getName().equals(DeployedPlugin.GENERATE_POM_TASK_NAME)) + .all((task) -> { + Sync syncBom = project.getTasks().create("syncBom", Sync.class); + syncBom.dependsOn(task); + File generatedBomDir = new File(project.getBuildDir(), "generated/bom"); + syncBom.setDestinationDir(generatedBomDir); + syncBom.from(((GenerateMavenPom) task).getDestination(), (pom) -> pom.rename((name) -> "pom.xml")); + try { + String settingsXmlContent = FileCopyUtils + .copyToString(new InputStreamReader( + getClass().getClassLoader().getResourceAsStream("effective-bom-settings.xml"), + StandardCharsets.UTF_8)) + .replace("localRepositoryPath", + new File(project.getBuildDir(), "local-m2-repository").getAbsolutePath()); + syncBom.from(project.getResources().getText().fromString(settingsXmlContent), + (settingsXml) -> settingsXml.rename((name) -> "settings.xml")); + } + catch (IOException ex) { + throw new GradleException("Failed to prepare settings.xml", ex); + } + MavenExec generateEffectiveBom = project.getTasks().create("generateEffectiveBom", MavenExec.class); + generateEffectiveBom.setProjectDir(generatedBomDir); + File effectiveBom = new File(project.getBuildDir(), + "generated/effective-bom/" + project.getName() + "-effective-bom.xml"); + generateEffectiveBom.args("--settings", "settings.xml", "help:effective-pom", + "-Doutput=" + effectiveBom); + generateEffectiveBom.dependsOn(syncBom); + generateEffectiveBom.getOutputs().file(effectiveBom); + generateEffectiveBom.doLast(new StripUnrepeatableOutputAction(effectiveBom)); + project.getArtifacts().add(effectiveBomConfiguration.getName(), effectiveBom, + (artifact) -> artifact.builtBy(generateEffectiveBom)); + }); + } + + private static final class PublishingCustomizer { + + private final Project project; + + private final BomExtension bom; + + private PublishingCustomizer(Project project, BomExtension bom) { + this.project = project; + this.bom = bom; + } + + private void customize() { + PublishingExtension publishing = this.project.getExtensions().getByType(PublishingExtension.class); + publishing.getPublications().withType(MavenPublication.class).all(this::configurePublication); + } + + private void configurePublication(MavenPublication publication) { + publication.pom(this::customizePom); + } + + @SuppressWarnings("unchecked") + private void customizePom(MavenPom pom) { + pom.withXml((xml) -> { + Node projectNode = xml.asNode(); + Node properties = new Node(null, "properties"); + this.bom.getProperties().forEach(properties::appendNode); + Node dependencyManagement = findChild(projectNode, "dependencyManagement"); + if (dependencyManagement != null) { + addPropertiesBeforeDependencyManagement(projectNode, properties); + replaceVersionsWithVersionPropertyReferences(dependencyManagement); + addExclusionsToManagedDependencies(dependencyManagement); + } + else { + projectNode.children().add(properties); + } + addPluginManagement(projectNode); + }); + } + + @SuppressWarnings("unchecked") + private void addPropertiesBeforeDependencyManagement(Node projectNode, Node properties) { + for (int i = 0; i < projectNode.children().size(); i++) { + if (isNodeWithName(projectNode.children().get(i), "dependencyManagement")) { + projectNode.children().add(i, properties); + break; + } + } + } + + private void replaceVersionsWithVersionPropertyReferences(Node dependencyManagement) { + Node dependencies = findChild(dependencyManagement, "dependencies"); + if (dependencies != null) { + for (Node dependency : findChildren(dependencies, "dependency")) { + String groupId = findChild(dependency, "groupId").text(); + String artifactId = findChild(dependency, "artifactId").text(); + findChild(dependency, "version") + .setValue("${" + this.bom.getArtifactVersionProperty(groupId, artifactId) + "}"); + } + } + } + + private void addExclusionsToManagedDependencies(Node dependencyManagement) { + Node dependencies = findChild(dependencyManagement, "dependencies"); + if (dependencies != null) { + for (Node dependency : findChildren(dependencies, "dependency")) { + String groupId = findChild(dependency, "groupId").text(); + String artifactId = findChild(dependency, "artifactId").text(); + this.bom.getLibraries().stream().flatMap((library) -> library.getGroups().stream()) + .filter((group) -> group.getId().equals(groupId)) + .flatMap((group) -> group.getModules().stream()) + .filter((module) -> module.getName().equals(artifactId)) + .flatMap((module) -> module.getExclusions().stream()).forEach((exclusion) -> { + Node exclusions = findOrCreateNode(dependency, "exclusions"); + Node node = new Node(exclusions, "exclusion"); + node.appendNode("groupId", exclusion.getGroupId()); + node.appendNode("artifactId", exclusion.getArtifactId()); + }); + } + } + } + + private void addPluginManagement(Node projectNode) { + for (Library library : this.bom.getLibraries()) { + for (Group group : library.getGroups()) { + Node plugins = findOrCreateNode(projectNode, "build", "pluginManagement", "plugins"); + for (String pluginName : group.getPlugins()) { + Node plugin = new Node(plugins, "plugin"); + plugin.appendNode("groupId", group.getId()); + plugin.appendNode("artifactId", pluginName); + plugin.appendNode("version", "${" + library.getVersionProperty() + "}"); + } + } + } + } + + private Node findOrCreateNode(Node parent, String... path) { + Node current = parent; + for (String nodeName : path) { + Node child = findChild(current, nodeName); + if (child == null) { + child = new Node(current, nodeName); + } + current = child; + } + return current; + } + + private Node findChild(Node parent, String name) { + for (Object child : parent.children()) { + if (child instanceof Node) { + Node node = (Node) child; + if ((node.name() instanceof QName) && name.equals(((QName) node.name()).getLocalPart())) { + return node; + } + if (name.equals(node.name())) { + return node; + } + } + } + return null; + } + + @SuppressWarnings("unchecked") + private List findChildren(Node parent, String name) { + return (List) parent.children().stream().filter((child) -> isNodeWithName(child, name)) + .collect(Collectors.toList()); + + } + + private boolean isNodeWithName(Object candidate, String name) { + if (candidate instanceof Node) { + Node node = (Node) candidate; + if ((node.name() instanceof QName) && name.equals(((QName) node.name()).getLocalPart())) { + return true; + } + if (name.equals(node.name())) { + return true; + } + } + return false; + } + + } + + private static final class StripUnrepeatableOutputAction implements Action { + + private final File effectiveBom; + + private StripUnrepeatableOutputAction(File xmlFile) { + this.effectiveBom = xmlFile; + } + + @Override + public void execute(Task task) { + try { + Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(this.effectiveBom); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList comments = (NodeList) xpath.evaluate("//comment()", document, XPathConstants.NODESET); + for (int i = 0; i < comments.getLength(); i++) { + org.w3c.dom.Node comment = comments.item(i); + comment.getParentNode().removeChild(comment); + } + org.w3c.dom.Node build = (org.w3c.dom.Node) xpath.evaluate("/project/build", document, + XPathConstants.NODE); + build.getParentNode().removeChild(build); + org.w3c.dom.Node reporting = (org.w3c.dom.Node) xpath.evaluate("/project/reporting", document, + XPathConstants.NODE); + reporting.getParentNode().removeChild(reporting); + TransformerFactory.newInstance().newTransformer().transform(new DOMSource(document), + new StreamResult(this.effectiveBom)); + } + catch (Exception ex) { + throw new TaskExecutionException(task, ex); + } + } + + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/CheckBom.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/CheckBom.java new file mode 100644 index 000000000000..cde5d53513b2 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/CheckBom.java @@ -0,0 +1,86 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom; + +import java.util.Set; +import java.util.TreeSet; +import java.util.stream.Collectors; + +import javax.inject.Inject; + +import org.gradle.api.DefaultTask; +import org.gradle.api.InvalidUserDataException; +import org.gradle.api.tasks.TaskAction; + +import org.springframework.boot.build.bom.Library.Group; +import org.springframework.boot.build.bom.Library.Module; +import org.springframework.boot.build.bom.bomr.version.DependencyVersion; + +/** + * Checks the validity of a bom. + * + * @author Andy Wilkinson + */ +public class CheckBom extends DefaultTask { + + private final BomExtension bom; + + @Inject + public CheckBom(BomExtension bom) { + this.bom = bom; + } + + @TaskAction + void checkBom() { + for (Library library : this.bom.getLibraries()) { + for (Group group : library.getGroups()) { + for (Module module : group.getModules()) { + if (!module.getExclusions().isEmpty()) { + checkExclusions(group.getId(), module, library.getVersion()); + } + } + } + } + } + + private void checkExclusions(String groupId, Module module, DependencyVersion version) { + Set resolved = getProject().getConfigurations() + .detachedConfiguration( + getProject().getDependencies().create(groupId + ":" + module.getName() + ":" + version)) + .getResolvedConfiguration().getResolvedArtifacts().stream() + .map((artifact) -> artifact.getModuleVersion().getId()) + .map((id) -> id.getGroup() + ":" + id.getModule().getName()).collect(Collectors.toSet()); + Set exclusions = module.getExclusions().stream() + .map((exclusion) -> exclusion.getGroupId() + ":" + exclusion.getArtifactId()) + .collect(Collectors.toSet()); + Set unused = new TreeSet<>(); + for (String exclusion : exclusions) { + if (!resolved.contains(exclusion) && exclusion.endsWith(":*")) { + String group = exclusion.substring(0, exclusion.indexOf(':') + 1); + if (!resolved.stream().filter((candidate) -> candidate.startsWith(group)).findFirst().isPresent()) { + unused.add(exclusion); + } + } + } + exclusions.removeAll(resolved); + if (!unused.isEmpty()) { + throw new InvalidUserDataException( + "Unnecessary exclusions on " + groupId + ":" + module.getName() + ": " + exclusions); + } + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/Library.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/Library.java new file mode 100644 index 000000000000..e28447838ca0 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/Library.java @@ -0,0 +1,196 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom; + +import java.util.Collections; +import java.util.List; +import java.util.Locale; + +import org.apache.maven.artifact.versioning.VersionRange; + +import org.springframework.boot.build.bom.bomr.version.DependencyVersion; + +/** + * A collection of modules, Maven plugins, and Maven boms that are versioned and released + * together. + * + * @author Andy Wilkinson + */ +public class Library { + + private final String name; + + private final DependencyVersion version; + + private final List groups; + + private final String versionProperty; + + private final List prohibitedVersions; + + /** + * Create a new {@code Library} with the given {@code name}, {@code version}, and + * {@code groups}. + * @param name name of the library + * @param version version of the library + * @param groups groups in the library + * @param prohibitedVersions version of the library that are prohibited + */ + public Library(String name, DependencyVersion version, List groups, + List prohibitedVersions) { + this.name = name; + this.version = version; + this.groups = groups; + this.versionProperty = name.toLowerCase(Locale.ENGLISH).replace(' ', '-') + ".version"; + this.prohibitedVersions = prohibitedVersions; + } + + public String getName() { + return this.name; + } + + public DependencyVersion getVersion() { + return this.version; + } + + public List getGroups() { + return this.groups; + } + + public String getVersionProperty() { + return this.versionProperty; + } + + public List getProhibitedVersions() { + return this.prohibitedVersions; + } + + /** + * A version or range of versions that are prohibited from being used in a bom. + */ + public static class ProhibitedVersion { + + private final VersionRange range; + + private final String reason; + + public ProhibitedVersion(VersionRange range, String reason) { + this.range = range; + this.reason = reason; + } + + public VersionRange getRange() { + return this.range; + } + + public String getReason() { + return this.reason; + } + + } + + /** + * A collection of modules, Maven plugins, and Maven boms with the same group ID. + */ + public static class Group { + + private final String id; + + private final List modules; + + private final List plugins; + + private final List boms; + + public Group(String id, List modules, List plugins, List boms) { + this.id = id; + this.modules = modules; + this.plugins = plugins; + this.boms = boms; + } + + public String getId() { + return this.id; + } + + public List getModules() { + return this.modules; + } + + public List getPlugins() { + return this.plugins; + } + + public List getBoms() { + return this.boms; + } + + } + + /** + * A module in a group. + */ + public static class Module { + + private final String name; + + private final List exclusions; + + public Module(String name) { + this(name, Collections.emptyList()); + } + + public Module(String name, List exclusions) { + this.name = name; + this.exclusions = exclusions; + } + + public String getName() { + return this.name; + } + + public List getExclusions() { + return this.exclusions; + } + + } + + /** + * An exclusion of a dependency identified by its group ID and artifact ID. + */ + public static class Exclusion { + + private final String groupId; + + private final String artifactId; + + public Exclusion(String groupId, String artifactId) { + this.groupId = groupId; + this.artifactId = artifactId; + } + + public String getGroupId() { + return this.groupId; + } + + public String getArtifactId() { + return this.artifactId; + } + + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/UpgradePolicy.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/UpgradePolicy.java new file mode 100644 index 000000000000..831d3b4f85cb --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/UpgradePolicy.java @@ -0,0 +1,61 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom; + +import java.util.function.BiPredicate; + +import org.springframework.boot.build.bom.bomr.version.DependencyVersion; + +/** + * Policies used to decide which versions are considered as possible upgrades. + * + * @author Andy Wilkinson + */ +public enum UpgradePolicy implements BiPredicate { + + /** + * All versions more recent than the current version will be suggested as possible + * upgrades. + */ + ANY((candidate, current) -> current.compareTo(candidate) < 0), + + /** + * New minor versions of the current major version will be suggested as possible + * upgrades. For example, if the current version is 1.2.3, all 1.x.y versions after + * 1.2.3 will be suggested. 2.x versions will not be offered. + */ + SAME_MAJOR_VERSION(DependencyVersion::isSameMajorAndNewerThan), + + /** + * New patch versions of the current minor version will be offered as possible + * upgrades. For example, if the current version is 1.2.3, all 1.2.x versions after + * 1.2.3 will be suggested. 1.x versions will not be offered. + */ + SAME_MINOR_VERSION(DependencyVersion::isSameMinorAndNewerThan); + + private BiPredicate delegate; + + UpgradePolicy(BiPredicate delegate) { + this.delegate = delegate; + } + + @Override + public boolean test(DependencyVersion candidate, DependencyVersion current) { + return this.delegate.test(candidate, current); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/InteractiveUpgradeResolver.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/InteractiveUpgradeResolver.java new file mode 100644 index 000000000000..b216e9e38293 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/InteractiveUpgradeResolver.java @@ -0,0 +1,142 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.SortedSet; +import java.util.stream.Collectors; + +import org.apache.maven.artifact.versioning.DefaultArtifactVersion; +import org.gradle.api.internal.tasks.userinput.UserInputHandler; + +import org.springframework.boot.build.bom.Library; +import org.springframework.boot.build.bom.Library.Group; +import org.springframework.boot.build.bom.Library.Module; +import org.springframework.boot.build.bom.Library.ProhibitedVersion; +import org.springframework.boot.build.bom.UpgradePolicy; +import org.springframework.boot.build.bom.bomr.version.DependencyVersion; +import org.springframework.util.StringUtils; + +/** + * Interactive {@link UpgradeResolver} that uses command line input to choose the upgrades + * to apply. + * + * @author Andy Wilkinson + */ +public final class InteractiveUpgradeResolver implements UpgradeResolver { + + private final VersionResolver versionResolver; + + private final UpgradePolicy upgradePolicy; + + private final UserInputHandler userInputHandler; + + InteractiveUpgradeResolver(VersionResolver versionResolver, UpgradePolicy upgradePolicy, + UserInputHandler userInputHandler) { + this.versionResolver = versionResolver; + this.upgradePolicy = upgradePolicy; + this.userInputHandler = userInputHandler; + } + + @Override + public List resolveUpgrades(Collection libraries) { + return libraries.stream().map(this::resolveUpgrade).filter((upgrade) -> upgrade != null) + .collect(Collectors.toList()); + } + + private Upgrade resolveUpgrade(Library library) { + Map> moduleVersions = new LinkedHashMap<>(); + for (Group group : library.getGroups()) { + for (Module module : group.getModules()) { + moduleVersions.put(group.getId() + ":" + module.getName(), + getLaterVersionsForModule(group.getId(), module.getName(), library.getVersion())); + } + } + List allVersions = moduleVersions.values().stream().flatMap(SortedSet::stream).distinct() + .filter((dependencyVersion) -> isPermitted(dependencyVersion, library.getProhibitedVersions())) + .collect(Collectors.toList()); + if (allVersions.isEmpty()) { + return null; + } + List versionOptions = allVersions.stream() + .map((version) -> new VersionOption(version, getMissingModules(moduleVersions, version))) + .collect(Collectors.toList()); + VersionOption current = new VersionOption(library.getVersion(), Collections.emptyList()); + VersionOption selected = this.userInputHandler.selectOption(library.getName() + " " + library.getVersion(), + versionOptions, current); + return (selected.equals(current)) ? null : new Upgrade(library, selected.version); + } + + private boolean isPermitted(DependencyVersion dependencyVersion, List prohibitedVersions) { + if (prohibitedVersions.isEmpty()) { + return true; + } + for (ProhibitedVersion prohibitedVersion : prohibitedVersions) { + if (prohibitedVersion.getRange() + .containsVersion(new DefaultArtifactVersion(dependencyVersion.toString()))) { + return false; + } + } + return true; + } + + private List getMissingModules(Map> moduleVersions, + DependencyVersion version) { + List missingModules = new ArrayList<>(); + moduleVersions.forEach((name, versions) -> { + if (!versions.contains(version)) { + missingModules.add(name); + } + }); + return missingModules; + } + + private SortedSet getLaterVersionsForModule(String groupId, String artifactId, + DependencyVersion currentVersion) { + SortedSet versions = this.versionResolver.resolveVersions(groupId, artifactId); + versions.removeIf((candidate) -> !this.upgradePolicy.test(candidate, currentVersion)); + return versions; + } + + private static final class VersionOption { + + private final DependencyVersion version; + + private final List missingModules; + + private VersionOption(DependencyVersion version, List missingModules) { + this.version = version; + this.missingModules = missingModules; + } + + @Override + public String toString() { + if (this.missingModules.isEmpty()) { + return this.version.toString(); + } + return this.version + " (some modules are missing: " + + StringUtils.collectionToDelimitedString(this.missingModules, ", ") + ")"; + } + + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/MavenMetadataVersionResolver.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/MavenMetadataVersionResolver.java new file mode 100644 index 000000000000..d29f6b075937 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/MavenMetadataVersionResolver.java @@ -0,0 +1,98 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr; + +import java.io.StringReader; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; +import java.util.stream.Collectors; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + +import org.w3c.dom.Document; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + +import org.springframework.boot.build.bom.bomr.version.DependencyVersion; +import org.springframework.http.HttpStatus; +import org.springframework.http.converter.StringHttpMessageConverter; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.RestTemplate; + +/** + * A {@link VersionResolver} that examines {@code maven-metadata.xml} to determine the + * available versions. + * + * @author Andy Wilkinson + */ +final class MavenMetadataVersionResolver implements VersionResolver { + + private final RestTemplate rest; + + private final List repositoryUrls; + + MavenMetadataVersionResolver(List repositoryUrls) { + this(new RestTemplate(Arrays.asList(new StringHttpMessageConverter())), repositoryUrls); + } + + MavenMetadataVersionResolver(RestTemplate restTemplate, List repositoryUrls) { + this.rest = restTemplate; + this.repositoryUrls = repositoryUrls; + } + + @Override + public SortedSet resolveVersions(String groupId, String artifactId) { + Set versions = new HashSet(); + for (String repositoryUrl : this.repositoryUrls) { + versions.addAll(resolveVersions(groupId, artifactId, repositoryUrl)); + } + return new TreeSet<>(versions.stream().map(DependencyVersion::parse).collect(Collectors.toSet())); + } + + private Set resolveVersions(String groupId, String artifactId, String repositoryUrl) { + Set versions = new HashSet(); + String url = repositoryUrl + "/" + groupId.replace('.', '/') + "/" + artifactId + "/maven-metadata.xml"; + try { + String metadata = this.rest.getForObject(url, String.class); + Document metadataDocument = DocumentBuilderFactory.newInstance().newDocumentBuilder() + .parse(new InputSource(new StringReader(metadata))); + NodeList versionNodes = (NodeList) XPathFactory.newInstance().newXPath() + .evaluate("/metadata/versioning/versions/version", metadataDocument, XPathConstants.NODESET); + for (int i = 0; i < versionNodes.getLength(); i++) { + versions.add(versionNodes.item(i).getTextContent()); + } + } + catch (HttpClientErrorException ex) { + if (ex.getStatusCode() != HttpStatus.NOT_FOUND) { + System.err.println("Failed to download maven-metadata.xml for " + groupId + ":" + artifactId + " from " + + url + ": " + ex.getMessage()); + } + } + catch (Exception ex) { + System.err.println("Failed to resolve versions for module " + groupId + ":" + artifactId + " in repository " + + repositoryUrl + ": " + ex.getMessage()); + } + return versions; + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/Upgrade.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/Upgrade.java new file mode 100644 index 000000000000..e0457fe8f4f5 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/Upgrade.java @@ -0,0 +1,46 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr; + +import org.springframework.boot.build.bom.Library; +import org.springframework.boot.build.bom.bomr.version.DependencyVersion; + +/** + * An upgrade to change a {@link Library} to use a new version}. + * + * @author Andy Wilkinson + */ +final class Upgrade { + + private final Library library; + + private final DependencyVersion version; + + Upgrade(Library library, DependencyVersion version) { + this.library = library; + this.version = version; + } + + Library getLibrary() { + return this.library; + } + + DependencyVersion getVersion() { + return this.version; + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeBom.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeBom.java new file mode 100644 index 000000000000..7da198a5f1b8 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeBom.java @@ -0,0 +1,146 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr; + +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.Reader; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.Properties; + +import javax.inject.Inject; + +import org.gradle.api.DefaultTask; +import org.gradle.api.InvalidUserDataException; +import org.gradle.api.Task; +import org.gradle.api.internal.tasks.userinput.UserInputHandler; +import org.gradle.api.tasks.TaskAction; +import org.gradle.api.tasks.TaskExecutionException; +import org.gradle.api.tasks.options.Option; + +import org.springframework.boot.build.bom.BomExtension; +import org.springframework.boot.build.bom.bomr.github.GitHub; +import org.springframework.boot.build.bom.bomr.github.GitHubRepository; +import org.springframework.boot.build.bom.bomr.github.Milestone; +import org.springframework.util.StringUtils; + +/** + * {@link Task} to upgrade the libraries managed by a bom. + * + * @author Andy Wilkinson + */ +public class UpgradeBom extends DefaultTask { + + private final BomExtension bom; + + private String milestone; + + @Inject + public UpgradeBom(BomExtension bom) { + this.bom = bom; + } + + @Option(option = "milestone", description = "Milestone to which dependency upgrade issues should be assigned") + public void setMilestone(String milestone) { + this.milestone = milestone; + } + + @TaskAction + void upgradeDependencies() { + GitHubRepository repository = createGitHub().getRepository(this.bom.getUpgrade().getGitHub().getOrganization(), + this.bom.getUpgrade().getGitHub().getRepository()); + List availableLabels = repository.getLabels(); + List issueLabels = this.bom.getUpgrade().getGitHub().getIssueLabels(); + if (!availableLabels.containsAll(issueLabels)) { + List unknownLabels = new ArrayList<>(issueLabels); + unknownLabels.removeAll(availableLabels); + throw new InvalidUserDataException( + "Unknown label(s): " + StringUtils.collectionToCommaDelimitedString(unknownLabels)); + } + Milestone milestone = determineMilestone(repository); + List upgrades = new InteractiveUpgradeResolver( + new MavenMetadataVersionResolver(Arrays.asList("https://repo1.maven.org/maven2/")), + this.bom.getUpgrade().getPolicy(), getServices().get(UserInputHandler.class)) + .resolveUpgrades(this.bom.getLibraries()); + for (Upgrade upgrade : upgrades) { + String title = "Upgrade to " + upgrade.getLibrary().getName() + " " + upgrade.getVersion(); + System.out.println(title); + try { + Path buildFile = getProject().getBuildFile().toPath(); + applyChanges(upgrade, buildFile); + int issueNumber = repository.openIssue(title, issueLabels, milestone); + if (new ProcessBuilder().command("git", "add", buildFile.toFile().getAbsolutePath()).start() + .waitFor() != 0) { + throw new IllegalStateException("git add failed"); + } + if (new ProcessBuilder().command("git", "commit", "-m", title + "\n\nCloses gh-" + issueNumber).start() + .waitFor() != 0) { + throw new IllegalStateException("git commit failed"); + } + } + catch (IOException ex) { + throw new TaskExecutionException(this, ex); + } + catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + } + } + } + + private GitHub createGitHub() { + Properties bomrProperties = new Properties(); + try (Reader reader = new FileReader(new File(System.getProperty("user.home"), ".bomr.properties"))) { + bomrProperties.load(reader); + String username = bomrProperties.getProperty("bomr.github.username"); + String password = bomrProperties.getProperty("bomr.github.password"); + return GitHub.withCredentials(username, password); + } + catch (IOException ex) { + throw new InvalidUserDataException("Failed to load .bomr.properties from user home", ex); + } + } + + private void applyChanges(Upgrade upgrade, Path buildFile) throws IOException { + String contents = new String(Files.readAllBytes(buildFile), StandardCharsets.UTF_8); + String modified = contents.replace( + "library('" + upgrade.getLibrary().getName() + "', '" + upgrade.getLibrary().getVersion() + "')", + "library('" + upgrade.getLibrary().getName() + "', '" + upgrade.getVersion() + "')"); + Files.write(buildFile, modified.getBytes(StandardCharsets.UTF_8), StandardOpenOption.CREATE); + } + + private Milestone determineMilestone(GitHubRepository repository) { + if (this.milestone == null) { + return null; + } + List milestones = repository.getMilestones(); + Optional matchingMilestone = milestones.stream() + .filter((milestone) -> milestone.getName().equals(this.milestone)).findFirst(); + if (!matchingMilestone.isPresent()) { + throw new InvalidUserDataException("Unknown milestone: " + this.milestone); + } + return matchingMilestone.get(); + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/src/main/java/org/springframework/launcher/it/jar/ExampleController.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeResolver.java similarity index 53% rename from spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/src/main/java/org/springframework/launcher/it/jar/ExampleController.java rename to buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeResolver.java index 41df3759ee6e..ed1805eca02e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/src/main/java/org/springframework/launcher/it/jar/ExampleController.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -14,24 +14,25 @@ * limitations under the License. */ -package org.springframework.boot.load.it.jar; +package org.springframework.boot.build.bom.bomr; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import java.util.Collection; +import java.util.List; + +import org.springframework.boot.build.bom.Library; /** - * Simple example Spring MVC Controller. + * Resolves upgrades for the libraries in a bom. * - * @author Phillip Webb + * @author Andy Wilkinson */ -@Controller -public class ExampleController { +interface UpgradeResolver { - @RequestMapping("/") - @ResponseBody - public String helloWorld() { - return "Hello Embedded Jar World!"; - } + /** + * Resolves the upgrades to be applied to the given {@code libraries}. + * @param libraries the libraries + * @return the upgrades + */ + List resolveUpgrades(Collection libraries); } diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/VersionResolver.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/VersionResolver.java new file mode 100644 index 000000000000..70b1c9298cf8 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/VersionResolver.java @@ -0,0 +1,39 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr; + +import java.util.SortedSet; + +import org.springframework.boot.build.bom.bomr.version.DependencyVersion; + +/** + * Resolves the available versions for a module. + * + * @author Andy Wilkinson + */ +interface VersionResolver { + + /** + * Resolves the available versions for the module identified by the given + * {@code groupId} and {@code artifactId}. + * @param groupId module's group ID + * @param artifactId module's artifact ID + * @return the available versions + */ + SortedSet resolveVersions(String groupId, String artifactId); + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/GitHub.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/GitHub.java new file mode 100644 index 000000000000..879caec26ef2 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/GitHub.java @@ -0,0 +1,46 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.github; + +/** + * Minimal API for interacting with GitHub. + * + * @author Andy Wilkinson + */ +public interface GitHub { + + /** + * Returns a {@link GitHubRepository} with the given {@code name} in the given + * {@code organization}. + * @param organization the organization + * @param name the name of the repository + * @return the repository + */ + GitHubRepository getRepository(String organization, String name); + + /** + * Creates a new {@code GitHub} that will authenticate with given {@code username} and + * {@code password}. + * @param username username for authentication + * @param password password for authentication + * @return the new {@code GitHub} instance + */ + static GitHub withCredentials(String username, String password) { + return new StandardGitHub(username, password); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/GitHubRepository.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/GitHubRepository.java new file mode 100644 index 000000000000..3c49ba56d55f --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/GitHubRepository.java @@ -0,0 +1,50 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.github; + +import java.util.List; + +/** + * Minimal API for interacting with a GitHub repository. + * + * @author Andy Wilkinson + */ +public interface GitHubRepository { + + /** + * Opens a new issue with the given title. The given {@code labels} will be applied to + * the issue and it will be assigned to the given {@code milestone}. + * @param title the title of the issue + * @param labels the labels to apply to the issue + * @param milestone the milestone to assign the issue to + * @return the number of the new issue + */ + int openIssue(String title, List labels, Milestone milestone); + + /** + * Returns the labels in the repository. + * @return the labels + */ + List getLabels(); + + /** + * Returns the milestones in the repository. + * @return the milestones + */ + List getMilestones(); + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/Milestone.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/Milestone.java new file mode 100644 index 000000000000..f50dd28c48dd --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/Milestone.java @@ -0,0 +1,56 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.github; + +/** + * A milestone in a {@link GitHubRepository GitHub repository}. + * + * @author Andy Wilkinson + */ +public class Milestone { + + private final String name; + + private final int number; + + Milestone(String name, int number) { + this.name = name; + this.number = number; + } + + /** + * Returns the name of the milestone. + * @return the name + */ + public String getName() { + return this.name; + } + + /** + * Returns the number of the milestone. + * @return the number + */ + public int getNumber() { + return this.number; + } + + @Override + public String toString() { + return this.name + " (" + this.number + ")"; + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHub.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHub.java new file mode 100644 index 000000000000..5be432a0ac92 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHub.java @@ -0,0 +1,74 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.github; + +import java.io.IOException; +import java.util.Arrays; +import java.util.Base64; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import org.springframework.http.HttpRequest; +import org.springframework.http.MediaType; +import org.springframework.http.client.ClientHttpRequestExecution; +import org.springframework.http.client.ClientHttpRequestInterceptor; +import org.springframework.http.client.ClientHttpResponse; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.web.client.RestTemplate; +import org.springframework.web.util.DefaultUriBuilderFactory; +import org.springframework.web.util.UriTemplateHandler; + +/** + * Standard implementation of {@link GitHub}. + * + * @author Andy Wilkinson + */ +final class StandardGitHub implements GitHub { + + private final String username; + + private final String password; + + StandardGitHub(String username, String password) { + this.username = username; + this.password = password; + } + + @Override + public GitHubRepository getRepository(String organization, String name) { + RestTemplate restTemplate = new RestTemplate( + Arrays.asList(new MappingJackson2HttpMessageConverter(new ObjectMapper()))); + restTemplate.getInterceptors().add(new ClientHttpRequestInterceptor() { + + @Override + public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) + throws IOException { + request.getHeaders().add("User-Agent", StandardGitHub.this.username); + request.getHeaders().add("Authorization", "Basic " + Base64.getEncoder().encodeToString( + (StandardGitHub.this.username + ":" + StandardGitHub.this.password).getBytes())); + request.getHeaders().add("Accept", MediaType.APPLICATION_JSON_VALUE); + return execution.execute(request, body); + } + + }); + UriTemplateHandler uriTemplateHandler = new DefaultUriBuilderFactory( + "https://api.github.com/repos/" + organization + "/" + name + "/"); + restTemplate.setUriTemplateHandler(uriTemplateHandler); + return new StandardGitHubRepository(restTemplate); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java new file mode 100644 index 000000000000..6eced352719a --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java @@ -0,0 +1,74 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.github; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.client.RestTemplate; + +/** + * Standard implementation of {@link GitHubRepository}. + * + * @author Andy Wilkinson + */ +final class StandardGitHubRepository implements GitHubRepository { + + private final RestTemplate rest; + + StandardGitHubRepository(RestTemplate restTemplate) { + this.rest = restTemplate; + } + + @Override + @SuppressWarnings("rawtypes") + public int openIssue(String title, List labels, Milestone milestone) { + Map body = new HashMap<>(); + body.put("title", title); + if (milestone != null) { + body.put("milestone", milestone.getNumber()); + } + if (!labels.isEmpty()) { + body.put("labels", labels); + } + ResponseEntity response = this.rest.postForEntity("issues", body, Map.class); + return (Integer) response.getBody().get("number"); + } + + @Override + public List getLabels() { + return get("labels?per_page=100", (label) -> (String) label.get("name")); + } + + @Override + public List getMilestones() { + return get("milestones?per_page=100", + (milestone) -> new Milestone((String) milestone.get("title"), (Integer) milestone.get("number"))); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + private List get(String name, Function, T> mapper) { + ResponseEntity response = this.rest.getForEntity(name, List.class); + List> body = response.getBody(); + return body.stream().map(mapper).collect(Collectors.toList()); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/AbstractDependencyVersion.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/AbstractDependencyVersion.java new file mode 100644 index 000000000000..0192c64f6f5c --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/AbstractDependencyVersion.java @@ -0,0 +1,69 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.version; + +import org.apache.maven.artifact.versioning.ComparableVersion; + +/** + * Base class for {@link DependencyVersion} implementations. + * + * @author Andy Wilkinson + */ +abstract class AbstractDependencyVersion implements DependencyVersion { + + private final ComparableVersion comparableVersion; + + protected AbstractDependencyVersion(ComparableVersion comparableVersion) { + this.comparableVersion = comparableVersion; + } + + @Override + public int compareTo(DependencyVersion other) { + ComparableVersion otherComparable = (other instanceof AbstractDependencyVersion) + ? ((AbstractDependencyVersion) other).comparableVersion : new ComparableVersion(other.toString()); + return this.comparableVersion.compareTo(otherComparable); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + AbstractDependencyVersion other = (AbstractDependencyVersion) obj; + if (!this.comparableVersion.equals(other.comparableVersion)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return this.comparableVersion.hashCode(); + } + + @Override + public String toString() { + return this.comparableVersion.toString(); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ArtifactVersionDependencyVersion.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ArtifactVersionDependencyVersion.java new file mode 100644 index 000000000000..8ff9408ef9b2 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ArtifactVersionDependencyVersion.java @@ -0,0 +1,100 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.version; + +import java.util.Optional; + +import org.apache.maven.artifact.versioning.ArtifactVersion; +import org.apache.maven.artifact.versioning.ComparableVersion; +import org.apache.maven.artifact.versioning.DefaultArtifactVersion; + +/** + * A {@link DependencyVersion} backed by an {@link ArtifactVersion}. + * + * @author Andy Wilkinson + */ +class ArtifactVersionDependencyVersion extends AbstractDependencyVersion { + + private final ArtifactVersion artifactVersion; + + protected ArtifactVersionDependencyVersion(ArtifactVersion artifactVersion) { + super(new ComparableVersion(artifactVersion.toString())); + this.artifactVersion = artifactVersion; + } + + protected ArtifactVersionDependencyVersion(ArtifactVersion artifactVersion, ComparableVersion comparableVersion) { + super(comparableVersion); + this.artifactVersion = artifactVersion; + } + + @Override + public boolean isNewerThan(DependencyVersion other) { + if (other instanceof ReleaseTrainDependencyVersion) { + return false; + } + return compareTo(other) > 0; + } + + @Override + public boolean isSameMajorAndNewerThan(DependencyVersion other) { + if (other instanceof ReleaseTrainDependencyVersion) { + return false; + } + return extractArtifactVersionDependencyVersion(other).map(this::isSameMajorAndNewerThan).orElse(true); + } + + private boolean isSameMajorAndNewerThan(ArtifactVersionDependencyVersion other) { + return this.artifactVersion.getMajorVersion() == other.artifactVersion.getMajorVersion() && isNewerThan(other); + } + + @Override + public boolean isSameMinorAndNewerThan(DependencyVersion other) { + if (other instanceof ReleaseTrainDependencyVersion) { + return false; + } + return extractArtifactVersionDependencyVersion(other).map(this::isSameMinorAndNewerThan).orElse(true); + } + + private boolean isSameMinorAndNewerThan(ArtifactVersionDependencyVersion other) { + return this.artifactVersion.getMajorVersion() == other.artifactVersion.getMajorVersion() + && this.artifactVersion.getMinorVersion() == other.artifactVersion.getMinorVersion() + && isNewerThan(other); + } + + @Override + public String toString() { + return this.artifactVersion.toString(); + } + + private Optional extractArtifactVersionDependencyVersion( + DependencyVersion other) { + ArtifactVersionDependencyVersion artifactVersion = null; + if (other instanceof ArtifactVersionDependencyVersion) { + artifactVersion = (ArtifactVersionDependencyVersion) other; + } + return Optional.ofNullable(artifactVersion); + } + + static ArtifactVersionDependencyVersion parse(String version) { + ArtifactVersion artifactVersion = new DefaultArtifactVersion(version); + if (artifactVersion.getQualifier() != null && artifactVersion.getQualifier().equals(version)) { + return null; + } + return new ArtifactVersionDependencyVersion(artifactVersion); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/CombinedPatchAndQualifierDependencyVersion.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/CombinedPatchAndQualifierDependencyVersion.java new file mode 100644 index 000000000000..8a910d6b60b7 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/CombinedPatchAndQualifierDependencyVersion.java @@ -0,0 +1,58 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.version; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.maven.artifact.versioning.ArtifactVersion; +import org.apache.maven.artifact.versioning.DefaultArtifactVersion; + +/** + * A {@link DependencyVersion} where the patch and qualifier are not separated. + * + * @author Andy Wilkinson + */ +final class CombinedPatchAndQualifierDependencyVersion extends ArtifactVersionDependencyVersion { + + private static final Pattern PATTERN = Pattern.compile("([0-9]+\\.[0-9]+\\.[0-9]+)([A-Za-z][A-Za-z0-9]+)"); + + private final String original; + + private CombinedPatchAndQualifierDependencyVersion(ArtifactVersion artifactVersion, String original) { + super(artifactVersion); + this.original = original; + } + + @Override + public String toString() { + return this.original; + } + + static CombinedPatchAndQualifierDependencyVersion parse(String version) { + Matcher matcher = PATTERN.matcher(version); + if (!matcher.matches()) { + return null; + } + ArtifactVersion artifactVersion = new DefaultArtifactVersion(matcher.group(1) + "." + matcher.group(2)); + if (artifactVersion.getQualifier() != null && artifactVersion.getQualifier().equals(version)) { + return null; + } + return new CombinedPatchAndQualifierDependencyVersion(artifactVersion, version); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/DependencyVersion.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/DependencyVersion.java new file mode 100644 index 000000000000..a344a5c0e68e --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/DependencyVersion.java @@ -0,0 +1,69 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.version; + +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; + +/** + * Version of a dependency. + * + * @author Andy Wilkinson + */ +public interface DependencyVersion extends Comparable { + + /** + * Returns whether this version is newer than the given {@code other} version. + * @param other version to test + * @return {@code true} if this version is newer, otherwise {@code false} + */ + boolean isNewerThan(DependencyVersion other); + + /** + * Returns whether this version has the same major versions as the {@code other} + * version while also being newer. + * @param other version to test + * @return {@code true} if this version has the same major and is newer, otherwise + * {@code false} + */ + boolean isSameMajorAndNewerThan(DependencyVersion other); + + /** + * Returns whether this version has the same major and minor versions as the + * {@code other} version while also being newer. + * @param other version to test + * @return {@code true} if this version has the same major and minor and is newer, + * otherwise {@code false} + */ + boolean isSameMinorAndNewerThan(DependencyVersion other); + + static DependencyVersion parse(String version) { + List> parsers = Arrays.asList(ArtifactVersionDependencyVersion::parse, + ReleaseTrainDependencyVersion::parse, NumericQualifierDependencyVersion::parse, + CombinedPatchAndQualifierDependencyVersion::parse, LeadingZeroesDependencyVersion::parse, + UnstructuredDependencyVersion::parse); + for (Function parser : parsers) { + DependencyVersion result = parser.apply(version); + if (result != null) { + return result; + } + } + throw new IllegalArgumentException("Version '" + version + "' could not be parsed"); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/LeadingZeroesDependencyVersion.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/LeadingZeroesDependencyVersion.java new file mode 100644 index 000000000000..5514b8b652a7 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/LeadingZeroesDependencyVersion.java @@ -0,0 +1,56 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.version; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.maven.artifact.versioning.ArtifactVersion; +import org.apache.maven.artifact.versioning.DefaultArtifactVersion; + +/** + * A {@link DependencyVersion} that tolerates leading zeroes. + * + * @author Andy Wilkinson + */ +final class LeadingZeroesDependencyVersion extends ArtifactVersionDependencyVersion { + + private static final Pattern PATTERN = Pattern.compile("0*([0-9]+)\\.0*([0-9]+)\\.0*([0-9]+)"); + + private final String original; + + private LeadingZeroesDependencyVersion(ArtifactVersion artifactVersion, String original) { + super(artifactVersion); + this.original = original; + } + + @Override + public String toString() { + return this.original; + } + + static LeadingZeroesDependencyVersion parse(String input) { + Matcher matcher = PATTERN.matcher(input); + if (!matcher.matches()) { + return null; + } + ArtifactVersion artifactVersion = new DefaultArtifactVersion( + matcher.group(1) + matcher.group(2) + matcher.group(3)); + return new LeadingZeroesDependencyVersion(artifactVersion, input); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/NumericQualifierDependencyVersion.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/NumericQualifierDependencyVersion.java new file mode 100644 index 000000000000..363def7d8010 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/NumericQualifierDependencyVersion.java @@ -0,0 +1,56 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.version; + +import org.apache.maven.artifact.versioning.ArtifactVersion; +import org.apache.maven.artifact.versioning.ComparableVersion; +import org.apache.maven.artifact.versioning.DefaultArtifactVersion; + +/** + * A fallback {@link DependencyVersion} to handle versions with four components that + * cannot be handled by {@link ArtifactVersion} because the fourth component is numeric. + * + * @author Andy Wilkinson + */ +final class NumericQualifierDependencyVersion extends ArtifactVersionDependencyVersion { + + private final String original; + + private NumericQualifierDependencyVersion(ArtifactVersion artifactVersion, String original) { + super(artifactVersion, new ComparableVersion(original)); + this.original = original; + } + + @Override + public String toString() { + return this.original; + } + + static NumericQualifierDependencyVersion parse(String input) { + String[] components = input.split("\\."); + if (components.length == 4) { + ArtifactVersion artifactVersion = new DefaultArtifactVersion( + components[0] + "." + components[1] + "." + components[2]); + if (artifactVersion.getQualifier() != null && artifactVersion.getQualifier().equals(input)) { + return null; + } + return new NumericQualifierDependencyVersion(artifactVersion, input); + } + return null; + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java new file mode 100644 index 000000000000..b3626d19846d --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersion.java @@ -0,0 +1,125 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.version; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.springframework.util.StringUtils; + +/** + * A {@link DependencyVersion} for a release train such as Spring Data. + * + * @author Andy Wilkinson + */ +final class ReleaseTrainDependencyVersion implements DependencyVersion { + + private static final Pattern VERSION_PATTERN = Pattern.compile("([A-Z][a-z]+)-([A-Z]+)([0-9]*)"); + + private final String releaseTrain; + + private final String type; + + private final int version; + + private final String original; + + private ReleaseTrainDependencyVersion(String releaseTrain, String type, int version, String original) { + this.releaseTrain = releaseTrain; + this.type = type; + this.version = version; + this.original = original; + } + + @Override + public int compareTo(DependencyVersion other) { + if (!(other instanceof ReleaseTrainDependencyVersion)) { + return 0; + } + ReleaseTrainDependencyVersion otherReleaseTrain = (ReleaseTrainDependencyVersion) other; + int comparison = this.releaseTrain.compareTo(otherReleaseTrain.releaseTrain); + if (comparison != 0) { + return comparison; + } + comparison = this.type.compareTo(otherReleaseTrain.type); + if (comparison != 0) { + return comparison; + } + return Integer.compare(this.version, otherReleaseTrain.version); + } + + @Override + public boolean isNewerThan(DependencyVersion other) { + if (!(other instanceof ReleaseTrainDependencyVersion)) { + return true; + } + ReleaseTrainDependencyVersion otherReleaseTrain = (ReleaseTrainDependencyVersion) other; + return otherReleaseTrain.compareTo(this) < 0; + } + + @Override + public boolean isSameMajorAndNewerThan(DependencyVersion other) { + return isNewerThan(other); + } + + @Override + public boolean isSameMinorAndNewerThan(DependencyVersion other) { + if (!(other instanceof ReleaseTrainDependencyVersion)) { + return true; + } + ReleaseTrainDependencyVersion otherReleaseTrain = (ReleaseTrainDependencyVersion) other; + return otherReleaseTrain.releaseTrain.equals(this.releaseTrain) && isNewerThan(other); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + ReleaseTrainDependencyVersion other = (ReleaseTrainDependencyVersion) obj; + if (!this.original.equals(other.original)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return this.original.hashCode(); + } + + @Override + public String toString() { + return this.original; + } + + static ReleaseTrainDependencyVersion parse(String input) { + Matcher matcher = VERSION_PATTERN.matcher(input); + if (!matcher.matches()) { + return null; + } + return new ReleaseTrainDependencyVersion(matcher.group(1), matcher.group(2), + (StringUtils.hasLength(matcher.group(3))) ? Integer.parseInt(matcher.group(3)) : 0, input); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/UnstructuredDependencyVersion.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/UnstructuredDependencyVersion.java new file mode 100644 index 000000000000..02822beaec99 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/version/UnstructuredDependencyVersion.java @@ -0,0 +1,60 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.version; + +import org.apache.maven.artifact.versioning.ComparableVersion; + +/** + * A {@link DependencyVersion} with no structure such that version comparisons are not + * possible. + * + * @author Andy Wilkinson + */ +final class UnstructuredDependencyVersion extends AbstractDependencyVersion implements DependencyVersion { + + private final String version; + + private UnstructuredDependencyVersion(String version) { + super(new ComparableVersion(version)); + this.version = version; + } + + @Override + public boolean isNewerThan(DependencyVersion other) { + return this.compareTo(other) > 0; + } + + @Override + public boolean isSameMajorAndNewerThan(DependencyVersion other) { + return this.compareTo(other) > 0; + } + + @Override + public boolean isSameMinorAndNewerThan(DependencyVersion other) { + return this.compareTo(other) > 0; + } + + @Override + public String toString() { + return this.version; + } + + static UnstructuredDependencyVersion parse(String version) { + return new UnstructuredDependencyVersion(version); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForConflicts.java b/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForConflicts.java new file mode 100644 index 000000000000..b5096ed11593 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForConflicts.java @@ -0,0 +1,135 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.classpath; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.TreeMap; +import java.util.function.Predicate; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.stream.Collectors; + +import org.gradle.api.DefaultTask; +import org.gradle.api.GradleException; +import org.gradle.api.Task; +import org.gradle.api.file.FileCollection; +import org.gradle.api.tasks.Classpath; +import org.gradle.api.tasks.TaskAction; + +/** + * A {@link Task} for checking the classpath for conflicting classes and resources. + * + * @author Andy Wilkinson + */ +public class CheckClasspathForConflicts extends DefaultTask { + + private final List> ignores = new ArrayList<>(); + + private FileCollection classpath; + + public void setClasspath(FileCollection classpath) { + this.classpath = classpath; + } + + @Classpath + public FileCollection getClasspath() { + return this.classpath; + } + + @TaskAction + public void checkForConflicts() throws IOException { + ClasspathContents classpathContents = new ClasspathContents(); + for (File file : this.classpath) { + if (file.isDirectory()) { + Path root = file.toPath(); + Files.walk(root).filter((path) -> Files.isRegularFile(path)) + .forEach((entry) -> classpathContents.add(root.relativize(entry).toString(), root.toString())); + } + else { + try (JarFile jar = new JarFile(file)) { + for (JarEntry entry : Collections.list(jar.entries())) { + if (!entry.isDirectory()) { + classpathContents.add(entry.getName(), file.getAbsolutePath()); + } + } + } + } + } + Map> conflicts = classpathContents.getConflicts(this.ignores); + if (!conflicts.isEmpty()) { + StringBuilder message = new StringBuilder(String.format("Found classpath conflicts:%n")); + conflicts.forEach((entry, locations) -> { + message.append(String.format(" %s%n", entry)); + locations.forEach((location) -> message.append(String.format(" %s%n", location))); + }); + throw new GradleException(message.toString()); + } + } + + public void ignore(Predicate predicate) { + this.ignores.add(predicate); + } + + private static final class ClasspathContents { + + private static final Set IGNORED_NAMES = new HashSet<>(Arrays.asList("about.html", "changelog.txt", + "LICENSE", "license.txt", "module-info.class", "notice.txt", "readme.txt")); + + private final Map> classpathContents = new HashMap<>(); + + private void add(String name, String source) { + this.classpathContents.computeIfAbsent(name, (key) -> new ArrayList<>()).add(source); + } + + private Map> getConflicts(List> ignores) { + return this.classpathContents.entrySet().stream().filter((entry) -> entry.getValue().size() > 1) + .filter((entry) -> canConflict(entry.getKey(), ignores)) + .collect(Collectors.toMap(Entry::getKey, Entry::getValue, (v1, v2) -> v1, TreeMap::new)); + } + + private boolean canConflict(String name, List> ignores) { + if (name.startsWith("META-INF/")) { + return false; + } + for (String ignoredName : IGNORED_NAMES) { + if (name.equals(ignoredName)) { + return false; + } + } + for (Predicate ignore : ignores) { + if (ignore.test(name)) { + return false; + } + } + return true; + } + + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java b/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java new file mode 100644 index 000000000000..301304deb712 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/classpath/CheckClasspathForProhibitedDependencies.java @@ -0,0 +1,85 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.classpath; + +import java.io.IOException; +import java.util.TreeSet; +import java.util.stream.Collectors; + +import org.gradle.api.DefaultTask; +import org.gradle.api.GradleException; +import org.gradle.api.Task; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.artifacts.ModuleVersionIdentifier; +import org.gradle.api.file.FileCollection; +import org.gradle.api.tasks.Classpath; +import org.gradle.api.tasks.TaskAction; + +/** + * A {@link Task} for checking the classpath for prohibited dependencies. + * + * @author Andy Wilkinson + */ +public class CheckClasspathForProhibitedDependencies extends DefaultTask { + + private Configuration classpath; + + public CheckClasspathForProhibitedDependencies() { + getOutputs().upToDateWhen((task) -> true); + } + + public void setClasspath(Configuration classpath) { + this.classpath = classpath; + } + + @Classpath + public FileCollection getClasspath() { + return this.classpath; + } + + @TaskAction + public void checkForProhibitedDependencies() throws IOException { + TreeSet prohibited = this.classpath.getResolvedConfiguration().getResolvedArtifacts().stream() + .map((artifact) -> artifact.getModuleVersion().getId()).filter(this::prohibited) + .map((id) -> id.getGroup() + ":" + id.getName()).collect(Collectors.toCollection(TreeSet::new)); + if (!prohibited.isEmpty()) { + StringBuilder message = new StringBuilder(String.format("Found prohibited dependencies:%n")); + for (String dependency : prohibited) { + message.append(String.format(" %s%n", dependency)); + } + throw new GradleException(message.toString()); + } + } + + private boolean prohibited(ModuleVersionIdentifier id) { + String group = id.getGroup(); + if (group.equals("javax.batch")) { + return false; + } + if (group.startsWith("javax")) { + return true; + } + if (group.equals("commons-logging")) { + return true; + } + if (group.equals("org.slf4j") && id.getName().equals("jcl-over-slf4j")) { + return true; + } + return false; + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/cli/AbstractPackageManagerDefinitionTask.java b/buildSrc/src/main/java/org/springframework/boot/build/cli/AbstractPackageManagerDefinitionTask.java new file mode 100644 index 000000000000..f0592979d396 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/cli/AbstractPackageManagerDefinitionTask.java @@ -0,0 +1,112 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.cli; + +import java.io.File; +import java.security.MessageDigest; +import java.util.HashMap; +import java.util.Map; + +import org.apache.commons.codec.digest.DigestUtils; +import org.gradle.api.DefaultTask; +import org.gradle.api.Project; +import org.gradle.api.file.RegularFile; +import org.gradle.api.provider.Provider; +import org.gradle.api.tasks.InputFile; +import org.gradle.api.tasks.OutputDirectory; +import org.gradle.api.tasks.TaskExecutionException; + +/** + * Base class for generating a package manager definition file such as a Scoop manifest or + * a Homebrew formula. + * + * @author Andy Wilkinson + */ +public abstract class AbstractPackageManagerDefinitionTask extends DefaultTask { + + private Provider archive; + + private File template; + + private File outputDir; + + public AbstractPackageManagerDefinitionTask() { + getInputs().property("version", getProject().provider(getProject()::getVersion)); + } + + @InputFile + public RegularFile getArchive() { + return this.archive.get(); + } + + public void setArchive(Provider archive) { + this.archive = archive; + } + + @InputFile + public File getTemplate() { + return this.template; + } + + public void setTemplate(File template) { + this.template = template; + } + + @OutputDirectory + public File getOutputDir() { + return this.outputDir; + } + + public void setOutputDir(File outputDir) { + this.outputDir = outputDir; + } + + protected void createDescriptor(Map additionalProperties) { + getProject().copy((copy) -> { + copy.from(this.template); + copy.into(this.outputDir); + Map properties = new HashMap<>(additionalProperties); + properties.put("hash", sha256(this.archive.get().getAsFile())); + properties.put("repo", determineArtifactoryRepo(getProject())); + properties.put("project", getProject()); + copy.expand(properties); + }); + } + + private String sha256(File file) { + try { + MessageDigest digest = MessageDigest.getInstance("SHA-256"); + return new DigestUtils(digest).digestAsHex(file); + } + catch (Exception ex) { + throw new TaskExecutionException(this, ex); + } + } + + private String determineArtifactoryRepo(Project project) { + String version = project.getVersion().toString(); + String type = version.substring(version.lastIndexOf('.')); + if (type.equals("RELEASE")) { + return "release"; + } + if (type.startsWith("M") || type.startsWith("RC")) { + return "milestone"; + } + return "snapshot"; + } + +} diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/main/java/sample/SampleController.java b/buildSrc/src/main/java/org/springframework/boot/build/cli/HomebrewFormula.java similarity index 57% rename from spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/main/java/sample/SampleController.java rename to buildSrc/src/main/java/org/springframework/boot/build/cli/HomebrewFormula.java index 819f68150b4b..5592d3061756 100644 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/main/java/sample/SampleController.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/cli/HomebrewFormula.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -14,17 +14,22 @@ * limitations under the License. */ -package sample; +package org.springframework.boot.build.cli; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; +import java.util.Collections; -@RestController -public class SampleController { +import org.gradle.api.tasks.TaskAction; - @GetMapping("/") - public String hello() { - return "Hello World"; +/** + * A {@Task} for creating a Homebrew formula manifest. + * + * @author Andy Wilkinson + */ +public class HomebrewFormula extends AbstractPackageManagerDefinitionTask { + + @TaskAction + void createFormula() { + createDescriptor(Collections.emptyMap()); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/src/main/java/org/springframework/launcher/it/jar/ExampleController.java b/buildSrc/src/main/java/org/springframework/boot/build/cli/ScoopManifest.java similarity index 53% rename from spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/src/main/java/org/springframework/launcher/it/jar/ExampleController.java rename to buildSrc/src/main/java/org/springframework/boot/build/cli/ScoopManifest.java index 41df3759ee6e..de671c8da14c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/src/main/java/org/springframework/launcher/it/jar/ExampleController.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/cli/ScoopManifest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -14,24 +14,23 @@ * limitations under the License. */ -package org.springframework.boot.load.it.jar; +package org.springframework.boot.build.cli; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import java.util.Collections; + +import org.gradle.api.tasks.TaskAction; /** - * Simple example Spring MVC Controller. + * A {@Task} for creating a Scoop manifest. * - * @author Phillip Webb + * @author Andy Wilkinson */ -@Controller -public class ExampleController { +public class ScoopManifest extends AbstractPackageManagerDefinitionTask { - @RequestMapping("/") - @ResponseBody - public String helloWorld() { - return "Hello Embedded Jar World!"; + @TaskAction + void createManifest() { + String version = getProject().getVersion().toString(); + createDescriptor(Collections.singletonMap("scoopVersion", version.substring(0, version.lastIndexOf('.')))); } } diff --git a/buildSrc/src/main/java/org/springframework/boot/build/constraints/DocumentConstrainedVersions.java b/buildSrc/src/main/java/org/springframework/boot/build/constraints/DocumentConstrainedVersions.java new file mode 100644 index 000000000000..101039e9fd8f --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/constraints/DocumentConstrainedVersions.java @@ -0,0 +1,81 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.constraints; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; + +import javax.inject.Inject; + +import org.gradle.api.DefaultTask; +import org.gradle.api.model.ObjectFactory; +import org.gradle.api.provider.SetProperty; +import org.gradle.api.tasks.Input; +import org.gradle.api.tasks.OutputFile; +import org.gradle.api.tasks.TaskAction; + +import org.springframework.boot.build.constraints.ExtractVersionConstraints.ConstrainedVersion; + +/** + * Task for documenting a platform's constrained versions. + * + * @author Andy Wilkinson + */ +public class DocumentConstrainedVersions extends DefaultTask { + + private final SetProperty constrainedVersions; + + private File outputFile; + + @Inject + public DocumentConstrainedVersions(ObjectFactory objectFactory) { + this.constrainedVersions = objectFactory.setProperty(ConstrainedVersion.class); + } + + @Input + public SetProperty getConstrainedVersions() { + return this.constrainedVersions; + } + + @OutputFile + public File getOutputFile() { + return this.outputFile; + } + + public void setOutputFile(File outputFile) { + this.outputFile = outputFile; + } + + @TaskAction + public void documentConstrainedVersions() throws IOException { + this.outputFile.getParentFile().mkdirs(); + try (PrintWriter writer = new PrintWriter(new FileWriter(this.outputFile))) { + writer.println("|==="); + writer.println("| Group ID | Artifact ID | Version"); + for (ConstrainedVersion constrainedVersion : this.constrainedVersions.get()) { + writer.println(); + writer.printf("| `%s`%n", constrainedVersion.getGroup()); + writer.printf("| `%s`%n", constrainedVersion.getArtifact()); + writer.printf("| `%s`%n", constrainedVersion.getVersion()); + } + writer.println("|==="); + } + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/constraints/ExtractVersionConstraints.java b/buildSrc/src/main/java/org/springframework/boot/build/constraints/ExtractVersionConstraints.java new file mode 100644 index 000000000000..3151560b7f6e --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/constraints/ExtractVersionConstraints.java @@ -0,0 +1,139 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.constraints; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; + +import org.gradle.api.Task; +import org.gradle.api.artifacts.ComponentMetadataDetails; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.artifacts.DependencyConstraint; +import org.gradle.api.artifacts.DependencyConstraintMetadata; +import org.gradle.api.artifacts.dsl.DependencyHandler; +import org.gradle.api.internal.AbstractTask; +import org.gradle.api.tasks.Internal; +import org.gradle.api.tasks.TaskAction; +import org.gradle.platform.base.Platform; + +/** + * {@link Task} to extract constraints from a {@link Platform}. The platform's own + * constraints and those in any boms upon which it depends are extracted. + * + * @author Andy Wilkinson + */ +public class ExtractVersionConstraints extends AbstractTask { + + private final Configuration configuration; + + private final Map versionConstraints = new TreeMap<>(); + + private final Set constrainedVersions = new TreeSet<>(); + + private final List projectPaths = new ArrayList(); + + public ExtractVersionConstraints() { + DependencyHandler dependencies = getProject().getDependencies(); + this.configuration = getProject().getConfigurations().create(getName()); + dependencies.getComponents().all(this::processMetadataDetails); + } + + public void enforcedPlatform(String projectPath) { + this.configuration.getDependencies().add(getProject().getDependencies().enforcedPlatform( + getProject().getDependencies().project(Collections.singletonMap("path", projectPath)))); + this.projectPaths.add(projectPath); + } + + @Internal + public Map getVersionConstraints() { + return Collections.unmodifiableMap(this.versionConstraints); + } + + @Internal + public Set getConstrainedVersions() { + return this.constrainedVersions; + } + + @TaskAction + void extractVersionConstraints() { + this.configuration.resolve(); + for (String projectPath : this.projectPaths) { + for (DependencyConstraint constraint : getProject().project(projectPath).getConfigurations() + .getByName("apiElements").getAllDependencyConstraints()) { + this.versionConstraints.put(constraint.getGroup() + ":" + constraint.getName(), + constraint.getVersionConstraint().toString()); + this.constrainedVersions.add(new ConstrainedVersion(constraint.getGroup(), constraint.getName(), + constraint.getVersionConstraint().toString())); + } + } + } + + private void processMetadataDetails(ComponentMetadataDetails details) { + details.allVariants((variantMetadata) -> variantMetadata.withDependencyConstraints((dependencyConstraints) -> { + for (DependencyConstraintMetadata constraint : dependencyConstraints) { + this.versionConstraints.put(constraint.getGroup() + ":" + constraint.getName(), + constraint.getVersionConstraint().toString()); + this.constrainedVersions.add(new ConstrainedVersion(constraint.getGroup(), constraint.getName(), + constraint.getVersionConstraint().toString())); + } + })); + } + + public static final class ConstrainedVersion implements Comparable, Serializable { + + private final String group; + + private final String artifact; + + private final String version; + + private ConstrainedVersion(String group, String artifact, String version) { + this.group = group; + this.artifact = artifact; + this.version = version; + } + + public String getGroup() { + return this.group; + } + + public String getArtifact() { + return this.artifact; + } + + public String getVersion() { + return this.version; + } + + @Override + public int compareTo(ConstrainedVersion other) { + int groupComparison = this.group.compareTo(other.group); + if (groupComparison != 0) { + return groupComparison; + } + return this.artifact.compareTo(other.artifact); + } + + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/AsciidocBuilder.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/AsciidocBuilder.java similarity index 91% rename from spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/AsciidocBuilder.java rename to buildSrc/src/main/java/org/springframework/boot/build/context/properties/AsciidocBuilder.java index e4cab45468db..305da3abcfe5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/AsciidocBuilder.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/AsciidocBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.configurationdocs; +package org.springframework.boot.build.context.properties; /** * Simple builder to help construct Asciidoc markup. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/CompoundConfigurationTableEntry.java similarity index 77% rename from spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java rename to buildSrc/src/main/java/org/springframework/boot/build/context/properties/CompoundConfigurationTableEntry.java index 603e902f5dce..f045b5d73089 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/CompoundConfigurationTableEntry.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -14,14 +14,12 @@ * limitations under the License. */ -package org.springframework.boot.configurationdocs; +package org.springframework.boot.build.context.properties; import java.util.Set; import java.util.TreeSet; import java.util.stream.Stream; -import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty; - /** * Table entry regrouping a list of configuration properties sharing the same description. * @@ -39,8 +37,8 @@ class CompoundConfigurationTableEntry extends ConfigurationTableEntry { this.configurationKeys = new TreeSet<>(); } - void addConfigurationKeys(ConfigurationMetadataProperty... properties) { - Stream.of(properties).map(ConfigurationMetadataProperty::getId).forEach(this.configurationKeys::add); + void addConfigurationKeys(ConfigurationProperty... properties) { + Stream.of(properties).map(ConfigurationProperty::getName).forEach(this.configurationKeys::add); } @Override diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationMetadataDocumentWriter.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationMetadataDocumentWriter.java similarity index 77% rename from spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationMetadataDocumentWriter.java rename to buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationMetadataDocumentWriter.java index 0269c91cf4db..f56610732219 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationMetadataDocumentWriter.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationMetadataDocumentWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -14,10 +14,9 @@ * limitations under the License. */ -package org.springframework.boot.configurationdocs; +package org.springframework.boot.build.context.properties; import java.io.IOException; -import java.io.InputStream; import java.io.OutputStream; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -28,8 +27,7 @@ import java.util.Map; import java.util.stream.Collectors; -import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty; -import org.springframework.boot.configurationmetadata.ConfigurationMetadataRepositoryJsonBuilder; +import org.gradle.api.file.FileCollection; /** * Write Asciidoc documents with configuration properties listings. @@ -39,14 +37,13 @@ */ public class ConfigurationMetadataDocumentWriter { - public void writeDocument(Path outputDirectory, DocumentOptions options, InputStream... metadata) + public void writeDocument(Path outputDirectory, DocumentOptions options, FileCollection metadataFiles) throws IOException { assertValidOutputDirectory(outputDirectory); if (!Files.exists(outputDirectory)) { Files.createDirectory(outputDirectory); } - assertMetadata(metadata); - List tables = createConfigTables(getMetadataProperties(metadata), options); + List tables = createConfigTables(ConfigurationProperties.fromFiles(metadataFiles), options); for (ConfigurationTable table : tables) { writeConfigurationTable(table, outputDirectory); } @@ -61,24 +58,11 @@ private void assertValidOutputDirectory(Path outputDirPath) { } } - private void assertMetadata(InputStream... metadata) { - if (metadata == null || metadata.length < 1) { - throw new IllegalArgumentException("missing input metadata"); - } - } - - private Map getMetadataProperties(InputStream... metadata) - throws IOException { - ConfigurationMetadataRepositoryJsonBuilder builder = ConfigurationMetadataRepositoryJsonBuilder - .create(metadata); - return builder.build().getAllProperties(); - } - - private List createConfigTables(Map metadataProperties, + private List createConfigTables(Map metadataProperties, DocumentOptions options) { List tables = new ArrayList<>(); List unmappedKeys = metadataProperties.values().stream().filter((property) -> !property.isDeprecated()) - .map(ConfigurationMetadataProperty::getId).collect(Collectors.toList()); + .map(ConfigurationProperty::getName).collect(Collectors.toList()); Map overrides = getOverrides(metadataProperties, unmappedKeys, options); options.getMetadataSections().forEach((id, keyPrefixes) -> tables @@ -95,8 +79,7 @@ private List createConfigTables(Map getOverrides( - Map metadataProperties, List unmappedKeys, - DocumentOptions options) { + Map metadataProperties, List unmappedKeys, DocumentOptions options) { Map overrides = new HashMap<>(); options.getOverrides().forEach((keyPrefix, description) -> { CompoundConfigurationTableEntry entry = new CompoundConfigurationTableEntry(keyPrefix, description); @@ -111,7 +94,7 @@ private Map getOverrides( return overrides; } - private ConfigurationTable createConfigTable(Map metadataProperties, + private ConfigurationTable createConfigTable(Map metadataProperties, List unmappedKeys, Map overrides, String id, List keyPrefixes) { ConfigurationTable table = new ConfigurationTable(id); @@ -123,7 +106,7 @@ private ConfigurationTable createConfigTable(Map matchingKeys = unmappedKeys.stream() .filter((key) -> keyPrefixes.stream().anyMatch(key::startsWith)).collect(Collectors.toList()); for (String matchingKey : matchingKeys) { - ConfigurationMetadataProperty property = metadataProperties.get(matchingKey); + ConfigurationProperty property = metadataProperties.get(matchingKey); table.addEntry(new SingleConfigurationTableEntry(property)); } unmappedKeys.removeAll(matchingKeys); diff --git a/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationProperties.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationProperties.java new file mode 100644 index 000000000000..5fa43adee13c --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationProperties.java @@ -0,0 +1,81 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.context.properties; + +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.Reader; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; +import org.gradle.api.file.FileCollection; + +/** + * Configuration properties read from one or more + * {@code META-INF/spring-configuration-metadata.json} files. + * + * @author Andy Wilkinson + */ +final class ConfigurationProperties { + + private static final Type MAP_TYPE = new MapTypeToken().getType(); + + private ConfigurationProperties() { + + } + + @SuppressWarnings("unchecked") + static Map fromFiles(FileCollection files) { + List configurationProperties = new ArrayList<>(); + try { + Gson gson = new GsonBuilder().create(); + for (File file : files) { + try (Reader reader = new FileReader(file)) { + Map json = gson.fromJson(reader, MAP_TYPE); + List> properties = (List>) json.get("properties"); + for (Map property : properties) { + String name = (String) property.get("name"); + String type = (String) property.get("type"); + Object defaultValue = property.get("defaultValue"); + String description = (String) property.get("description"); + boolean deprecated = property.containsKey("deprecated"); + configurationProperties + .add(new ConfigurationProperty(name, type, defaultValue, description, deprecated)); + } + } + } + return configurationProperties.stream() + .collect(Collectors.toMap(ConfigurationProperty::getName, Function.identity())); + } + catch (IOException ex) { + throw new RuntimeException("Failed to load configuration metadata", ex); + } + } + + private static final class MapTypeToken extends TypeToken> { + + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationPropertiesPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationPropertiesPlugin.java new file mode 100644 index 000000000000..81f51281fb46 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationPropertiesPlugin.java @@ -0,0 +1,94 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.context.properties; + +import java.io.File; +import java.util.Collections; +import java.util.concurrent.Callable; +import java.util.stream.Collectors; + +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.plugins.JavaPlugin; +import org.gradle.api.plugins.JavaPluginConvention; +import org.gradle.api.tasks.SourceSet; +import org.gradle.api.tasks.compile.JavaCompile; + +import org.springframework.util.StringUtils; + +/** + * {@link Plugin} for projects that define {@code @ConfigurationProperties}. When applied, + * the plugin reacts to the presence of the {@link JavaPlugin} by: + * + *
    + *
  • Adding a dependency on the configuration properties annotation processor. + *
  • Configure the additional metadata locations annotation processor compiler argument + *
  • Defining an artifact for the resulting configuration property metadata so that it + * can be consumed by downstream projects. + *
+ * + * @author Andy Wilkinson + */ +public class ConfigurationPropertiesPlugin implements Plugin { + + /** + * Name of the {@link Configuration} that holds the configuration property metadata + * artifact. + */ + public static final String CONFIGURATION_PROPERTIES_METADATA_CONFIGURATION_NAME = "configurationPropertiesMetadata"; + + @Override + public void apply(Project project) { + project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> { + addConfigurationProcessorDependency(project); + configureAdditionalMetadataLocationsCompilerArgument(project); + addMetadataArtifact(project); + }); + } + + private void addConfigurationProcessorDependency(Project project) { + Configuration annotationProcessors = project.getConfigurations() + .getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME); + annotationProcessors.getDependencies().add(project.getDependencies().project(Collections.singletonMap("path", + ":spring-boot-project:spring-boot-tools:spring-boot-configuration-processor"))); + } + + private void addMetadataArtifact(Project project) { + SourceSet mainSourceSet = project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets() + .getByName(SourceSet.MAIN_SOURCE_SET_NAME); + project.getConfigurations().maybeCreate(CONFIGURATION_PROPERTIES_METADATA_CONFIGURATION_NAME); + project.afterEvaluate((evaluatedProject) -> evaluatedProject.getArtifacts().add( + CONFIGURATION_PROPERTIES_METADATA_CONFIGURATION_NAME, + evaluatedProject.provider((Callable) () -> new File(mainSourceSet.getJava().getOutputDir(), + "META-INF/spring-configuration-metadata.json")), + (artifact) -> artifact + .builtBy(evaluatedProject.getTasks().getByName(mainSourceSet.getClassesTaskName())))); + } + + private void configureAdditionalMetadataLocationsCompilerArgument(Project project) { + JavaCompile compileJava = project.getTasks().withType(JavaCompile.class) + .getByName(JavaPlugin.COMPILE_JAVA_TASK_NAME); + SourceSet mainSourceSet = project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets() + .getByName(SourceSet.MAIN_SOURCE_SET_NAME); + compileJava.getOptions().getCompilerArgs() + .add("-Aorg.springframework.boot.configurationprocessor.additionalMetadataLocations=" + StringUtils + .collectionToCommaDelimitedString(mainSourceSet.getResources().getSourceDirectories().getFiles() + .stream().map(project.getRootProject()::relativePath).collect(Collectors.toSet()))); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationProperty.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationProperty.java new file mode 100644 index 000000000000..e66c236f478f --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationProperty.java @@ -0,0 +1,68 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.context.properties; + +/** + * A configuration property. + * + * @author Andy Wilkinson + */ +public class ConfigurationProperty { + + private final String name; + + private final String type; + + private final Object defaultValue; + + private final String description; + + private final boolean deprecated; + + ConfigurationProperty(String name, String type) { + this(name, type, null, null, false); + } + + ConfigurationProperty(String name, String type, Object defaultValue, String description, boolean deprecated) { + this.name = name; + this.type = type; + this.defaultValue = defaultValue; + this.description = description; + this.deprecated = deprecated; + } + + public String getName() { + return this.name; + } + + public String getType() { + return this.type; + } + + public Object getDefaultValue() { + return this.defaultValue; + } + + public String getDescription() { + return this.description; + } + + public boolean isDeprecated() { + return this.deprecated; + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationTable.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationTable.java similarity index 92% rename from spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationTable.java rename to buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationTable.java index 83a36d9bb1d2..533c0b8365d1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationTable.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.configurationdocs; +package org.springframework.boot.build.context.properties; import java.util.Arrays; import java.util.Set; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationTableEntry.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationTableEntry.java similarity index 92% rename from spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationTableEntry.java rename to buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationTableEntry.java index 8c81a9601738..a0ebc3361b66 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationTableEntry.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationTableEntry.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.configurationdocs; +package org.springframework.boot.build.context.properties; /** * Abstract class for entries in {@link ConfigurationTable}. diff --git a/buildSrc/src/main/java/org/springframework/boot/build/context/properties/DocumentConfigurationProperties.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/DocumentConfigurationProperties.java new file mode 100644 index 000000000000..bb38138e2cc0 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/DocumentConfigurationProperties.java @@ -0,0 +1,95 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.context.properties; + +import java.io.File; +import java.io.IOException; + +import org.gradle.api.Task; +import org.gradle.api.file.FileCollection; +import org.gradle.api.internal.AbstractTask; +import org.gradle.api.tasks.InputFiles; +import org.gradle.api.tasks.OutputDirectory; +import org.gradle.api.tasks.TaskAction; + +import org.springframework.boot.build.context.properties.DocumentOptions.Builder; + +/** + * {@link Task} used to document auto-configuration classes. + * + * @author Andy Wilkinson + */ +public class DocumentConfigurationProperties extends AbstractTask { + + private FileCollection configurationPropertyMetadata; + + private File outputDir; + + @InputFiles + public FileCollection getConfigurationPropertyMetadata() { + return this.configurationPropertyMetadata; + } + + public void setConfigurationPropertyMetadata(FileCollection configurationPropertyMetadata) { + this.configurationPropertyMetadata = configurationPropertyMetadata; + } + + @OutputDirectory + public File getOutputDir() { + return this.outputDir; + } + + public void setOutputDir(File outputDir) { + this.outputDir = outputDir; + } + + @TaskAction + void documentConfigurationProperties() throws IOException { + Builder builder = DocumentOptions.builder(); + builder.addSection("core") + .withKeyPrefixes("debug", "trace", "logging", "spring.aop", "spring.application", + "spring.autoconfigure", "spring.banner", "spring.beaninfo", "spring.codec", "spring.config", + "spring.info", "spring.jmx", "spring.main", "spring.messages", "spring.pid", "spring.profiles", + "spring.quartz", "spring.reactor", "spring.task", "spring.mandatory-file-encoding", "info", + "spring.output.ansi.enabled") + .addSection("mail").withKeyPrefixes("spring.mail", "spring.sendgrid").addSection("cache") + .withKeyPrefixes("spring.cache").addSection("server").withKeyPrefixes("server").addSection("web") + .withKeyPrefixes("spring.hateoas", "spring.http", "spring.servlet", "spring.jersey", "spring.mvc", + "spring.resources", "spring.webflux") + .addSection("json").withKeyPrefixes("spring.jackson", "spring.gson").addSection("rsocket") + .withKeyPrefixes("spring.rsocket").addSection("templating") + .withKeyPrefixes("spring.freemarker", "spring.groovy", "spring.mustache", "spring.thymeleaf") + .addOverride("spring.groovy.template.configuration", "See GroovyMarkupConfigurer") + .addSection("security").withKeyPrefixes("spring.security", "spring.ldap", "spring.session") + .addSection("data-migration").withKeyPrefixes("spring.flyway", "spring.liquibase").addSection("data") + .withKeyPrefixes("spring.couchbase", "spring.elasticsearch", "spring.h2", "spring.influx", + "spring.mongodb", "spring.redis", "spring.dao", "spring.data", "spring.datasource", + "spring.jooq", "spring.jdbc", "spring.jpa") + .addOverride("spring.datasource.dbcp2", "Commons DBCP2 specific settings") + .addOverride("spring.datasource.tomcat", "Tomcat datasource specific settings") + .addOverride("spring.datasource.hikari", "Hikari specific settings").addSection("transaction") + .withKeyPrefixes("spring.jta", "spring.transaction").addSection("integration") + .withKeyPrefixes("spring.activemq", "spring.artemis", "spring.batch", "spring.integration", + "spring.jms", "spring.kafka", "spring.rabbitmq", "spring.hazelcast", "spring.webservices") + .addSection("actuator").withKeyPrefixes("management").addSection("devtools") + .withKeyPrefixes("spring.devtools").addSection("testing").withKeyPrefixes("spring.test"); + DocumentOptions options = builder.build(); + new ConfigurationMetadataDocumentWriter().writeDocument(this.outputDir.toPath(), options, + this.configurationPropertyMetadata); + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/DocumentOptions.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/DocumentOptions.java similarity index 95% rename from spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/DocumentOptions.java rename to buildSrc/src/main/java/org/springframework/boot/build/context/properties/DocumentOptions.java index 6e96e8d94bb2..53fc4adec3f4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/DocumentOptions.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/DocumentOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.configurationdocs; +package org.springframework.boot.build.context.properties; import java.util.Arrays; import java.util.HashMap; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntry.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/SingleConfigurationTableEntry.java similarity index 88% rename from spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntry.java rename to buildSrc/src/main/java/org/springframework/boot/build/context/properties/SingleConfigurationTableEntry.java index 17ac8bc32a21..a2692818433c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntry.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/SingleConfigurationTableEntry.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -14,13 +14,11 @@ * limitations under the License. */ -package org.springframework.boot.configurationdocs; +package org.springframework.boot.build.context.properties; import java.util.Arrays; import java.util.stream.Collectors; -import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty; - /** * Table entry containing a single configuration property. * @@ -32,8 +30,8 @@ class SingleConfigurationTableEntry extends ConfigurationTableEntry { private final String defaultValue; - SingleConfigurationTableEntry(ConfigurationMetadataProperty property) { - this.key = property.getId(); + SingleConfigurationTableEntry(ConfigurationProperty property) { + this.key = property.getName(); if (property.getType() != null && property.getType().startsWith("java.util.Map")) { this.key += ".*"; } diff --git a/buildSrc/src/main/java/org/springframework/boot/build/log4j2/ReproducibleLog4j2PluginsDatAction.java b/buildSrc/src/main/java/org/springframework/boot/build/log4j2/ReproducibleLog4j2PluginsDatAction.java new file mode 100644 index 000000000000..0414fb1cbb79 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/log4j2/ReproducibleLog4j2PluginsDatAction.java @@ -0,0 +1,111 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.log4j2; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TreeMap; + +import org.gradle.api.Action; +import org.gradle.api.InvalidUserDataException; +import org.gradle.api.tasks.TaskExecutionException; +import org.gradle.api.tasks.compile.JavaCompile; + +/** + * An {@Action} to post-process a {@code Log4j2Plugins.dat} and re-order its content so + * that it is reproducible. + * + * @author Andy Wilkinson + */ +public class ReproducibleLog4j2PluginsDatAction implements Action { + + @Override + public void execute(JavaCompile javaCompile) { + File datFile = new File(javaCompile.getDestinationDir(), + "META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat"); + try { + postProcess(datFile); + } + catch (IOException ex) { + throw new TaskExecutionException(javaCompile, ex); + } + } + + void postProcess(File datFile) throws IOException { + if (!datFile.isFile()) { + throw new InvalidUserDataException( + "META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat not found"); + } + Map> categories = new TreeMap<>(); + try (DataInputStream input = new DataInputStream(new FileInputStream(datFile))) { + int categoryCount = input.readInt(); + for (int i = 0; i < categoryCount; i++) { + String categoryName = input.readUTF(); + int pluginCount = input.readInt(); + Map category = categories.computeIfAbsent(categoryName, (c) -> new TreeMap<>()); + for (int j = 0; j < pluginCount; j++) { + Plugin plugin = new Plugin(input.readUTF(), input.readUTF(), input.readUTF(), input.readBoolean(), + input.readBoolean()); + category.putIfAbsent(plugin.key, plugin); + } + } + } + try (DataOutputStream output = new DataOutputStream(new FileOutputStream(datFile))) { + output.writeInt(categories.size()); + for (Entry> category : categories.entrySet()) { + output.writeUTF(category.getKey()); + output.writeInt(category.getValue().size()); + for (Plugin plugin : category.getValue().values()) { + output.writeUTF(plugin.key); + output.writeUTF(plugin.className); + output.writeUTF(plugin.name); + output.writeBoolean(plugin.printable); + output.writeBoolean(plugin.defer); + } + } + } + } + + private static final class Plugin { + + private final String key; + + private final String className; + + private final String name; + + private final boolean printable; + + private final boolean defer; + + private Plugin(String key, String className, String name, boolean printable, boolean defer) { + this.key = key; + this.className = className; + this.name = name; + this.printable = printable; + this.defer = defer; + } + + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/DocumentPluginGoals.java b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/DocumentPluginGoals.java new file mode 100644 index 000000000000..2a16072dbb13 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/DocumentPluginGoals.java @@ -0,0 +1,194 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.mavenplugin; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.List; +import java.util.stream.Collectors; + +import org.gradle.api.DefaultTask; +import org.gradle.api.Task; +import org.gradle.api.tasks.InputFile; +import org.gradle.api.tasks.OutputDirectory; +import org.gradle.api.tasks.TaskAction; + +import org.springframework.boot.build.mavenplugin.PluginXmlParser.Mojo; +import org.springframework.boot.build.mavenplugin.PluginXmlParser.Parameter; +import org.springframework.boot.build.mavenplugin.PluginXmlParser.Plugin; + +/** + * A {@link Task} to document the plugin's goals. + * + * @author Andy Wilkinson + */ +public class DocumentPluginGoals extends DefaultTask { + + private final PluginXmlParser parser = new PluginXmlParser(); + + private File pluginXml; + + private File outputDir; + + @OutputDirectory + public File getOutputDir() { + return this.outputDir; + } + + public void setOutputDir(File outputDir) { + this.outputDir = outputDir; + } + + @InputFile + public File getPluginXml() { + return this.pluginXml; + } + + public void setPluginXml(File pluginXml) { + this.pluginXml = pluginXml; + } + + @TaskAction + public void documentPluginGoals() throws IOException { + Plugin plugin = this.parser.parse(this.pluginXml); + writeOverview(plugin); + for (Mojo mojo : plugin.getMojos()) { + documentMojo(plugin, mojo); + } + } + + private void writeOverview(Plugin plugin) throws IOException { + try (PrintWriter writer = new PrintWriter(new FileWriter(new File(this.outputDir, "overview.adoc")))) { + writer.println("[cols=\"1,3\"]"); + writer.println("|==="); + writer.println("| Goal | Description"); + writer.println(); + for (Mojo mojo : plugin.getMojos()) { + writer.printf("| <>%n", mojo.getGoal(), plugin.getGoalPrefix(), mojo.getGoal()); + writer.printf("| %s%n", mojo.getDescription()); + writer.println(); + } + writer.println("|==="); + } + } + + private void documentMojo(Plugin plugin, Mojo mojo) throws IOException { + try (PrintWriter writer = new PrintWriter(new FileWriter(new File(this.outputDir, mojo.getGoal() + ".adoc")))) { + String sectionId = "goals-" + mojo.getGoal(); + writer.println(); + writer.println(); + writer.printf("[[%s]]%n", sectionId); + writer.printf("== `%s:%s`%n", plugin.getGoalPrefix(), mojo.getGoal()); + writer.printf("`%s:%s:%s`%n", plugin.getGroupId(), plugin.getArtifactId(), plugin.getVersion()); + writer.println(); + writer.println(mojo.getDescription()); + List parameters = mojo.getParameters().stream().filter(Parameter::isEditable) + .collect(Collectors.toList()); + List requiredParameters = parameters.stream().filter(Parameter::isRequired) + .collect(Collectors.toList()); + String parametersSectionId = sectionId + "-parameters"; + String detailsSectionId = parametersSectionId + "-details"; + if (!requiredParameters.isEmpty()) { + writer.println(); + writer.println(); + writer.printf("[[%s-required]]%n", parametersSectionId); + writer.println("=== Required parameters"); + writeParametersTable(writer, mojo.getGoal(), requiredParameters); + } + List optionalParameters = parameters.stream().filter((parameter) -> !parameter.isRequired()) + .collect(Collectors.toList()); + if (!optionalParameters.isEmpty()) { + writer.println(); + writer.println(); + writer.printf("[[%s-optional]]%n", parametersSectionId); + writer.println("=== Optional parameters"); + writeParametersTable(writer, detailsSectionId, optionalParameters); + } + writer.println(); + writer.println(); + writer.printf("[[%s]]%n", detailsSectionId); + writer.println("=== Parameter details"); + writeParameterDetails(writer, parameters, detailsSectionId); + } + } + + private void writeParametersTable(PrintWriter writer, String detailsSectionId, List parameters) { + writer.println("[cols=\"3,2,3\"]"); + writer.println("|==="); + writer.println("| Name | Type | Default"); + writer.println(); + for (Parameter parameter : parameters) { + String name = parameter.getName(); + writer.printf("| <<%s-%s,%s>>%n", detailsSectionId, name, name); + String type = parameter.getType(); + if (type.lastIndexOf('.') >= 0) { + type = type.substring(type.lastIndexOf('.') + 1); + } + writer.printf("| `%s`%n", type); + String defaultValue = parameter.getDefaultValue(); + if (defaultValue != null) { + writer.printf("| `%s`%n", defaultValue); + } + else { + writer.println("|"); + } + writer.println(); + } + writer.println("|==="); + } + + private void writeParameterDetails(PrintWriter writer, List parameters, String sectionId) { + for (Parameter parameter : parameters) { + String name = parameter.getName(); + writer.println(); + writer.println(); + writer.printf("[[%s-%s]]%n", sectionId, name); + writer.printf("==== `%s`%n", name); + writer.println(parameter.getDescription()); + writer.println(); + writer.println("[cols=\"10h,90\"]"); + writer.println("|==="); + writer.println(); + writeDetail(writer, "Name", name); + writeDetail(writer, "Type", parameter.getType()); + writeOptionalDetail(writer, "Default value", parameter.getDefaultValue()); + writeOptionalDetail(writer, "User property", parameter.getUserProperty()); + writeOptionalDetail(writer, "Since", parameter.getSince()); + writer.println("|==="); + } + } + + private void writeDetail(PrintWriter writer, String name, String value) { + writer.printf("| %s%n", name); + writer.printf("| `%s`%n", value); + writer.println(); + } + + private void writeOptionalDetail(PrintWriter writer, String name, String value) { + writer.printf("| %s%n", name); + if (value != null) { + writer.printf("| `%s`%n", value); + } + else { + writer.println("|"); + } + writer.println(); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenExec.java b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenExec.java new file mode 100644 index 000000000000..17694f11d141 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenExec.java @@ -0,0 +1,101 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.mavenplugin; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +import org.gradle.api.Project; +import org.gradle.api.Task; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.tasks.Internal; +import org.gradle.api.tasks.JavaExec; +import org.gradle.api.tasks.TaskExecutionException; +import org.gradle.process.internal.ExecException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * A custom {@link JavaExec} {@link Task task} for running Maven. + * + * @author Andy Wilkinson + */ +public class MavenExec extends JavaExec { + + private Logger log = LoggerFactory.getLogger(MavenExec.class); + + private File projectDir; + + public MavenExec() throws IOException { + setClasspath(mavenConfiguration(getProject())); + args("--batch-mode"); + setMain("org.apache.maven.cli.MavenCli"); + } + + public void setProjectDir(File projectDir) { + this.projectDir = projectDir; + getInputs().file(new File(projectDir, "pom.xml")); + } + + @Override + public void exec() { + workingDir(this.projectDir); + systemProperty("maven.multiModuleProjectDirectory", this.projectDir.getAbsolutePath()); + try { + Path logFile = Files.createTempFile(getName(), ".log"); + try { + args("--log-file", logFile.toFile().getAbsolutePath()); + super.exec(); + if (this.log.isInfoEnabled()) { + Files.readAllLines(logFile).forEach(this.log::info); + } + } + catch (ExecException ex) { + System.out.println("Exec exception! Dumping log"); + Files.readAllLines(logFile).forEach(System.out::println); + throw ex; + } + } + catch (IOException ex) { + throw new TaskExecutionException(this, ex); + } + } + + private Configuration mavenConfiguration(Project project) { + Configuration existing = project.getConfigurations().findByName("maven"); + if (existing != null) { + return existing; + } + return project.getConfigurations().create("maven", (maven) -> { + maven.getDependencies().add(project.getDependencies().create("org.apache.maven:maven-embedder:3.6.2")); + maven.getDependencies().add(project.getDependencies().create("org.apache.maven:maven-compat:3.6.2")); + maven.getDependencies().add(project.getDependencies().create("org.slf4j:slf4j-simple:1.7.5")); + maven.getDependencies().add( + project.getDependencies().create("org.apache.maven.resolver:maven-resolver-connector-basic:1.4.1")); + maven.getDependencies().add( + project.getDependencies().create("org.apache.maven.resolver:maven-resolver-transport-http:1.4.1")); + }); + } + + @Internal + public File getProjectDir() { + return this.projectDir; + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenPluginPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenPluginPlugin.java new file mode 100644 index 000000000000..08874b11aaac --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenPluginPlugin.java @@ -0,0 +1,211 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.mavenplugin; + +import java.io.File; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; + +import io.spring.javaformat.formatter.FileFormatter; +import org.gradle.api.DefaultTask; +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.Task; +import org.gradle.api.plugins.JavaLibraryPlugin; +import org.gradle.api.plugins.JavaPlugin; +import org.gradle.api.plugins.JavaPluginConvention; +import org.gradle.api.publish.PublishingExtension; +import org.gradle.api.publish.maven.MavenPublication; +import org.gradle.api.publish.maven.plugins.MavenPublishPlugin; +import org.gradle.api.tasks.Copy; +import org.gradle.api.tasks.JavaExec; +import org.gradle.api.tasks.OutputDirectory; +import org.gradle.api.tasks.SourceSet; +import org.gradle.api.tasks.SourceSetContainer; +import org.gradle.api.tasks.TaskAction; +import org.gradle.api.tasks.TaskExecutionException; +import org.gradle.api.tasks.bundling.Jar; +import org.gradle.api.tasks.javadoc.Javadoc; +import org.gradle.external.javadoc.StandardJavadocDocletOptions; + +import org.springframework.boot.build.DeployedPlugin; +import org.springframework.boot.build.MavenRepositoryPlugin; +import org.springframework.boot.build.test.IntegrationTestPlugin; + +/** + * Plugin for building Spring Boot's Maven Plugin. + * + * @author Andy Wilkinson + */ +public class MavenPluginPlugin implements Plugin { + + @Override + public void apply(Project project) { + project.getPlugins().apply(JavaLibraryPlugin.class); + project.getPlugins().apply(MavenPublishPlugin.class); + project.getPlugins().apply(DeployedPlugin.class); + project.getPlugins().apply(MavenRepositoryPlugin.class); + project.getPlugins().apply(IntegrationTestPlugin.class); + Copy populateIntTestMavenRepository = project.getTasks().create("populateIntTestMavenRepository", Copy.class); + populateIntTestMavenRepository.setDestinationDir(project.getBuildDir()); + populateIntTestMavenRepository.into("int-test-maven-repository", (copy) -> { + copy.from(project.getConfigurations().getByName(MavenRepositoryPlugin.MAVEN_REPOSITORY_CONFIGURATION_NAME)); + copy.from(new File(project.getBuildDir(), "maven-repository")); + }); + populateIntTestMavenRepository + .dependsOn(project.getTasks().getByName(MavenRepositoryPlugin.PUBLISH_TO_PROJECT_REPOSITORY_TASK_NAME)); + configurePomPackaging(project); + MavenExec generateHelpMojo = configureMojoGenerationTasks(project); + MavenExec generatePluginDescriptor = configurePluginDescriptorGenerationTasks(project, generateHelpMojo); + DocumentPluginGoals documentPluginGoals = project.getTasks().create("documentPluginGoals", + DocumentPluginGoals.class); + documentPluginGoals.setPluginXml(generatePluginDescriptor.getOutputs().getFiles().getSingleFile()); + documentPluginGoals.setOutputDir(new File(project.getBuildDir(), "docs/generated/goals/")); + documentPluginGoals.dependsOn(generatePluginDescriptor); + Jar jar = (Jar) project.getTasks().getByName(JavaPlugin.JAR_TASK_NAME); + includeDescriptorInJar(jar, generatePluginDescriptor); + includeHelpMojoInJar(jar, generateHelpMojo); + PrepareMavenBinaries prepareMavenBinaries = project.getTasks().create("prepareMavenBinaries", + PrepareMavenBinaries.class); + prepareMavenBinaries.setOutputDir(new File(project.getBuildDir(), "maven-binaries")); + project.getTasks().getByName(IntegrationTestPlugin.INT_TEST_TASK_NAME).dependsOn(populateIntTestMavenRepository, + prepareMavenBinaries); + } + + private void configurePomPackaging(Project project) { + PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class); + publishing.getPublications().withType(MavenPublication.class, + (mavenPublication) -> mavenPublication.pom((pom) -> pom.setPackaging("maven-plugin"))); + } + + private MavenExec configureMojoGenerationTasks(Project project) { + File helpMojoDir = new File(project.getBuildDir(), "help-mojo"); + Copy helpMojoInputs = createCopyHelpMojoInputs(project, helpMojoDir); + MavenExec generateHelpMojo = createGenerateHelpMojo(project, helpMojoDir); + generateHelpMojo.dependsOn(helpMojoInputs); + return generateHelpMojo; + } + + private Copy createCopyHelpMojoInputs(Project project, File mavenDir) { + Copy mojoInputs = project.getTasks().create("copyHelpMojoInputs", Copy.class); + mojoInputs.setDestinationDir(mavenDir); + mojoInputs.from(new File(project.getProjectDir(), "src/maven/resources/pom.xml"), + (sync) -> sync.filter((input) -> input.replace("{{version}}", project.getVersion().toString()))); + return mojoInputs; + } + + private MavenExec createGenerateHelpMojo(Project project, File mavenDir) { + MavenExec generateHelpMojo = project.getTasks().create("generateHelpMojo", MavenExec.class); + generateHelpMojo.setProjectDir(mavenDir); + generateHelpMojo.args("org.apache.maven.plugins:maven-plugin-plugin:3.6.0:helpmojo"); + generateHelpMojo.getOutputs().dir(new File(mavenDir, "target/generated-sources/plugin")); + return generateHelpMojo; + } + + private MavenExec configurePluginDescriptorGenerationTasks(Project project, MavenExec generateHelpMojo) { + File pluginDescriptorDir = new File(project.getBuildDir(), "plugin-descriptor"); + SourceSetContainer sourceSets = project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets(); + SourceSet mainSourceSet = sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME); + File generatedHelpMojoDir = new File(project.getBuildDir(), "generated/sources/helpMojo"); + project.getTasks().withType(Javadoc.class, + (javadoc) -> ((StandardJavadocDocletOptions) javadoc.getOptions()).addMultilineStringsOption("tag") + .setValue(Arrays.asList("goal:X", "requiresProject:X", "threadSafe:X"))); + FormatHelpMojoSource copyFormattedHelpMojoSource = project.getTasks().create("copyFormattedHelpMojoSource", + FormatHelpMojoSource.class); + copyFormattedHelpMojoSource.setGenerator(generateHelpMojo); + copyFormattedHelpMojoSource.setOutputDir(generatedHelpMojoDir); + mainSourceSet.getAllJava().srcDir(generatedHelpMojoDir); + project.getTasks().getByName(mainSourceSet.getCompileJavaTaskName()).dependsOn(copyFormattedHelpMojoSource); + Copy pluginDescriptorInputs = createCopyPluginDescriptorInputs(project, pluginDescriptorDir, mainSourceSet); + pluginDescriptorInputs.dependsOn(mainSourceSet.getClassesTaskName()); + MavenExec generatePluginDescriptor = createGeneratePluginDescriptor(project, pluginDescriptorDir); + generatePluginDescriptor.dependsOn(pluginDescriptorInputs); + return generatePluginDescriptor; + } + + private Copy createCopyPluginDescriptorInputs(Project project, File destination, SourceSet sourceSet) { + Copy pluginDescriptorInputs = project.getTasks().create("copyPluginDescriptorInputs", Copy.class); + pluginDescriptorInputs.setDestinationDir(destination); + pluginDescriptorInputs.from(new File(project.getProjectDir(), "src/maven/resources/pom.xml"), + (sync) -> sync.filter((input) -> input.replace("{{version}}", project.getVersion().toString()))); + pluginDescriptorInputs.from(sourceSet.getOutput().getClassesDirs(), (sync) -> sync.into("target/classes")); + pluginDescriptorInputs.from(sourceSet.getAllJava().getSrcDirs(), (sync) -> sync.into("src/main/java")); + return pluginDescriptorInputs; + } + + private MavenExec createGeneratePluginDescriptor(Project project, File mavenDir) { + MavenExec generatePluginDescriptor = project.getTasks().create("generatePluginDescriptor", MavenExec.class); + generatePluginDescriptor.args("org.apache.maven.plugins:maven-plugin-plugin:3.6.0:descriptor"); + generatePluginDescriptor.getOutputs().file(new File(mavenDir, "target/classes/META-INF/maven/plugin.xml")); + generatePluginDescriptor.getInputs().dir(new File(mavenDir, "target/classes/org")); + generatePluginDescriptor.setProjectDir(mavenDir); + return generatePluginDescriptor; + } + + private void includeDescriptorInJar(Jar jar, JavaExec generatePluginDescriptor) { + jar.from(generatePluginDescriptor, (copy) -> copy.into("META-INF/maven/")); + jar.dependsOn(generatePluginDescriptor); + } + + private void includeHelpMojoInJar(Jar jar, JavaExec generateHelpMojo) { + jar.from(generateHelpMojo); + jar.dependsOn(generateHelpMojo); + } + + public static class FormatHelpMojoSource extends DefaultTask { + + private Task generator; + + private File outputDir; + + void setGenerator(Task generator) { + this.generator = generator; + getInputs().files(this.generator); + } + + @OutputDirectory + public File getOutputDir() { + return this.outputDir; + } + + void setOutputDir(File outputDir) { + this.outputDir = outputDir; + } + + @TaskAction + void syncAndFormat() { + FileFormatter fileFormatter = new FileFormatter(); + for (File output : this.generator.getOutputs().getFiles()) { + fileFormatter.formatFiles(getProject().fileTree(output), StandardCharsets.UTF_8).forEach((fileEdit) -> { + Path relativePath = output.toPath().relativize(fileEdit.getFile().toPath()); + Path outputLocation = this.outputDir.toPath().resolve(relativePath); + try { + Files.createDirectories(outputLocation.getParent()); + Files.write(outputLocation, fileEdit.getFormattedContent().getBytes(StandardCharsets.UTF_8)); + } + catch (Exception ex) { + throw new TaskExecutionException(this, ex); + } + }); + } + } + + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java new file mode 100644 index 000000000000..6269923df2a7 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PluginXmlParser.java @@ -0,0 +1,287 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.mavenplugin; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; + +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * A parser for a Maven plugin's {@code plugin.xml} file. + * + * @author Andy Wilkinson + */ +class PluginXmlParser { + + private final XPath xpath; + + PluginXmlParser() { + this.xpath = XPathFactory.newInstance().newXPath(); + } + + Plugin parse(File pluginXml) { + try { + Node root = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(pluginXml); + List mojos = parseMojos(root); + return new Plugin(textAt("//plugin/groupId", root), textAt("//plugin/artifactId", root), + textAt("//plugin/version", root), textAt("//plugin/goalPrefix", root), mojos); + } + catch (Exception ex) { + throw new RuntimeException(ex); + } + } + + private String textAt(String path, Node source) throws XPathExpressionException { + String text = this.xpath.evaluate(path + "/text()", source); + return (text.length() == 0) ? null : text; + } + + private List parseMojos(Node plugin) throws XPathExpressionException { + List mojos = new ArrayList(); + for (Node mojoNode : nodesAt("//plugin/mojos/mojo", plugin)) { + mojos.add(new Mojo(textAt("goal", mojoNode), format(textAt("description", mojoNode)), + parseParameters(mojoNode))); + } + return mojos; + } + + private Iterable nodesAt(String path, Node source) throws XPathExpressionException { + return IterableNodeList.of((NodeList) this.xpath.evaluate(path, source, XPathConstants.NODESET)); + } + + private List parseParameters(Node mojoNode) throws XPathExpressionException { + Map defaultValues = new HashMap<>(); + Map userProperties = new HashMap<>(); + for (Node parameterConfigurationNode : nodesAt("configuration/*", mojoNode)) { + String userProperty = parameterConfigurationNode.getTextContent(); + if (userProperty != null && userProperty.length() > 0) { + userProperties.put(parameterConfigurationNode.getNodeName(), + userProperty.replace("${", "`").replace("}", "`")); + } + Node defaultValueAttribute = parameterConfigurationNode.getAttributes().getNamedItem("default-value"); + if (defaultValueAttribute != null && defaultValueAttribute.getTextContent().length() > 0) { + defaultValues.put(parameterConfigurationNode.getNodeName(), defaultValueAttribute.getTextContent()); + } + } + List parameters = new ArrayList<>(); + for (Node parameterNode : nodesAt("parameters/parameter", mojoNode)) { + parameters.add(parseParameter(parameterNode, defaultValues, userProperties)); + } + return parameters; + } + + private Parameter parseParameter(Node parameterNode, Map defaultValues, + Map userProperties) throws XPathExpressionException { + Parameter parameter = new Parameter(textAt("name", parameterNode), textAt("type", parameterNode), + booleanAt("required", parameterNode), booleanAt("editable", parameterNode), + format(textAt("description", parameterNode)), defaultValues.get(textAt("name", parameterNode)), + userProperties.get(textAt("name", parameterNode)), textAt("since", parameterNode)); + return parameter; + } + + private boolean booleanAt(String path, Node node) throws XPathExpressionException { + return Boolean.valueOf(textAt(path, node)); + } + + private String format(String input) { + return input.replace("", "`").replace("", "`").replace("<", "<").replace(">", ">") + .replace("
", " ").replace("\n", " ").replace(""", "\"").replaceAll("\\{@code (.*?)\\}", "`$1`") + .replaceAll("\\{@link (.*?)\\}", "`$1`").replaceAll("\\{@literal (.*?)\\}", "`$1`") + .replaceAll("(.*?)", "\\$1[\\$2]"); + } + + private static final class IterableNodeList implements Iterable { + + private final NodeList nodeList; + + private IterableNodeList(NodeList nodeList) { + this.nodeList = nodeList; + } + + private static Iterable of(NodeList nodeList) { + return new IterableNodeList(nodeList); + } + + @Override + public Iterator iterator() { + + return new Iterator() { + + private int index = 0; + + @Override + public boolean hasNext() { + return this.index < IterableNodeList.this.nodeList.getLength(); + } + + @Override + public Node next() { + return IterableNodeList.this.nodeList.item(this.index++); + } + + }; + } + + } + + static final class Plugin { + + private final String groupId; + + private final String artifactId; + + private final String version; + + private final String goalPrefix; + + private final List mojos; + + private Plugin(String groupId, String artifactId, String version, String goalPrefix, List mojos) { + this.groupId = groupId; + this.artifactId = artifactId; + this.version = version; + this.goalPrefix = goalPrefix; + this.mojos = mojos; + } + + String getGroupId() { + return this.groupId; + } + + String getArtifactId() { + return this.artifactId; + } + + String getVersion() { + return this.version; + } + + String getGoalPrefix() { + return this.goalPrefix; + } + + List getMojos() { + return this.mojos; + } + + } + + static final class Mojo { + + private final String goal; + + private final String description; + + private final List parameters; + + private Mojo(String goal, String description, List parameters) { + this.goal = goal; + this.description = description; + this.parameters = parameters; + } + + String getGoal() { + return this.goal; + } + + String getDescription() { + return this.description; + } + + List getParameters() { + return this.parameters; + } + + } + + static final class Parameter { + + private final String name; + + private final String type; + + private final boolean required; + + private final boolean editable; + + private final String description; + + private final String defaultValue; + + private final String userProperty; + + private final String since; + + private Parameter(String name, String type, boolean required, boolean editable, String description, + String defaultValue, String userProperty, String since) { + this.name = name; + this.type = type; + this.required = required; + this.editable = editable; + this.description = description; + this.defaultValue = defaultValue; + this.userProperty = userProperty; + this.since = since; + } + + String getName() { + return this.name; + } + + String getType() { + return this.type; + } + + boolean isRequired() { + return this.required; + } + + boolean isEditable() { + return this.editable; + } + + String getDescription() { + return this.description; + } + + String getDefaultValue() { + return this.defaultValue; + } + + String getUserProperty() { + return this.userProperty; + } + + String getSince() { + return this.since; + } + + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PrepareMavenBinaries.java b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PrepareMavenBinaries.java new file mode 100644 index 000000000000..e4f18ece6b49 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/PrepareMavenBinaries.java @@ -0,0 +1,70 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.mavenplugin; + +import java.io.File; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.Set; + +import org.gradle.api.DefaultTask; +import org.gradle.api.Task; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.tasks.Input; +import org.gradle.api.tasks.OutputDirectory; +import org.gradle.api.tasks.TaskAction; + +/** + * {@link Task} to make Maven binaries available for integration testing. + * + * @author Andy Wilkinson + */ +public class PrepareMavenBinaries extends DefaultTask { + + private Set versions = new LinkedHashSet<>(); + + private File outputDir; + + @OutputDirectory + public File getOutputDir() { + return this.outputDir; + } + + public void setOutputDir(File outputDir) { + this.outputDir = outputDir; + } + + @Input + public Set getVersions() { + return this.versions; + } + + public void versions(String... versions) { + this.versions.addAll(Arrays.asList(versions)); + } + + @TaskAction + public void prepareBinaries() { + for (String version : this.versions) { + Configuration configuration = getProject().getConfigurations().detachedConfiguration( + getProject().getDependencies().create("org.apache.maven:apache-maven:" + version + ":bin@zip")); + getProject().copy( + (copy) -> copy.into(this.outputDir).from(getProject().zipTree(configuration.getSingleFile()))); + } + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/optional/OptionalDependenciesPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/optional/OptionalDependenciesPlugin.java new file mode 100644 index 000000000000..0f622fcee852 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/optional/OptionalDependenciesPlugin.java @@ -0,0 +1,65 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.optional; + +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.attributes.Usage; +import org.gradle.api.plugins.JavaPlugin; +import org.gradle.api.plugins.JavaPluginConvention; +import org.gradle.api.tasks.SourceSetContainer; +import org.gradle.api.tasks.javadoc.Javadoc; +import org.gradle.plugins.ide.eclipse.EclipsePlugin; +import org.gradle.plugins.ide.eclipse.model.EclipseModel; + +/** + * A {@code Plugin} that adds support for Maven-style optional dependencies. Creates a new + * {@code optional} configuration. The {@code optional} configuration is part of the + * project's compile and runtime classpath's but does not affect the classpath of + * dependent projects. + * + * @author Andy Wilkinson + */ +public class OptionalDependenciesPlugin implements Plugin { + + /** + * Name of the {@code optional} configuration. + */ + public static final String OPTIONAL_CONFIGURATION_NAME = "optional"; + + @Override + public void apply(Project project) { + Configuration optional = project.getConfigurations().create("optional"); + optional.attributes((attributes) -> attributes.attribute(Usage.USAGE_ATTRIBUTE, + project.getObjects().named(Usage.class, Usage.JAVA_RUNTIME))); + project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> { + SourceSetContainer sourceSets = project.getConvention().getPlugin(JavaPluginConvention.class) + .getSourceSets(); + sourceSets.all((sourceSet) -> { + sourceSet.setCompileClasspath(sourceSet.getCompileClasspath().plus(optional)); + sourceSet.setRuntimeClasspath(sourceSet.getRuntimeClasspath().plus(optional)); + }); + project.getTasks().withType(Javadoc.class) + .all((javadoc) -> javadoc.setClasspath(javadoc.getClasspath().plus(optional))); + }); + project.getPlugins().withType(EclipsePlugin.class, + (eclipePlugin) -> project.getExtensions().getByType(EclipseModel.class) + .classpath((classpath) -> classpath.getPlusConfigurations().add(optional))); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/starters/DocumentStarters.java b/buildSrc/src/main/java/org/springframework/boot/build/starters/DocumentStarters.java new file mode 100644 index 000000000000..a5cdf124d47a --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/starters/DocumentStarters.java @@ -0,0 +1,163 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.starters; + +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.TreeSet; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.gradle.api.Task; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.file.FileCollection; +import org.gradle.api.internal.AbstractTask; +import org.gradle.api.tasks.InputFiles; +import org.gradle.api.tasks.OutputDirectory; +import org.gradle.api.tasks.TaskAction; + +import org.springframework.util.StringUtils; + +/** + * {@link Task} to document all starter projects. + * + * @author Andy Wilkinson + */ +public class DocumentStarters extends AbstractTask { + + private final Configuration starters; + + private File outputDir; + + public DocumentStarters() { + this.starters = getProject().getConfigurations().create("starters"); + getProject().getGradle().projectsEvaluated((gradle) -> { + gradle.allprojects((project) -> { + if (project.getPlugins().hasPlugin(StarterPlugin.class)) { + Map dependency = new HashMap<>(); + dependency.put("path", project.getPath()); + dependency.put("configuration", "starterMetadata"); + this.starters.getDependencies().add(project.getDependencies().project(dependency)); + } + }); + }); + } + + @OutputDirectory + public File getOutputDir() { + return this.outputDir; + } + + public void setOutputDir(File outputDir) { + this.outputDir = outputDir; + } + + @InputFiles + public FileCollection getStarters() { + return this.starters; + } + + @TaskAction + void documentStarters() { + Set starters = this.starters.getFiles().stream().map(this::loadStarter) + .collect(Collectors.toCollection(TreeSet::new)); + writeTable("application-starters", starters.stream().filter(Starter::isApplication)); + writeTable("production-starters", starters.stream().filter(Starter::isProduction)); + writeTable("technical-starters", starters.stream().filter(Starter::isTechnical)); + } + + private Starter loadStarter(File metadata) { + Properties properties = new Properties(); + try (FileReader reader = new FileReader(metadata)) { + properties.load(reader); + return new Starter(properties.getProperty("name"), properties.getProperty("description"), + StringUtils.commaDelimitedListToSet(properties.getProperty("dependencies"))); + } + catch (IOException ex) { + throw new RuntimeException(ex); + } + } + + private void writeTable(String name, Stream starters) { + File output = new File(this.outputDir, name + ".adoc"); + output.getParentFile().mkdirs(); + try (PrintWriter writer = new PrintWriter(new FileWriter(output))) { + writer.println("|==="); + writer.println("| Name | Description"); + starters.forEach((starter) -> { + writer.println(); + writer.printf("| [[%s]]`%s`%n", starter.name, starter.name); + writer.printf("| %s%n", postProcessDescription(starter.description)); + }); + writer.println("|==="); + } + catch (IOException ex) { + throw new RuntimeException(ex); + } + } + + private String postProcessDescription(String description) { + return addStarterCrossLinks(description); + } + + private String addStarterCrossLinks(String input) { + return input.replaceAll("(spring-boot-starter[A-Za-z-]*)", "<<$1,`$1`>>"); + } + + private static final class Starter implements Comparable { + + private final String name; + + private final String description; + + private final Set dependencies; + + private Starter(String name, String description, Set dependencies) { + this.name = name; + this.description = description; + this.dependencies = dependencies; + } + + private boolean isProduction() { + return this.name.equals("spring-boot-starter-actuator"); + } + + private boolean isTechnical() { + return !Arrays.asList("spring-boot-starter", "spring-boot-starter-test").contains(this.name) + && !isProduction() && !this.dependencies.contains("spring-boot-starter"); + } + + private boolean isApplication() { + return !isProduction() && !isTechnical(); + } + + @Override + public int compareTo(Starter other) { + return this.name.compareTo(other.name); + } + + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/starters/StarterMetadata.java b/buildSrc/src/main/java/org/springframework/boot/build/starters/StarterMetadata.java new file mode 100644 index 000000000000..75e09c127385 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/starters/StarterMetadata.java @@ -0,0 +1,82 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.starters; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.util.Properties; +import java.util.concurrent.Callable; +import java.util.stream.Collectors; + +import org.gradle.api.Task; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.artifacts.ResolvedArtifact; +import org.gradle.api.file.FileCollection; +import org.gradle.api.internal.AbstractTask; +import org.gradle.api.tasks.InputFiles; +import org.gradle.api.tasks.OutputFile; +import org.gradle.api.tasks.TaskAction; + +/** + * A {@link Task} for generating metadata that describes a starter. + * + * @author Andy Wilkinson + */ +public class StarterMetadata extends AbstractTask { + + private Configuration dependencies; + + private File destination; + + public StarterMetadata() { + getInputs().property("name", (Callable) () -> getProject().getName()); + getInputs().property("description", (Callable) () -> getProject().getDescription()); + } + + @InputFiles + public FileCollection getDependencies() { + return this.dependencies; + } + + public void setDependencies(Configuration dependencies) { + this.dependencies = dependencies; + } + + @OutputFile + public File getDestination() { + return this.destination; + } + + public void setDestination(File destination) { + this.destination = destination; + } + + @TaskAction + void generateMetadata() throws IOException { + Properties properties = new Properties(); + properties.setProperty("name", getProject().getName()); + properties.setProperty("description", getProject().getDescription()); + properties.setProperty("dependencies", String.join(",", this.dependencies.getResolvedConfiguration() + .getResolvedArtifacts().stream().map(ResolvedArtifact::getName).collect(Collectors.toSet()))); + this.destination.getParentFile().mkdirs(); + try (FileWriter writer = new FileWriter(this.destination)) { + properties.store(writer, null); + } + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/starters/StarterPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/starters/StarterPlugin.java new file mode 100644 index 000000000000..3ad6a3f714c8 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/starters/StarterPlugin.java @@ -0,0 +1,78 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.starters; + +import java.io.File; + +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.artifacts.ConfigurationContainer; +import org.gradle.api.plugins.JavaBasePlugin; +import org.gradle.api.plugins.JavaLibraryPlugin; +import org.gradle.api.plugins.JavaPlugin; +import org.gradle.api.plugins.PluginContainer; + +import org.springframework.boot.build.ConventionsPlugin; +import org.springframework.boot.build.DeployedPlugin; +import org.springframework.boot.build.classpath.CheckClasspathForConflicts; +import org.springframework.boot.build.classpath.CheckClasspathForProhibitedDependencies; +import org.springframework.util.StringUtils; + +/** + * A {@link Plugin} for a starter project. + * + * @author Andy Wilkinson + */ +public class StarterPlugin implements Plugin { + + @Override + public void apply(Project project) { + PluginContainer plugins = project.getPlugins(); + plugins.apply(DeployedPlugin.class); + plugins.apply(JavaLibraryPlugin.class); + plugins.apply(ConventionsPlugin.class); + StarterMetadata starterMetadata = project.getTasks().create("starterMetadata", StarterMetadata.class); + ConfigurationContainer configurations = project.getConfigurations(); + Configuration runtimeClasspath = configurations.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME); + starterMetadata.setDependencies(runtimeClasspath); + File destination = new File(project.getBuildDir(), "starter-metadata.properties"); + starterMetadata.setDestination(destination); + configurations.create("starterMetadata"); + project.getArtifacts().add("starterMetadata", project.provider(starterMetadata::getDestination), + (artifact) -> artifact.builtBy(starterMetadata)); + createClasspathConflictsCheck(runtimeClasspath, project); + createProhibitedDependenciesCheck(runtimeClasspath, project); + } + + private void createClasspathConflictsCheck(Configuration classpath, Project project) { + CheckClasspathForConflicts checkClasspathForConflicts = project.getTasks().create( + "check" + StringUtils.capitalize(classpath.getName() + "ForConflicts"), + CheckClasspathForConflicts.class); + checkClasspathForConflicts.setClasspath(classpath); + project.getTasks().getByName(JavaBasePlugin.CHECK_TASK_NAME).dependsOn(checkClasspathForConflicts); + } + + private void createProhibitedDependenciesCheck(Configuration classpath, Project project) { + CheckClasspathForProhibitedDependencies checkClasspathForProhibitedDependencies = project.getTasks().create( + "check" + StringUtils.capitalize(classpath.getName() + "ForProhibitedDependencies"), + CheckClasspathForProhibitedDependencies.class); + checkClasspathForProhibitedDependencies.setClasspath(classpath); + project.getTasks().getByName(JavaBasePlugin.CHECK_TASK_NAME).dependsOn(checkClasspathForProhibitedDependencies); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/test/IntegrationTestPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/test/IntegrationTestPlugin.java new file mode 100644 index 000000000000..58ac2fb33f10 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/test/IntegrationTestPlugin.java @@ -0,0 +1,82 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.test; + +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.plugins.JavaPlugin; +import org.gradle.api.plugins.JavaPluginConvention; +import org.gradle.api.tasks.SourceSet; +import org.gradle.api.tasks.SourceSetContainer; +import org.gradle.api.tasks.testing.Test; +import org.gradle.language.base.plugins.LifecycleBasePlugin; +import org.gradle.plugins.ide.eclipse.EclipsePlugin; +import org.gradle.plugins.ide.eclipse.model.EclipseModel; + +/** + * A {@Plugin} to configure integration testing support in a {@link Project}. + * + * @author Andy Wilkinson + */ +public class IntegrationTestPlugin implements Plugin { + + /** + * Name of the {@code intTest} task. + */ + public static String INT_TEST_TASK_NAME = "intTest"; + + /** + * Name of the {@code intTest} source set. + */ + public static String INT_TEST_SOURCE_SET_NAME = "intTest"; + + @Override + public void apply(Project project) { + project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> this.configureIntegrationTesting(project)); + } + + private void configureIntegrationTesting(Project project) { + SourceSet intTestSourceSet = createSourceSet(project); + Test intTest = createTestTask(project, intTestSourceSet); + project.getTasks().getByName(LifecycleBasePlugin.CHECK_TASK_NAME).dependsOn(intTest); + project.getPlugins().withType(EclipsePlugin.class, (eclipsePlugin) -> { + EclipseModel eclipse = project.getExtensions().getByType(EclipseModel.class); + eclipse.classpath((classpath) -> classpath.getPlusConfigurations().add( + project.getConfigurations().getByName(intTestSourceSet.getRuntimeClasspathConfigurationName()))); + }); + } + + private SourceSet createSourceSet(Project project) { + SourceSetContainer sourceSets = project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets(); + SourceSet intTestSourceSet = sourceSets.create(INT_TEST_SOURCE_SET_NAME); + SourceSet main = sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME); + intTestSourceSet.setCompileClasspath(intTestSourceSet.getCompileClasspath().plus(main.getOutput())); + intTestSourceSet.setRuntimeClasspath(intTestSourceSet.getRuntimeClasspath().plus(main.getOutput())); + return intTestSourceSet; + } + + private Test createTestTask(Project project, SourceSet intTestSourceSet) { + Test intTest = project.getTasks().create(INT_TEST_TASK_NAME, Test.class); + intTest.setGroup(LifecycleBasePlugin.VERIFICATION_GROUP); + intTest.setDescription("Runs integration tests."); + intTest.setTestClassesDirs(intTestSourceSet.getOutput().getClassesDirs()); + intTest.setClasspath(intTestSourceSet.getRuntimeClasspath()); + intTest.shouldRunAfter(JavaPlugin.TEST_TASK_NAME); + return intTest; + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/test/autoconfigure/DocumentTestSlices.java b/buildSrc/src/main/java/org/springframework/boot/build/test/autoconfigure/DocumentTestSlices.java new file mode 100644 index 000000000000..6643b9fcf190 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/test/autoconfigure/DocumentTestSlices.java @@ -0,0 +1,129 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.test.autoconfigure; + +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.Reader; +import java.util.Collections; +import java.util.Enumeration; +import java.util.Properties; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; + +import org.gradle.api.Task; +import org.gradle.api.file.FileCollection; +import org.gradle.api.internal.AbstractTask; +import org.gradle.api.tasks.InputFiles; +import org.gradle.api.tasks.OutputFile; +import org.gradle.api.tasks.TaskAction; + +import org.springframework.util.ClassUtils; +import org.springframework.util.StringUtils; + +/** + * {@link Task} used to document test slices. + * + * @author Andy Wilkinson + */ +public class DocumentTestSlices extends AbstractTask { + + private FileCollection testSlices; + + private File outputFile; + + @InputFiles + public FileCollection getTestSlices() { + return this.testSlices; + } + + public void setTestSlices(FileCollection testSlices) { + this.testSlices = testSlices; + } + + @OutputFile + public File getOutputFile() { + return this.outputFile; + } + + public void setOutputFile(File outputFile) { + this.outputFile = outputFile; + } + + @TaskAction + void documentTestSlices() throws IOException { + Set testSlices = readTestSlices(); + writeTable(testSlices); + } + + @SuppressWarnings("unchecked") + private Set readTestSlices() throws IOException { + Set testSlices = new TreeSet<>(); + for (File metadataFile : this.testSlices) { + Properties metadata = new Properties(); + try (Reader reader = new FileReader(metadataFile)) { + metadata.load(reader); + } + for (String name : Collections.list((Enumeration) metadata.propertyNames())) { + testSlices.add(new TestSlice(name, + new TreeSet<>(StringUtils.commaDelimitedListToSet(metadata.getProperty(name))))); + } + } + return testSlices; + } + + private void writeTable(Set testSlices) throws IOException { + this.outputFile.getParentFile().mkdirs(); + try (PrintWriter writer = new PrintWriter(new FileWriter(this.outputFile))) { + writer.println("[cols=\"d,a\"]"); + writer.println("|==="); + writer.println("| Test slice | Imported auto-configuration"); + for (TestSlice testSlice : testSlices) { + writer.println(); + writer.printf("| `@%s`%n", testSlice.className); + writer.println("| "); + for (String importedAutoConfiguration : testSlice.importedAutoConfigurations) { + writer.printf("`%s`%n", importedAutoConfiguration); + } + } + writer.println("|==="); + } + } + + private static final class TestSlice implements Comparable { + + private final String className; + + private final SortedSet importedAutoConfigurations; + + private TestSlice(String className, SortedSet importedAutoConfigurations) { + this.className = ClassUtils.getShortName(className); + this.importedAutoConfigurations = importedAutoConfigurations; + } + + @Override + public int compareTo(TestSlice other) { + return this.className.compareTo(other.className); + } + + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/test/autoconfigure/TestSliceMetadata.java b/buildSrc/src/main/java/org/springframework/boot/build/test/autoconfigure/TestSliceMetadata.java new file mode 100644 index 000000000000..1a1c5ab9de1a --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/test/autoconfigure/TestSliceMetadata.java @@ -0,0 +1,172 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.test.autoconfigure; + +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.Reader; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Properties; +import java.util.SortedSet; +import java.util.TreeSet; +import java.util.concurrent.Callable; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; + +import org.gradle.api.Task; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.file.FileCollection; +import org.gradle.api.internal.AbstractTask; +import org.gradle.api.tasks.OutputFile; +import org.gradle.api.tasks.SourceSet; +import org.gradle.api.tasks.TaskAction; + +import org.springframework.core.io.FileSystemResource; +import org.springframework.core.type.AnnotationMetadata; +import org.springframework.core.type.classreading.MetadataReader; +import org.springframework.core.type.classreading.MetadataReaderFactory; +import org.springframework.core.type.classreading.SimpleMetadataReaderFactory; +import org.springframework.util.StringUtils; + +/** + * A {@link Task} for generating metadata describing a project's test slices. + * + * @author Andy Wilkinson + */ +public class TestSliceMetadata extends AbstractTask { + + private SourceSet sourceSet; + + private File outputFile; + + public TestSliceMetadata() { + getInputs().dir((Callable) () -> this.sourceSet.getOutput().getResourcesDir()); + getInputs().files((Callable) () -> this.sourceSet.getOutput().getClassesDirs()); + } + + public void setSourceSet(SourceSet sourceSet) { + this.sourceSet = sourceSet; + } + + @OutputFile + public File getOutputFile() { + return this.outputFile; + } + + public void setOutputFile(File outputFile) { + this.outputFile = outputFile; + Configuration testSliceMetadata = getProject().getConfigurations().maybeCreate("testSliceMetadata"); + getProject().getArtifacts().add(testSliceMetadata.getName(), + getProject().provider((Callable) this::getOutputFile), (artifact) -> artifact.builtBy(this)); + } + + @TaskAction + void documentTestSlices() throws IOException { + Properties testSlices = readTestSlices(); + getOutputFile().getParentFile().mkdirs(); + try (FileWriter writer = new FileWriter(getOutputFile())) { + testSlices.store(writer, null); + } + } + + private Properties readTestSlices() throws IOException { + Properties testSlices = new Properties(); + try (URLClassLoader classLoader = new URLClassLoader( + StreamSupport.stream(this.sourceSet.getRuntimeClasspath().spliterator(), false).map(this::toURL) + .toArray(URL[]::new))) { + MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory(classLoader); + Properties springFactories = readSpringFactories( + new File(this.sourceSet.getOutput().getResourcesDir(), "META-INF/spring.factories")); + for (File classesDir : this.sourceSet.getOutput().getClassesDirs()) { + addTestSlices(testSlices, classesDir, metadataReaderFactory, springFactories); + } + } + return testSlices; + } + + private URL toURL(File file) { + try { + return file.toURI().toURL(); + } + catch (MalformedURLException ex) { + throw new RuntimeException(ex); + } + } + + private Properties readSpringFactories(File file) throws IOException { + Properties springFactories = new Properties(); + try (Reader in = new FileReader(file)) { + springFactories.load(in); + } + return springFactories; + } + + private void addTestSlices(Properties testSlices, File classesDir, MetadataReaderFactory metadataReaderFactory, + Properties springFactories) throws IOException { + try (Stream classes = Files.walk(classesDir.toPath())) { + classes.filter((path) -> path.toString().endsWith("Test.class")) + .map((path) -> getMetadataReader(path, metadataReaderFactory)) + .filter((metadataReader) -> metadataReader.getClassMetadata().isAnnotation()) + .forEach((metadataReader) -> addTestSlice(testSlices, springFactories, metadataReader)); + } + + } + + private MetadataReader getMetadataReader(Path path, MetadataReaderFactory metadataReaderFactory) { + try { + return metadataReaderFactory.getMetadataReader(new FileSystemResource(path)); + } + catch (IOException ex) { + throw new RuntimeException(ex); + } + } + + private void addTestSlice(Properties testSlices, Properties springFactories, MetadataReader metadataReader) { + testSlices.setProperty(metadataReader.getClassMetadata().getClassName(), + StringUtils.collectionToCommaDelimitedString( + getImportedAutoConfiguration(springFactories, metadataReader.getAnnotationMetadata()))); + } + + private SortedSet getImportedAutoConfiguration(Properties springFactories, + AnnotationMetadata annotationMetadata) { + Stream importers = findMetaImporters(annotationMetadata); + if (annotationMetadata.isAnnotated("org.springframework.boot.autoconfigure.ImportAutoConfiguration")) { + importers = Stream.concat(importers, Stream.of(annotationMetadata.getClassName())); + } + return importers.flatMap( + (importer) -> StringUtils.commaDelimitedListToSet(springFactories.getProperty(importer)).stream()) + .collect(Collectors.toCollection(TreeSet::new)); + } + + private Stream findMetaImporters(AnnotationMetadata annotationMetadata) { + return annotationMetadata.getAnnotationTypes().stream() + .filter((annotationType) -> isAutoConfigurationImporter(annotationType, annotationMetadata)); + } + + private boolean isAutoConfigurationImporter(String annotationType, AnnotationMetadata metadata) { + return metadata.getMetaAnnotationTypes(annotationType) + .contains("org.springframework.boot.autoconfigure.ImportAutoConfiguration"); + } + +} diff --git a/buildSrc/src/main/resources/effective-bom-settings.xml b/buildSrc/src/main/resources/effective-bom-settings.xml new file mode 100644 index 000000000000..d67307453cf6 --- /dev/null +++ b/buildSrc/src/main/resources/effective-bom-settings.xml @@ -0,0 +1,24 @@ + + localRepositoryPath + + + spring-repositories + + true + + + + spring-snapshot + https://repo.spring.io/snapshot + + true + + + + spring-milestone + https://repo.spring.io/milestone + + + + + diff --git a/buildSrc/src/test/java/org/springframework/boot/build/assertj/NodeAssert.java b/buildSrc/src/test/java/org/springframework/boot/build/assertj/NodeAssert.java new file mode 100644 index 000000000000..452fafaf6fdc --- /dev/null +++ b/buildSrc/src/test/java/org/springframework/boot/build/assertj/NodeAssert.java @@ -0,0 +1,87 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.assertj; + +import java.io.File; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; + +import org.assertj.core.api.AbstractAssert; +import org.assertj.core.api.AssertProvider; +import org.assertj.core.api.StringAssert; +import org.w3c.dom.Document; +import org.w3c.dom.Node; + +/** + * AssertJ {@link AssertProvider} for {@link Node} assertions. + * + * @author Andy Wilkinson + */ +public class NodeAssert extends AbstractAssert implements AssertProvider { + + private static final DocumentBuilderFactory FACTORY = DocumentBuilderFactory.newInstance(); + + private final XPathFactory xpathFactory = XPathFactory.newInstance(); + + private final XPath xpath = this.xpathFactory.newXPath(); + + public NodeAssert(File xmlFile) { + this(read(xmlFile)); + } + + public NodeAssert(Node actual) { + super(actual, NodeAssert.class); + } + + private static Document read(File xmlFile) { + try { + return FACTORY.newDocumentBuilder().parse(xmlFile); + } + catch (Exception ex) { + throw new RuntimeException(ex); + } + } + + public NodeAssert nodeAtPath(String xpath) { + try { + return new NodeAssert((Node) this.xpath.evaluate(xpath, this.actual, XPathConstants.NODE)); + } + catch (XPathExpressionException ex) { + throw new RuntimeException(ex); + } + } + + public StringAssert textAtPath(String xpath) { + try { + return new StringAssert( + (String) this.xpath.evaluate(xpath + "/text()", this.actual, XPathConstants.STRING)); + } + catch (XPathExpressionException ex) { + throw new RuntimeException(ex); + } + } + + @Override + public NodeAssert assertThat() { + return this; + } + +} diff --git a/buildSrc/src/test/java/org/springframework/boot/build/bom/BomPluginIntegrationTests.java b/buildSrc/src/test/java/org/springframework/boot/build/bom/BomPluginIntegrationTests.java new file mode 100644 index 000000000000..3bd1c2bb4a81 --- /dev/null +++ b/buildSrc/src/test/java/org/springframework/boot/build/bom/BomPluginIntegrationTests.java @@ -0,0 +1,193 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.boot.build.bom; + +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.Reader; +import java.util.function.Consumer; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.GradleRunner; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import org.springframework.boot.build.DeployedPlugin; +import org.springframework.boot.build.assertj.NodeAssert; +import org.springframework.util.FileCopyUtils; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link BomPlugin}. + * + * @author Andy Wilkinson + */ +public class BomPluginIntegrationTests { + + private File projectDir; + + private File buildFile; + + @BeforeEach + public void setup(@TempDir File projectDir) throws IOException { + this.projectDir = projectDir; + this.buildFile = new File(this.projectDir, "build.gradle"); + } + + @Test + void libraryModulesAreIncludedInDependencyManagementOfGeneratedPom() throws IOException { + try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) { + out.println("plugins {"); + out.println(" id 'org.springframework.boot.bom'"); + out.println("}"); + out.println("bom {"); + out.println(" library('ActiveMQ', '5.15.10') {"); + out.println(" group('org.apache.activemq') {"); + out.println(" modules = ["); + out.println(" 'activemq-amqp',"); + out.println(" 'activemq-blueprint'"); + out.println(" ]"); + out.println(" }"); + out.println(" }"); + out.println("}"); + } + generatePom((pom) -> { + assertThat(pom).textAtPath("//properties/activemq.version").isEqualTo("5.15.10"); + NodeAssert dependency = pom.nodeAtPath("//dependencyManagement/dependencies/dependency[1]"); + assertThat(dependency).textAtPath("groupId").isEqualTo("org.apache.activemq"); + assertThat(dependency).textAtPath("artifactId").isEqualTo("activemq-amqp"); + assertThat(dependency).textAtPath("version").isEqualTo("${activemq.version}"); + assertThat(dependency).textAtPath("scope").isNullOrEmpty(); + assertThat(dependency).textAtPath("type").isNullOrEmpty(); + dependency = pom.nodeAtPath("//dependencyManagement/dependencies/dependency[2]"); + assertThat(dependency).textAtPath("groupId").isEqualTo("org.apache.activemq"); + assertThat(dependency).textAtPath("artifactId").isEqualTo("activemq-blueprint"); + assertThat(dependency).textAtPath("version").isEqualTo("${activemq.version}"); + assertThat(dependency).textAtPath("scope").isNullOrEmpty(); + assertThat(dependency).textAtPath("type").isNullOrEmpty(); + }); + } + + @Test + void libraryPluginsAreIncludedInPluginManagementOfGeneratedPom() throws IOException { + try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) { + out.println("plugins {"); + out.println(" id 'org.springframework.boot.bom'"); + out.println("}"); + out.println("bom {"); + out.println(" library('Flyway', '6.0.8') {"); + out.println(" group('org.flywaydb') {"); + out.println(" plugins = ["); + out.println(" 'flyway-maven-plugin'"); + out.println(" ]"); + out.println(" }"); + out.println(" }"); + out.println("}"); + } + generatePom((pom) -> { + assertThat(pom).textAtPath("//properties/flyway.version").isEqualTo("6.0.8"); + NodeAssert plugin = pom.nodeAtPath("//pluginManagement/plugins/plugin"); + assertThat(plugin).textAtPath("groupId").isEqualTo("org.flywaydb"); + assertThat(plugin).textAtPath("artifactId").isEqualTo("flyway-maven-plugin"); + assertThat(plugin).textAtPath("version").isEqualTo("${flyway.version}"); + assertThat(plugin).textAtPath("scope").isNullOrEmpty(); + assertThat(plugin).textAtPath("type").isNullOrEmpty(); + }); + } + + @Test + void libraryImportsAreIncludedInDependencyManagementOfGeneratedPom() throws Exception { + try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) { + out.println("plugins {"); + out.println(" id 'org.springframework.boot.bom'"); + out.println("}"); + out.println("bom {"); + out.println(" library('Jackson Bom', '2.10.0') {"); + out.println(" group('com.fasterxml.jackson') {"); + out.println(" imports = ["); + out.println(" 'jackson-bom'"); + out.println(" ]"); + out.println(" }"); + out.println(" }"); + out.println("}"); + } + generatePom((pom) -> { + assertThat(pom).textAtPath("//properties/jackson-bom.version").isEqualTo("2.10.0"); + NodeAssert dependency = pom.nodeAtPath("//dependencyManagement/dependencies/dependency"); + assertThat(dependency).textAtPath("groupId").isEqualTo("com.fasterxml.jackson"); + assertThat(dependency).textAtPath("artifactId").isEqualTo("jackson-bom"); + assertThat(dependency).textAtPath("version").isEqualTo("${jackson-bom.version}"); + assertThat(dependency).textAtPath("scope").isEqualTo("import"); + assertThat(dependency).textAtPath("type").isEqualTo("pom"); + }); + } + + @Test + void moduleExclusionsAreIncludedInDependencyManagementOfGeneratedPom() throws IOException { + try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) { + out.println("plugins {"); + out.println(" id 'org.springframework.boot.bom'"); + out.println("}"); + out.println("bom {"); + out.println(" library('MySQL', '8.0.18') {"); + out.println(" group('mysql') {"); + out.println(" modules = ["); + out.println(" 'mysql-connector-java' {"); + out.println(" exclude group: 'com.google.protobuf', module: 'protobuf-java'"); + out.println(" }"); + out.println(" ]"); + out.println(" }"); + out.println(" }"); + out.println("}"); + } + generatePom((pom) -> { + assertThat(pom).textAtPath("//properties/mysql.version").isEqualTo("8.0.18"); + NodeAssert dependency = pom.nodeAtPath("//dependencyManagement/dependencies/dependency"); + assertThat(dependency).textAtPath("groupId").isEqualTo("mysql"); + assertThat(dependency).textAtPath("artifactId").isEqualTo("mysql-connector-java"); + assertThat(dependency).textAtPath("version").isEqualTo("${mysql.version}"); + assertThat(dependency).textAtPath("scope").isNullOrEmpty(); + assertThat(dependency).textAtPath("type").isNullOrEmpty(); + NodeAssert exclusion = dependency.nodeAtPath("exclusions/exclusion"); + assertThat(exclusion).textAtPath("groupId").isEqualTo("com.google.protobuf"); + assertThat(exclusion).textAtPath("artifactId").isEqualTo("protobuf-java"); + }); + } + + private BuildResult runGradle(String... args) { + return GradleRunner.create().withDebug(true).withProjectDir(this.projectDir).withArguments(args) + .withPluginClasspath().build(); + } + + private void generatePom(Consumer consumer) { + runGradle(DeployedPlugin.GENERATE_POM_TASK_NAME, "-s"); + File generatedPomXml = new File(this.projectDir, "build/publications/maven/pom-default.xml"); + try (Reader reader = new FileReader(generatedPomXml)) { + System.out.println(FileCopyUtils.copyToString(reader)); + } + catch (IOException ex) { + + } + assertThat(generatedPomXml).isFile(); + consumer.accept(new NodeAssert(generatedPomXml)); + } + +} diff --git a/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/ArtifactVersionDependencyVersionTests.java b/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/ArtifactVersionDependencyVersionTests.java new file mode 100644 index 000000000000..643baa221998 --- /dev/null +++ b/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/ArtifactVersionDependencyVersionTests.java @@ -0,0 +1,119 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.version; + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link ArtifactVersionDependencyVersion}. + * + * @author Andy Wilkinson + */ +public class ArtifactVersionDependencyVersionTests { + + @Test + void parseWhenVersionIsNotAMavenVersionShouldReturnNull() { + assertThat(version("1.2.3.1")).isNull(); + } + + @Test + void parseWhenVersionIsAMavenVersionShouldReturnAVersion() { + assertThat(version("1.2.3")).isNotNull(); + } + + @Test + void isNewerThanWhenInputIsOlderMajorShouldReturnTrue() { + assertThat(version("2.1.2").isNewerThan(version("1.9.0"))).isTrue(); + } + + @Test + void isNewerThanWhenInputIsOlderMinorShouldReturnTrue() { + assertThat(version("2.1.2").isNewerThan(version("2.0.2"))).isTrue(); + } + + @Test + void isNewerThanWhenInputIsOlderPatchShouldReturnTrue() { + assertThat(version("2.1.2").isNewerThan(version("2.1.1"))).isTrue(); + } + + @Test + void isNewerThanWhenInputIsNewerMajorShouldReturnFalse() { + assertThat(version("2.1.2").isNewerThan(version("3.2.1"))).isFalse(); + } + + @Test + void isSameMajorAndNewerThanWhenMinorIsOlderShouldReturnTrue() { + assertThat(version("1.10.2").isSameMajorAndNewerThan(version("1.9.0"))).isTrue(); + } + + @Test + void isSameMajorAndNewerThanWhenMajorIsOlderShouldReturnFalse() { + assertThat(version("2.0.2").isSameMajorAndNewerThan(version("1.9.0"))).isFalse(); + } + + @Test + void isSameMajorAndNewerThanWhenPatchIsNewerShouldReturnTrue() { + assertThat(version("2.1.2").isSameMajorAndNewerThan(version("2.1.1"))).isTrue(); + } + + @Test + void isSameMajorAndNewerThanWhenMinorIsNewerShouldReturnFalse() { + assertThat(version("2.1.2").isSameMajorAndNewerThan(version("2.2.1"))).isFalse(); + } + + @Test + void isSameMajorAndNewerThanWhenMajorIsNewerShouldReturnFalse() { + assertThat(version("2.1.2").isSameMajorAndNewerThan(version("3.0.1"))).isFalse(); + } + + @Test + void isSameMinorAndNewerThanWhenPatchIsOlderShouldReturnTrue() { + assertThat(version("1.10.2").isSameMinorAndNewerThan(version("1.10.1"))).isTrue(); + } + + @Test + void isSameMinorAndNewerThanWhenMinorIsOlderShouldReturnFalse() { + assertThat(version("2.1.2").isSameMinorAndNewerThan(version("2.0.1"))).isFalse(); + } + + @Test + void isSameMinorAndNewerThanWhenVersionsAreTheSameShouldReturnFalse() { + assertThat(version("2.1.2").isSameMinorAndNewerThan(version("2.1.2"))).isFalse(); + } + + @Test + void isSameMinorAndNewerThanWhenPatchIsNewerShouldReturnFalse() { + assertThat(version("2.1.2").isSameMinorAndNewerThan(version("2.1.3"))).isFalse(); + } + + @Test + void isSameMinorAndNewerThanWhenMinorIsNewerShouldReturnFalse() { + assertThat(version("2.1.2").isSameMinorAndNewerThan(version("2.0.1"))).isFalse(); + } + + @Test + void isSameMinorAndNewerThanWhenMajorIsNewerShouldReturnFalse() { + assertThat(version("3.1.2").isSameMinorAndNewerThan(version("2.0.1"))).isFalse(); + } + + private ArtifactVersionDependencyVersion version(String version) { + return ArtifactVersionDependencyVersion.parse(version); + } + +} diff --git a/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/DependencyVersionTests.java b/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/DependencyVersionTests.java new file mode 100644 index 000000000000..2e0b16d7f0f7 --- /dev/null +++ b/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/DependencyVersionTests.java @@ -0,0 +1,55 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.version; + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link DependencyVersion}. + * + * @author Andy Wilkinson + */ +public class DependencyVersionTests { + + @Test + void parseWhenValidMavenVersionShouldReturnArtifactVersionDependencyVersion() { + assertThat(DependencyVersion.parse("1.2.3.Final")).isInstanceOf(ArtifactVersionDependencyVersion.class); + } + + @Test + void parseWhenReleaseTrainShouldReturnReleaseTrainDependencyVersion() { + assertThat(DependencyVersion.parse("Ingalls-SR5")).isInstanceOf(ReleaseTrainDependencyVersion.class); + } + + @Test + void parseWhenMavenLikeVersionWithNumericQualifieShouldReturnNumericQualifierDependencyVersion() { + assertThat(DependencyVersion.parse("1.2.3.4")).isInstanceOf(NumericQualifierDependencyVersion.class); + } + + @Test + void parseWhenVersionWithLeadingZeroesShouldReturnLeadingZeroesDependencyVersion() { + assertThat(DependencyVersion.parse("1.4.01")).isInstanceOf(LeadingZeroesDependencyVersion.class); + } + + @Test + void parseWhenVersionWithCombinedPatchAndQualifierShouldReturnCombinedPatchAndQualifierDependencyVersion() { + assertThat(DependencyVersion.parse("4.0.0M4")).isInstanceOf(CombinedPatchAndQualifierDependencyVersion.class); + } + +} diff --git a/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/NumericQualifierDependencyVersionTests.java b/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/NumericQualifierDependencyVersionTests.java new file mode 100644 index 000000000000..5e58d3a99c27 --- /dev/null +++ b/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/NumericQualifierDependencyVersionTests.java @@ -0,0 +1,54 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.version; + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link NumericQualifierDependencyVersion}. + * + * @author Andy Wilkinson + */ +public class NumericQualifierDependencyVersionTests { + + @Test + void isNewerThanOnVersionWithNumericQualifierWhenInputHasNoQualifierShouldReturnTrue() { + assertThat(version("2.9.9.20190806").isNewerThan(DependencyVersion.parse("2.9.9"))).isTrue(); + } + + @Test + void isNewerThanOnVersionWithNumericQualifierWhenInputHasOlderQualifierShouldReturnTrue() { + assertThat(version("2.9.9.20190806").isNewerThan(version("2.9.9.20190805"))).isTrue(); + } + + @Test + void isNewerThanOnVersionWithNumericQualifierWhenInputHasNewerQualifierShouldReturnFalse() { + assertThat(version("2.9.9.20190806").isNewerThan(version("2.9.9.20190807"))).isFalse(); + } + + @Test + void isNewerThanOnVersionWithNumericQualifierWhenInputHasSameQualifierShouldReturnFalse() { + assertThat(version("2.9.9.20190806").isNewerThan(version("2.9.9.20190806"))).isFalse(); + } + + private NumericQualifierDependencyVersion version(String version) { + return NumericQualifierDependencyVersion.parse(version); + } + +} diff --git a/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersionTests.java b/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersionTests.java new file mode 100644 index 000000000000..6010bfd07506 --- /dev/null +++ b/buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/ReleaseTrainDependencyVersionTests.java @@ -0,0 +1,99 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.bom.bomr.version; + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link ReleaseTrainDependencyVersion}. + * + * @author Andy Wilkinson + */ +public class ReleaseTrainDependencyVersionTests { + + @Test + void parsingOfANonReleaseTrainVersionReturnsNull() { + assertThat(version("5.1.4.RELEASE")).isNull(); + } + + @Test + void parsingOfAReleaseTrainVersionReturnsVersion() { + assertThat(version("Lovelace-SR3")).isNotNull(); + } + + @Test + void isNewerThanWhenReleaseTrainIsNewerShouldReturnTrue() { + assertThat(version("Lovelace-RELEASE").isNewerThan(version("Kay-SR5"))).isTrue(); + } + + @Test + void isNewerThanWhenVersionIsNewerShouldReturnTrue() { + assertThat(version("Kay-SR10").isNewerThan(version("Kay-SR5"))).isTrue(); + } + + @Test + void isNewerThanWhenVersionIsOlderShouldReturnFalse() { + assertThat(version("Kay-RELEASE").isNewerThan(version("Kay-SR5"))).isFalse(); + } + + @Test + void isNewerThanWhenReleaseTrainIsOlderShouldReturnFalse() { + assertThat(version("Ingalls-RELEASE").isNewerThan(version("Kay-SR5"))).isFalse(); + } + + @Test + void isSameMajorAndNewerWhenWhenReleaseTrainIsNewerShouldReturnTrue() { + assertThat(version("Lovelace-RELEASE").isSameMajorAndNewerThan(version("Kay-SR5"))).isTrue(); + } + + @Test + void isSameMajorAndNewerThanWhenReleaseTrainIsOlderShouldReturnFalse() { + assertThat(version("Ingalls-RELEASE").isSameMajorAndNewerThan(version("Kay-SR5"))).isFalse(); + } + + @Test + void isSameMajorAndNewerThanWhenVersionIsNewerShouldReturnTrue() { + assertThat(version("Kay-SR6").isSameMajorAndNewerThan(version("Kay-SR5"))).isTrue(); + } + + @Test + void isSameMinorAndNewerThanWhenReleaseTrainIsNewerShouldReturnFalse() { + assertThat(version("Lovelace-RELEASE").isSameMinorAndNewerThan(version("Kay-SR5"))).isFalse(); + } + + @Test + void isSameMinorAndNewerThanWhenReleaseTrainIsTheSameAndVersionIsNewerShouldReturnTrue() { + assertThat(version("Kay-SR6").isSameMinorAndNewerThan(version("Kay-SR5"))).isTrue(); + } + + @Test + void isSameMinorAndNewerThanWhenReleaseTrainAndVersionAreTheSameShouldReturnFalse() { + assertThat(version("Kay-SR6").isSameMinorAndNewerThan(version("Kay-SR6"))).isFalse(); + } + + @Test + void isSameMinorAndNewerThanWhenReleaseTrainIsTheSameAndVersionIsOlderShouldReturnFalse() { + assertThat(version("Kay-SR6").isSameMinorAndNewerThan(version("Kay-SR7"))).isFalse(); + } + + private static ReleaseTrainDependencyVersion version(String input) { + return ReleaseTrainDependencyVersion.parse(input); + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntryTests.java b/buildSrc/src/test/java/org/springframework/boot/build/context/properties/CompoundConfigurationTableEntryTests.java similarity index 65% rename from spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntryTests.java rename to buildSrc/src/test/java/org/springframework/boot/build/context/properties/CompoundConfigurationTableEntryTests.java index 0e06b5950992..2f229b93b75f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntryTests.java +++ b/buildSrc/src/test/java/org/springframework/boot/build/context/properties/CompoundConfigurationTableEntryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -14,12 +14,10 @@ * limitations under the License. */ -package org.springframework.boot.configurationdocs; +package org.springframework.boot.build.context.properties; import org.junit.jupiter.api.Test; -import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty; - import static org.assertj.core.api.Assertions.assertThat; /** @@ -27,21 +25,15 @@ * * @author Brian Clozel */ -class CompoundConfigurationTableEntryTests { +public class CompoundConfigurationTableEntryTests { private static String NEWLINE = System.lineSeparator(); @Test void simpleProperty() { - ConfigurationMetadataProperty firstProp = new ConfigurationMetadataProperty(); - firstProp.setId("spring.test.first"); - firstProp.setType("java.lang.String"); - ConfigurationMetadataProperty secondProp = new ConfigurationMetadataProperty(); - secondProp.setId("spring.test.second"); - secondProp.setType("java.lang.String"); - ConfigurationMetadataProperty thirdProp = new ConfigurationMetadataProperty(); - thirdProp.setId("spring.test.third"); - thirdProp.setType("java.lang.String"); + ConfigurationProperty firstProp = new ConfigurationProperty("spring.test.first", "java.lang.String"); + ConfigurationProperty secondProp = new ConfigurationProperty("spring.test.second", "java.lang.String"); + ConfigurationProperty thirdProp = new ConfigurationProperty("spring.test.third", "java.lang.String"); CompoundConfigurationTableEntry entry = new CompoundConfigurationTableEntry("spring.test", "This is a description."); entry.addConfigurationKeys(firstProp, secondProp, thirdProp); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/ConfigurationTableTests.java b/buildSrc/src/test/java/org/springframework/boot/build/context/properties/ConfigurationTableTests.java similarity index 67% rename from spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/ConfigurationTableTests.java rename to buildSrc/src/test/java/org/springframework/boot/build/context/properties/ConfigurationTableTests.java index 2b15a4767584..c757c73f16e9 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/ConfigurationTableTests.java +++ b/buildSrc/src/test/java/org/springframework/boot/build/context/properties/ConfigurationTableTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -14,12 +14,10 @@ * limitations under the License. */ -package org.springframework.boot.configurationdocs; +package org.springframework.boot.build.context.properties; import org.junit.jupiter.api.Test; -import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty; - import static org.assertj.core.api.Assertions.assertThat; /** @@ -27,23 +25,17 @@ * * @author Brian Clozel */ -class ConfigurationTableTests { +public class ConfigurationTableTests { private static String NEWLINE = System.lineSeparator(); @Test void simpleTable() { ConfigurationTable table = new ConfigurationTable("test"); - ConfigurationMetadataProperty first = new ConfigurationMetadataProperty(); - first.setId("spring.test.prop"); - first.setDefaultValue("something"); - first.setDescription("This is a description."); - first.setType("java.lang.String"); - ConfigurationMetadataProperty second = new ConfigurationMetadataProperty(); - second.setId("spring.test.other"); - second.setDefaultValue("other value"); - second.setDescription("This is another description."); - second.setType("java.lang.String"); + ConfigurationProperty first = new ConfigurationProperty("spring.test.prop", "java.lang.String", "something", + "This is a description.", false); + ConfigurationProperty second = new ConfigurationProperty("spring.test.other", "java.lang.String", "other value", + "This is another description.", false); table.addEntry(new SingleConfigurationTableEntry(first)); table.addEntry(new SingleConfigurationTableEntry(second)); assertThat(table.toAsciidocTable()).isEqualTo("[cols=\"1,1,2\", options=\"header\"]" + NEWLINE + "|===" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntryTests.java b/buildSrc/src/test/java/org/springframework/boot/build/context/properties/SingleConfigurationTableEntryTests.java similarity index 63% rename from spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntryTests.java rename to buildSrc/src/test/java/org/springframework/boot/build/context/properties/SingleConfigurationTableEntryTests.java index 013320c729b3..615cdca6aee1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntryTests.java +++ b/buildSrc/src/test/java/org/springframework/boot/build/context/properties/SingleConfigurationTableEntryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -14,12 +14,10 @@ * limitations under the License. */ -package org.springframework.boot.configurationdocs; +package org.springframework.boot.build.context.properties; import org.junit.jupiter.api.Test; -import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty; - import static org.assertj.core.api.Assertions.assertThat; /** @@ -27,17 +25,14 @@ * * @author Brian Clozel */ -class SingleConfigurationTableEntryTests { +public class SingleConfigurationTableEntryTests { private static String NEWLINE = System.lineSeparator(); @Test void simpleProperty() { - ConfigurationMetadataProperty property = new ConfigurationMetadataProperty(); - property.setId("spring.test.prop"); - property.setDefaultValue("something"); - property.setDescription("This is a description."); - property.setType("java.lang.String"); + ConfigurationProperty property = new ConfigurationProperty("spring.test.prop", "java.lang.String", "something", + "This is a description.", false); SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); AsciidocBuilder builder = new AsciidocBuilder(); entry.write(builder); @@ -47,10 +42,8 @@ void simpleProperty() { @Test void noDefaultValue() { - ConfigurationMetadataProperty property = new ConfigurationMetadataProperty(); - property.setId("spring.test.prop"); - property.setDescription("This is a description."); - property.setType("java.lang.String"); + ConfigurationProperty property = new ConfigurationProperty("spring.test.prop", "java.lang.String", null, + "This is a description.", false); SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); AsciidocBuilder builder = new AsciidocBuilder(); entry.write(builder); @@ -60,11 +53,8 @@ void noDefaultValue() { @Test void defaultValueWithPipes() { - ConfigurationMetadataProperty property = new ConfigurationMetadataProperty(); - property.setId("spring.test.prop"); - property.setDefaultValue("first|second"); - property.setDescription("This is a description."); - property.setType("java.lang.String"); + ConfigurationProperty property = new ConfigurationProperty("spring.test.prop", "java.lang.String", + "first|second", "This is a description.", false); SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); AsciidocBuilder builder = new AsciidocBuilder(); entry.write(builder); @@ -74,11 +64,8 @@ void defaultValueWithPipes() { @Test void defaultValueWithBackslash() { - ConfigurationMetadataProperty property = new ConfigurationMetadataProperty(); - property.setId("spring.test.prop"); - property.setDefaultValue("first\\second"); - property.setDescription("This is a description."); - property.setType("java.lang.String"); + ConfigurationProperty property = new ConfigurationProperty("spring.test.prop", "java.lang.String", + "first\\second", "This is a description.", false); SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); AsciidocBuilder builder = new AsciidocBuilder(); entry.write(builder); @@ -88,10 +75,8 @@ void defaultValueWithBackslash() { @Test void descriptionWithPipe() { - ConfigurationMetadataProperty property = new ConfigurationMetadataProperty(); - property.setId("spring.test.prop"); - property.setDescription("This is a description with a | pipe."); - property.setType("java.lang.String"); + ConfigurationProperty property = new ConfigurationProperty("spring.test.prop", "java.lang.String", null, + "This is a description with a | pipe.", false); SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); AsciidocBuilder builder = new AsciidocBuilder(); entry.write(builder); @@ -101,10 +86,8 @@ void descriptionWithPipe() { @Test void mapProperty() { - ConfigurationMetadataProperty property = new ConfigurationMetadataProperty(); - property.setId("spring.test.prop"); - property.setDescription("This is a description."); - property.setType("java.util.Map"); + ConfigurationProperty property = new ConfigurationProperty("spring.test.prop", + "java.util.Map", null, "This is a description.", false); SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); AsciidocBuilder builder = new AsciidocBuilder(); entry.write(builder); @@ -115,11 +98,8 @@ void mapProperty() { @Test void listProperty() { String[] defaultValue = new String[] { "first", "second", "third" }; - ConfigurationMetadataProperty property = new ConfigurationMetadataProperty(); - property.setId("spring.test.prop"); - property.setDescription("This is a description."); - property.setType("java.util.List"); - property.setDefaultValue(defaultValue); + ConfigurationProperty property = new ConfigurationProperty("spring.test.prop", + "java.util.List", defaultValue, "This is a description.", false); SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); AsciidocBuilder builder = new AsciidocBuilder(); entry.write(builder); diff --git a/buildSrc/src/test/java/org/springframework/boot/build/log4j2/ReproduciblePluginsDatActionTests.java b/buildSrc/src/test/java/org/springframework/boot/build/log4j2/ReproduciblePluginsDatActionTests.java new file mode 100644 index 000000000000..f482f5353e96 --- /dev/null +++ b/buildSrc/src/test/java/org/springframework/boot/build/log4j2/ReproduciblePluginsDatActionTests.java @@ -0,0 +1,80 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.log4j2; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Vector; + +import org.apache.logging.log4j.core.config.plugins.processor.PluginCache; +import org.apache.logging.log4j.core.config.plugins.processor.PluginEntry; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link ReproducibleLog4j2PluginsDatAction} + * + * @author Andy Wilkinson + */ +public class ReproduciblePluginsDatActionTests { + + @Test + void postProcessingOrdersCategoriesAndPlugins() throws IOException { + Path datFile = Files.createTempFile("Log4j2Plugins", "dat"); + try { + write(datFile); + PluginCache cache = new PluginCache(); + cache.loadCacheFiles(new Vector<>(Arrays.asList(datFile.toUri().toURL())).elements()); + assertThat(cache.getAllCategories().keySet()).containsExactly("one", "two"); + assertThat(cache.getCategory("one").keySet()).containsExactly("alpha", "bravo", "charlie"); + assertThat(cache.getCategory("two").keySet()).containsExactly("delta", "echo", "foxtrot"); + } + finally { + Files.delete(datFile); + } + } + + private void write(Path datFile) throws IOException { + PluginCache cache = new PluginCache(); + createCategory(cache, "two", Arrays.asList("delta", "foxtrot", "echo")); + createCategory(cache, "one", Arrays.asList("bravo", "alpha", "charlie")); + try (OutputStream output = new FileOutputStream(datFile.toFile())) { + cache.writeCache(output); + new ReproducibleLog4j2PluginsDatAction().postProcess(datFile.toFile()); + } + } + + private void createCategory(PluginCache cache, String categoryName, List entryNames) { + Map category = cache.getCategory(categoryName); + for (String entryName : entryNames) { + PluginEntry entry = new PluginEntry(); + entry.setKey(entryName); + entry.setClassName("com.example.Plugin"); + entry.setName("name"); + entry.setCategory(categoryName); + category.put(entryName, entry); + } + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/ExampleController.java b/buildSrc/src/test/java/org/springframework/boot/build/mavenplugin/PluginXmlParserTests.java similarity index 52% rename from spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/ExampleController.java rename to buildSrc/src/test/java/org/springframework/boot/build/mavenplugin/PluginXmlParserTests.java index 6c0cbe3ca0b4..b5a4f8382041 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/ExampleController.java +++ b/buildSrc/src/test/java/org/springframework/boot/build/mavenplugin/PluginXmlParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,24 +14,27 @@ * limitations under the License. */ -package org.springframework.boot.load.it.war; +package org.springframework.boot.build.mavenplugin; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import java.io.File; + +import org.junit.jupiter.api.Test; + +import org.springframework.boot.build.mavenplugin.PluginXmlParser.Plugin; /** - * Simple example Spring MVC Controller. + * Tests for {@link PluginXmlParser}. * - * @author Phillip Webb + * @author Andy Wilkinson */ -@Controller -public class ExampleController { +public class PluginXmlParserTests { + + private final PluginXmlParser parser = new PluginXmlParser(); - @RequestMapping("/") - @ResponseBody - public String helloWorld() { - return "Hello Embedded WAR World!"; + @Test + void dunno() { + Plugin plugin = this.parser.parse(new File("src/test/resources/plugin.xml")); + System.out.println(plugin); } } diff --git a/buildSrc/src/test/java/org/springframework/boot/build/optional/OptionalDependenciesPluginIntegrationTests.java b/buildSrc/src/test/java/org/springframework/boot/build/optional/OptionalDependenciesPluginIntegrationTests.java new file mode 100644 index 000000000000..d5585ee9e6c9 --- /dev/null +++ b/buildSrc/src/test/java/org/springframework/boot/build/optional/OptionalDependenciesPluginIntegrationTests.java @@ -0,0 +1,110 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.optional; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.GradleRunner; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Integration tests for {@link OptionalDependenciesPlugin}. + * + * @author Andy Wilkinson + */ +public class OptionalDependenciesPluginIntegrationTests { + + private File projectDir; + + private File buildFile; + + @BeforeEach + public void setup(@TempDir File projectDir) throws IOException { + this.projectDir = projectDir; + this.buildFile = new File(this.projectDir, "build.gradle"); + } + + @Test + void optionalConfigurationIsCreated() throws IOException { + try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) { + out.println("plugins { id 'org.springframework.boot.optional-dependencies' }"); + out.println("task printConfigurations {"); + out.println(" doLast {"); + out.println(" configurations.all { println it.name }"); + out.println(" }"); + out.println("}"); + } + BuildResult buildResult = runGradle("printConfigurations"); + assertThat(buildResult.getOutput()).contains("optional"); + } + + @Test + void optionalDependenciesAreAddedToMainSourceSetsCompileClasspath() throws IOException { + optionalDependenciesAreAddedToSourceSetClasspath("main", "compileClasspath"); + } + + @Test + void optionalDependenciesAreAddedToMainSourceSetsRuntimeClasspath() throws IOException { + optionalDependenciesAreAddedToSourceSetClasspath("main", "runtimeClasspath"); + } + + @Test + void optionalDependenciesAreAddedToTestSourceSetsCompileClasspath() throws IOException { + optionalDependenciesAreAddedToSourceSetClasspath("test", "compileClasspath"); + } + + @Test + void optionalDependenciesAreAddedToTestSourceSetsRuntimeClasspath() throws IOException { + optionalDependenciesAreAddedToSourceSetClasspath("test", "runtimeClasspath"); + } + + public void optionalDependenciesAreAddedToSourceSetClasspath(String sourceSet, String classpath) + throws IOException { + try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) { + out.println("plugins {"); + out.println(" id 'org.springframework.boot.optional-dependencies'"); + out.println(" id 'java'"); + out.println("}"); + out.println("repositories {"); + out.println(" mavenCentral()"); + out.println("}"); + out.println("dependencies {"); + out.println(" optional 'org.springframework:spring-jcl:5.1.2.RELEASE'"); + out.println("}"); + out.println("task printClasspath {"); + out.println(" doLast {"); + out.println(" println sourceSets." + sourceSet + "." + classpath + ".files"); + out.println(" }"); + out.println("}"); + } + BuildResult buildResult = runGradle("printClasspath"); + assertThat(buildResult.getOutput()).contains("spring-jcl"); + } + + private BuildResult runGradle(String... args) { + return GradleRunner.create().withProjectDir(this.projectDir).withArguments(args).withPluginClasspath().build(); + } + +} diff --git a/buildSrc/src/test/resources/plugin.xml b/buildSrc/src/test/resources/plugin.xml new file mode 100644 index 000000000000..f9464b5a5dd2 --- /dev/null +++ b/buildSrc/src/test/resources/plugin.xml @@ -0,0 +1,911 @@ + + + + + + Spring Boot Maven Plugin + + org.springframework.boot + spring-boot-maven-plugin + 2.2.0.GRADLE-SNAPSHOT + spring-boot + false + true + + + build-info + Generate a {@code build-info.properties} file based the content of the current +{@link MavenProject}. + false + true + false + false + false + true + generate-resources + org.springframework.boot.maven.BuildInfoMojo + java + per-lookup + once-per-session + 1.4.0 + true + + + additionalProperties + java.util.Map + false + true + Additional properties to store in the build-info.properties. Each entry is prefixed +by {@code build.} in the generated build-info.properties. + + + outputFile + java.io.File + false + true + The location of the generated build-info.properties. + + + project + org.apache.maven.project.MavenProject + true + false + The Maven project. + + + session + org.apache.maven.execution.MavenSession + true + false + The Maven session. + + + time + java.lang.String + 2.2.0 + false + true + The value used for the {@code build.time} property in a form suitable for +{@link Instant#parse(CharSequence)}. Defaults to {@code session.request.startTime}. +To disable the {@code build.time} property entirely, use {@code 'off'}. + + + + + + + + + + org.sonatype.plexus.build.incremental.BuildContext + buildContext + + + + + help + Display help information on spring-boot-maven-plugin.<br> +Call <code>mvn spring-boot:help -Ddetail=true -Dgoal=&lt;goal-name&gt;</code> to display parameter details. + false + false + false + false + false + true + org.springframework.boot.maven.HelpMojo + java + per-lookup + once-per-session + true + + + detail + boolean + false + true + If <code>true</code>, display all settable properties for each goal. + + + goal + java.lang.String + false + true + The name of the goal for which to show help. If unspecified, all goals will be displayed. + + + indentSize + int + false + true + The number of spaces per indentation level, should be positive. + + + lineLength + int + false + true + The maximum length of a display line, should be positive. + + + + ${detail} + ${goal} + ${indentSize} + ${lineLength} + + + + repackage + Repackages existing JAR and WAR archives so that they can be executed from the command +line using {@literal java -jar}. With <code>layout=NONE</code> can also be used simply +to package a JAR with nested dependencies (and no main class, so not executable). + compile+runtime + false + true + false + false + false + true + package + org.springframework.boot.maven.RepackageMojo + java + per-lookup + once-per-session + 1.0.0 + compile+runtime + true + + + attach + boolean + 1.4.0 + false + true + Attach the repackaged archive to be installed and deployed. + + + classifier + java.lang.String + 1.0.0 + false + true + Classifier to add to the repackaged archive. If not given, the main artifact will +be replaced by the repackaged archive. If given, the classifier will also be used +to determine the source archive to repackage: if an artifact with that classifier +already exists, it will be used as source and replaced. If no such artifact exists, +the main artifact will be used as source and the repackaged archive will be +attached as a supplemental artifact with that classifier. Attaching the artifact +allows to deploy it alongside to the original one, see <a href= +"https://maven.apache.org/plugins/maven-deploy-plugin/examples/deploying-with-classifiers.html" +>the Maven documentation for more details</a>. + + + embeddedLaunchScript + java.io.File + 1.3.0 + false + true + The embedded launch script to prepend to the front of the jar if it is fully +executable. If not specified the 'Spring Boot' default script will be used. + + + embeddedLaunchScriptProperties + java.util.Properties + 1.3.0 + false + true + Properties that should be expanded in the embedded launch script. + + + excludeDevtools + boolean + 1.3.0 + false + true + Exclude Spring Boot devtools from the repackaged archive. + + + excludeGroupIds + java.lang.String + 1.1.0 + false + true + Comma separated list of groupId names to exclude (exact match). + + + excludes + java.util.List + 1.1.0 + false + true + Collection of artifact definitions to exclude. The {@link Exclude} element defines +a {@code groupId} and {@code artifactId} mandatory properties and an optional +{@code classifier} property. + + + executable + boolean + 1.3.0 + false + true + Make a fully executable jar for *nix machines by prepending a launch script to the +jar. +<p> +Currently, some tools do not accept this format so you may not always be able to +use this technique. For example, {@code jar -xf} may silently fail to extract a jar +or war that has been made fully-executable. It is recommended that you only enable +this option if you intend to execute it directly, rather than running it with +{@code java -jar} or deploying it to a servlet container. + + + finalName + java.lang.String + 1.0.0 + false + false + Name of the generated archive. + + + includeSystemScope + boolean + 1.4.0 + false + true + Include system scoped dependencies. + + + includes + java.util.List + 1.2.0 + false + true + Collection of artifact definitions to include. The {@link Include} element defines +a {@code groupId} and {@code artifactId} mandatory properties and an optional +{@code classifier} property. + + + layout + org.springframework.boot.maven.RepackageMojo$LayoutType + 1.0.0 + false + true + The type of archive (which corresponds to how the dependencies are laid out inside +it). Possible values are JAR, WAR, ZIP, DIR, NONE. Defaults to a guess based on the +archive type. + + + layoutFactory + org.springframework.boot.loader.tools.LayoutFactory + 1.5.0 + false + true + The layout factory that will be used to create the executable archive if no +explicit layout is set. Alternative layouts implementations can be provided by 3rd +parties. + + + mainClass + java.lang.String + 1.0.0 + false + true + The name of the main class. If not specified the first compiled class found that +contains a 'main' method will be used. + + + outputDirectory + java.io.File + 1.0.0 + true + true + Directory containing the generated archive. + + + project + org.apache.maven.project.MavenProject + 1.0.0 + true + false + The Maven project. + + + requiresUnpack + java.util.List + 1.1.0 + false + true + A list of the libraries that must be unpacked from fat jars in order to run. +Specify each library as a {@code <dependency>} with a {@code <groupId>} and a +{@code <artifactId>} and they will be unpacked at runtime. + + + skip + boolean + 1.2.0 + false + true + Skip the execution. + + + + + ${spring-boot.repackage.excludeDevtools} + ${spring-boot.excludeGroupIds} + ${spring-boot.excludes} + + + + ${spring-boot.includes} + ${spring-boot.repackage.layout} + + + ${spring-boot.repackage.skip} + + + + org.apache.maven.project.MavenProjectHelper + projectHelper + + + + + run + Run an executable archive application. + test + false + true + false + false + false + true + validate + test-compile + org.springframework.boot.maven.RunMojo + java + per-lookup + once-per-session + 1.0.0 + false + + + addResources + boolean + 1.0.0 + false + true + Add maven resources to the classpath directly, this allows live in-place editing of +resources. Duplicate resources are removed from {@code target/classes} to prevent +them to appear twice if {@code ClassLoader.getResources()} is called. Please +consider adding {@code spring-boot-devtools} to your project instead as it provides +this feature and many more. + + + agent + java.io.File[] + 1.0.0 + since 2.2.0 in favor of {@code agents} + false + true + Path to agent jar. NOTE: a forked process is required to use this feature. + + + agents + java.io.File[] + 2.2.0 + false + true + Path to agent jars. NOTE: a forked process is required to use this feature. + + + arguments + java.lang.String[] + 1.0.0 + false + true + Arguments that should be passed to the application. On command line use commas to +separate multiple arguments. + + + classesDirectory + java.io.File + 1.0.0 + true + true + Directory containing the classes and resource files that should be packaged into +the archive. + + + environmentVariables + java.util.Map + 2.1.0 + false + true + List of Environment variables that should be associated with the forked process +used to run the application. NOTE: a forked process is required to use this +feature. + + + excludeGroupIds + java.lang.String + 1.1.0 + false + true + Comma separated list of groupId names to exclude (exact match). + + + excludes + java.util.List + 1.1.0 + false + true + Collection of artifact definitions to exclude. The {@link Exclude} element defines +a {@code groupId} and {@code artifactId} mandatory properties and an optional +{@code classifier} property. + + + folders + java.lang.String[] + 1.0.0 + false + true + Additional folders besides the classes directory that should be added to the +classpath. + + + fork + boolean + 1.2.0 + false + true + Flag to indicate if the run processes should be forked. Disabling forking will +disable some features such as an agent, custom JVM arguments, devtools or +specifying the working directory to use. + + + includes + java.util.List + 1.2.0 + false + true + Collection of artifact definitions to include. The {@link Include} element defines +a {@code groupId} and {@code artifactId} mandatory properties and an optional +{@code classifier} property. + + + jvmArguments + java.lang.String + 1.1.0 + false + true + JVM arguments that should be associated with the forked process used to run the +application. On command line, make sure to wrap multiple values between quotes. +NOTE: a forked process is required to use this feature. + + + mainClass + java.lang.String + 1.0.0 + false + true + The name of the main class. If not specified the first compiled class found that +contains a 'main' method will be used. + + + noverify + boolean + 1.0.0 + false + true + Flag to say that the agent requires -noverify. + + + optimizedLaunch + boolean + 2.2.0 + false + true + Whether the JVM's launch should be optimized. + + + profiles + java.lang.String[] + 1.3.0 + false + true + The spring profiles to activate. Convenience shortcut of specifying the +'spring.profiles.active' argument. On command line use commas to separate multiple +profiles. + + + project + org.apache.maven.project.MavenProject + 1.0.0 + true + false + The Maven project. + + + skip + boolean + 1.3.2 + false + true + Skip the execution. + + + systemPropertyVariables + java.util.Map + 2.1.0 + false + true + List of JVM system properties to pass to the process. NOTE: a forked process is +required to use this feature. + + + useTestClasspath + java.lang.Boolean + 1.3.0 + false + true + Flag to include the test classpath when running. + + + workingDirectory + java.io.File + 1.5.0 + false + true + Current working directory to use for the application. If not specified, basedir +will be used. NOTE: a forked process is required to use this feature. + + + + ${spring-boot.run.addResources} + ${spring-boot.run.agent} + ${spring-boot.run.agents} + ${spring-boot.run.arguments} + + ${spring-boot.excludeGroupIds} + ${spring-boot.excludes} + ${spring-boot.run.folders} + ${spring-boot.run.fork} + ${spring-boot.includes} + ${spring-boot.run.jvmArguments} + ${spring-boot.run.main-class} + ${spring-boot.run.noverify} + ${spring-boot.run.optimizedLaunch} + ${spring-boot.run.profiles} + + ${spring-boot.run.skip} + ${spring-boot.run.useTestClasspath} + ${spring-boot.run.workingDirectory} + + + + start + Start a spring application. Contrary to the {@code run} goal, this does not block and +allows other goal to operate on the application. This goal is typically used in +integration test scenario where the application is started before a test suite and +stopped after. + test + false + true + false + false + false + true + pre-integration-test + org.springframework.boot.maven.StartMojo + java + per-lookup + once-per-session + 1.3.0 + false + + + addResources + boolean + 1.0.0 + false + true + Add maven resources to the classpath directly, this allows live in-place editing of +resources. Duplicate resources are removed from {@code target/classes} to prevent +them to appear twice if {@code ClassLoader.getResources()} is called. Please +consider adding {@code spring-boot-devtools} to your project instead as it provides +this feature and many more. + + + agent + java.io.File[] + 1.0.0 + since 2.2.0 in favor of {@code agents} + false + true + Path to agent jar. NOTE: a forked process is required to use this feature. + + + agents + java.io.File[] + 2.2.0 + false + true + Path to agent jars. NOTE: a forked process is required to use this feature. + + + arguments + java.lang.String[] + 1.0.0 + false + true + Arguments that should be passed to the application. On command line use commas to +separate multiple arguments. + + + classesDirectory + java.io.File + 1.0.0 + true + true + Directory containing the classes and resource files that should be packaged into +the archive. + + + environmentVariables + java.util.Map + 2.1.0 + false + true + List of Environment variables that should be associated with the forked process +used to run the application. NOTE: a forked process is required to use this +feature. + + + excludeGroupIds + java.lang.String + 1.1.0 + false + true + Comma separated list of groupId names to exclude (exact match). + + + excludes + java.util.List + 1.1.0 + false + true + Collection of artifact definitions to exclude. The {@link Exclude} element defines +a {@code groupId} and {@code artifactId} mandatory properties and an optional +{@code classifier} property. + + + folders + java.lang.String[] + 1.0.0 + false + true + Additional folders besides the classes directory that should be added to the +classpath. + + + fork + boolean + 1.2.0 + false + true + Flag to indicate if the run processes should be forked. Disabling forking will +disable some features such as an agent, custom JVM arguments, devtools or +specifying the working directory to use. + + + includes + java.util.List + 1.2.0 + false + true + Collection of artifact definitions to include. The {@link Include} element defines +a {@code groupId} and {@code artifactId} mandatory properties and an optional +{@code classifier} property. + + + jmxName + java.lang.String + false + true + The JMX name of the automatically deployed MBean managing the lifecycle of the +spring application. + + + jmxPort + int + false + true + The port to use to expose the platform MBeanServer if the application is forked. + + + jvmArguments + java.lang.String + 1.1.0 + false + true + JVM arguments that should be associated with the forked process used to run the +application. On command line, make sure to wrap multiple values between quotes. +NOTE: a forked process is required to use this feature. + + + mainClass + java.lang.String + 1.0.0 + false + true + The name of the main class. If not specified the first compiled class found that +contains a 'main' method will be used. + + + maxAttempts + int + false + true + The maximum number of attempts to check if the spring application is ready. +Combined with the "wait" argument, this gives a global timeout value (30 sec by +default) + + + noverify + boolean + 1.0.0 + false + true + Flag to say that the agent requires -noverify. + + + profiles + java.lang.String[] + 1.3.0 + false + true + The spring profiles to activate. Convenience shortcut of specifying the +'spring.profiles.active' argument. On command line use commas to separate multiple +profiles. + + + project + org.apache.maven.project.MavenProject + 1.0.0 + true + false + The Maven project. + + + skip + boolean + 1.3.2 + false + true + Skip the execution. + + + systemPropertyVariables + java.util.Map + 2.1.0 + false + true + List of JVM system properties to pass to the process. NOTE: a forked process is +required to use this feature. + + + useTestClasspath + java.lang.Boolean + 1.3.0 + false + true + Flag to include the test classpath when running. + + + wait + long + false + true + The number of milli-seconds to wait between each attempt to check if the spring +application is ready. + + + workingDirectory + java.io.File + 1.5.0 + false + true + Current working directory to use for the application. If not specified, basedir +will be used. NOTE: a forked process is required to use this feature. + + + + ${spring-boot.run.addResources} + ${spring-boot.run.agent} + ${spring-boot.run.agents} + ${spring-boot.run.arguments} + + ${spring-boot.excludeGroupIds} + ${spring-boot.excludes} + ${spring-boot.run.folders} + ${spring-boot.run.fork} + ${spring-boot.includes} + ${spring-boot.run.jvmArguments} + ${spring-boot.run.main-class} + ${spring-boot.run.noverify} + ${spring-boot.run.profiles} + + ${spring-boot.run.skip} + ${spring-boot.run.useTestClasspath} + ${spring-boot.run.workingDirectory} + + + + stop + Stop a spring application that has been started by the "start" goal. Typically invoked +once a test suite has completed. + false + true + false + false + false + true + post-integration-test + org.springframework.boot.maven.StopMojo + java + per-lookup + once-per-session + 1.3.0 + false + + + fork + java.lang.Boolean + 1.3.0 + false + true + Flag to indicate if process to stop was forked. By default, the value is inherited +from the {@link MavenProject}. If it is set, it must match the value used to +{@link StartMojo start} the process. + + + jmxName + java.lang.String + false + true + The JMX name of the automatically deployed MBean managing the lifecycle of the +application. + + + jmxPort + int + false + true + The port to use to lookup the platform MBeanServer if the application has been +forked. + + + project + org.apache.maven.project.MavenProject + 1.4.1 + true + false + The Maven project. + + + skip + boolean + 1.3.2 + false + true + Skip the execution. + + + + ${spring-boot.stop.fork} + + ${spring-boot.stop.skip} + + + + + diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 73131464cab7..e2aeb3871f2f 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -3,7 +3,7 @@ resource_types: type: docker-image source: repository: springio/artifactory-resource - tag: 0.0.10 + tag: 0.0.11-SNAPSHOT - name: pull-request type: docker-image source: @@ -209,19 +209,9 @@ jobs: timeout: ((task-timeout)) image: spring-boot-ci-image file: git-repo/ci/tasks/build-project.yml - - in_parallel: - - task: build-smoke-tests - timeout: ((task-timeout)) - image: spring-boot-ci-image - file: git-repo/ci/tasks/build-smoke-tests.yml - - task: build-integration-tests - timeout: ((task-timeout)) - image: spring-boot-ci-image - file: git-repo/ci/tasks/build-integration-tests.yml - - task: build-deployment-tests - timeout: ((task-timeout)) - image: spring-boot-ci-image - file: git-repo/ci/tasks/build-deployment-tests.yml + params: + GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle-enterprise-cache-username)) + GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle-enterprise-cache-password)) on_failure: do: - put: repo-status-build @@ -241,16 +231,15 @@ jobs: build_uri: "https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}" build_number: "${BUILD_PIPELINE_NAME}-${BUILD_JOB_NAME}-${BUILD_NAME}" disable_checksum_uploads: true - exclude: - - "**/*.effective-pom" - - "**/spring-boot-configuration-docs/**" - - "**/spring-boot-test-support/**" + threads: 8 artifact_set: - include: - "/**/spring-boot-docs-*.zip" properties: "zip.type": "docs" "zip.deployed": "false" + get_params: + threads: 8 on_failure: do: - put: slack-alert @@ -283,19 +272,6 @@ jobs: timeout: ((task-timeout)) image: spring-boot-ci-image file: git-repo/ci/tasks/build-pr-project.yml - - in_parallel: - - task: build-smoke-tests - timeout: ((task-timeout)) - image: spring-boot-ci-image - file: git-repo/ci/tasks/build-smoke-tests.yml - - task: build-integration-tests - timeout: ((task-timeout)) - image: spring-boot-ci-image - file: git-repo/ci/tasks/build-integration-tests.yml - - task: build-deployment-tests - timeout: ((task-timeout)) - image: spring-boot-ci-image - file: git-repo/ci/tasks/build-deployment-tests.yml on_success: put: git-pull-request params: @@ -321,19 +297,9 @@ jobs: timeout: ((task-timeout)) image: spring-boot-jdk11-ci-image file: git-repo/ci/tasks/build-project.yml - - in_parallel: - - task: build-smoke-tests - timeout: ((task-timeout)) - image: spring-boot-jdk11-ci-image - file: git-repo/ci/tasks/build-smoke-tests.yml - - task: build-integration-tests - timeout: ((task-timeout)) - image: spring-boot-jdk11-ci-image - file: git-repo/ci/tasks/build-integration-tests.yml - - task: build-deployment-tests - timeout: ((task-timeout)) - image: spring-boot-jdk11-ci-image - file: git-repo/ci/tasks/build-deployment-tests.yml + params: + GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle-enterprise-cache-username)) + GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle-enterprise-cache-password)) on_failure: do: - put: repo-status-jdk11-build @@ -362,24 +328,14 @@ jobs: - put: repo-status-jdk13-build params: { state: "pending", commit: "git-repo" } - do: - - task: build-project - privileged: true - timeout: ((task-timeout)) - image: spring-boot-jdk13-ci-image - file: git-repo/ci/tasks/build-project.yml - - in_parallel: - - task: build-smoke-tests - timeout: ((task-timeout)) - image: spring-boot-jdk13-ci-image - file: git-repo/ci/tasks/build-smoke-tests.yml - - task: build-integration-tests - timeout: ((task-timeout)) - image: spring-boot-jdk13-ci-image - file: git-repo/ci/tasks/build-integration-tests.yml - - task: build-deployment-tests - timeout: ((task-timeout)) - image: spring-boot-jdk13-ci-image - file: git-repo/ci/tasks/build-deployment-tests.yml + - task: build-project + privileged: true + timeout: ((task-timeout)) + image: spring-boot-jdk13-ci-image + file: git-repo/ci/tasks/build-project.yml + params: + GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle-enterprise-cache-username)) + GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle-enterprise-cache-password)) on_failure: do: - put: repo-status-jdk13-build @@ -412,6 +368,9 @@ jobs: tags: - WIN64 timeout: ((task-timeout)) + params: + GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle-enterprise-cache-username)) + GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle-enterprise-cache-password)) on_failure: do: - put: slack-alert @@ -437,6 +396,8 @@ jobs: file: git-repo/ci/tasks/stage.yml params: RELEASE_TYPE: M + GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle-enterprise-cache-username)) + GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle-enterprise-cache-password)) - put: artifactory-repo params: <<: *artifactory-params @@ -455,6 +416,8 @@ jobs: file: git-repo/ci/tasks/stage.yml params: RELEASE_TYPE: RC + GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle-enterprise-cache-username)) + GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle-enterprise-cache-password)) - put: artifactory-repo params: <<: *artifactory-params @@ -473,6 +436,8 @@ jobs: file: git-repo/ci/tasks/stage.yml params: RELEASE_TYPE: RELEASE + GRADLE_ENTERPRISE_CACHE_USERNAME: ((gradle-enterprise-cache-username)) + GRADLE_ENTERPRISE_CACHE_PASSWORD: ((gradle-enterprise-cache-password)) - put: artifactory-repo params: <<: *artifactory-params diff --git a/ci/scripts/build-deployment-tests.sh b/ci/scripts/build-deployment-tests.sh deleted file mode 100755 index c93fd0900837..000000000000 --- a/ci/scripts/build-deployment-tests.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -e - -source $(dirname $0)/common.sh -repository=$(pwd)/distribution-repository - -pushd git-repo > /dev/null -run_maven -f spring-boot-tests/spring-boot-deployment-tests/pom.xml clean install -U -Dfull -Drepository=file://${repository} -popd > /dev/null diff --git a/ci/scripts/build-integration-tests.sh b/ci/scripts/build-integration-tests.sh deleted file mode 100755 index 953eaebb1c74..000000000000 --- a/ci/scripts/build-integration-tests.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -e - -source $(dirname $0)/common.sh -repository=$(pwd)/distribution-repository - -pushd git-repo > /dev/null -run_maven -f spring-boot-tests/spring-boot-integration-tests/pom.xml clean install -U -Dfull -Drepository=file://${repository} -popd > /dev/null diff --git a/ci/scripts/build-project-windows.bat b/ci/scripts/build-project-windows.bat index efade5d1acfa..aa8b62e1abdf 100755 --- a/ci/scripts/build-project-windows.bat +++ b/ci/scripts/build-project-windows.bat @@ -1,6 +1,4 @@ SET "JAVA_HOME=C:\opt\jdk-8" SET PATH=%PATH%;C:\Program Files\Git\usr\bin cd git-repo - -echo ".\mvnw clean install" > build.log -.\mvnw clean install -U >> build.log 2>&1 || (sleep 1 && tail -n 3000 build.log && exit 1) \ No newline at end of file +.\gradlew --no-daemon --max-workers=4 build diff --git a/ci/scripts/build-project.sh b/ci/scripts/build-project.sh index da3c44e4723a..767884cbc9b9 100755 --- a/ci/scripts/build-project.sh +++ b/ci/scripts/build-project.sh @@ -5,6 +5,5 @@ source $(dirname $0)/common.sh repository=$(pwd)/distribution-repository pushd git-repo > /dev/null -run_maven -N clean verify -run_maven -f spring-boot-project/pom.xml clean deploy -U -Dfull -DaltDeploymentRepository=distribution::default::file://${repository} +./gradlew --no-daemon --max-workers=4 -PdeploymentRepository=${repository} build publishAllPublicationsToDeploymentRepository popd > /dev/null diff --git a/ci/scripts/build-smoke-tests.sh b/ci/scripts/build-smoke-tests.sh deleted file mode 100755 index cfb839c0efa7..000000000000 --- a/ci/scripts/build-smoke-tests.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -e - -source $(dirname $0)/common.sh -repository=$(pwd)/distribution-repository - -pushd git-repo > /dev/null -run_maven -f spring-boot-tests/spring-boot-smoke-tests/pom.xml clean install -U -Dfull -Drepository=file://${repository} -popd > /dev/null diff --git a/ci/scripts/stage.sh b/ci/scripts/stage.sh index 2ff3a71bb375..79aa2d584610 100755 --- a/ci/scripts/stage.sh +++ b/ci/scripts/stage.sh @@ -12,7 +12,7 @@ git clone git-repo stage-git-repo > /dev/null pushd stage-git-repo > /dev/null -snapshotVersion=$( get_revision_from_pom ) +snapshotVersion=$( awk -F '=' '$1 == "version" { print $2 }' gradle.properties ) if [[ $RELEASE_TYPE = "M" ]]; then stageVersion=$( get_next_milestone_release $snapshotVersion) nextVersion=$snapshotVersion @@ -27,23 +27,20 @@ else fi echo "Staging $stageVersion (next version will be $nextVersion)" +sed -i "s/version=$snapshotVersion/version=$stageVersion/" gradle.properties -set_revision_to_pom "$stageVersion" git config user.name "Spring Buildmaster" > /dev/null git config user.email "buildmaster@springframework.org" > /dev/null -git add pom.xml > /dev/null +git add gradle.properties > /dev/null git commit -m"Release v$stageVersion" > /dev/null git tag -a "v$stageVersion" -m"Release v$stageVersion" > /dev/null -run_maven -f spring-boot-project/pom.xml clean deploy -U -Dfull -DaltDeploymentRepository=distribution::default::file://${repository} -run_maven -f spring-boot-tests/spring-boot-smoke-tests/pom.xml clean install -U -Dfull -Drepository=file://${repository} -run_maven -f spring-boot-tests/spring-boot-integration-tests/pom.xml clean install -U -Dfull -Drepository=file://${repository} -run_maven -f spring-boot-tests/spring-boot-deployment-tests/pom.xml clean install -U -Dfull -Drepository=file://${repository} +./gradlew --no-daemon --max-workers=4 -PdeploymentRepository=${repository} build publishAllPublicationsToDeploymentRepository git reset --hard HEAD^ > /dev/null if [[ $nextVersion != $snapshotVersion ]]; then echo "Setting next development version (v$nextVersion)" - set_revision_to_pom "$nextVersion" + sed -i "s/version=$snapshotVersion/version=$nextVersion/" gradle.properties git add pom.xml > /dev/null git commit -m"Next development version (v$nextVersion)" > /dev/null fi; diff --git a/ci/tasks/build-deployment-tests.yml b/ci/tasks/build-deployment-tests.yml deleted file mode 100644 index e45a4c2a301b..000000000000 --- a/ci/tasks/build-deployment-tests.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -platform: linux -inputs: -- name: git-repo -- name: distribution-repository -caches: -- path: maven -- path: gradle -run: - path: git-repo/ci/scripts/build-deployment-tests.sh diff --git a/ci/tasks/build-integration-tests.yml b/ci/tasks/build-integration-tests.yml deleted file mode 100644 index bc96aa6cef45..000000000000 --- a/ci/tasks/build-integration-tests.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -platform: linux -inputs: -- name: git-repo -- name: distribution-repository -caches: -- path: maven -- path: gradle -run: - path: git-repo/ci/scripts/build-integration-tests.sh diff --git a/ci/tasks/build-pr-project.yml b/ci/tasks/build-pr-project.yml index b4576a4849fc..c3dbfc8c05ae 100644 --- a/ci/tasks/build-pr-project.yml +++ b/ci/tasks/build-pr-project.yml @@ -7,5 +7,8 @@ outputs: caches: - path: maven - path: gradle +params: + CI: true + GRADLE_ENTERPRISE_URL: https://ge.spring.io run: path: git-repo/ci/scripts/build-project.sh diff --git a/ci/tasks/build-project.yml b/ci/tasks/build-project.yml index 50e222c7d247..a22b6f5d9dea 100644 --- a/ci/tasks/build-project.yml +++ b/ci/tasks/build-project.yml @@ -8,6 +8,11 @@ caches: - path: maven - path: gradle - path: embedmongo +params: + CI: true + GRADLE_ENTERPRISE_CACHE_USERNAME: + GRADLE_ENTERPRISE_CACHE_PASSWORD: + GRADLE_ENTERPRISE_URL: https://ge.spring.io run: path: bash args: @@ -16,4 +21,3 @@ run: source /docker-lib.sh start_docker ${PWD}/git-repo/ci/scripts/build-project.sh - diff --git a/ci/tasks/build-smoke-tests.yml b/ci/tasks/build-smoke-tests.yml deleted file mode 100644 index a38dfb2ef9ff..000000000000 --- a/ci/tasks/build-smoke-tests.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -platform: linux -inputs: -- name: git-repo -- name: distribution-repository -caches: -- path: maven -- path: gradle -run: - path: git-repo/ci/scripts/build-smoke-tests.sh diff --git a/ci/tasks/stage.yml b/ci/tasks/stage.yml index f486313ae918..dd21db74f8e9 100644 --- a/ci/tasks/stage.yml +++ b/ci/tasks/stage.yml @@ -7,6 +7,10 @@ outputs: - name: distribution-repository params: RELEASE_TYPE: + CI: true + GRADLE_ENTERPRISE_CACHE_USERNAME: + GRADLE_ENTERPRISE_CACHE_PASSWORD: + GRADLE_ENTERPRISE_URL: https://ge.spring.io caches: - path: maven - path: gradle diff --git a/eclipse/spring-boot-project.setup b/eclipse/spring-boot-project.setup index 79100f5284de..2048d3b1bd05 100644 --- a/eclipse/spring-boot-project.setup +++ b/eclipse/spring-boot-project.setup @@ -4,13 +4,12 @@ xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdt="http://www.eclipse.org/oomph/setup/jdt/1.0" - xmlns:maven="http://www.eclipse.org/oomph/setup/maven/1.0" xmlns:predicates="http://www.eclipse.org/oomph/predicates/1.0" xmlns:setup="http://www.eclipse.org/oomph/setup/1.0" xmlns:setup.p2="http://www.eclipse.org/oomph/setup/p2/1.0" xmlns:setup.workingsets="http://www.eclipse.org/oomph/setup/workingsets/1.0" xmlns:workingsets="http://www.eclipse.org/oomph/workingsets/1.0" - xsi:schemaLocation="http://www.eclipse.org/oomph/setup/jdt/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/JDT.ecore http://www.eclipse.org/oomph/setup/maven/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Maven.ecore http://www.eclipse.org/oomph/predicates/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Predicates.ecore http://www.eclipse.org/oomph/setup/workingsets/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/SetupWorkingSets.ecore http://www.eclipse.org/oomph/workingsets/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/WorkingSets.ecore" + xsi:schemaLocation="http://www.eclipse.org/oomph/setup/jdt/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/JDT.ecore http://www.eclipse.org/oomph/predicates/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Predicates.ecore http://www.eclipse.org/oomph/setup/workingsets/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/SetupWorkingSets.ecore http://www.eclipse.org/oomph/workingsets/1.0 https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/WorkingSets.ecore" name="spring.boot.2.3.x" label="Spring Boot 2.3.x"> - - - - spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin - - - search) { + def query = search.collect { name, value -> + "search.names=${encodeURL(name)}&search.values=${encodeURL(value)}" + }.join('&') + + "$gradleEnterprise.buildScan.server/scans?$query" +} + +String encodeURL(String url) { + URLEncoder.encode(url, 'UTF-8') +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 000000000000..cc4fdc293d0e Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties similarity index 91% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradle/wrapper/gradle-wrapper.properties rename to gradle/wrapper/gradle-wrapper.properties index 290541c73864..94920145f34e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradlew b/gradlew similarity index 75% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradlew rename to gradlew index cccdd3d517fc..2fe81a7d95e4 100755 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradlew +++ b/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -109,8 +125,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` @@ -138,19 +154,19 @@ if $cygwin ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -159,14 +175,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradlew.bat b/gradlew.bat similarity index 75% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradlew.bat rename to gradlew.bat index f9553162f122..9618d8d9607c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/pom.xml b/pom.xml deleted file mode 100644 index dd169ece2b29..000000000000 --- a/pom.xml +++ /dev/null @@ -1,384 +0,0 @@ - - - 4.0.0 - org.springframework.boot - spring-boot-build - ${revision} - pom - Spring Boot Build - Spring Boot Build - - 2.3.0.BUILD-SNAPSHOT - ${basedir} - - - - - - default - - - !disable-spring-boot-default-profile - - - - 0.0.17 - 0.0.4.RELEASE - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.0.0 - - - com.puppycrawl.tools - checkstyle - 8.22 - - - io.spring.javaformat - spring-javaformat-checkstyle - ${spring-javaformat.version} - - - io.spring.nohttp - nohttp-checkstyle - ${nohttp-checkstyle.version} - - - - - checkstyle-validation - validate - - ${disable.checks} - src/checkstyle/checkstyle.xml - src/checkstyle/checkstyle-suppressions.xml - true - main.basedir=${main.basedir} - UTF-8 - - - check - - - - nohttp-checkstyle-validation - validate - - ${disable.checks} - src/checkstyle/nohttp-checkstyle.xml - src/checkstyle/nohttp-checkstyle-suppressions.xml - main.basedir=${main.basedir} - UTF-8 - ${basedir} - **/* - **/.git/**/*,**/target/**/,**/.flattened-pom.xml,**/*.class,**/spring-boot-gradle-plugin/build/**,**/spring-boot-gradle-plugin/bin/** - - - check - - false - - - - - io.spring.javaformat - spring-javaformat-maven-plugin - ${spring-javaformat.version} - - - validate - - ${disable.checks} - - - validate - - - - - - - - spring-boot-project - - spring-boot-tests - - - - - m2e - - - m2e.version - - - - spring-boot-project - spring-boot-tests - - - - repository - - - repository - - - - - repository - ${repository} - - true - - - - - - repository - ${repository} - - true - - - - - - - - - central - https://repo.maven.apache.org/maven2 - - false - - - - spring-milestone - Spring Milestone - https://repo.spring.io/milestone - - false - - - - spring-snapshot - Spring Snapshot - https://repo.spring.io/snapshot - - true - - - - rabbit-milestone - Rabbit Milestone - https://dl.bintray.com/rabbitmq/maven-milestones - - false - - - - - - central - https://repo.maven.apache.org/maven2 - - false - - - - spring-release - Spring Release - https://repo.spring.io/release - - - spring-milestone - Spring Milestone - https://repo.spring.io/milestone - - false - - - - spring-snapshot - Spring Snapshot - https://repo.spring.io/snapshot - - true - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - [1,) - - check - - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - [1,) - - copy - copy-dependencies - unpack - - - - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - [1,) - - enforce - - - - - - - - - org.apache.maven.plugins - maven-invoker-plugin - [1,) - - install - - - - - - - - - org.apache.maven.plugins - maven-plugin-plugin - [1,) - - descriptor - helpmojo - - - - - - - - - org.basepom.maven - duplicate-finder-maven-plugin - [1,) - - check - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - [1,) - - reserve-network-port - - - - - - - - - org.codehaus.mojo - flatten-maven-plugin - [1,) - - flatten - - - - - - - - - org.jetbrains.kotlin - kotlin-maven-plugin - [1,) - - compile - test-compile - - - - - - - - - org.jooq - jooq-codegen-maven - [1,) - - generate - - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - [1,) - - build-info - - - - - - - - - - - - - - diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 000000000000..43d7fd1cfbae --- /dev/null +++ b/settings.gradle @@ -0,0 +1,71 @@ +pluginManagement { + repositories { + mavenCentral() + gradlePluginPortal() + maven { url 'https://repo.spring.io/snapshot' } + } + resolutionStrategy { + eachPlugin { + if (requested.id.id == 'org.jetbrains.kotlin.jvm') { + useVersion "${kotlinVersion}" + } + if (requested.id.id == 'org.jetbrains.kotlin.plugin.spring') { + useVersion "${kotlinVersion}" + } + } + } +} + +plugins { + id 'com.gradle.enterprise' version '3.1' +} + +apply from: "$rootDir/gradle/build-scan-user-data.gradle" +gradleEnterprise { + buildScan { + captureTaskInputFiles = true + obfuscation { + ipAddresses { addresses -> addresses.collect { address -> '0.0.0.0'} } + } + publishAlwaysIf(System.getenv('GRADLE_ENTERPRISE_URL') != null) + server = 'https://ge.spring.io' + } +} + +apply from: new File(settingsDir, 'gradle/build-cache-settings.gradle') + +rootProject.name='spring-boot-build' + +include 'spring-boot-project:spring-boot-dependencies' +include 'spring-boot-project:spring-boot-parent' +include 'spring-boot-project:spring-boot-tools:spring-boot-antlib' +include 'spring-boot-project:spring-boot-tools:spring-boot-autoconfigure-processor' +include 'spring-boot-project:spring-boot-tools:spring-boot-configuration-metadata' +include 'spring-boot-project:spring-boot-tools:spring-boot-configuration-processor' +include 'spring-boot-project:spring-boot-tools:spring-boot-gradle-plugin' +include 'spring-boot-project:spring-boot-tools:spring-boot-loader' +include 'spring-boot-project:spring-boot-tools:spring-boot-loader-tools' +include 'spring-boot-project:spring-boot-tools:spring-boot-maven-plugin' +include 'spring-boot-project:spring-boot-tools:spring-boot-test-support' +include 'spring-boot-project:spring-boot' +include 'spring-boot-project:spring-boot-autoconfigure' +include 'spring-boot-project:spring-boot-actuator' +include 'spring-boot-project:spring-boot-actuator-autoconfigure' +include 'spring-boot-project:spring-boot-cli' +include 'spring-boot-project:spring-boot-devtools' +include 'spring-boot-project:spring-boot-docs' +include 'spring-boot-project:spring-boot-properties-migrator' +include 'spring-boot-project:spring-boot-test' +include 'spring-boot-project:spring-boot-test-autoconfigure' +include 'spring-boot-tests:spring-boot-deployment-tests' +include 'spring-boot-tests:spring-boot-integration-tests:spring-boot-configuration-processor-tests' +include 'spring-boot-tests:spring-boot-integration-tests:spring-boot-launch-script-tests' +include 'spring-boot-tests:spring-boot-integration-tests:spring-boot-server-tests' + +new File("$rootDir/spring-boot-project/spring-boot-starters").eachFileMatch(groovy.io.FileType.DIRECTORIES, ~/spring-boot-starter.*/) { + include "spring-boot-project:spring-boot-starters:$it.name" +} + +new File("$rootDir/spring-boot-tests/spring-boot-smoke-tests").eachFileMatch(groovy.io.FileType.DIRECTORIES, ~/spring-boot-smoke-test.*/) { + include "spring-boot-tests:spring-boot-smoke-tests:$it.name" +} diff --git a/spring-boot-project/pom.xml b/spring-boot-project/pom.xml deleted file mode 100644 index 2e893ff2819b..000000000000 --- a/spring-boot-project/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-build - ${revision} - - spring-boot-project - pom - Spring Boot Project - Spring Boot Project - - ${basedir}/.. - - - spring-boot-dependencies - spring-boot-parent - spring-boot - spring-boot-actuator - spring-boot-actuator-autoconfigure - spring-boot-autoconfigure - spring-boot-devtools - spring-boot-properties-migrator - spring-boot-test - spring-boot-test-autoconfigure - spring-boot-tools - spring-boot-starters - spring-boot-cli - spring-boot-docs - - diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle new file mode 100644 index 000000000000..5c7076e9ef42 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle @@ -0,0 +1,185 @@ +plugins { + id 'java-library' + id 'org.asciidoctor.jvm.convert' + id 'org.asciidoctor.jvm.pdf' + id 'org.springframework.boot.auto-configuration' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.deployed' + id 'org.springframework.boot.optional-dependencies' +} + +description = 'Spring Boot Actuator AutoConfigure' + +configurations { + asciidoctorExtensions + documentation +} + +dependencies { + asciidoctorExtensions enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + asciidoctorExtensions 'org.springframework.restdocs:spring-restdocs-asciidoctor' + + api project(':spring-boot-project:spring-boot-actuator') + + implementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + implementation project(':spring-boot-project:spring-boot') + implementation project(':spring-boot-project:spring-boot-autoconfigure') + implementation 'com.fasterxml.jackson.core:jackson-databind' + implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310' + implementation 'org.springframework:spring-core' + implementation 'org.springframework:spring-context' + + optional enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + optional 'ch.qos.logback:logback-classic' + optional 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml' + optional 'com.github.ben-manes.caffeine:caffeine' + optional 'com.hazelcast:hazelcast' + optional 'com.hazelcast:hazelcast-spring' + optional 'com.sun.mail:jakarta.mail' + optional 'com.zaxxer:HikariCP' + optional 'io.dropwizard.metrics:metrics-jmx' + optional 'io.lettuce:lettuce-core' + optional 'io.micrometer:micrometer-core' + optional 'io.micrometer:micrometer-jersey2' + optional 'io.micrometer:micrometer-registry-appoptics' + optional 'io.micrometer:micrometer-registry-atlas' + optional 'io.micrometer:micrometer-registry-datadog' + optional 'io.micrometer:micrometer-registry-dynatrace' + optional 'io.micrometer:micrometer-registry-elastic' + optional 'io.micrometer:micrometer-registry-ganglia' + optional 'io.micrometer:micrometer-registry-graphite' + optional 'io.micrometer:micrometer-registry-humio' + optional 'io.micrometer:micrometer-registry-influx' + optional 'io.micrometer:micrometer-registry-jmx' + optional 'io.micrometer:micrometer-registry-kairos' + optional 'io.micrometer:micrometer-registry-new-relic' + optional 'io.micrometer:micrometer-registry-prometheus' + optional 'io.micrometer:micrometer-registry-stackdriver' + optional 'io.prometheus:simpleclient_pushgateway' + optional 'io.micrometer:micrometer-registry-signalfx' + optional 'io.micrometer:micrometer-registry-statsd' + optional 'io.micrometer:micrometer-registry-wavefront' + optional 'io.projectreactor.netty:reactor-netty' + optional 'io.searchbox:jest' + optional 'jakarta.jms:jakarta.jms-api' + optional 'jakarta.servlet:jakarta.servlet-api' + optional 'javax.cache:cache-api' + optional 'net.sf.ehcache:ehcache' + optional 'org.apache.activemq:activemq-broker' + optional 'org.apache.commons:commons-dbcp2' + optional 'org.apache.kafka:kafka-clients' + optional 'org.apache.tomcat.embed:tomcat-embed-core' + optional 'org.apache.tomcat.embed:tomcat-embed-el' + optional 'org.apache.tomcat:tomcat-jdbc' + optional 'org.aspectj:aspectjweaver' + optional 'org.eclipse.jetty:jetty-server' + optional 'org.elasticsearch:elasticsearch' + optional 'org.elasticsearch.client:elasticsearch-rest-client' + optional 'org.flywaydb:flyway-core' + optional 'org.glassfish.jersey.core:jersey-server' + optional 'org.glassfish.jersey.containers:jersey-container-servlet-core' + optional 'org.hibernate:hibernate-core' + optional 'org.hibernate.validator:hibernate-validator' + optional 'org.influxdb:influxdb-java' + optional 'org.jolokia:jolokia-core' + optional 'org.infinispan:infinispan-spring4-embedded' + optional 'org.liquibase:liquibase-core' + optional 'org.mongodb:mongodb-driver-async' + optional 'org.mongodb:mongodb-driver-reactivestreams' + optional 'org.springframework:spring-jdbc' + optional 'org.springframework:spring-jms' + optional 'org.springframework:spring-messaging' + optional 'org.springframework:spring-webflux' + optional 'org.springframework:spring-webmvc' + optional 'org.springframework.amqp:spring-rabbit' + optional 'org.springframework.data:spring-data-cassandra' + optional 'org.springframework.data:spring-data-couchbase' + optional 'org.springframework.data:spring-data-ldap' + optional 'org.springframework.data:spring-data-mongodb' + optional 'org.springframework.data:spring-data-neo4j' + optional 'org.springframework.data:spring-data-redis' + optional 'org.springframework.data:spring-data-solr' + optional 'org.springframework.integration:spring-integration-core' + optional 'org.springframework.security:spring-security-config' + optional 'org.springframework.security:spring-security-web' + optional 'org.springframework.session:spring-session-core' + optional 'redis.clients:jedis' + + testImplementation project(':spring-boot-project:spring-boot-test') + testImplementation project(':spring-boot-project:spring-boot-tools:spring-boot-test-support') + testImplementation 'io.projectreactor:reactor-test' + testImplementation 'com.squareup.okhttp3:mockwebserver' + testImplementation 'com.jayway.jsonpath:json-path' + testImplementation 'io.undertow:undertow-core' + testImplementation ('io.undertow:undertow-servlet') { + exclude group: 'org.jboss.spec.javax.annotation', module: 'jboss-annotations-api_1.2_spec' + exclude group: 'org.jboss.spec.javax.servlet', module: 'jboss-servlet-api_4.0_spec' + } + testImplementation 'javax.xml.bind:jaxb-api' + testImplementation 'org.apache.logging.log4j:log4j-to-slf4j' + testImplementation 'org.aspectj:aspectjrt' + testImplementation 'org.assertj:assertj-core' + testImplementation 'org.eclipse.jetty:jetty-webapp' + testImplementation 'org.glassfish.jersey.ext:jersey-spring4' + testImplementation 'org.glassfish.jersey.media:jersey-media-json-jackson' + testImplementation 'org.hamcrest:hamcrest' + testImplementation 'org.hsqldb:hsqldb' + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.mockito:mockito-core' + testImplementation 'org.skyscreamer:jsonassert' + testImplementation 'org.springframework:spring-orm' + testImplementation 'org.springframework.data:spring-data-elasticsearch' + testImplementation 'org.springframework.data:spring-data-rest-webmvc' + testImplementation 'org.springframework.integration:spring-integration-jmx' + testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc' + testImplementation 'org.springframework.restdocs:spring-restdocs-webtestclient' + testImplementation 'org.springframework.security:spring-security-test' + testImplementation 'org.yaml:snakeyaml' + + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' + testRuntimeOnly 'org.springframework.security:spring-security-oauth2-jose' + testRuntimeOnly 'org.springframework.security:spring-security-oauth2-resource-server' +} + +compileJava { + options.compilerArgs << '-parameters' +} + +compileTestJava { + options.compilerArgs << '-parameters' +} + +test { + outputs.dir("$buildDir/generated-snippets") +} + +asciidoctor { + configurations 'asciidoctorExtensions' + dependsOn test + sources { + include 'index.adoc' + } +} + +asciidoctorPdf { + configurations 'asciidoctorExtensions' + dependsOn test + sources { + include 'index.adoc' + } +} + +task zip(type: Zip) { + dependsOn asciidoctor, asciidoctorPdf + duplicatesStrategy 'fail' + from(asciidoctorPdf.outputDir) { + into 'pdf' + } + from(asciidoctor.outputDir) { + into 'html' + } +} + +artifacts { + documentation zip +} diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml b/spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml deleted file mode 100644 index aa824b2ae100..000000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml +++ /dev/null @@ -1,863 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-parent - ${revision} - ../spring-boot-parent - - spring-boot-actuator-autoconfigure - Spring Boot Actuator AutoConfigure - Spring Boot Actuator AutoConfigure - - ${basedir}/../.. - ${project.build.directory}/refdocs/ - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-autoconfigure - - - com.fasterxml.jackson.core - jackson-databind - - - org.springframework - spring-core - - - org.springframework - spring-context - - - - ch.qos.logback - logback-classic - true - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - true - - - com.github.ben-manes.caffeine - caffeine - true - - - com.hazelcast - hazelcast - true - - - com.hazelcast - hazelcast-spring - true - - - com.sun.mail - jakarta.mail - true - - - com.zaxxer - HikariCP - true - - - io.dropwizard.metrics - metrics-jmx - true - - - io.lettuce - lettuce-core - true - - - io.micrometer - micrometer-core - true - - - io.micrometer - micrometer-jersey2 - true - - - io.micrometer - micrometer-registry-appoptics - true - - - io.micrometer - micrometer-registry-atlas - true - - - io.micrometer - micrometer-registry-datadog - true - - - io.micrometer - micrometer-registry-dynatrace - true - - - io.micrometer - micrometer-registry-elastic - true - - - io.micrometer - micrometer-registry-ganglia - true - - - io.micrometer - micrometer-registry-graphite - true - - - io.micrometer - micrometer-registry-humio - true - - - io.micrometer - micrometer-registry-influx - true - - - io.micrometer - micrometer-registry-jmx - true - - - io.micrometer - micrometer-registry-kairos - true - - - io.micrometer - micrometer-registry-new-relic - true - - - io.micrometer - micrometer-registry-prometheus - true - - - io.prometheus - simpleclient_pushgateway - true - - - io.micrometer - micrometer-registry-signalfx - true - - - io.micrometer - micrometer-registry-stackdriver - true - - - io.micrometer - micrometer-registry-statsd - true - - - io.micrometer - micrometer-registry-wavefront - true - - - io.projectreactor.netty - reactor-netty - true - - - io.searchbox - jest - true - - - jakarta.jms - jakarta.jms-api - true - - - jakarta.servlet - jakarta.servlet-api - true - - - jakarta.persistence - jakarta.persistence-api - true - - - jakarta.ws.rs - jakarta.ws.rs-api - true - - - javax.cache - cache-api - true - - - net.sf.ehcache - ehcache - true - - - org.apache.activemq - activemq-broker - true - - - geronimo-jms_1.1_spec - org.apache.geronimo.specs - - - - - org.apache.commons - commons-dbcp2 - true - - - org.apache.kafka - kafka-clients - true - - - org.apache.tomcat.embed - tomcat-embed-core - true - - - org.apache.tomcat.embed - tomcat-embed-el - true - - - org.apache.tomcat - tomcat-jdbc - true - - - org.aspectj - aspectjweaver - true - - - org.eclipse.jetty - jetty-server - true - - - javax.servlet - javax.servlet-api - - - - - org.elasticsearch - elasticsearch - true - - - org.elasticsearch.client - elasticsearch-rest-client - true - - - org.flywaydb - flyway-core - true - - - org.glassfish.jersey.core - jersey-server - true - - - javax.validation - validation-api - - - - - org.glassfish.jersey.containers - jersey-container-servlet-core - true - - - org.hibernate - hibernate-core - true - - - javax.activation - javax.activation-api - - - javax.xml.bind - jaxb-api - - - javax.persistence - javax.persistence-api - - - - - org.hibernate.validator - hibernate-validator - true - - - javax.validation - validation-api - - - - - org.influxdb - influxdb-java - true - - - org.jolokia - jolokia-core - true - - - org.infinispan - infinispan-spring5-embedded - true - - - org.liquibase - liquibase-core - true - - - org.mongodb - mongodb-driver-async - true - - - org.mongodb - mongodb-driver-reactivestreams - true - - - org.springframework - spring-jdbc - true - - - org.springframework - spring-jms - true - - - org.springframework - spring-messaging - true - - - org.springframework - spring-webflux - true - - - org.springframework - spring-webmvc - true - - - org.springframework.amqp - spring-rabbit - true - - - org.springframework.data - spring-data-cassandra - true - - - org.springframework.data - spring-data-couchbase - true - - - org.springframework.data - spring-data-ldap - true - - - org.springframework.data - spring-data-mongodb - true - - - org.springframework.data - spring-data-neo4j - true - - - org.springframework.data - spring-data-redis - true - - - org.springframework.data - spring-data-solr - true - - - - wstx-asl - org.codehaus.woodstox - - - - - org.springframework.integration - spring-integration-core - true - - - org.springframework.security - spring-security-config - true - - - org.springframework.security - spring-security-web - true - - - org.springframework.session - spring-session-core - true - - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - runtime - - - - org.springframework.boot - spring-boot-autoconfigure-processor - true - - - org.springframework.boot - spring-boot-configuration-processor - true - - - - org.springframework.boot - spring-boot-test - test - - - org.springframework.boot - spring-boot-test-support - test - - - io.projectreactor - reactor-test - test - - - com.squareup.okhttp3 - mockwebserver - test - - - org.hamcrest - hamcrest-core - - - - - com.jayway.jsonpath - json-path - test - - - io.undertow - undertow-core - test - - - io.undertow - undertow-servlet - test - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec - - - - - jakarta.validation - jakarta.validation-api - test - - - jakarta.xml.bind - jakarta.xml.bind-api - test - - - org.apache.logging.log4j - log4j-to-slf4j - test - - - org.aspectj - aspectjrt - test - - - org.eclipse.jetty - jetty-webapp - test - - - org.hsqldb - hsqldb - test - - - org.glassfish.jersey.ext - jersey-spring5 - test - - - org.glassfish.jersey.media - jersey-media-json-jackson - test - - - org.skyscreamer - jsonassert - test - - - org.springframework - spring-orm - test - - - org.springframework.data - spring-data-elasticsearch - test - - - org.springframework.data - spring-data-rest-webmvc - test - - - org.springframework.integration - spring-integration-jmx - test - - - org.springframework.restdocs - spring-restdocs-mockmvc - test - - - javax.servlet - javax.servlet-api - - - - - org.springframework.restdocs - spring-restdocs-webtestclient - test - - - org.springframework.security - spring-security-test - test - - - org.springframework.security - spring-security-oauth2-resource-server - test - - - org.springframework.security - spring-security-oauth2-jose - test - - - org.yaml - snakeyaml - test - - - redis.clients - jedis - true - - - - - full - - - full - - - - - - com.googlecode.maven-download-plugin - download-maven-plugin - - - unpack-doc-resources - generate-resources - - wget - - - ${spring-doc-resources.url} - true - ${refdocs.build.directory} - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - ant-contrib - ant-contrib - 1.0b3 - - - ant - ant - - - - - org.apache.ant - ant-nodeps - 1.8.1 - - - org.tigris.antelope - antelopetasks - 3.2.10 - - - - - set-up-maven-properties - prepare-package - - run - - - true - - - - - - - - - - - - - - - package-docs-zip - package - - run - - - - - - - - - - - - - - - - - org.asciidoctor - asciidoctor-maven-plugin - - - generate-html-documentation - prepare-package - - process-asciidoc - - - html5 - ${project.build.directory}/generated-docs/reference/html - highlight.js - book - - js/highlight - github - true - ./images - font - css/ - spring.css - warn - - - true - - DEBUG - - - - - - generate-pdf-documentation - prepare-package - - process-asciidoc - - - pdf - ${project.build.directory}/generated-docs/reference/pdf - - - - - ${refdocs.build.directory} - index.adoc - - ${version-type} - ${project.version} - ${project.build.directory}/generated-snippets/ - - - - - org.asciidoctor - asciidoctorj-pdf - 1.5.0-alpha.18 - - - - - org.apache.maven.plugins - maven-resources-plugin - - - copy-asciidoc-resources - generate-resources - - copy-resources - - - ${refdocs.build.directory} - - - src/main/asciidoc - false - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-zip - - attach-artifact - - - - - ${project.build.directory}/${project.artifactId}-${project.version}-docs.zip - zip - docs - - - - - - - - - - - diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/auditevents.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/auditevents.adoc similarity index 79% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/auditevents.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/auditevents.adoc index 91dac834d5e8..9c6358f20b31 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/auditevents.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/auditevents.adoc @@ -10,12 +10,12 @@ The `auditevents` endpoint provides information about the application's audit ev To retrieve the audit events, make a `GET` request to `/actuator/auditevents`, as shown in the following curl-based example: -include::{snippets}auditevents/filtered/curl-request.adoc[] +include::{snippets}/auditevents/filtered/curl-request.adoc[] The preceding example retrieves `logout` events for the principal, `alice`, that occurred after 09:37 on 7 November 2017 in the UTC timezone. The resulting response is similar to the following: -include::{snippets}auditevents/filtered/http-response.adoc[] +include::{snippets}/auditevents/filtered/http-response.adoc[] @@ -26,7 +26,7 @@ The endpoint uses query parameters to limit the events that it returns. The following table shows the supported query parameters: [cols="2,4"] -include::{snippets}auditevents/filtered/request-parameters.adoc[] +include::{snippets}/auditevents/filtered/request-parameters.adoc[] @@ -37,4 +37,4 @@ The response contains details of all of the audit events that matched the query. The following table describes the structure of the response: [cols="2,1,3"] -include::{snippets}auditevents/all/response-fields.adoc[] +include::{snippets}/auditevents/all/response-fields.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/beans.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/beans.adoc similarity index 78% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/beans.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/beans.adoc index 5417a906011b..e3307538bae2 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/beans.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/beans.adoc @@ -10,11 +10,11 @@ The `beans` endpoint provides information about the application's beans. To retrieve the beans, make a `GET` request to `/actuator/beans`, as shown in the following curl-based example: -include::{snippets}beans/curl-request.adoc[] +include::{snippets}/beans/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}beans/http-response.adoc[] +include::{snippets}/beans/http-response.adoc[] @@ -25,4 +25,4 @@ The response contains details of the application's beans. The following table describes the structure of the response: [cols="2,1,3"] -include::{snippets}beans/response-fields.adoc[] +include::{snippets}/beans/response-fields.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/caches.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/caches.adoc similarity index 78% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/caches.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/caches.adoc index 3f2156a4b9a8..f6057a656d25 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/caches.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/caches.adoc @@ -9,11 +9,11 @@ The `caches` endpoint provides access to the application's caches. == Retrieving All Caches To retrieve the application's caches, make a `GET` request to `/actuator/caches`, as shown in the following curl-based example: -include::{snippets}caches/all/curl-request.adoc[] +include::{snippets}/caches/all/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}caches/all/http-response.adoc[] +include::{snippets}/caches/all/http-response.adoc[] @@ -23,7 +23,7 @@ The response contains details of the application's caches. The following table describes the structure of the response: [cols="3,1,3"] -include::{snippets}caches/all/response-fields.adoc[] +include::{snippets}/caches/all/response-fields.adoc[] @@ -31,12 +31,12 @@ include::{snippets}caches/all/response-fields.adoc[] == Retrieving Caches by Name To retrieve a cache by name, make a `GET` request to `/actuator/caches/\{name}`, as shown in the following curl-based example: -include::{snippets}caches/named/curl-request.adoc[] +include::{snippets}/caches/named/curl-request.adoc[] The preceding example retrieves information about the cache named `cities`. The resulting response is similar to the following: -include::{snippets}caches/named/http-response.adoc[] +include::{snippets}/caches/named/http-response.adoc[] @@ -47,7 +47,7 @@ Otherwise, the `cacheManager` must be specified. The following table shows the supported query parameters: [cols="2,4"] -include::{snippets}caches/named/request-parameters.adoc[] +include::{snippets}/caches/named/request-parameters.adoc[] @@ -57,7 +57,7 @@ The response contains details of the requested cache. The following table describes the structure of the response: [cols="3,1,3"] -include::{snippets}caches/named/response-fields.adoc[] +include::{snippets}/caches/named/response-fields.adoc[] @@ -65,7 +65,7 @@ include::{snippets}caches/named/response-fields.adoc[] == Evict All Caches To clear all available caches, make a `DELETE` request to `/actuator/caches` as shown in the following curl-based example: -include::{snippets}caches/evict-all/curl-request.adoc[] +include::{snippets}/caches/evict-all/curl-request.adoc[] @@ -73,7 +73,7 @@ include::{snippets}caches/evict-all/curl-request.adoc[] == Evict a Cache by Name To evict a particular cache, make a `DELETE` request to `/actuator/caches/\{name}` as shown in the following curl-based example: -include::{snippets}caches/evict-named/curl-request.adoc[] +include::{snippets}/caches/evict-named/curl-request.adoc[] NOTE: As there are two caches named `countries`, the `cacheManager` has to be provided to specify which `Cache` should be cleared. @@ -86,4 +86,4 @@ Otherwise, the `cacheManager` must be specified. The following table shows the supported query parameters: [cols="2,4"] -include::{snippets}caches/evict-named/request-parameters.adoc[] +include::{snippets}/caches/evict-named/request-parameters.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/conditions.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/conditions.adoc similarity index 80% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/conditions.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/conditions.adoc index 26dace0267f5..2477015d8320 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/conditions.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/conditions.adoc @@ -10,11 +10,11 @@ The `conditions` endpoint provides information about the evaluation of condition To retrieve the report, make a `GET` request to `/actuator/conditions`, as shown in the following curl-based example: -include::{snippets}conditions/curl-request.adoc[] +include::{snippets}/conditions/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}conditions/http-response.adoc[] +include::{snippets}/conditions/http-response.adoc[] @@ -25,4 +25,4 @@ The response contains details of the application's condition evaluation. The following table describes the structure of the response: [cols="3,1,3"] -include::{snippets}conditions/response-fields.adoc[] +include::{snippets}/conditions/response-fields.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/configprops.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/configprops.adoc similarity index 80% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/configprops.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/configprops.adoc index 651b0ec51237..1f251b9c2edd 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/configprops.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/configprops.adoc @@ -10,11 +10,11 @@ The `configprops` endpoint provides information about the application's `@Config To retrieve the `@ConfigurationProperties` beans, make a `GET` request to `/actuator/configprops`, as shown in the following curl-based example: -include::{snippets}configprops/curl-request.adoc[] +include::{snippets}/configprops/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}configprops/http-response.adoc[] +include::{snippets}/configprops/http-response.adoc[] @@ -25,4 +25,4 @@ The response contains details of the application's `@ConfigurationProperties` be The following table describes the structure of the response: [cols="2,1,3"] -include::{snippets}configprops/response-fields.adoc[] +include::{snippets}/configprops/response-fields.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/env.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/env.adoc similarity index 78% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/env.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/env.adoc index d7b917ca1668..4b624946dba6 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/env.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/env.adoc @@ -10,11 +10,11 @@ The `env` endpoint provides information about the application's `Environment`. To retrieve the entire environment, make a `GET` request to `/actuator/env`, as shown in the following curl-based example: -include::{snippets}env/all/curl-request.adoc[] +include::{snippets}/env/all/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}env/all/http-response.adoc[] +include::{snippets}/env/all/http-response.adoc[] @@ -25,7 +25,7 @@ The response contains details of the application's `Environment`. The following table describes the structure of the response: [cols="3,1,3"] -include::{snippets}env/all/response-fields.adoc[] +include::{snippets}/env/all/response-fields.adoc[] @@ -34,12 +34,12 @@ include::{snippets}env/all/response-fields.adoc[] To retrieve a single property, make a `GET` request to `/actuator/env/{property.name}`, as shown in the following curl-based example: -include::{snippets}env/single/curl-request.adoc[] +include::{snippets}/env/single/curl-request.adoc[] The preceding example retrieves information about the property named `com.example.cache.max-size`. The resulting response is similar to the following: -include::{snippets}env/single/http-response.adoc[] +include::{snippets}/env/single/http-response.adoc[] @@ -50,4 +50,4 @@ The response contains details of the requested property. The following table describes the structure of the response: [cols="3,1,3"] -include::{snippets}env/single/response-fields.adoc[] +include::{snippets}/env/single/response-fields.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/flyway.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/flyway.adoc similarity index 79% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/flyway.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/flyway.adoc index 8fe81d6295d3..d70b0e6a5637 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/flyway.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/flyway.adoc @@ -10,11 +10,11 @@ The `flyway` endpoint provides information about database migrations performed b To retrieve the migrations, make a `GET` request to `/actuator/flyway`, as shown in the following curl-based example: -include::{snippets}flyway/curl-request.adoc[] +include::{snippets}/flyway/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}flyway/http-response.adoc[] +include::{snippets}/flyway/http-response.adoc[] @@ -25,4 +25,4 @@ The response contains details of the application's Flyway migrations. The following table describes the structure of the response: [cols="2,1,3"] -include::{snippets}flyway/response-fields.adoc[] +include::{snippets}/flyway/response-fields.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/health.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/health.adoc similarity index 82% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/health.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/health.adoc index a7c1998dde37..6cbaf51771be 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/health.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/health.adoc @@ -8,11 +8,11 @@ The `health` endpoint provides detailed information about the health of the appl == Retrieving the Health of the application To retrieve the health of the application, make a `GET` request to `/actuator/health`, as shown in the following curl-based example: -include::{snippets}health/curl-request.adoc[] +include::{snippets}/health/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}health/http-response.adoc[] +include::{snippets}/health/http-response.adoc[] @@ -22,7 +22,7 @@ The response contains details of the health of the application. The following table describes the structure of the response: [cols="2,1,3"] -include::{snippets}health/response-fields.adoc[] +include::{snippets}/health/response-fields.adoc[] NOTE: The response fields above are for the V3 API. If you need to return V2 JSON you should use an accept header or `application/vnd.spring-boot.actuator.v2+json` @@ -33,11 +33,11 @@ If you need to return V2 JSON you should use an accept header or `application/vn == Retrieving the Health of a component To retrieve the health of a particular component of the application's health, make a `GET` request to `/actuator/health/\{component}`, as shown in the following curl-based example: -include::{snippets}health/component/curl-request.adoc[] +include::{snippets}/health/component/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}health/component/http-response.adoc[] +include::{snippets}/health/component/http-response.adoc[] @@ -47,7 +47,7 @@ The response contains details of the health of a particular component of the app The following table describes the structure of the response: [cols="2,1,3"] -include::{snippets}health/component/response-fields.adoc[] +include::{snippets}/health/component/response-fields.adoc[] @@ -55,11 +55,11 @@ include::{snippets}health/component/response-fields.adoc[] == Retrieving the Health of a nested component If a particular component contains other nested components (as the `broker` indicator in the example above), the health of such a nested component can be retrieved by issuing a `GET` request to `/actuator/health/\{component}/\{subcomponent}`, as shown in the following curl-based example: -include::{snippets}health/instance/curl-request.adoc[] +include::{snippets}/health/instance/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}health/instance/http-response.adoc[] +include::{snippets}/health/instance/http-response.adoc[] Components of an application's health may be nested arbitrarily deep depending on the application's health indicators and how they have been grouped. The health endpoint supports any number of `/\{component}` identifiers in the URL to allow the health of a component at any depth to be retrieved. @@ -72,4 +72,4 @@ The response contains details of the health of an instance of a particular compo The following table describes the structure of the response: [cols="2,1,3"] -include::{snippets}health/instance/response-fields.adoc[] +include::{snippets}/health/instance/response-fields.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/heapdump.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/heapdump.adoc similarity index 92% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/heapdump.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/heapdump.adoc index ebbba69207db..57488cb0170d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/heapdump.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/heapdump.adoc @@ -13,6 +13,6 @@ The response is binary data in https://docs.oracle.com/javase/8/docs/technotes/s Typically, you should save the response to disk for subsequent analysis. When using curl, this can be achieved by using the `-O` option, as shown in the following example: -include::{snippets}heapdump/curl-request.adoc[] +include::{snippets}/heapdump/curl-request.adoc[] The preceding example results in a file named `heapdump` being written to the current working directory. diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/httptrace.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/httptrace.adoc similarity index 79% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/httptrace.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/httptrace.adoc index ea1149f9efd5..b7937e57a2b2 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/httptrace.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/httptrace.adoc @@ -10,11 +10,11 @@ The `httptrace` endpoint provides information about HTTP request-response exchan To retrieve the traces, make a `GET` request to `/actuator/httptrace`, as shown in the following curl-based example: -include::{snippets}httptrace/curl-request.adoc[] +include::{snippets}/httptrace/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}httptrace/http-response.adoc[] +include::{snippets}/httptrace/http-response.adoc[] @@ -25,4 +25,4 @@ The response contains details of the traced HTTP request-response exchanges. The following table describes the structure of the response: [cols="2,1,3"] -include::{snippets}httptrace/response-fields.adoc[] +include::{snippets}/httptrace/response-fields.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/info.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/info.adoc similarity index 81% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/info.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/info.adoc index f431c3a8d80a..91f884face21 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/info.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/info.adoc @@ -10,11 +10,11 @@ The `info` endpoint provides general information about the application. To retrieve the information about the application, make a `GET` request to `/actuator/info`, as shown in the following curl-based example: -include::{snippets}info/curl-request.adoc[] +include::{snippets}/info/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}info/http-response.adoc[] +include::{snippets}/info/http-response.adoc[] @@ -33,7 +33,7 @@ Spring Boot provides `build` and `git` contributions. The following table describe the structure of the `build` section of the response: [cols="2,1,3"] -include::{snippets}info/response-fields-beneath-build.adoc[] +include::{snippets}/info/response-fields-beneath-build.adoc[] @@ -43,4 +43,4 @@ include::{snippets}info/response-fields-beneath-build.adoc[] The following table describes the structure of the `git` section of the response: [cols="2,1,3"] -include::{snippets}info/response-fields-beneath-git.adoc[] +include::{snippets}/info/response-fields-beneath-git.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/integrationgraph.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/integrationgraph.adoc similarity index 80% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/integrationgraph.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/integrationgraph.adoc index e2d3274729dc..5a2b28a63a09 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/integrationgraph.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/integrationgraph.adoc @@ -9,11 +9,11 @@ The `integrationgraph` endpoint exposes a graph containing all Spring Integratio == Retrieving the Spring Integration graph To retrieve the information about the application, make a `GET` request to `/actuator/integrationgraph`, as shown in the following curl-based example: -include::{snippets}integrationgraph/graph/curl-request.adoc[] +include::{snippets}/integrationgraph/graph/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}integrationgraph/graph/http-response.adoc[] +include::{snippets}/integrationgraph/graph/http-response.adoc[] @@ -28,8 +28,8 @@ More information about the structure can be found in the https://docs.spring.io/ == Rebuilding the Spring Integration graph To rebuild the exposed graph, make a `POST` request to `/actuator/integrationgraph`, as shown in the following curl-based example: -include::{snippets}integrationgraph/rebuild/curl-request.adoc[] +include::{snippets}/integrationgraph/rebuild/curl-request.adoc[] This will result in a `204 - No Content` response: -include::{snippets}integrationgraph/rebuild/http-response.adoc[] +include::{snippets}/integrationgraph/rebuild/http-response.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/liquibase.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/liquibase.adoc similarity index 79% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/liquibase.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/liquibase.adoc index 1e84c8efac84..a517d85cce28 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/liquibase.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/liquibase.adoc @@ -10,11 +10,11 @@ The `liquibase` endpoint provides information about database change sets applied To retrieve the changes, make a `GET` request to `/actuator/liquibase`, as shown in the following curl-based example: -include::{snippets}liquibase/curl-request.adoc[] +include::{snippets}/liquibase/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}liquibase/http-response.adoc[] +include::{snippets}/liquibase/http-response.adoc[] @@ -25,4 +25,4 @@ The response contains details of the application's Liquibase change sets. The following table describes the structure of the response: [cols="2,1,3"] -include::{snippets}liquibase/response-fields.adoc[] +include::{snippets}/liquibase/response-fields.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/logfile.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/logfile.adoc similarity index 77% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/logfile.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/logfile.adoc index 99121fc6734d..9fd1dc8658fe 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/logfile.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/logfile.adoc @@ -10,11 +10,11 @@ The `logfile` endpoint provides access to the contents of the application's log To retrieve the log file, make a `GET` request to `/actuator/logfile`, as shown in the following curl-based example: -include::{snippets}logfile/entire/curl-request.adoc[] +include::{snippets}/logfile/entire/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}logfile/entire/http-response.adoc[] +include::{snippets}/logfile/entire/http-response.adoc[] @@ -25,9 +25,9 @@ NOTE: Retrieving part of the log file is not supported when using Jersey. To retrieve part of the log file, make a `GET` request to `/actuator/logfile` by using the `Range` header, as shown in the following curl-based example: -include::{snippets}logfile/range/curl-request.adoc[] +include::{snippets}/logfile/range/curl-request.adoc[] The preceding example retrieves the first 1024 bytes of the log file. The resulting response is similar to the following: -include::{snippets}logfile/range/http-response.adoc[] +include::{snippets}/logfile/range/http-response.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/loggers.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/loggers.adoc similarity index 79% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/loggers.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/loggers.adoc index e4609c73e7ff..5e88b104e458 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/loggers.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/loggers.adoc @@ -10,11 +10,11 @@ The `loggers` endpoint provides access to the application's loggers and the conf To retrieve the application's loggers, make a `GET` request to `/actuator/loggers`, as shown in the following curl-based example: -include::{snippets}loggers/all/curl-request.adoc[] +include::{snippets}/loggers/all/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}loggers/all/http-response.adoc[] +include::{snippets}/loggers/all/http-response.adoc[] @@ -25,7 +25,7 @@ The response contains details of the application's loggers. The following table describes the structure of the response: [cols="3,1,3"] -include::{snippets}loggers/all/response-fields.adoc[] +include::{snippets}/loggers/all/response-fields.adoc[] @@ -34,12 +34,12 @@ include::{snippets}loggers/all/response-fields.adoc[] To retrieve a single logger, make a `GET` request to `/actuator/loggers/{logger.name}`, as shown in the following curl-based example: -include::{snippets}loggers/single/curl-request.adoc[] +include::{snippets}/loggers/single/curl-request.adoc[] The preceding example retrieves information about the logger named `com.example`. The resulting response is similar to the following: -include::{snippets}loggers/single/http-response.adoc[] +include::{snippets}/loggers/single/http-response.adoc[] @@ -50,7 +50,7 @@ The response contains details of the requested logger. The following table describes the structure of the response: [cols="3,1,3"] -include::{snippets}loggers/single/response-fields.adoc[] +include::{snippets}/loggers/single/response-fields.adoc[] @@ -60,12 +60,12 @@ include::{snippets}loggers/single/response-fields.adoc[] To retrieve a single group, make a `GET` request to `/actuator/loggers/{group.name}`, as shown in the following curl-based example: -include::{snippets}loggers/group/curl-request.adoc[] +include::{snippets}/loggers/group/curl-request.adoc[] The preceding example retrieves information about the logger group named `test`. The resulting response is similar to the following: -include::{snippets}loggers/group/http-response.adoc[] +include::{snippets}/loggers/group/http-response.adoc[] @@ -76,7 +76,7 @@ The response contains details of the requested group. The following table describes the structure of the response: [cols="3,1,3"] -include::{snippets}loggers/group/response-fields.adoc[] +include::{snippets}/loggers/group/response-fields.adoc[] @@ -85,7 +85,7 @@ include::{snippets}loggers/group/response-fields.adoc[] To set the level of a logger, make a `POST` request to `/actuator/loggers/{logger.name}` with a JSON body that specifies the configured level for the logger, as shown in the following curl-based example: -include::{snippets}loggers/set/curl-request.adoc[] +include::{snippets}/loggers/set/curl-request.adoc[] The preceding example sets the `configuredLevel` of the `com.example` logger to `DEBUG`. @@ -98,7 +98,7 @@ The request specifies the desired level of the logger. The following table describes the structure of the request: [cols="3,1,3"] -include::{snippets}loggers/set/request-fields.adoc[] +include::{snippets}/loggers/set/request-fields.adoc[] @@ -107,7 +107,7 @@ include::{snippets}loggers/set/request-fields.adoc[] To set the level of a logger, make a `POST` request to `/actuator/loggers/{group.name}` with a JSON body that specifies the configured level for the logger group, as shown in the following curl-based example: -include::{snippets}loggers/setGroup/curl-request.adoc[] +include::{snippets}/loggers/setGroup/curl-request.adoc[] The preceding example sets the `configuredLevel` of the `test` logger group to `DEBUG`. @@ -120,7 +120,7 @@ The request specifies the desired level of the logger group. The following table describes the structure of the request: [cols="3,1,3"] -include::{snippets}loggers/set/request-fields.adoc[] +include::{snippets}/loggers/set/request-fields.adoc[] @@ -129,6 +129,6 @@ include::{snippets}loggers/set/request-fields.adoc[] To clear the level of a logger, make a `POST` request to `/actuator/loggers/{logger.name}` with a JSON body containing an empty object, as shown in the following curl-based example: -include::{snippets}loggers/clear/curl-request.adoc[] +include::{snippets}/loggers/clear/curl-request.adoc[] The preceding example clears the configured level of the `com.example` logger. diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/mappings.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/mappings.adoc similarity index 83% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/mappings.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/mappings.adoc index 1d7371d9e252..20ac03e0f78c 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/mappings.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/mappings.adoc @@ -10,11 +10,11 @@ The `mappings` endpoint provides information about the application's request map To retrieve the mappings, make a `GET` request to `/actuator/mappings`, as shown in the following curl-based example: -include::{snippets}mappings/curl-request.adoc[] +include::{snippets}/mappings/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}mappings/http-response.adoc[] +include::{snippets}/mappings/http-response.adoc[] @@ -26,7 +26,7 @@ The items found in the response depend on the type of web application (reactive The following table describes the structure of the common elements of the response: [cols="2,1,3"] -include::{snippets}mappings/response-fields.adoc[] +include::{snippets}/mappings/response-fields.adoc[] The entries that may be found in `contexts.*.mappings` are described in the following sections. @@ -38,7 +38,7 @@ When using Spring MVC, the response contains details of any `DispatcherServlet` The following table describes the structure of this section of the response: [cols="4,1,2"] -include::{snippets}mappings/response-fields-dispatcher-servlets.adoc[] +include::{snippets}/mappings/response-fields-dispatcher-servlets.adoc[] @@ -49,7 +49,7 @@ When using the Servlet stack, the response contains details of any `Servlet` map The following table describes the structure of this section of the response: [cols="2,1,3"] -include::{snippets}mappings/response-fields-servlets.adoc[] +include::{snippets}/mappings/response-fields-servlets.adoc[] @@ -60,7 +60,7 @@ When using the Servlet stack, the response contains details of any `Filter` mapp The following table describes the structure of this section of the response: [cols="2,1,3"] -include::{snippets}mappings/response-fields-servlet-filters.adoc[] +include::{snippets}/mappings/response-fields-servlet-filters.adoc[] @@ -71,4 +71,4 @@ When using Spring WebFlux, the response contains details of any `DispatcherHandl The following table describes the structure of this section of the response: [cols="4,1,2"] -include::{snippets}mappings/response-fields-dispatcher-handlers.adoc[] +include::{snippets}/mappings/response-fields-dispatcher-handlers.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/metrics.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/metrics.adoc similarity index 76% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/metrics.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/metrics.adoc index db26c3fd95e1..ac5430abe8fc 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/metrics.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/metrics.adoc @@ -10,11 +10,11 @@ The `metrics` endpoint provides access to application metrics. To retrieve the names of the available metrics, make a `GET` request to `/actuator/metrics`, as shown in the following curl-based example: -include::{snippets}metrics/names/curl-request.adoc[] +include::{snippets}/metrics/names/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}metrics/names/http-response.adoc[] +include::{snippets}/metrics/names/http-response.adoc[] @@ -25,7 +25,7 @@ The response contains details of the metric names. The following table describes the structure of the response: [cols="3,1,2"] -include::{snippets}metrics/names/response-fields.adoc[] +include::{snippets}/metrics/names/response-fields.adoc[] @@ -34,12 +34,12 @@ include::{snippets}metrics/names/response-fields.adoc[] To retrieve a metric, make a `GET` request to `/actuator/metrics/{metric.name}`, as shown in the following curl-based example: -include::{snippets}metrics/metric/curl-request.adoc[] +include::{snippets}/metrics/metric/curl-request.adoc[] The preceding example retrieves information about the metric named `jvm.memory.max`. The resulting response is similar to the following: -include::{snippets}metrics/metric/http-response.adoc[] +include::{snippets}/metrics/metric/http-response.adoc[] @@ -50,7 +50,7 @@ The endpoint uses query parameters to <> into The following table shows the single supported query parameter: [cols="2,4"] -include::{snippets}metrics/metric-with-tags/request-parameters.adoc[] +include::{snippets}/metrics/metric-with-tags/request-parameters.adoc[] @@ -60,7 +60,7 @@ include::{snippets}metrics/metric-with-tags/request-parameters.adoc[] The response contains details of the metric. The following table describes the structure of the response: -include::{snippets}metrics/metric/response-fields.adoc[] +include::{snippets}/metrics/metric/response-fields.adoc[] [[metrics-drilling-down]] @@ -68,9 +68,9 @@ include::{snippets}metrics/metric/response-fields.adoc[] To drill down into a metric, make a `GET` request to `/actuator/metrics/{metric.name}` using the `tag` query parameter, as shown in the following curl-based example: -include::{snippets}metrics/metric-with-tags/curl-request.adoc[] +include::{snippets}/metrics/metric-with-tags/curl-request.adoc[] The preceding example retrieves the `jvm.memory.max` metric, where the `area` tag has a value of `nonheap` and the `id` attribute has a value of `Compressed Class Space`. The resulting response is similar to the following: -include::{snippets}metrics/metric-with-tags/http-response.adoc[] +include::{snippets}/metrics/metric-with-tags/http-response.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/prometheus.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/prometheus.adoc similarity index 79% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/prometheus.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/prometheus.adoc index 1d1006bc3764..16d2205ba4ae 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/prometheus.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/prometheus.adoc @@ -10,8 +10,8 @@ The `prometheus` endpoint provides Spring Boot application's metrics in the form To retrieve the metrics, make a `GET` request to `/actuator/prometheus`, as shown in the following curl-based example: -include::{snippets}prometheus/curl-request.adoc[] +include::{snippets}/prometheus/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}prometheus/http-response.adoc[] +include::{snippets}/prometheus/http-response.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/scheduledtasks.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/scheduledtasks.adoc similarity index 78% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/scheduledtasks.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/scheduledtasks.adoc index a3a4f3a9a4c4..1e69e6046a3a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/scheduledtasks.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/scheduledtasks.adoc @@ -10,11 +10,11 @@ The `scheduledtasks` endpoint provides information about the application's sched To retrieve the scheduled tasks, make a `GET` request to `/actuator/scheduledtasks`, as shown in the following curl-based example: -include::{snippets}scheduled-tasks/curl-request.adoc[] +include::{snippets}/scheduled-tasks/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}scheduled-tasks/http-response.adoc[] +include::{snippets}/scheduled-tasks/http-response.adoc[] @@ -25,4 +25,4 @@ The response contains details of the application's scheduled tasks. The following table describes the structure of the response: [cols="2,1,3"] -include::{snippets}scheduled-tasks/response-fields.adoc[] +include::{snippets}/scheduled-tasks/response-fields.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/sessions.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/sessions.adoc similarity index 78% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/sessions.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/sessions.adoc index 8cc3508d9e99..01f2d8a8428b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/sessions.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/sessions.adoc @@ -10,12 +10,12 @@ The `sessions` endpoint provides information about the application's HTTP sessio To retrieve the sessions, make a `GET` request to `/actuator/sessions`, as shown in the following curl-based example: -include::{snippets}sessions/username/curl-request.adoc[] +include::{snippets}/sessions/username/curl-request.adoc[] The preceding examples retrieves all of the sessions for the user whose username is `alice`. The resulting response is similar to the following: -include::{snippets}sessions/username/http-response.adoc[] +include::{snippets}/sessions/username/http-response.adoc[] @@ -26,7 +26,7 @@ The endpoint uses query parameters to limit the sessions that it returns. The following table shows the single required query parameter: [cols="2,4"] -include::{snippets}sessions/username/request-parameters.adoc[] +include::{snippets}/sessions/username/request-parameters.adoc[] @@ -37,7 +37,7 @@ The response contains details of the matching sessions. The following table describes the structure of the response: [cols="3,1,3"] -include::{snippets}sessions/username/response-fields.adoc[] +include::{snippets}/sessions/username/response-fields.adoc[] @@ -46,12 +46,12 @@ include::{snippets}sessions/username/response-fields.adoc[] To retrieve a single session, make a `GET` request to `/actuator/sessions/\{id}`, as shown in the following curl-based example: -include::{snippets}sessions/id/curl-request.adoc[] +include::{snippets}/sessions/id/curl-request.adoc[] The preceding example retrieves the session with the `id` of `4db5efcc-99cb-4d05-a52c-b49acfbb7ea9`. The resulting response is similar to the following: -include::{snippets}sessions/id/http-response.adoc[] +include::{snippets}/sessions/id/http-response.adoc[] @@ -62,7 +62,7 @@ The response contains details of the requested session. The following table describes the structure of the response: [cols="3,1,3"] -include::{snippets}sessions/id/response-fields.adoc[] +include::{snippets}/sessions/id/response-fields.adoc[] @@ -71,6 +71,6 @@ include::{snippets}sessions/id/response-fields.adoc[] To delete a session, make a `DELETE` request to `/actuator/sessions/\{id}`, as shown in the following curl-based example: -include::{snippets}sessions/delete/curl-request.adoc[] +include::{snippets}/sessions/delete/curl-request.adoc[] The preceding example deletes the session with the `id` of `4db5efcc-99cb-4d05-a52c-b49acfbb7ea9`. diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/shutdown.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/shutdown.adoc similarity index 78% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/shutdown.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/shutdown.adoc index 00aec5b1bf03..2231904f675d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/shutdown.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/shutdown.adoc @@ -10,11 +10,11 @@ The `shutdown` endpoint is used to shut down the application. To shut down the application, make a `POST` request to `/actuator/shutdown`, as shown in the following curl-based example: -include::{snippets}shutdown/curl-request.adoc[] +include::{snippets}/shutdown/curl-request.adoc[] A response similar to the following is produced: -include::{snippets}shutdown/http-response.adoc[] +include::{snippets}/shutdown/http-response.adoc[] @@ -25,4 +25,4 @@ The response contains details of the result of the shutdown request. The following table describes the structure of the response: [cols="3,1,3"] -include::{snippets}shutdown/response-fields.adoc[] +include::{snippets}/shutdown/response-fields.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/threaddump.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/threaddump.adoc similarity index 76% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/threaddump.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/threaddump.adoc index fa61f6df0c9a..e141296d7038 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/threaddump.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/threaddump.adoc @@ -10,11 +10,11 @@ The `threaddump` endpoint provides a thread dump from the application's JVM. To retrieve the thread dump as JSON, make a `GET` request to `/actuator/threaddump` with an appropriate `Accept` header, as shown in the following curl-based example: -include::{snippets}threaddump/json/curl-request.adoc[] +include::{snippets}/threaddump/json/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}threaddump/json/http-response.adoc[] +include::{snippets}/threaddump/json/http-response.adoc[] @@ -25,7 +25,7 @@ The response contains details of the JVM's threads. The following table describes the structure of the response: [cols="3,1,2"] -include::{snippets}threaddump/json/response-fields.adoc[] +include::{snippets}/threaddump/json/response-fields.adoc[] @@ -35,8 +35,8 @@ include::{snippets}threaddump/json/response-fields.adoc[] To retrieve the thread dump as text, make a `GET` request to `/actuator/threaddump` that accepts `text/plain`, as shown in the following curl-based example: -include::{snippets}threaddump/text/curl-request.adoc[] +include::{snippets}/threaddump/text/curl-request.adoc[] The resulting response is similar to the following: -include::{snippets}threaddump/text/http-response.adoc[] +include::{snippets}/threaddump/text/http-response.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/index.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/index.adoc similarity index 100% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/index.adoc rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/index.adoc diff --git a/spring-boot-project/spring-boot-actuator/build.gradle b/spring-boot-project/spring-boot-actuator/build.gradle new file mode 100644 index 000000000000..73dddb188037 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator/build.gradle @@ -0,0 +1,96 @@ +plugins { + id 'java-library' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.configuration-properties' + id 'org.springframework.boot.optional-dependencies' + id 'org.springframework.boot.deployed' +} + +description = 'Spring Boot Actuator' + +dependencies { + implementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + implementation project(':spring-boot-project:spring-boot') + + optional enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + optional 'com.fasterxml.jackson.core:jackson-databind' + optional 'com.hazelcast:hazelcast' + optional 'com.hazelcast:hazelcast-spring' + optional 'com.sun.mail:jakarta.mail' + optional 'com.zaxxer:HikariCP' + optional 'io.lettuce:lettuce-core' + optional 'io.micrometer:micrometer-core' + optional 'io.micrometer:micrometer-registry-prometheus' + optional 'io.prometheus:simpleclient_pushgateway' + optional 'io.reactivex:rxjava-reactive-streams' + optional 'io.searchbox:jest' + optional 'org.elasticsearch.client:elasticsearch-rest-client' + optional ('io.undertow:undertow-servlet') { + exclude group: 'org.jboss.spec.javax.annotation', module: 'jboss-annotations-api_1.2_spec' + exclude group: 'org.jboss.spec.javax.servlet', module: 'jboss-servlet-api_4.0_spec' + } + optional 'javax.cache:cache-api' + optional 'javax.jms:javax.jms-api' + optional 'net.sf.ehcache:ehcache' + optional 'org.apache.tomcat.embed:tomcat-embed-core' + optional 'org.aspectj:aspectjweaver' + optional 'org.eclipse.jetty:jetty-server' + optional 'org.elasticsearch:elasticsearch' + optional 'org.flywaydb:flyway-core' + optional 'org.glassfish.jersey.core:jersey-server' + optional 'org.glassfish.jersey.containers:jersey-container-servlet-core' + optional 'org.hibernate.validator:hibernate-validator' + optional 'org.infinispan:infinispan-spring4-embedded' + optional 'org.influxdb:influxdb-java' + optional 'org.liquibase:liquibase-core' + optional 'org.mongodb:mongodb-driver-async' + optional 'org.mongodb:mongodb-driver-reactivestreams' + optional 'org.springframework:spring-jdbc' + optional 'org.springframework:spring-messaging' + optional 'org.springframework:spring-webflux' + optional 'org.springframework:spring-web' + optional 'org.springframework:spring-webmvc' + optional 'org.springframework.amqp:spring-rabbit' + optional 'org.springframework.data:spring-data-cassandra' + optional 'org.springframework.data:spring-data-couchbase' + optional 'org.springframework.data:spring-data-ldap' + optional 'org.springframework.data:spring-data-mongodb' + optional 'org.springframework.data:spring-data-neo4j' + optional 'org.springframework.data:spring-data-redis' + optional 'org.springframework.data:spring-data-rest-webmvc' + optional 'org.springframework.data:spring-data-solr' + optional 'org.springframework.integration:spring-integration-core' + optional 'org.springframework.security:spring-security-core' + optional 'org.springframework.security:spring-security-web' + optional 'org.springframework.session:spring-session-core' + + testImplementation project(':spring-boot-project:spring-boot-test') + testImplementation project(':spring-boot-project:spring-boot-tools:spring-boot-test-support') + testImplementation project(':spring-boot-project:spring-boot-autoconfigure') + testImplementation 'org.assertj:assertj-core' + testImplementation 'com.jayway.jsonpath:json-path' + testImplementation 'io.projectreactor:reactor-test' + testImplementation 'org.apache.logging.log4j:log4j-to-slf4j' + testImplementation 'org.awaitility:awaitility' + testImplementation 'org.glassfish.jersey.media:jersey-media-json-jackson' + testImplementation 'org.hamcrest:hamcrest' + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.mockito:mockito-core' + testImplementation 'org.mockito:mockito-junit-jupiter' + testImplementation 'org.skyscreamer:jsonassert' + testImplementation 'org.springframework:spring-test' + + testRuntimeOnly 'io.projectreactor.netty:reactor-netty' + testRuntimeOnly 'javax.xml.bind:jaxb-api' + testRuntimeOnly 'org.apache.tomcat.embed:tomcat-embed-el' + testRuntimeOnly 'org.glassfish.jersey.ext:jersey-spring4' + testRuntimeOnly 'org.hsqldb:hsqldb' +} + +compileJava { + options.compilerArgs << '-parameters' +} + +compileTestJava { + options.compilerArgs << '-parameters' +} \ No newline at end of file diff --git a/spring-boot-project/spring-boot-actuator/pom.xml b/spring-boot-project/spring-boot-actuator/pom.xml deleted file mode 100644 index cedc88716cff..000000000000 --- a/spring-boot-project/spring-boot-actuator/pom.xml +++ /dev/null @@ -1,401 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-parent - ${revision} - ../spring-boot-parent - - spring-boot-actuator - Spring Boot Actuator - Spring Boot Actuator - - ${basedir}/../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - org.springframework.boot - spring-boot - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - - - - com.fasterxml.jackson.core - jackson-databind - true - - - com.hazelcast - hazelcast - true - - - com.hazelcast - hazelcast-spring - true - - - com.sun.mail - jakarta.mail - true - - - com.zaxxer - HikariCP - true - - - io.lettuce - lettuce-core - true - - - io.micrometer - micrometer-core - true - - - io.micrometer - micrometer-registry-prometheus - true - - - io.prometheus - simpleclient_pushgateway - true - - - io.reactivex - rxjava-reactive-streams - true - - - io.searchbox - jest - true - - - org.elasticsearch.client - elasticsearch-rest-client - true - - - io.undertow - undertow-servlet - true - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec - - - - - javax.cache - cache-api - true - - - jakarta.jms - jakarta.jms-api - true - - - jakarta.ws.rs - jakarta.ws.rs-api - true - - - net.sf.ehcache - ehcache - true - - - org.apache.tomcat.embed - tomcat-embed-core - true - - - org.aspectj - aspectjweaver - true - - - org.eclipse.jetty - jetty-server - true - - - javax.servlet - javax.servlet-api - - - - - org.elasticsearch - elasticsearch - true - - - org.flywaydb - flyway-core - true - - - org.glassfish.jersey.core - jersey-server - true - - - javax.validation - validation-api - - - - - org.glassfish.jersey.containers - jersey-container-servlet-core - true - - - org.hibernate.validator - hibernate-validator - true - - - javax.validation - validation-api - - - - - org.infinispan - infinispan-spring5-embedded - true - - - org.influxdb - influxdb-java - true - - - org.liquibase - liquibase-core - true - - - org.mongodb - mongodb-driver-async - true - - - org.mongodb - mongodb-driver-reactivestreams - true - - - org.springframework - spring-jdbc - true - - - org.springframework - spring-messaging - true - - - org.springframework - spring-webflux - true - - - org.springframework - spring-web - true - - - org.springframework - spring-webmvc - true - - - org.springframework.amqp - spring-rabbit - true - - - org.springframework.data - spring-data-cassandra - true - - - org.springframework.data - spring-data-couchbase - true - - - org.springframework.data - spring-data-ldap - true - - - org.springframework.data - spring-data-mongodb - true - - - org.springframework.data - spring-data-neo4j - true - - - org.springframework.data - spring-data-redis - true - - - org.springframework.data - spring-data-rest-webmvc - true - - - org.springframework.data - spring-data-solr - true - - - - wstx-asl - org.codehaus.woodstox - - - - - org.springframework.integration - spring-integration-core - true - - - org.springframework.security - spring-security-core - true - - - org.springframework.security - spring-security-web - true - - - org.springframework.session - spring-session-core - true - - - - org.springframework.boot - spring-boot-configuration-processor - true - - - - org.springframework.boot - spring-boot-test - test - - - org.springframework.boot - spring-boot-test-support - test - - - org.springframework.boot - spring-boot-autoconfigure - test - - - ch.qos.logback - logback-classic - test - - - jakarta.validation - jakarta.validation-api - test - - - jakarta.xml.bind - jakarta.xml.bind-api - test - - - org.apache.logging.log4j - log4j-to-slf4j - test - - - org.apache.tomcat.embed - tomcat-embed-el - test - - - org.glassfish.jersey.media - jersey-media-json-jackson - test - - - org.awaitility - awaitility - test - - - com.jayway.jsonpath - json-path - test - - - io.projectreactor - reactor-test - test - - - io.projectreactor.netty - reactor-netty - test - - - org.hsqldb - hsqldb - test - - - org.glassfish.jersey.ext - jersey-spring5 - test - - - javax.validation - validation-api - - - - - org.skyscreamer - jsonassert - test - - - - diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java index 41bf39c07faf..c1669f454577 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java @@ -66,6 +66,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.MergedAnnotations; import org.springframework.core.annotation.MergedAnnotations.SearchStrategy; +import org.springframework.http.HttpMethod; import org.springframework.http.server.reactive.HttpHandler; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.util.ClassUtils; @@ -192,7 +193,13 @@ private WebTestClient createWebTestClient() { DefaultUriBuilderFactory uriBuilderFactory = new DefaultUriBuilderFactory( "http://localhost:" + determinePort()); uriBuilderFactory.setEncodingMode(EncodingMode.NONE); - return WebTestClient.bindToServer().uriBuilderFactory(uriBuilderFactory).responseTimeout(TIMEOUT).build(); + return WebTestClient.bindToServer().uriBuilderFactory(uriBuilderFactory).responseTimeout(TIMEOUT) + .filter((request, next) -> { + if (HttpMethod.GET == request.method()) { + return next.exchange(request).retry(10); + } + return next.exchange(request); + }).build(); } private int determinePort() { diff --git a/spring-boot-project/spring-boot-autoconfigure/build.gradle b/spring-boot-project/spring-boot-autoconfigure/build.gradle new file mode 100644 index 000000000000..ff509e742587 --- /dev/null +++ b/spring-boot-project/spring-boot-autoconfigure/build.gradle @@ -0,0 +1,185 @@ +plugins { + id 'java-library' + id 'org.jetbrains.kotlin.jvm' + id 'org.springframework.boot.auto-configuration' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.deployed' + id 'org.springframework.boot.optional-dependencies' +} + +description = 'Spring Boot AutoConfigure' + +dependencies { + api project(':spring-boot-project:spring-boot') + + implementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + + optional enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + optional 'com.atomikos:transactions-jdbc' + optional 'com.atomikos:transactions-jta' + optional 'com.couchbase.client:couchbase-spring-cache' + optional 'com.fasterxml.jackson.core:jackson-databind' + optional 'com.fasterxml.jackson.dataformat:jackson-dataformat-cbor' + optional 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml' + optional 'com.fasterxml.jackson.datatype:jackson-datatype-joda' + optional 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310' + optional 'com.fasterxml.jackson.module:jackson-module-parameter-names' + optional 'com.google.code.gson:gson' + optional 'com.hazelcast:hazelcast' + optional 'com.hazelcast:hazelcast-client' + optional 'com.hazelcast:hazelcast-spring' + optional 'com.h2database:h2' + optional 'com.samskivert:jmustache' + optional 'com.sun.mail:jakarta.mail' + optional 'de.flapdoodle.embed:de.flapdoodle.embed.mongo' + optional 'io.lettuce:lettuce-core' + optional 'io.projectreactor.netty:reactor-netty' + optional 'io.searchbox:jest' + optional 'io.rsocket:rsocket-core' + optional 'io.rsocket:rsocket-transport-netty' + optional ('io.undertow:undertow-servlet') { + exclude group: 'org.jboss.spec.javax.annotation', module: 'jboss-annotations-api_1.2_spec' + exclude group: 'org.jboss.spec.javax.servlet', module: 'jboss-servlet-api_4.0_spec' + } + optional ('io.undertow:undertow-websockets-jsr') { + exclude group: 'org.jboss.spec.javax.annotation', module: 'jboss-annotations-api_1.2_spec' + exclude group: 'org.jboss.spec.javax.servlet', module: 'jboss-servlet-api_4.0_spec' + } + optional 'jakarta.jms:jakarta.jms-api' + optional 'jakarta.mail:jakarta.mail-api' + optional 'jakarta.json.bind:jakarta.json.bind-api' + optional 'jakarta.persistence:jakarta.persistence-api' + optional 'jakarta.validation:jakarta.validation-api' + optional 'jakarta.ws.rs:jakarta.ws.rs-api' + optional 'javax.cache:cache-api' + optional 'javax.money:money-api' + optional 'net.sf.ehcache:ehcache' + optional 'org.apache.activemq:activemq-broker' + optional 'org.apache.activemq:artemis-jms-client' + optional 'org.apache.activemq:artemis-jms-server' + optional 'org.apache.commons:commons-dbcp2' + optional 'org.apache.kafka:kafka-streams' + optional 'org.apache.solr:solr-solrj' + optional 'org.apache.tomcat.embed:tomcat-embed-core' + optional 'org.apache.tomcat.embed:tomcat-embed-el' + optional 'org.apache.tomcat.embed:tomcat-embed-websocket' + optional 'org.apache.tomcat:tomcat-jdbc' + optional 'org.codehaus.btm:btm' + optional 'org.codehaus.groovy:groovy-templates' + optional 'com.github.ben-manes.caffeine:caffeine' + optional 'com.github.mxab.thymeleaf.extras:thymeleaf-extras-data-attribute' + optional 'com.sendgrid:sendgrid-java' + optional 'com.unboundid:unboundid-ldapsdk' + optional 'com.zaxxer:HikariCP' + optional 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' + optional 'org.aspectj:aspectjweaver' + optional 'org.eclipse.jetty:jetty-webapp' + optional 'org.eclipse.jetty:jetty-reactive-httpclient' + optional 'org.eclipse.jetty.websocket:javax-websocket-server-impl' + optional 'org.ehcache:ehcache' + optional 'org.elasticsearch.client:elasticsearch-rest-client' + optional 'org.elasticsearch.client:elasticsearch-rest-high-level-client' + optional 'org.flywaydb:flyway-core' + optional 'org.freemarker:freemarker' + optional 'org.glassfish.jersey.core:jersey-server' + optional 'org.glassfish.jersey.containers:jersey-container-servlet-core' + optional 'org.glassfish.jersey.containers:jersey-container-servlet' + optional 'org.glassfish.jersey.ext:jersey-spring5' + optional 'org.glassfish.jersey.media:jersey-media-json-jackson' + optional 'org.hibernate:hibernate-core' + optional 'org.hibernate:hibernate-jcache' + optional 'org.hibernate.validator:hibernate-validator' + optional 'org.infinispan:infinispan-jcache' + optional 'org.infinispan:infinispan-spring5-embedded' + optional 'org.influxdb:influxdb-java' + optional 'org.jboss:jboss-transaction-spi' + optional 'org.jooq:jooq' + optional 'org.liquibase:liquibase-core' + optional 'org.messaginghub:pooled-jms' + optional 'org.mongodb:mongodb-driver-async' + optional 'org.mongodb:mongodb-driver-reactivestreams' + optional 'org.quartz-scheduler:quartz' + optional 'org.springframework:spring-jdbc' + optional 'org.springframework.integration:spring-integration-core' + optional 'org.springframework.integration:spring-integration-jdbc' + optional 'org.springframework.integration:spring-integration-jmx' + optional 'org.springframework:spring-jms' + optional 'org.springframework:spring-orm' + optional 'org.springframework:spring-tx' + optional 'org.springframework:spring-web' + optional 'org.springframework:spring-websocket' + optional 'org.springframework:spring-webflux' + optional 'org.springframework:spring-webmvc' + optional 'org.springframework.batch:spring-batch-core' + optional 'org.springframework.data:spring-data-couchbase' + optional 'org.springframework.data:spring-data-jpa' + optional 'org.springframework.data:spring-data-rest-webmvc' + optional 'org.springframework.data:spring-data-cassandra' + optional 'org.springframework.data:spring-data-elasticsearch' + optional 'org.springframework.data:spring-data-jdbc' + optional 'org.springframework.data:spring-data-ldap' + optional 'org.springframework.data:spring-data-mongodb' + optional 'org.springframework.data:spring-data-neo4j' + optional 'org.springframework.data:spring-data-redis' + optional 'org.springframework.data:spring-data-solr' + optional 'org.springframework.hateoas:spring-hateoas' + optional 'org.springframework.security:spring-security-acl' + optional 'org.springframework.security:spring-security-config' + optional 'org.springframework.security:spring-security-data' + optional 'org.springframework.security:spring-security-oauth2-client' + optional 'org.springframework.security:spring-security-oauth2-jose' + optional 'org.springframework.security:spring-security-oauth2-resource-server' + optional 'org.springframework.security:spring-security-rsocket' + optional 'org.springframework.security:spring-security-saml2-service-provider' + optional 'org.springframework.security:spring-security-web' + optional 'org.springframework.session:spring-session-core' + optional 'org.springframework.session:spring-session-data-mongodb' + optional 'org.springframework.session:spring-session-data-redis' + optional 'org.springframework.session:spring-session-hazelcast' + optional 'org.springframework.session:spring-session-jdbc' + optional 'org.springframework.amqp:spring-rabbit' + optional 'org.springframework.kafka:spring-kafka' + optional 'org.springframework.cloud:spring-cloud-spring-service-connector' + optional 'org.springframework.ws:spring-ws-core' + optional 'org.thymeleaf:thymeleaf' + optional 'org.thymeleaf:thymeleaf-spring5' + optional 'org.thymeleaf.extras:thymeleaf-extras-java8time' + optional 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5' + optional 'redis.clients:jedis' + + testImplementation enforcedPlatform(project(':spring-boot-project:spring-boot-parent')) + testImplementation project(':spring-boot-project:spring-boot-tools:spring-boot-test-support') + testImplementation project(':spring-boot-project:spring-boot-test') + testImplementation 'ch.qos.logback:logback-classic' + testImplementation 'commons-fileupload:commons-fileupload' + testImplementation 'com.atomikos:transactions-jms' + testImplementation 'com.jayway.jsonpath:json-path' + testImplementation 'com.squareup.okhttp3:mockwebserver' + testImplementation 'com.sun.xml.messaging.saaj:saaj-impl' + testImplementation 'jakarta.json:jakarta.json-api' + testImplementation 'jakarta.xml.ws:jakarta.xml.ws-api' + testImplementation 'mysql:mysql-connector-java' + testImplementation 'org.apache.johnzon:johnzon-jsonb' + testImplementation 'org.apache.logging.log4j:log4j-to-slf4j' + testImplementation 'org.apache.tomcat.embed:tomcat-embed-jasper' + testImplementation 'org.assertj:assertj-core' + testImplementation 'org.awaitility:awaitility' + testImplementation 'org.hsqldb:hsqldb' + testImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.neo4j:neo4j-ogm-bolt-native-types' + testImplementation 'org.neo4j:neo4j-ogm-http-driver' + testImplementation 'org.neo4j:neo4j-ogm-embedded-driver' + testImplementation 'org.springframework:spring-test' + testImplementation 'org.springframework.kafka:spring-kafka-test' + testImplementation 'org.springframework.security:spring-security-test' + testImplementation 'org.testcontainers:cassandra' + testImplementation 'org.testcontainers:couchbase' + testImplementation 'org.testcontainers:elasticsearch' + testImplementation 'org.testcontainers:junit-jupiter' + testImplementation 'org.testcontainers:testcontainers' + testImplementation 'org.yaml:snakeyaml' + + testRuntimeOnly 'org.jetbrains.kotlin:kotlin-reflect' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' +} diff --git a/spring-boot-project/spring-boot-autoconfigure/pom.xml b/spring-boot-project/spring-boot-autoconfigure/pom.xml deleted file mode 100755 index a187161806f3..000000000000 --- a/spring-boot-project/spring-boot-autoconfigure/pom.xml +++ /dev/null @@ -1,1044 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-parent - ${revision} - ../spring-boot-parent - - spring-boot-autoconfigure - Spring Boot AutoConfigure - Spring Boot AutoConfigure - - ${basedir}/../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - org.springframework.boot - spring-boot - - - - com.atomikos - transactions-jdbc - true - - - com.atomikos - transactions-jta - true - - - com.couchbase.client - couchbase-spring-cache - true - - - com.fasterxml.jackson.core - jackson-databind - true - - - com.fasterxml.jackson.dataformat - jackson-dataformat-cbor - true - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - true - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - true - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - true - - - com.fasterxml.jackson.module - jackson-module-parameter-names - true - - - com.google.code.gson - gson - true - - - com.hazelcast - hazelcast - true - - - com.hazelcast - hazelcast-client - true - - - com.hazelcast - hazelcast-spring - true - - - com.h2database - h2 - true - - - com.samskivert - jmustache - true - - - com.sun.mail - jakarta.mail - true - - - de.flapdoodle.embed - de.flapdoodle.embed.mongo - true - - - io.lettuce - lettuce-core - true - - - io.projectreactor.netty - reactor-netty - true - - - io.rsocket - rsocket-core - true - - - io.rsocket - rsocket-transport-netty - true - - - io.searchbox - jest - true - - - jakarta.json.bind - jakarta.json.bind-api - true - - - javax.cache - cache-api - true - - - javax.money - money-api - true - - - org.apache.kafka - kafka-streams - true - - - javax.ws.rs - javax.ws.rs-api - - - - - org.flywaydb - flyway-core - true - - - org.glassfish.jersey.core - jersey-server - true - - - javax.validation - validation-api - - - - - org.glassfish.jersey.containers - jersey-container-servlet-core - true - - - org.glassfish.jersey.containers - jersey-container-servlet - true - - - org.glassfish.jersey.ext - jersey-spring5 - true - - - org.glassfish.hk2.external - bean-validator - - - org.hibernate - hibernate-validator - - - - - org.glassfish.jersey.media - jersey-media-json-jackson - true - - - org.apache.activemq - activemq-broker - true - - - geronimo-jms_1.1_spec - org.apache.geronimo.specs - - - - - org.apache.activemq - artemis-jms-client - true - - - geronimo-jms_2.0_spec - org.apache.geronimo.specs - - - - - org.apache.activemq - artemis-jms-server - true - - - geronimo-jms_2.0_spec - org.apache.geronimo.specs - - - - - org.apache.commons - commons-dbcp2 - true - - - org.apache.solr - solr-solrj - true - - - org.codehaus.woodstox - wstx-asl - - - log4j - log4j - - - - - org.apache.tomcat.embed - tomcat-embed-core - true - - - org.apache.tomcat.embed - tomcat-embed-el - true - - - org.apache.tomcat.embed - tomcat-embed-websocket - true - - - org.apache.tomcat - tomcat-jdbc - true - - - org.codehaus.btm - btm - true - - - javax.transaction - jta - - - - - org.codehaus.groovy - groovy-templates - true - - - com.sendgrid - sendgrid-java - true - - - com.unboundid - unboundid-ldapsdk - true - - - com.zaxxer - HikariCP - true - - - org.eclipse.jetty - jetty-webapp - true - - - javax.servlet - javax.servlet-api - - - - - org.eclipse.jetty - jetty-reactive-httpclient - true - - - org.eclipse.jetty.websocket - javax-websocket-server-impl - true - - - javax.annotation - javax.annotation-api - - - javax.servlet - javax.servlet-api - - - javax.websocket - javax.websocket-api - - - javax.websocket - javax.websocket-client-api - - - - - io.undertow - undertow-servlet - true - - - io.undertow - undertow-websockets-jsr - true - - - jakarta.persistence - jakarta.persistence-api - true - - - jakarta.validation - jakarta.validation-api - true - - - jakarta.ws.rs - jakarta.ws.rs-api - true - - - org.ehcache - ehcache - true - - - org.elasticsearch.client - elasticsearch-rest-client - true - - - org.elasticsearch.client - elasticsearch-rest-high-level-client - true - - - org.freemarker - freemarker - true - - - org.hibernate - hibernate-core - true - - - javax.activation - javax.activation-api - - - javax.persistence - javax.persistence-api - - - javax.xml.bind - jaxb-api - - - - - org.hibernate - hibernate-jcache - true - - - org.hibernate.validator - hibernate-validator - true - - - javax.validation - validation-api - - - - - org.infinispan - infinispan-jcache - true - - - org.infinispan - infinispan-spring5-embedded - true - - - org.jboss - jboss-transaction-spi - true - - - org.messaginghub - pooled-jms - true - - - org.apache.geronimo.specs - geronimo-jms_2.0_spec - - - - - org.mongodb - mongodb-driver-async - true - - - org.mongodb - mongodb-driver-reactivestreams - true - - - org.springframework - spring-jdbc - true - - - org.springframework.integration - spring-integration-core - true - - - org.springframework.integration - spring-integration-jdbc - true - - - org.springframework.integration - spring-integration-jmx - true - - - org.springframework - spring-jms - true - - - org.springframework - spring-orm - true - - - org.springframework - spring-tx - true - - - org.springframework - spring-web - true - - - org.springframework - spring-websocket - true - - - org.springframework - spring-webflux - true - - - org.springframework - spring-webmvc - true - - - org.springframework.batch - spring-batch-core - true - - - org.springframework.data - spring-data-couchbase - true - - - org.slf4j - jcl-over-slf4j - - - - - org.springframework.data - spring-data-jpa - true - - - jcl-over-slf4j - org.slf4j - - - - - org.springframework.data - spring-data-rest-webmvc - true - - - jcl-over-slf4j - org.slf4j - - - - - org.springframework.data - spring-data-cassandra - true - - - org.springframework.data - spring-data-jdbc - true - - - org.springframework.data - spring-data-ldap - true - - - org.springframework.data - spring-data-mongodb - true - - - jcl-over-slf4j - org.slf4j - - - - - org.springframework.data - spring-data-neo4j - true - - - jcl-over-slf4j - org.slf4j - - - - - org.springframework.data - spring-data-redis - true - - - org.springframework.data - spring-data-elasticsearch - true - - - jcl-over-slf4j - org.slf4j - - - - - org.springframework.data - spring-data-solr - true - - - jcl-over-slf4j - org.slf4j - - - - - org.springframework.hateoas - spring-hateoas - true - - - redis.clients - jedis - true - - - org.liquibase - liquibase-core - true - - - org.springframework.security - spring-security-acl - true - - - org.springframework.security - spring-security-config - true - - - org.springframework.security - spring-security-data - true - - - javax.xml.bind - jaxb-api - - - - - org.springframework.security - spring-security-oauth2-client - true - - - com.sun.mail - javax.mail - - - - - org.springframework.security - spring-security-oauth2-jose - true - - - org.springframework.security - spring-security-oauth2-resource-server - true - - - org.springframework.security - spring-security-rsocket - true - - - org.springframework.security - spring-security-saml2-service-provider - true - - - org.springframework.security - spring-security-web - true - - - org.springframework.session - spring-session-core - true - - - org.springframework.session - spring-session-data-mongodb - true - - - org.springframework.session - spring-session-data-redis - true - - - org.springframework.session - spring-session-hazelcast - true - - - javax.annotation - javax.annotation-api - - - - - org.springframework.session - spring-session-jdbc - true - - - org.springframework.amqp - spring-rabbit - true - - - org.springframework.kafka - spring-kafka - true - - - org.springframework.cloud - spring-cloud-spring-service-connector - true - - - org.springframework.ws - spring-ws-core - true - - - org.thymeleaf - thymeleaf - true - - - org.thymeleaf - thymeleaf-spring5 - true - - - nz.net.ultraq.thymeleaf - thymeleaf-layout-dialect - true - - - com.github.ben-manes.caffeine - caffeine - true - - - com.github.mxab.thymeleaf.extras - thymeleaf-extras-data-attribute - true - - - org.thymeleaf.extras - thymeleaf-extras-java8time - true - - - org.thymeleaf.extras - thymeleaf-extras-springsecurity5 - true - - - jakarta.jms - jakarta.jms-api - true - - - jakarta.mail - jakarta.mail-api - true - - - net.sf.ehcache - ehcache - true - - - org.aspectj - aspectjweaver - true - - - org.influxdb - influxdb-java - true - - - org.jooq - jooq - true - - - javax.xml.bind - jaxb-api - - - - - org.quartz-scheduler - quartz - true - - - - org.springframework.boot - spring-boot-autoconfigure-processor - true - - - org.springframework.boot - spring-boot-configuration-processor - true - - - - org.jetbrains.kotlin - kotlin-reflect - test - - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - test - - - org.springframework.boot - spring-boot-test-support - test - - - org.springframework.boot - spring-boot-test - test - - - ch.qos.logback - logback-classic - test - - - commons-fileupload - commons-fileupload - test - - - com.atomikos - transactions-jms - test - - - com.jayway.jsonpath - json-path - test - - - com.squareup.okhttp3 - mockwebserver - test - - - org.hamcrest - hamcrest-core - - - - - com.sun.xml.messaging.saaj - saaj-impl - test - - - jakarta.json - jakarta.json-api - test - - - jakarta.xml.ws - jakarta.xml.ws-api - test - - - mysql - mysql-connector-java - test - - - org.apache.johnzon - johnzon-jsonb - test - - - org.apache.logging.log4j - log4j-to-slf4j - test - - - org.apache.tomcat.embed - tomcat-embed-jasper - test - - - org.awaitility - awaitility - test - - - org.hsqldb - hsqldb - test - - - org.neo4j - neo4j-ogm-bolt-native-types - test - - - org.neo4j - neo4j-ogm-embedded-driver - test - - - org.neo4j - neo4j-ogm-http-driver - test - - - org.springframework - spring-test - test - - - org.springframework.kafka - spring-kafka-test - test - - - org.springframework.security - spring-security-test - test - - - org.testcontainers - cassandra - test - - - org.testcontainers - couchbase - test - - - org.testcontainers - elasticsearch - test - - - org.testcontainers - junit-jupiter - test - - - org.testcontainers - testcontainers - test - - - javax.annotation - javax.annotation-api - - - javax.xml.bind - jaxb-api - - - - - org.yaml - snakeyaml - test - - - - - - org.jetbrains.kotlin - kotlin-maven-plugin - - - test-compile - test-compile - - test-compile - - - - ${project.basedir}/src/test/kotlin - ${project.basedir}/src/test/java - - - - - - - - - - java9+ - - [9,) - - - - org.glassfish.jaxb - jaxb-runtime - true - - - - - diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveRestClientAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveRestClientAutoConfigurationTests.java index 8ccaf257f985..614c598ae7ff 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveRestClientAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveRestClientAutoConfigurationTests.java @@ -74,10 +74,11 @@ void configureWhenCustomClientConfig() { @Test void restClientCanQueryElasticsearchNode() { - this.contextRunner - .withPropertyValues("spring.data.elasticsearch.client.reactive.endpoints=" - + elasticsearch.getContainerIpAddress() + ":" + elasticsearch.getFirstMappedPort()) - .run((context) -> { + this.contextRunner.withPropertyValues( + "spring.data.elasticsearch.client.reactive.endpoints=" + elasticsearch.getContainerIpAddress() + ":" + + elasticsearch.getFirstMappedPort(), + "spring.data.elasticsearch.client.reactive.connection-timeout=120s", + "spring.data.elasticsearch.client.reactive.socket-timeout=120s").run((context) -> { ReactiveElasticsearchClient client = context.getBean(ReactiveElasticsearchClient.class); Map source = new HashMap<>(); source.put("a", "alpha"); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/TransactionAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/TransactionAutoConfigurationTests.java index ba889f9762cc..2461c1eaa953 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/TransactionAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/TransactionAutoConfigurationTests.java @@ -16,6 +16,8 @@ package org.springframework.boot.autoconfigure.transaction; +import java.util.UUID; + import javax.sql.DataSource; import org.junit.jupiter.api.Test; @@ -81,7 +83,7 @@ void whenThereAreBothReactiveAndPlatformTransactionManagersATemplateAndAnOperato DataSourceTransactionManagerAutoConfiguration.class)) .withUserConfiguration(SinglePlatformTransactionManagerConfiguration.class, SingleReactiveTransactionManagerConfiguration.class) - .run((context) -> { + .withPropertyValues("spring.datasource.url:jdbc:h2:mem:" + UUID.randomUUID()).run((context) -> { PlatformTransactionManager platformTransactionManager = context .getBean(PlatformTransactionManager.class); TransactionTemplate transactionTemplate = context.getBean(TransactionTemplate.class); diff --git a/spring-boot-project/spring-boot-cli/build.gradle b/spring-boot-project/spring-boot-cli/build.gradle new file mode 100644 index 000000000000..db7ee46c8d50 --- /dev/null +++ b/spring-boot-project/spring-boot-cli/build.gradle @@ -0,0 +1,195 @@ +plugins { + id 'java' + id 'org.springframework.boot.deployed' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.integration-test' +} + +description = "Spring Boot CLI" + +configurations { + dependenciesBom + loader + testRepository +} + +dependencies { + compileOnly project(':spring-boot-project:spring-boot') + + compileOnly 'jakarta.servlet:jakarta.servlet-api' + compileOnly 'org.codehaus.groovy:groovy-templates' + compileOnly 'org.springframework:spring-web' + + dependenciesBom project(path: ':spring-boot-project:spring-boot-dependencies', configuration: 'effectiveBom') + + implementation enforcedPlatform(project(':spring-boot-project:spring-boot-parent')) + implementation project(':spring-boot-project:spring-boot-tools:spring-boot-loader-tools') + + implementation 'com.vaadin.external.google:android-json' + implementation 'jline:jline' + implementation 'net.sf.jopt-simple:jopt-simple' + implementation('org.apache.httpcomponents:httpclient') { + exclude group: 'commons-logging', module: 'commons-logging' + } + implementation 'org.apache.maven:maven-model' + implementation('org.apache.maven:maven-resolver-provider') { + exclude group: 'com.google.guava', module: 'guava' + } + implementation 'org.apache.maven.resolver:maven-resolver-connector-basic' + implementation 'org.apache.maven.resolver:maven-resolver-transport-file' + implementation('org.apache.maven.resolver:maven-resolver-transport-http') { + exclude group: 'org.slf4j', module: 'jcl-over-slf4j' + } + implementation 'org.apache.maven:maven-settings-builder' + implementation 'org.codehaus.groovy:groovy' + implementation 'org.slf4j:slf4j-simple' + implementation 'org.sonatype.plexus:plexus-sec-dispatcher' + implementation('org.sonatype.sisu:sisu-inject-plexus') { + exclude group: 'javax.enterprise', module: 'cdi-api' + exclude group: 'org.sonatype.sisu', module: 'sisu-inject-bean' + } + implementation 'org.springframework:spring-core' + implementation 'org.springframework.security:spring-security-crypto' + + intTestImplementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + intTestImplementation project(':spring-boot-project:spring-boot-tools:spring-boot-loader-tools') + intTestImplementation project(':spring-boot-project:spring-boot-tools:spring-boot-test-support') + intTestImplementation 'org.assertj:assertj-core' + intTestImplementation 'org.junit.jupiter:junit-jupiter' + intTestImplementation 'org.springframework:spring-core' + + loader project(':spring-boot-project:spring-boot-tools:spring-boot-loader') + + testImplementation project(':spring-boot-project:spring-boot') + testImplementation project(':spring-boot-project:spring-boot-tools:spring-boot-test-support') + testImplementation project(':spring-boot-project:spring-boot-test') + testImplementation 'org.assertj:assertj-core' + testImplementation 'org.codehaus.groovy:groovy-templates' + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.mockito:mockito-core' + testImplementation 'org.springframework:spring-test' + + testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator', configuration: 'mavenRepository') + testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter-amqp', configuration: 'mavenRepository') + testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter-aop', configuration: 'mavenRepository') + testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter-artemis', configuration: 'mavenRepository') + testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter-batch', configuration: 'mavenRepository') + testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter-data-jpa', configuration: 'mavenRepository') + testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter-jdbc', configuration: 'mavenRepository') + testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter-integration', configuration: 'mavenRepository') + testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter-security', configuration: 'mavenRepository') + testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter-web', configuration: 'mavenRepository') +} + +task syncSpringBootDependenciesBom(type: Sync) { + destinationDir = file("$buildDir/generated-resources/org/springframework/boot/cli/compiler/dependencies") + from configurations.dependenciesBom +} + +task syncTestRepository(type: Sync) { + destinationDir = file("${buildDir}/test-repository") + from configurations.testRepository +} + +sourceSets { + main { + output.dir("$buildDir/generated-resources", builtBy: 'syncSpringBootDependenciesBom') + } +} + +test { + dependsOn syncTestRepository + useJUnitPlatform() +} + +task fullJar(type: Jar) { + classifier = 'full' + entryCompression = 'stored' + from(configurations.runtimeClasspath) { + into 'BOOT-INF/lib' + } + from(sourceSets.main.output) { + into 'BOOT-INF/classes' + } + into("") { + from zipTree(configurations.loader.singleFile) + } + manifest { + attributes( + 'Class-Loader': 'groovy.lang.GroovyClassLoader', + 'Main-Class': 'org.springframework.boot.loader.JarLauncher', + 'Start-Class': 'org.springframework.boot.cli.SpringCli' + ) + } +} + +def configureArchive(archive) { + archive.classifier = 'bin' + archive.into "spring-${project.version}" + archive.from(fullJar) { + rename { + it.replace("-full", "") + } + into 'lib/' + } + archive.from(file('src/main/content')) { + eachFile { it.mode = it.directory ? 0x755 : 0x644 } + } + archive.from(file('src/main/executablecontent')) { + eachFile { it.mode = 0x755 } + } +} + +task zip(type: Zip) { + classifier = 'bin' + configureArchive it +} + +intTest { + dependsOn syncTestRepository, zip +} + +task tar(type: Tar) { + compression = 'gzip' + archiveExtension = 'tar.gz' + configureArchive it +} + +task scoopManifest(type: org.springframework.boot.build.cli.ScoopManifest) { + dependsOn zip + outputDir = file("$buildDir/scoop") + template = file('src/main/scoop/springboot.json') + archive = zip.archiveFile +} + +def scoopManifestArtifact = artifacts.add('archives', file("$buildDir/scoop/springboot.json")) { + type 'json' + classifier 'scoop' + builtBy 'scoopManifest' +} + +task homebrewFormula(type: org.springframework.boot.build.cli.HomebrewFormula) { + dependsOn tar + outputDir = file("$buildDir/homebrew") + template = file('src/main/homebrew/springboot.rb') + archive = tar.archiveFile +} + +def homebrewFormulaArtifact = artifacts.add('archives', file("$buildDir/homebrew/springboot.rb")) { + type 'rb' + classifier 'homebrew' + builtBy 'homebrewFormula' +} + +publishing { + publications { + getByName('maven') { + artifact fullJar + artifact tar + artifact zip + artifact scoopManifestArtifact + artifact homebrewFormulaArtifact + } + } +} + diff --git a/spring-boot-project/spring-boot-cli/pom.xml b/spring-boot-project/spring-boot-cli/pom.xml deleted file mode 100644 index a349767d00ad..000000000000 --- a/spring-boot-project/spring-boot-cli/pom.xml +++ /dev/null @@ -1,469 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-parent - ${revision} - ../spring-boot-parent - - spring-boot-cli - Spring Boot CLI - Spring Boot CLI - - ${basedir}/../.. - org.springframework.boot.cli.SpringCli - default - ${project.build.directory}/generated-resources/org/springframework/boot/cli/compiler/dependencies - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - org.springframework.boot - spring-boot-loader-tools - - - com.vaadin.external.google - android-json - - - jline - jline - - - net.sf.jopt-simple - jopt-simple - - - org.codehaus.groovy - groovy - - - org.sonatype.plexus - plexus-sec-dispatcher - - - org.sonatype.sisu - sisu-inject-plexus - - - org.sonatype.sisu - sisu-inject-bean - - - javax.enterprise - cdi-api - - - - - org.springframework - spring-core - - - org.springframework.security - spring-security-crypto - - - org.apache.httpcomponents - httpclient - - - org.apache.maven - maven-model - - - org.apache.maven - maven-settings-builder - - - org.apache.maven - maven-resolver-provider - - - com.google.guava - guava - - - - - org.apache.maven.resolver - maven-resolver-connector-basic - - - org.apache.maven.resolver - maven-resolver-impl - - - org.apache.maven.resolver - maven-resolver-transport-file - - - org.apache.maven.resolver - maven-resolver-transport-http - - - jcl-over-slf4j - org.slf4j - - - - - - org.springframework.boot - spring-boot-dependencies - effective-pom - provided - ${project.version} - - - org.codehaus.groovy - groovy-templates - provided - - - org.springframework.boot - spring-boot - provided - - - org.springframework - spring-web - provided - - - jakarta.servlet - jakarta.servlet-api - provided - - - - org.springframework.boot - spring-boot-test-support - test - - - org.springframework.boot - spring-boot-test - test - - - junit - junit - test - - - org.hamcrest - hamcrest-core - - - - - - - - ${project.build.directory}/generated-resources - - - ${basedir}/src/main/resources - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - - ${project.build.directory}/generated-resources - - - ${spring.profiles.active} - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-effective-pom - generate-resources - - copy - - - - - org.springframework.boot - spring-boot-dependencies - effective-pom - true - ${generated.pom.dir} - effective-pom.xml - - - - - - unpack - prepare-package - - unpack - - - - - org.springframework.boot - spring-boot-loader - ${project.version} - jar - - - ${project.build.directory}/assembly - - - - copy - prepare-package - - copy-dependencies - - - ${project.build.directory}/assembly/BOOT-INF/lib - runtime - - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - jar-with-dependencies - package - - single - - - - src/main/assembly/jar-with-dependencies.xml - - - - true - org.springframework.boot.loader.JarLauncher - - - ${start-class} - groovy.lang.GroovyClassLoader - - - - - - bin-package - package - - single - - - - src/main/assembly/bin-package.xml - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - ant-contrib - ant-contrib - 1.0b3 - - - ant - ant - - - - - org.apache.ant - ant-nodeps - 1.8.1 - - - org.tigris.antelope - antelopetasks - 3.2.10 - - - - - homebrew - package - - run - - false - - - - - - - - - - - - - - - - - - - - - - - - - scoop - package - - run - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-test-source - process-resources - - add-test-source - - - - src/it/java - - - - - - - - - - integration - - true - - - integration - - - - java9+ - - [9,) - - - - org.glassfish.jaxb - jaxb-runtime - true - - - - - diff --git a/spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/CommandLineIT.java b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/CommandLineIT.java similarity index 81% rename from spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/CommandLineIT.java rename to spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/CommandLineIT.java index c98970b2692c..1ee793985551 100644 --- a/spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/CommandLineIT.java +++ b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/CommandLineIT.java @@ -43,39 +43,40 @@ void setup(@TempDir File tempDir) { this.cli = new CommandLineInvoker(tempDir); } - @Test void hintProducesListOfValidCommands() - throws IOException, InterruptedException { + @Test + void hintProducesListOfValidCommands() throws IOException, InterruptedException { Invocation cli = this.cli.invoke("hint"); assertThat(cli.await()).isEqualTo(0); assertThat(cli.getErrorOutput()).isEmpty(); assertThat(cli.getStandardOutputLines()).hasSize(11); } - @Test void invokingWithNoArgumentsDisplaysHelp() - throws IOException, InterruptedException { + @Test + void invokingWithNoArgumentsDisplaysHelp() throws IOException, InterruptedException { Invocation cli = this.cli.invoke(); assertThat(cli.await()).isEqualTo(1); assertThat(cli.getErrorOutput()).isEmpty(); assertThat(cli.getStandardOutput()).startsWith("usage:"); } - @Test void unrecognizedCommandsAreHandledGracefully() - throws IOException, InterruptedException { + @Test + void unrecognizedCommandsAreHandledGracefully() throws IOException, InterruptedException { Invocation cli = this.cli.invoke("not-a-real-command"); assertThat(cli.await()).isEqualTo(1); - assertThat(cli.getErrorOutput()) - .contains("'not-a-real-command' is not a valid command"); + assertThat(cli.getErrorOutput()).contains("'not-a-real-command' is not a valid command"); assertThat(cli.getStandardOutput()).isEmpty(); } - @Test void version() throws IOException, InterruptedException { + @Test + void version() throws IOException, InterruptedException { Invocation cli = this.cli.invoke("version"); assertThat(cli.await()).isEqualTo(0); assertThat(cli.getErrorOutput()).isEmpty(); assertThat(cli.getStandardOutput()).startsWith("Spring CLI v"); } - @Test void help() throws IOException, InterruptedException { + @Test + void help() throws IOException, InterruptedException { Invocation cli = this.cli.invoke("help"); assertThat(cli.await()).isEqualTo(1); assertThat(cli.getErrorOutput()).isEmpty(); diff --git a/spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/JarCommandIT.java b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/JarCommandIT.java similarity index 71% rename from spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/JarCommandIT.java rename to spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/JarCommandIT.java index 255b91d5de02..cafb01739d37 100644 --- a/spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/JarCommandIT.java +++ b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/JarCommandIT.java @@ -37,8 +37,7 @@ */ class JarCommandIT { - private static final boolean JAVA_9_OR_LATER = isClassPresent( - "java.security.cert.URICertStoreParameters"); + private static final boolean JAVA_9_OR_LATER = isClassPresent("java.security.cert.URICertStoreParameters"); private CommandLineInvoker cli; @@ -46,31 +45,32 @@ class JarCommandIT { @BeforeEach void setup(@TempDir File tempDir) { - this.cli = new CommandLineInvoker(new File("src/it/resources/jar-command"), - tempDir); + this.cli = new CommandLineInvoker(new File("src/intTest/resources/jar-command"), tempDir); this.tempDir = tempDir; } - @Test void noArguments() throws Exception { + @Test + void noArguments() throws Exception { Invocation invocation = this.cli.invoke("jar"); invocation.await(); assertThat(invocation.getStandardOutput()).isEqualTo(""); - assertThat(invocation.getErrorOutput()).contains("The name of the " - + "resulting jar and at least one source file must be specified"); + assertThat(invocation.getErrorOutput()) + .contains("The name of the " + "resulting jar and at least one source file must be specified"); } - @Test void noSources() throws Exception { + @Test + void noSources() throws Exception { Invocation invocation = this.cli.invoke("jar", "test-app.jar"); invocation.await(); assertThat(invocation.getStandardOutput()).isEqualTo(""); - assertThat(invocation.getErrorOutput()).contains("The name of the " - + "resulting jar and at least one source file must be specified"); + assertThat(invocation.getErrorOutput()) + .contains("The name of the " + "resulting jar and at least one source file must be specified"); } - @Test void jarCreationWithGrabResolver() throws Exception { + @Test + void jarCreationWithGrabResolver() throws Exception { File jar = new File(this.tempDir, "test-app.jar"); - Invocation invocation = this.cli.invoke("run", jar.getAbsolutePath(), - "bad.groovy"); + Invocation invocation = this.cli.invoke("run", jar.getAbsolutePath(), "bad.groovy"); invocation.await(); if (!JAVA_9_OR_LATER) { assertThat(invocation.getErrorOutput()).isEqualTo(""); @@ -82,8 +82,7 @@ void setup(@TempDir File tempDir) { } assertThat(jar).exists(); - Process process = new JavaExecutable() - .processBuilder("-jar", jar.getAbsolutePath()).start(); + Process process = new JavaExecutable().processBuilder("-jar", jar.getAbsolutePath()).start(); invocation = new Invocation(process); invocation.await(); @@ -92,18 +91,17 @@ void setup(@TempDir File tempDir) { } } - @Test void jarCreation() throws Exception { + @Test + void jarCreation() throws Exception { File jar = new File(this.tempDir, "test-app.jar"); - Invocation invocation = this.cli.invoke("jar", jar.getAbsolutePath(), - "jar.groovy"); + Invocation invocation = this.cli.invoke("jar", jar.getAbsolutePath(), "jar.groovy"); invocation.await(); if (!JAVA_9_OR_LATER) { assertThat(invocation.getErrorOutput()).isEmpty(); } assertThat(jar).exists(); - Process process = new JavaExecutable() - .processBuilder("-jar", jar.getAbsolutePath()).start(); + Process process = new JavaExecutable().processBuilder("-jar", jar.getAbsolutePath()).start(); invocation = new Invocation(process); invocation.await(); @@ -111,33 +109,30 @@ void setup(@TempDir File tempDir) { assertThat(invocation.getErrorOutput()).isEqualTo(""); } assertThat(invocation.getStandardOutput()).contains("Hello World!") - .contains("/BOOT-INF/classes!/public/public.txt") - .contains("/BOOT-INF/classes!/resources/resource.txt") - .contains("/BOOT-INF/classes!/static/static.txt") - .contains("/BOOT-INF/classes!/templates/template.txt") + .contains("/BOOT-INF/classes!/public/public.txt").contains("/BOOT-INF/classes!/resources/resource.txt") + .contains("/BOOT-INF/classes!/static/static.txt").contains("/BOOT-INF/classes!/templates/template.txt") .contains("/BOOT-INF/classes!/root.properties").contains("Goodbye Mama"); } - @Test void jarCreationWithIncludes() throws Exception { + @Test + void jarCreationWithIncludes() throws Exception { File jar = new File(this.tempDir, "test-app.jar"); - Invocation invocation = this.cli.invoke("jar", jar.getAbsolutePath(), "--include", - "-public/**,-resources/**", "jar.groovy"); + Invocation invocation = this.cli.invoke("jar", jar.getAbsolutePath(), "--include", "-public/**,-resources/**", + "jar.groovy"); invocation.await(); if (!JAVA_9_OR_LATER) { assertThat(invocation.getErrorOutput()).isEmpty(); } assertThat(jar).exists(); - Process process = new JavaExecutable() - .processBuilder("-jar", jar.getAbsolutePath()).start(); + Process process = new JavaExecutable().processBuilder("-jar", jar.getAbsolutePath()).start(); invocation = new Invocation(process); invocation.await(); if (!JAVA_9_OR_LATER) { assertThat(invocation.getErrorOutput()).isEqualTo(""); } - assertThat(invocation.getStandardOutput()).contains("Hello World!") - .doesNotContain("/public/public.txt") + assertThat(invocation.getStandardOutput()).contains("Hello World!").doesNotContain("/public/public.txt") .doesNotContain("/resources/resource.txt").contains("/static/static.txt") .contains("/templates/template.txt").contains("Goodbye Mama"); } diff --git a/spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/WarCommandIT.java b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/WarCommandIT.java similarity index 83% rename from spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/WarCommandIT.java rename to spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/WarCommandIT.java index 0554fff7d986..4ea3ffa4b5bb 100644 --- a/spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/WarCommandIT.java +++ b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/WarCommandIT.java @@ -43,25 +43,22 @@ class WarCommandIT { @BeforeEach void setup(@TempDir File tempDir) { - this.cli = new CommandLineInvoker(new File("src/it/resources/war-command"), - tempDir); + this.cli = new CommandLineInvoker(new File("src/intTest/resources/war-command"), tempDir); this.tempDir = tempDir; } - @Test void warCreation() throws Exception { + @Test + void warCreation() throws Exception { File war = new File(this.tempDir, "test-app.war"); - Invocation invocation = this.cli.invoke("war", war.getAbsolutePath(), - "war.groovy"); + Invocation invocation = this.cli.invoke("war", war.getAbsolutePath(), "war.groovy"); invocation.await(); assertThat(war.exists()).isTrue(); - Process process = new JavaExecutable() - .processBuilder("-jar", war.getAbsolutePath(), "--server.port=0").start(); + Process process = new JavaExecutable().processBuilder("-jar", war.getAbsolutePath(), "--server.port=0").start(); invocation = new Invocation(process); invocation.await(); assertThat(invocation.getOutput()).contains("onStart error"); assertThat(invocation.getOutput()).contains("Tomcat started"); - assertThat(invocation.getOutput()) - .contains("/WEB-INF/lib-provided/tomcat-embed-core"); + assertThat(invocation.getOutput()).contains("/WEB-INF/lib-provided/tomcat-embed-core"); assertThat(invocation.getOutput()).contains("WEB-INF/classes!/root.properties"); process.destroy(); } diff --git a/spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java similarity index 83% rename from spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java rename to spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java index b1e1c0cd78ca..4792b8ebadcf 100644 --- a/spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java +++ b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java @@ -25,6 +25,10 @@ import java.io.PrintWriter; import java.io.StringReader; import java.io.StringWriter; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -63,19 +67,22 @@ public Invocation invoke(String... args) throws IOException { } private Process runCliProcess(String... args) throws IOException { + Path m2 = this.temp.toPath().resolve(".m2"); + Files.createDirectories(m2); + Files.copy(Paths.get("src", "intTest", "resources", "settings.xml"), m2.resolve("settings.xml"), + StandardCopyOption.REPLACE_EXISTING); List command = new ArrayList<>(); command.add(findLaunchScript().getAbsolutePath()); command.addAll(Arrays.asList(args)); - ProcessBuilder processBuilder = new ProcessBuilder(command) - .directory(this.workingDirectory); - processBuilder.environment().remove("JAVA_OPTS"); + ProcessBuilder processBuilder = new ProcessBuilder(command).directory(this.workingDirectory); + processBuilder.environment().put("JAVA_OPTS", "-Duser.home=" + this.temp); return processBuilder.start(); } private File findLaunchScript() throws IOException { File unpacked = new File(this.temp, "unpacked-cli"); if (!unpacked.isDirectory()) { - File zip = new BuildOutput(getClass()).getRootLocation() + File zip = new File(new BuildOutput(getClass()).getRootLocation(), "distributions") .listFiles((pathname) -> pathname.getName().endsWith("-bin.zip"))[0]; try (ZipInputStream input = new ZipInputStream(new FileInputStream(zip))) { ZipEntry entry; @@ -99,8 +106,7 @@ private File findLaunchScript() throws IOException { File bin = new File(unpacked.listFiles()[0], "bin"); File launchScript = new File(bin, isWindows() ? "spring.bat" : "spring"); Assert.state(launchScript.exists() && launchScript.isFile(), - () -> "Could not find CLI launch script " - + launchScript.getAbsolutePath()); + () -> "Could not find CLI launch script " + launchScript.getAbsolutePath()); return launchScript; } @@ -125,10 +131,10 @@ public static final class Invocation { public Invocation(Process process) { this.process = process; - this.streamReaders.add(new Thread(new StreamReadingRunnable( - this.process.getErrorStream(), this.err, this.combined))); - this.streamReaders.add(new Thread(new StreamReadingRunnable( - this.process.getInputStream(), this.out, this.combined))); + this.streamReaders + .add(new Thread(new StreamReadingRunnable(this.process.getErrorStream(), this.err, this.combined))); + this.streamReaders + .add(new Thread(new StreamReadingRunnable(this.process.getInputStream(), this.out, this.combined))); for (Thread streamReader : this.streamReaders) { streamReader.start(); } @@ -162,10 +168,8 @@ private String postProcessLines(List lines) { } private List getLines(StringBuffer buffer) { - BufferedReader reader = new BufferedReader( - new StringReader(buffer.toString())); - return reader.lines().filter((line) -> !line.startsWith("Picked up ")) - .collect(Collectors.toList()); + BufferedReader reader = new BufferedReader(new StringReader(buffer.toString())); + return reader.lines().filter((line) -> !line.startsWith("Picked up ")).collect(Collectors.toList()); } public int await() throws InterruptedException { diff --git a/spring-boot-project/spring-boot-cli/src/it/resources/jar-command/bad.groovy b/spring-boot-project/spring-boot-cli/src/intTest/resources/jar-command/bad.groovy similarity index 100% rename from spring-boot-project/spring-boot-cli/src/it/resources/jar-command/bad.groovy rename to spring-boot-project/spring-boot-cli/src/intTest/resources/jar-command/bad.groovy diff --git a/spring-boot-project/spring-boot-cli/src/it/resources/jar-command/jar.groovy b/spring-boot-project/spring-boot-cli/src/intTest/resources/jar-command/jar.groovy similarity index 100% rename from spring-boot-project/spring-boot-cli/src/it/resources/jar-command/jar.groovy rename to spring-boot-project/spring-boot-cli/src/intTest/resources/jar-command/jar.groovy diff --git a/spring-boot-project/spring-boot-cli/src/it/resources/jar-command/public/public.txt b/spring-boot-project/spring-boot-cli/src/intTest/resources/jar-command/public/public.txt similarity index 100% rename from spring-boot-project/spring-boot-cli/src/it/resources/jar-command/public/public.txt rename to spring-boot-project/spring-boot-cli/src/intTest/resources/jar-command/public/public.txt diff --git a/spring-boot-project/spring-boot-cli/src/it/resources/jar-command/resources/resource.txt b/spring-boot-project/spring-boot-cli/src/intTest/resources/jar-command/resources/resource.txt similarity index 100% rename from spring-boot-project/spring-boot-cli/src/it/resources/jar-command/resources/resource.txt rename to spring-boot-project/spring-boot-cli/src/intTest/resources/jar-command/resources/resource.txt diff --git a/spring-boot-project/spring-boot-cli/src/it/resources/jar-command/root.properties b/spring-boot-project/spring-boot-cli/src/intTest/resources/jar-command/root.properties similarity index 100% rename from spring-boot-project/spring-boot-cli/src/it/resources/jar-command/root.properties rename to spring-boot-project/spring-boot-cli/src/intTest/resources/jar-command/root.properties diff --git a/spring-boot-project/spring-boot-cli/src/it/resources/jar-command/static/static.txt b/spring-boot-project/spring-boot-cli/src/intTest/resources/jar-command/static/static.txt similarity index 100% rename from spring-boot-project/spring-boot-cli/src/it/resources/jar-command/static/static.txt rename to spring-boot-project/spring-boot-cli/src/intTest/resources/jar-command/static/static.txt diff --git a/spring-boot-project/spring-boot-cli/src/it/resources/jar-command/templates/template.txt b/spring-boot-project/spring-boot-cli/src/intTest/resources/jar-command/templates/template.txt similarity index 100% rename from spring-boot-project/spring-boot-cli/src/it/resources/jar-command/templates/template.txt rename to spring-boot-project/spring-boot-cli/src/intTest/resources/jar-command/templates/template.txt diff --git a/spring-boot-project/spring-boot-cli/src/it/resources/run-command/quiet.groovy b/spring-boot-project/spring-boot-cli/src/intTest/resources/run-command/quiet.groovy similarity index 100% rename from spring-boot-project/spring-boot-cli/src/it/resources/run-command/quiet.groovy rename to spring-boot-project/spring-boot-cli/src/intTest/resources/run-command/quiet.groovy diff --git a/spring-boot-project/spring-boot-cli/src/intTest/resources/settings.xml b/spring-boot-project/spring-boot-cli/src/intTest/resources/settings.xml new file mode 100644 index 000000000000..bbe1ac0ed3cd --- /dev/null +++ b/spring-boot-project/spring-boot-cli/src/intTest/resources/settings.xml @@ -0,0 +1,23 @@ + + ../../../../build/local-m2-repository + + + cli-test-repo + + true + + + + local.central + file:../../../../build/test-repository + + true + + + true + + + + + + \ No newline at end of file diff --git a/spring-boot-project/spring-boot-cli/src/it/resources/war-command/root.properties b/spring-boot-project/spring-boot-cli/src/intTest/resources/war-command/root.properties similarity index 100% rename from spring-boot-project/spring-boot-cli/src/it/resources/war-command/root.properties rename to spring-boot-project/spring-boot-cli/src/intTest/resources/war-command/root.properties diff --git a/spring-boot-project/spring-boot-cli/src/it/resources/war-command/war.groovy b/spring-boot-project/spring-boot-cli/src/intTest/resources/war-command/war.groovy similarity index 100% rename from spring-boot-project/spring-boot-cli/src/it/resources/war-command/war.groovy rename to spring-boot-project/spring-boot-cli/src/intTest/resources/war-command/war.groovy diff --git a/spring-boot-project/spring-boot-cli/src/main/homebrew/springboot.rb b/spring-boot-project/spring-boot-cli/src/main/homebrew/springboot.rb index 4c9d0e75905c..5f338dcceb26 100644 --- a/spring-boot-project/spring-boot-cli/src/main/homebrew/springboot.rb +++ b/spring-boot-project/spring-boot-cli/src/main/homebrew/springboot.rb @@ -4,7 +4,7 @@ class Springboot < Formula homepage 'https://spring.io/projects/spring-boot' url 'https://repo.spring.io/${repo}/org/springframework/boot/spring-boot-cli/${project.version}/spring-boot-cli-${project.version}-bin.tar.gz' version '${project.version}' - sha256 '${checksum}' + sha256 '${hash}' head 'https://github.com/spring-projects/spring-boot.git' if build.head? diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/dependencies/SpringBootDependenciesDependencyManagement.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/dependencies/SpringBootDependenciesDependencyManagement.java index 694c2785428f..7f79b5c08a84 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/dependencies/SpringBootDependenciesDependencyManagement.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/dependencies/SpringBootDependenciesDependencyManagement.java @@ -42,8 +42,8 @@ private static Model readModel() { modelProcessor.setModelReader(new DefaultModelReader()); try { - return modelProcessor.read( - SpringBootDependenciesDependencyManagement.class.getResourceAsStream("effective-pom.xml"), null); + return modelProcessor.read(SpringBootDependenciesDependencyManagement.class + .getResourceAsStream("spring-boot-dependencies-effective-bom.xml"), null); } catch (IOException ex) { throw new IllegalStateException("Failed to build model from effective pom", ex); diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/maven/MavenSettingsReader.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/maven/MavenSettingsReader.java index 10a8e7b02a49..c1ae15b6d501 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/maven/MavenSettingsReader.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/maven/MavenSettingsReader.java @@ -17,7 +17,6 @@ package org.springframework.boot.cli.compiler.maven; import java.io.File; -import java.lang.reflect.Field; import org.apache.maven.settings.Settings; import org.apache.maven.settings.building.DefaultSettingsBuilderFactory; @@ -83,21 +82,7 @@ private SettingsDecryptionResult decryptSettings(Settings settings) { } private SettingsDecrypter createSettingsDecrypter() { - SettingsDecrypter settingsDecrypter = new DefaultSettingsDecrypter(); - setField(DefaultSettingsDecrypter.class, "securityDispatcher", settingsDecrypter, - new SpringBootSecDispatcher()); - return settingsDecrypter; - } - - private void setField(Class sourceClass, String fieldName, Object target, Object value) { - try { - Field field = sourceClass.getDeclaredField(fieldName); - field.setAccessible(true); - field.set(target, value); - } - catch (Exception ex) { - throw new IllegalStateException("Failed to set field '" + fieldName + "' on '" + target + "'", ex); - } + return new DefaultSettingsDecrypter(new SpringBootSecDispatcher()); } private class SpringBootSecDispatcher extends DefaultSecDispatcher { diff --git a/spring-boot-project/spring-boot-cli/src/main/scoop/springboot.json b/spring-boot-project/spring-boot-cli/src/main/scoop/springboot.json index b8b3ad73f2df..dbfe2308cc14 100644 --- a/spring-boot-project/spring-boot-cli/src/main/scoop/springboot.json +++ b/spring-boot-project/spring-boot-cli/src/main/scoop/springboot.json @@ -1,11 +1,11 @@ { "homepage": "https://projects.spring.io/spring-boot/", - "version": "${scoop-version}", + "version": "${scoopVersion}", "license": "Apache 2.0", "hash": "${hash}", "url": "https://repo.spring.io/${repo}/org/springframework/boot/spring-boot-cli/${project.version}/spring-boot-cli-${project.version}-bin.zip", "extract_dir": "spring-${project.version}", - "bin": "bin\\spring.bat", + "bin": "bin\\\\spring.bat", "suggest": { "JDK": [ "java/oraclejdk", @@ -14,13 +14,13 @@ }, "checkver": { "github": "https://github.com/spring-projects/spring-boot", - "re": "/releases/tag/(?:v)?(2[\\d.]+)\\.RELEASE" + "re": "/releases/tag/(?:v)?(2[\\d.]+)\\\\.RELEASE" }, "autoupdate": { - "url": "https://repo.spring.io/release/org/springframework/boot/spring-boot-cli/$version.RELEASE/spring-boot-cli-$version.RELEASE-bin.zip", - "extract_dir": "spring-$version.RELEASE", + "url": "https://repo.spring.io/release/org/springframework/boot/spring-boot-cli/\$version.RELEASE/spring-boot-cli-\$version.RELEASE-bin.zip", + "extract_dir": "spring-\$version.RELEASE", "hash": { - "url": "$url.sha256" + "url": "\$url.sha256" } } } diff --git a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/CliTester.java b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/CliTester.java index f9015b196fc1..0586e792af32 100644 --- a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/CliTester.java +++ b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/CliTester.java @@ -96,12 +96,14 @@ public String run(String... args) throws Exception { for (String arg : args) { if (arg.startsWith("--classpath=")) { arg = arg + ":" + this.buildOutput.getTestClassesLocation().getAbsolutePath(); + arg = arg + ":" + this.buildOutput.getTestResourcesLocation().getAbsolutePath(); classpathUpdated = true; } updatedArgs.add(arg); } if (!classpathUpdated) { - updatedArgs.add("--classpath=.:" + this.buildOutput.getTestClassesLocation().getAbsolutePath()); + updatedArgs.add("--classpath=.:" + this.buildOutput.getTestClassesLocation().getAbsolutePath() + ":" + + this.buildOutput.getTestResourcesLocation().getAbsolutePath()); } Future future = submitCommand(new RunCommand(), StringUtils.toStringArray(updatedArgs)); this.commands.add(future.get(this.timeout, TimeUnit.MILLISECONDS)); @@ -134,6 +136,8 @@ private Future submitCommand(T command, Stri "org.springframework.boot.cli.CliTesterSpringApplication"); this.serverPortFile = new File(this.temp, "server.port"); System.setProperty("portfile", this.serverPortFile.getAbsolutePath()); + String userHome = System.getProperty("user.home"); + System.setProperty("user.home", "src/test/resources/cli-tester"); try { command.run(sources); return command; @@ -142,6 +146,7 @@ private Future submitCommand(T command, Stri System.clearProperty("server.port"); System.clearProperty("spring.application.class.name"); System.clearProperty("portfile"); + System.setProperty("user.home", userHome); Thread.currentThread().setContextClassLoader(loader); } }); diff --git a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/GrabCommandIntegrationTests.java b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/GrabCommandIntegrationTests.java index 8790f3f31462..fec42a0efc27 100644 --- a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/GrabCommandIntegrationTests.java +++ b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/GrabCommandIntegrationTests.java @@ -57,15 +57,12 @@ void deleteLocalRepository() { @Test void grab() throws Exception { - System.setProperty("grape.root", this.cli.getTemp().getAbsolutePath()); System.setProperty("groovy.grape.report.downloads", "true"); - // Use --autoconfigure=false to limit the amount of downloaded dependencies String output = this.cli.grab("grab.groovy", "--autoconfigure=false"); assertThat(new File(this.cli.getTemp(), "repository/joda-time/joda-time")).isDirectory(); - // Should be resolved from local repository cache - assertThat(output.contains("Downloading: file:")).isTrue(); + assertThat(output).contains("Downloading: "); } @Test diff --git a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/RunCommandIntegrationTests.java b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/RunCommandIntegrationTests.java index d16fa456845d..28c5991d5b48 100644 --- a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/RunCommandIntegrationTests.java +++ b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/RunCommandIntegrationTests.java @@ -42,7 +42,7 @@ class RunCommandIntegrationTests { CliTester cli; RunCommandIntegrationTests(CapturedOutput output) { - this.cli = new CliTester("src/it/resources/run-command/", output); + this.cli = new CliTester("src/test/resources/run-command/", output); } private Properties systemProperties = new Properties(); diff --git a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/dependencies/SpringBootDependenciesDependencyManagementTests.java b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/dependencies/SpringBootDependenciesDependencyManagementTests.java index abf868f0f7b8..b6677248c5e9 100644 --- a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/dependencies/SpringBootDependenciesDependencyManagementTests.java +++ b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/dependencies/SpringBootDependenciesDependencyManagementTests.java @@ -19,7 +19,6 @@ import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; -import static org.hamcrest.Matchers.empty; /** * Tests for {@link SpringBootDependenciesDependencyManagement} @@ -45,7 +44,7 @@ void find() { @Test void getDependencies() { - assertThat(this.dependencyManagement.getDependencies()).isNotEqualTo(empty()); + assertThat(this.dependencyManagement.getDependencies()).isNotEmpty(); } } diff --git a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineTests.java b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineTests.java index 95377e122b0e..2c1d15329c7d 100644 --- a/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineTests.java +++ b/spring-boot-project/spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineTests.java @@ -47,9 +47,12 @@ class AetherGrapeEngineTests { private final GroovyClassLoader groovyClassLoader = new GroovyClassLoader(); - private final RepositoryConfiguration springMilestones = new RepositoryConfiguration("spring-milestones", + private final RepositoryConfiguration springMilestone = new RepositoryConfiguration("spring-milestone", URI.create("https://repo.spring.io/milestone"), false); + private final RepositoryConfiguration springSnaphot = new RepositoryConfiguration("spring-snapshot", + URI.create("https://repo.spring.io/snapshot"), true); + private AetherGrapeEngine createGrapeEngine(RepositoryConfiguration... additionalRepositories) { List repositoryConfigurations = new ArrayList<>(); repositoryConfigurations @@ -64,7 +67,7 @@ private AetherGrapeEngine createGrapeEngine(RepositoryConfiguration... additiona @Test void dependencyResolution() { Map args = new HashMap<>(); - createGrapeEngine(this.springMilestones).grab(args, + createGrapeEngine(this.springMilestone, this.springSnaphot).grab(args, createDependency("org.springframework", "spring-jdbc", null)); assertThat(this.groovyClassLoader.getURLs()).hasSize(5); } @@ -104,7 +107,7 @@ void dependencyResolutionWithExclusions() { Map args = new HashMap<>(); args.put("excludes", Arrays.asList(createExclusion("org.springframework", "spring-core"))); - createGrapeEngine(this.springMilestones).grab(args, + createGrapeEngine(this.springMilestone, this.springSnaphot).grab(args, createDependency("org.springframework", "spring-jdbc", "3.2.4.RELEASE"), createDependency("org.springframework", "spring-beans", "3.2.4.RELEASE")); @@ -126,7 +129,7 @@ void dependencyResolutionWithCustomClassLoader() { GroovyClassLoader customClassLoader = new GroovyClassLoader(); args.put("classLoader", customClassLoader); - createGrapeEngine(this.springMilestones).grab(args, + createGrapeEngine(this.springMilestone, this.springSnaphot).grab(args, createDependency("org.springframework", "spring-jdbc", null)); assertThat(this.groovyClassLoader.getURLs()).isEmpty(); diff --git a/spring-boot-project/spring-boot-cli/src/test/resources/.m2/settings.xml b/spring-boot-project/spring-boot-cli/src/test/resources/.m2/settings.xml index 8ae764f39d3b..7aff3641141a 100644 --- a/spring-boot-project/spring-boot-cli/src/test/resources/.m2/settings.xml +++ b/spring-boot-project/spring-boot-cli/src/test/resources/.m2/settings.xml @@ -2,7 +2,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd"> - + build/local-m2-repository central-mirror @@ -10,7 +10,6 @@ central - central-mirror @@ -18,7 +17,6 @@ password - true @@ -29,5 +27,4 @@ password - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/settings.xml b/spring-boot-project/spring-boot-cli/src/test/resources/cli-tester/.m2/settings.xml similarity index 52% rename from spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/settings.xml rename to spring-boot-project/spring-boot-cli/src/test/resources/cli-tester/.m2/settings.xml index e1e0ace341b9..504eb80a0555 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/settings.xml +++ b/spring-boot-project/spring-boot-cli/src/test/resources/cli-tester/.m2/settings.xml @@ -1,15 +1,16 @@ + build/local-m2-repository - it-repo + cli-test-repo true local.central - @localRepositoryUrl@ + file:build/test-repository true @@ -17,19 +18,27 @@ true - - - - local.central - @localRepositoryUrl@ + + spring-snapshot + https://repo.spring.io/snapshot - true + false true - - + + + spring-milestone + https://repo.spring.io/milestone + + true + + + false + + + diff --git a/spring-boot-project/spring-boot-cli/src/test/resources/run-command/quiet.groovy b/spring-boot-project/spring-boot-cli/src/test/resources/run-command/quiet.groovy new file mode 100644 index 000000000000..32640370e1a9 --- /dev/null +++ b/spring-boot-project/spring-boot-cli/src/test/resources/run-command/quiet.groovy @@ -0,0 +1,10 @@ +package org.test + +@Component +class Example implements CommandLineRunner { + + void run(String... args) { + print "Ssshh" + } + +} \ No newline at end of file diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle new file mode 100644 index 000000000000..f3d7d7ec17ef --- /dev/null +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -0,0 +1,1900 @@ +plugins { + id 'org.springframework.boot.bom' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.deployed' +} + +description = 'Spring Boot Dependencies' + +bom { + upgrade { + policy = 'same-major-version' + gitHub { + issueLabels = ['type: dependency-upgrade'] + } + } + library('ActiveMQ', '5.15.11') { + group('org.apache.activemq') { + modules = [ + 'activemq-amqp', + 'activemq-blueprint', + 'activemq-broker', + 'activemq-camel', + 'activemq-client', + 'activemq-console' { + exclude group: 'commons-logging', module: 'commons-logging' + }, + 'activemq-http', + 'activemq-jaas', + 'activemq-jdbc-store', + 'activemq-jms-pool', + 'activemq-kahadb-store', + 'activemq-karaf', + 'activemq-leveldb-store' { + exclude group: 'commons-logging', module: 'commons-logging' + }, + 'activemq-log4j-appender', + 'activemq-mqtt', + 'activemq-openwire-generator', + 'activemq-openwire-legacy', + 'activemq-osgi', + 'activemq-partition', + 'activemq-pool', + 'activemq-ra', + 'activemq-run', + 'activemq-runtime-config', + 'activemq-shiro', + 'activemq-spring' { + exclude group: 'commons-logging', module: 'commons-logging' + }, + 'activemq-stomp', + 'activemq-web' + ] + } + } + library('ANTLR2', '2.7.7') { + group('antlr') { + modules = [ + 'antlr' + ] + } + } + library('AppEngine SDK', '1.9.77') { + group('com.google.appengine') { + modules = [ + 'appengine-api-1.0-sdk' + ] + } + } + library('Artemis', '2.10.1') { + group('org.apache.activemq') { + modules = [ + 'artemis-amqp-protocol', + 'artemis-commons' { + exclude group: 'commons-logging', module: 'commons-logging' + }, + 'artemis-core-client' { + exclude group: 'org.apache.geronimo.specs', module: 'geronimo-json_1.0_spec' + }, + 'artemis-jms-client' { + exclude group: 'org.apache.geronimo.specs', module: 'geronimo-json_1.0_spec' + }, + 'artemis-jms-server' { + exclude group: 'org.apache.geronimo.specs', module: 'geronimo-json_1.0_spec' + }, + 'artemis-journal', + 'artemis-selector', + 'artemis-server' { + exclude group: 'commons-logging', module: 'commons-logging' + exclude group: 'org.apache.geronimo.specs', module: 'geronimo-json_1.0_spec' + }, + 'artemis-service-extensions' + ] + } + } + library('AspectJ', '1.9.5') { + group('org.aspectj') { + modules = [ + 'aspectjrt', + 'aspectjtools', + 'aspectjweaver' + ] + } + } + library('AssertJ', '3.14.0') { + group('org.assertj') { + modules = [ + 'assertj-core' + ] + } + } + library('Atomikos', '4.0.6') { + group('com.atomikos') { + modules = [ + 'transactions-jdbc', + 'transactions-jms', + 'transactions-jta' + ] + } + } + library('Awaitility', '4.0.1') { + group('org.awaitility') { + modules = [ + 'awaitility', + 'awaitility-groovy', + 'awaitility-kotlin', + 'awaitility-scala' + ] + } + } + library('Bitronix', '2.1.4') { + group('org.codehaus.btm') { + modules = [ + 'btm' + ] + } + } + library('Build Helper Maven Plugin', '3.0.0') { + group('org.codehaus.mojo') { + plugins = [ + 'build-helper-maven-plugin' + ] + } + } + library('Byte Buddy', '1.10.4') { + group('net.bytebuddy') { + modules = [ + 'byte-buddy', + 'byte-buddy-agent' + ] + } + } + library('Caffeine', '2.8.0') { + group('com.github.ben-manes.caffeine') { + modules = [ + 'caffeine', + 'guava', + 'jcache', + 'simulator' + ] + } + } + library('Cassandra Driver', '3.7.2') { + group('com.datastax.cassandra') { + modules = [ + 'cassandra-driver-core', + 'cassandra-driver-mapping' + ] + } + } + library('Classmate', '1.5.1') { + group('com.fasterxml') { + modules = [ + 'classmate' + ] + } + } + library('Commons Codec', '1.13') { + group('commons-codec') { + modules = [ + 'commons-codec' + ] + } + } + library('Commons DBCP2', '2.7.0') { + group('org.apache.commons') { + modules = [ + 'commons-dbcp2' { + exclude group: 'commons-logging', module: 'commons-logging' + } + ] + } + } + library('Commons Lang3', '3.9') { + group('org.apache.commons') { + modules = [ + 'commons-lang3' + ] + } + } + library('Commons Pool', '1.6') { + group('commons-pool') { + modules = [ + 'commons-pool' + ] + } + } + library('Commons Pool2', '2.7.0') { + group('org.apache.commons') { + modules = [ + 'commons-pool2' + ] + } + } + library('Couchbase Cache Client', '2.1.0') { + group('com.couchbase.client') { + modules = [ + 'couchbase-spring-cache' + ] + } + } + library('Couchbase Client', '2.7.11') { + group('com.couchbase.client') { + modules = [ + 'java-client' + ] + } + } + library('DB2 JDBC', '11.5.0.0') { + group('com.ibm.db2') { + modules = [ + 'jcc' + ] + } + } + library('Dependency Management Plugin', '1.0.8.RELEASE') { + group('io.spring.gradle') { + modules = [ + 'dependency-management-plugin' + ] + } + } + library('Derby', '10.14.2.0') { + prohibit('[10.15,)') { + because 'it requires Java 9' + } + group('org.apache.derby') { + modules = [ + 'derby', + 'derbyclient' + ] + } + } + library('Dropwizard Metrics', '4.1.1') { + group('io.dropwizard.metrics') { + modules = [ + 'metrics-annotation', + 'metrics-core', + 'metrics-ehcache', + 'metrics-graphite', + 'metrics-healthchecks', + 'metrics-httpasyncclient', + 'metrics-jdbi', + 'metrics-jersey2', + 'metrics-jetty9', + 'metrics-jmx', + 'metrics-json', + 'metrics-jvm', + 'metrics-log4j2', + 'metrics-logback', + 'metrics-servlet', + 'metrics-servlets' + ] + } + } + library('Ehcache', '2.10.6') { + group('net.sf.ehcache') { + modules = [ + 'ehcache' + ] + } + } + library('Ehcache3', '3.8.1') { + group('org.ehcache') { + modules = [ + 'ehcache', + 'ehcache-clustered', + 'ehcache-transactions' + ] + } + } + library('Elasticsearch', '6.8.5') { + group('org.elasticsearch') { + modules = [ + 'elasticsearch' + ] + } + group('org.elasticsearch.client') { + modules = [ + 'transport', + 'elasticsearch-rest-client' { + exclude group: 'commons-logging', module: 'commons-logging' + }, + 'elasticsearch-rest-high-level-client' + ] + } + group('org.elasticsearch.distribution.integ-test-zip') { + modules = [ + 'elasticsearch' + ] + } + group('org.elasticsearch.plugin') { + modules = [ + 'transport-netty4-client' + ] + } + } + library('Embedded Mongo', '2.2.0') { + group('de.flapdoodle.embed') { + modules = [ + 'de.flapdoodle.embed.mongo' + ] + } + } + library('Exec Maven Plugin', '1.6.0') { + group('org.codehaus.mojo') { + plugins = [ + 'exec-maven-plugin' + ] + } + } + library('Flatten Maven Plugin', '1.1.0') { + group('org.codehaus.mojo') { + plugins = [ + 'flatten-maven-plugin' + ] + } + } + library('Flyway', '6.1.3') { + group('org.flywaydb') { + modules = [ + 'flyway-core' + ] + plugins = [ + 'flyway-maven-plugin' + ] + } + } + library('FreeMarker', '2.3.29') { + group('org.freemarker') { + modules = [ + 'freemarker' + ] + } + } + library('Git Commit ID Plugin', '3.0.1') { + group('pl.project13.maven') { + plugins = [ + 'git-commit-id-plugin' + ] + } + } + library('Glassfish EL', '3.0.3') { + group('org.glassfish') { + modules = [ + 'jakarta.el' + ] + } + } + library('Glassfish JAXB', '2.3.2') { + group('org.glassfish.jaxb') { + modules = [ + 'codemodel', + 'codemodel-annotation-compiler', + 'jaxb-jxc', + 'jaxb-runtime', + 'jaxb-xjc', + 'txw2', + 'txwc2', + 'xsom' + ] + } + } + library('Groovy', '2.5.8') { + group('org.codehaus.groovy') { + modules = [ + 'groovy', + 'groovy-ant', + 'groovy-backports-compat23', + 'groovy-bsf', + 'groovy-cli-commons', + 'groovy-cli-picocli', + 'groovy-console', + 'groovy-datetime', + 'groovy-dateutil', + 'groovy-docgenerator', + 'groovy-groovydoc', + 'groovy-groovysh', + 'groovy-jaxb', + 'groovy-jmx', + 'groovy-json', + 'groovy-json-direct', + 'groovy-jsr223', + 'groovy-macro', + 'groovy-nio', + 'groovy-servlet', + 'groovy-sql', + 'groovy-swing', + 'groovy-templates', + 'groovy-test', + 'groovy-test-junit5', + 'groovy-testng', + 'groovy-xml' + ] + } + } + library('Gson', '2.8.6') { + group('com.google.code.gson') { + modules = [ + 'gson' + ] + } + } + library('H2', '1.4.200') { + group('com.h2database') { + modules = [ + 'h2' + ] + } + } + library('Hamcrest', '2.2') { + group('org.hamcrest') { + modules = [ + 'hamcrest', + 'hamcrest-core', + 'hamcrest-library' + ] + } + } + library('Hazelcast', '3.12.4') { + group('com.hazelcast') { + modules = [ + 'hazelcast', + 'hazelcast-client', + 'hazelcast-spring' + ] + } + } + library('Hazelcast Hibernate5', '1.3.2') { + group('com.hazelcast') { + modules = [ + 'hazelcast-hibernate52', + 'hazelcast-hibernate53' + ] + } + } + library('Hibernate', '5.4.9.Final') { + group('org.hibernate') { + modules = [ + 'hibernate-c3p0', + 'hibernate-core', + 'hibernate-ehcache', + 'hibernate-entitymanager', + 'hibernate-envers', + 'hibernate-hikaricp', + 'hibernate-java8', + 'hibernate-jcache', + 'hibernate-jpamodelgen', + 'hibernate-proxool', + 'hibernate-spatial', + 'hibernate-testing', + 'hibernate-vibur' + ] + } + } + library('Hibernate Validator', '6.1.0.Final') { + group('org.hibernate.validator') { + modules = [ + 'hibernate-validator', + 'hibernate-validator-annotation-processor' + ] + } + } + library('HikariCP', '3.4.1') { + group('com.zaxxer') { + modules = [ + 'HikariCP' + ] + } + } + library('HSQLDB', '2.5.0') { + group('org.hsqldb') { + modules = [ + 'hsqldb' + ] + } + } + library('HtmlUnit', '2.36.0') { + group('net.sourceforge.htmlunit') { + modules = [ + 'htmlunit' { + exclude group: 'commons-logging', module: 'commons-logging' + } + ] + } + } + library('HttpAsyncClient', '4.1.4') { + group('org.apache.httpcomponents') { + modules = [ + 'httpasyncclient' { + exclude group: 'commons-logging', module: 'commons-logging' + } + ] + } + } + library('HttpClient', '4.5.10') { + group('org.apache.httpcomponents') { + modules = [ + 'fluent-hc', + 'httpclient' { + exclude group: 'commons-logging', module: 'commons-logging' + }, + 'httpclient-cache', + 'httpclient-osgi', + 'httpclient-win', + 'httpmime' + ] + } + } + library('HttpCore', '4.4.12') { + group('org.apache.httpcomponents') { + modules = [ + 'httpcore', + 'httpcore-nio' + ] + } + } + library('Infinispan', '9.4.16.Final') { + group('org.infinispan') { + modules = [ + 'infinispan-cachestore-jdbc', + 'infinispan-cachestore-jpa', + 'infinispan-cachestore-leveldb', + 'infinispan-cachestore-remote', + 'infinispan-cachestore-rest', + 'infinispan-cachestore-rocksdb', + 'infinispan-cdi-common', + 'infinispan-cdi-embedded', + 'infinispan-cdi-remote', + 'infinispan-client-hotrod', + 'infinispan-cloud', + 'infinispan-clustered-counter', + 'infinispan-clustered-lock', + 'infinispan-commons', + 'infinispan-core', + 'infinispan-directory-provider', + 'infinispan-hibernate-cache-v53', + 'infinispan-jcache', + 'infinispan-jcache-commons', + 'infinispan-jcache-remote', + 'infinispan-lucene-directory', + 'infinispan-objectfilter', + 'infinispan-osgi', + 'infinispan-persistence-cli', + 'infinispan-persistence-soft-index', + 'infinispan-query', + 'infinispan-query-dsl', + 'infinispan-remote-query-client', + 'infinispan-remote-query-server', + 'infinispan-scripting', + 'infinispan-server-core', + 'infinispan-server-hotrod', + 'infinispan-server-memcached', + 'infinispan-server-router', + 'infinispan-spring4-common', + 'infinispan-spring4-embedded', + 'infinispan-spring4-remote', + 'infinispan-spring5-common', + 'infinispan-spring5-embedded', + 'infinispan-spring5-remote', + 'infinispan-tasks', + 'infinispan-tasks-api', + 'infinispan-tools', + 'infinispan-tree' + ] + plugins = [ + 'infinispan-protocol-parser-generator-maven-plugin' + ] + } + } + library('InfluxDB Java', '2.16') { + group('org.influxdb') { + modules = [ + 'influxdb-java' + ] + } + } + library('Jackson Bom', '2.10.1') { + group('com.fasterxml.jackson') { + imports = [ + 'jackson-bom' + ] + } + } + library('Jakarta Activation', '1.2.1') { + group('com.sun.activation') { + modules = [ + 'jakarta.activation' + ] + } + group('jakarta.activation') { + modules = [ + 'jakarta.activation-api' + ] + } + } + library('Jakarta Annotation', '1.3.5') { + group('jakarta.annotation') { + modules = [ + 'jakarta.annotation-api' + ] + } + } + library('Jakarta JMS', '2.0.3') { + group('jakarta.jms') { + modules = [ + 'jakarta.jms-api' + ] + } + } + library('Jakarta Json', '1.1.6') { + group('jakarta.json') { + modules = [ + 'jakarta.json-api' + ] + } + } + library('Jakarta Json Bind', '1.0.2') { + group('jakarta.json.bind') { + modules = [ + 'jakarta.json.bind-api' + ] + } + } + library('Jakarta Mail', '1.6.4') { + group('jakarta.mail') { + modules = [ + 'jakarta.mail-api' + ] + } + } + library('Jakarta Persistence', '2.2.3') { + group('jakarta.persistence') { + modules = [ + 'jakarta.persistence-api' + ] + } + } + library('Jakarta Servlet', '4.0.3') { + group('jakarta.servlet') { + modules = [ + 'jakarta.servlet-api' + ] + } + } + library('Jakarta Servlet JSP JSTL', '1.2.7') { + group('jakarta.servlet.jsp.jstl') { + modules = [ + 'jakarta.servlet.jsp.jstl-api' + ] + } + } + library('Jakarta Transaction', '1.3.3') { + group('jakarta.transaction') { + modules = [ + 'jakarta.transaction-api' + ] + } + } + library('Jakarta Validation', '2.0.1') { + group('jakarta.validation') { + modules = [ + 'jakarta.validation-api' + ] + } + } + library('Jakarta WebSocket', '1.1.2') { + group('jakarta.websocket') { + modules = [ + 'jakarta.websocket-api' + ] + } + } + library('Jakarta WS RS', '2.1.6') { + group('jakarta.ws.rs') { + modules = [ + 'jakarta.ws.rs-api' + ] + } + } + library('Jakarta XML Bind', '2.3.2') { + group('jakarta.xml.bind') { + modules = [ + 'jakarta.xml.bind-api' + ] + } + } + library('Jakarta XML WS', '2.3.2') { + group('jakarta.xml.ws') { + modules = [ + 'jakarta.xml.ws-api' + ] + } + } + library('Janino', '3.1.0') { + group('org.codehaus.janino') { + modules = [ + 'commons-compiler', + 'commons-compiler-jdk', + 'janino' + ] + } + } + library('Javax Activation', '1.2.0') { + group('javax.activation') { + modules = [ + 'javax.activation-api' + ] + } + } + library('Javax Annotation', '1.3.2') { + group('javax.annotation') { + modules = [ + 'javax.annotation-api' + ] + } + } + library('Javax Cache', '1.1.1') { + group('javax.cache') { + modules = [ + 'cache-api' + ] + } + } + library('Javax JAXB', '2.3.1') { + group('javax.xml.bind') { + modules = [ + 'jaxb-api' + ] + } + } + library('Javax JAXWS', '2.3.1') { + group('javax.xml.ws') { + modules = [ + 'jaxws-api' + ] + } + } + library('Javax JMS', '2.0.1') { + group('javax.jms') { + modules = [ + 'javax.jms-api' + ] + } + } + library('Javax Json', '1.1.4') { + group('javax.json') { + modules = [ + 'javax.json-api' + ] + } + } + library('Javax JsonB', '1.0') { + group('javax.json.bind') { + modules = [ + 'javax.json.bind-api' + ] + } + } + library('Javax Mail', '1.6.2') { + group('javax.mail') { + modules = [ + 'javax.mail-api' + ] + } + } + library('Javax Money', '1.0.3') { + group('javax.money') { + modules = [ + 'money-api' + ] + } + } + library('Javax Persistence', '2.2') { + group('javax.persistence') { + modules = [ + 'javax.persistence-api' + ] + } + } + library('Javax Transaction', '1.3') { + group('javax.transaction') { + modules = [ + 'javax.transaction-api' + ] + } + } + library('Javax Validation', '2.0.1.Final') { + group('javax.validation') { + modules = [ + 'validation-api' + ] + } + } + library('Javax WebSocket', '1.1') { + group('javax.websocket') { + modules = [ + 'javax.websocket-api' + ] + } + } + library('Jaxen', '1.2.0') { + group('jaxen') { + modules = [ + 'jaxen' + ] + } + } + library('Jaybird', '3.0.8') { + group('org.firebirdsql.jdbc') { + modules = [ + 'jaybird-jdk17', + 'jaybird-jdk18' + ] + } + } + library('JBoss Logging', '3.4.1.Final') { + group('org.jboss.logging') { + modules = [ + 'jboss-logging' + ] + } + } + library('JBoss Transaction SPI', '7.6.0.Final') { + group('org.jboss') { + modules = [ + 'jboss-transaction-spi' + ] + } + } + library('JDOM2', '2.0.6') { + group('org.jdom') { + modules = [ + 'jdom2' + ] + } + } + library('Jedis', '3.1.0') { + group('redis.clients') { + modules = [ + 'jedis' + ] + } + } + library('Jersey', '2.29.1') { + group('org.glassfish.jersey') { + imports = [ + 'jersey-bom' + ] + } + } + library('Jest', '6.3.1') { + group('io.searchbox') { + modules = [ + 'jest' + ] + } + } + library('Jetty EL', '8.5.40') { + group('org.mortbay.jasper') { + modules = [ + 'apache-el' + ] + } + } + library('Jetty JSP', '2.2.0.v201112011158') { + group('org.eclipse.jetty.orbit') { + modules = [ + 'javax.servlet.jsp' + ] + } + } + library('Jetty Reactive HTTPClient', '1.1.0') { + group('org.eclipse.jetty') { + modules = [ + 'jetty-reactive-httpclient' + ] + } + } + library('Jetty', '9.4.24.v20191120') { + group('org.eclipse.jetty') { + imports = [ + 'jetty-bom' + ] + } + } + library('JMustache', '1.15') { + group('com.samskivert') { + modules = [ + 'jmustache' + ] + } + } + library('JNA', '4.5.2') { + group('net.java.dev.jna') { + modules = [ + 'jna', + 'jna-platform' + ] + } + } + library('Joda Time', '2.10.5') { + group('joda-time') { + modules = [ + 'joda-time' + ] + } + } + library('Johnzon', '1.2.2') { + group('org.apache.johnzon') { + modules = [ + 'johnzon-core', + 'johnzon-jaxrs', + 'johnzon-jsonb', + 'johnzon-jsonb-extras', + 'johnzon-jsonschema', + 'johnzon-mapper', + 'johnzon-websocket' + ] + plugins = [ + 'johnzon-maven-plugin' + ] + } + } + library('Jolokia', '1.6.2') { + group('org.jolokia') { + modules = [ + 'jolokia-core' + ] + } + } + library('jOOQ', '3.12.3') { + group('org.jooq') { + modules = [ + 'jooq', + 'jooq-meta', + 'jooq-codegen' + ] + plugins = [ + 'jooq-codegen-maven' + ] + } + } + library('Json Path', '2.4.0') { + group('com.jayway.jsonpath') { + modules = [ + 'json-path', + 'json-path-assert' + ] + } + } + library('JsonAssert', '1.5.0') { + group('org.skyscreamer') { + modules = [ + 'jsonassert' + ] + } + } + library('JSTL', '1.2') { + group('javax.servlet') { + modules = [ + 'jstl' + ] + } + } + library('JTDS', '1.3.1') { + group('net.sourceforge.jtds') { + modules = [ + 'jtds' + ] + } + } + library('JUnit', '4.12') { + group('junit') { + modules = [ + 'junit' + ] + } + } + library('JUnit Jupiter', '5.5.2') { + group('org.junit') { + imports = [ + 'junit-bom' + ] + } + } + library('Kafka', '2.3.1') { + group('org.apache.kafka') { + modules = [ + 'connect-api', + 'connect-basic-auth-extension', + 'connect-file', + 'connect-json', + 'connect-runtime', + 'connect-transforms', + 'kafka-clients', + 'kafka-log4j-appender', + 'kafka-streams', + 'kafka-streams-scala_2.11', + 'kafka-streams-scala_2.12', + 'kafka-streams-test-utils', + 'kafka-tools', + 'kafka_2.11', + 'kafka_2.12' + ] + } + } + library('Kotlin', "$kotlinVersion") { + group('org.jetbrains.kotlin') { + imports = [ + 'kotlin-bom' + ] + plugins = [ + 'kotlin-maven-plugin' + ] + } + } + library('Kotlin Coroutines', '1.3.2') { + group('org.jetbrains.kotlinx') { + imports = [ + 'kotlinx-coroutines-bom' + ] + } + } + library('Lettuce', '5.2.1.RELEASE') { + group('io.lettuce') { + modules = [ + 'lettuce-core' + ] + } + } + library('Liquibase', '3.8.2') { + group('org.liquibase') { + modules = [ + 'liquibase-core' { + exclude group: 'ch.qos.logback', module: 'logback-classic' + } + ] + } + } + library('Log4j2', '2.12.1') { + group('org.apache.logging.log4j') { + modules = [ + 'log4j-to-slf4j' + ] + imports = [ + 'log4j-bom' + ] + } + } + library('Logback', '1.2.3') { + group('ch.qos.logback') { + modules = [ + 'logback-access', + 'logback-classic', + 'logback-core' + ] + } + } + library('Lombok', '1.18.10') { + group('org.projectlombok') { + modules = [ + 'lombok' + ] + } + } + library('MariaDB', '2.5.2') { + group('org.mariadb.jdbc') { + modules = [ + 'mariadb-java-client' + ] + } + } + library('Maven AntRun Plugin', '1.8') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-antrun-plugin' + ] + } + } + library('Maven Assembly Plugin', '3.2.0') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-assembly-plugin' + ] + } + } + library('Maven Clean Plugin', '3.1.0') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-clean-plugin' + ] + } + } + library('Maven Compiler Plugin', '3.8.1') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-compiler-plugin' + ] + } + } + library('Maven Dependency Plugin', '3.1.1') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-dependency-plugin' + ] + } + } + library('Maven Deploy Plugin', '2.8.2') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-deploy-plugin' + ] + } + } + library('Maven Enforcer Plugin', '3.0.0-M3') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-enforcer-plugin' + ] + } + } + library('Maven Failsafe Plugin', '2.22.2') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-failsafe-plugin' + ] + } + } + library('Maven Help Plugin', '3.2.0') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-help-plugin' + ] + } + } + library('Maven Install Plugin', '2.5.2') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-install-plugin' + ] + } + } + library('Maven Invoker Plugin', '3.2.1') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-invoker-plugin' + ] + } + } + library('Maven Jar Plugin', '3.2.0') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-jar-plugin' + ] + } + } + library('Maven Javadoc Plugin', '3.1.1') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-javadoc-plugin' + ] + } + } + library('Maven Resources Plugin', '3.1.0') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-resources-plugin' + ] + } + } + library('Maven Shade Plugin', '3.2.1') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-shade-plugin' + ] + } + } + library('Maven Source Plugin', '3.2.0') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-source-plugin' + ] + } + } + library('Maven Surefire Plugin', '2.22.2') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-surefire-plugin' + ] + } + } + library('Maven War Plugin', '3.2.3') { + group('org.apache.maven.plugins') { + plugins = [ + 'maven-war-plugin' + ] + } + } + library('Micrometer', '1.3.1') { + group('io.micrometer') { + modules = [ + 'micrometer-registry-stackdriver' { + exclude group: 'javax.annotation', module: 'javax.annotation-api' + } + ] + imports = [ + 'micrometer-bom' + ] + } + } + library('MIMEPull', '1.9.12') { + group('org.jvnet.mimepull') { + modules = [ + 'mimepull' + ] + } + } + library('Mockito', '3.2.0') { + group('org.mockito') { + modules = [ + 'mockito-core', + 'mockito-inline', + 'mockito-junit-jupiter' + ] + } + } + library('Mongo Driver ReactiveStreams', '1.12.0') { + group('org.mongodb') { + modules = [ + 'mongodb-driver-reactivestreams' + ] + } + } + library('MongoDB', '3.11.2') { + group('org.mongodb') { + modules = [ + 'bson', + 'mongodb-driver', + 'mongodb-driver-async', + 'mongodb-driver-core', + 'mongo-java-driver' + ] + } + } + library('MSSQL JDBC', '7.4.1.jre8') { + group('com.microsoft.sqlserver') { + modules = [ + 'mssql-jdbc' + ] + } + } + library('MySQL', '8.0.18') { + group('mysql') { + modules = [ + 'mysql-connector-java' { + exclude group: 'com.google.protobuf', module: 'protobuf-java' + } + ] + } + } + library('NekoHTML', '1.9.22') { + group('net.sourceforge.nekohtml') { + modules = [ + 'nekohtml' + ] + } + } + library('Neo4j OGM', '3.2.3') { + group('org.neo4j') { + modules = [ + 'neo4j-ogm-api', + 'neo4j-ogm-bolt-driver', + 'neo4j-ogm-bolt-native-types', + 'neo4j-ogm-core', + 'neo4j-ogm-embedded-driver', + 'neo4j-ogm-embedded-native-types', + 'neo4j-ogm-http-driver' + ] + } + } + library('Netty', '4.1.43.Final') { + group('io.netty') { + imports = [ + 'netty-bom' + ] + } + } + library('Netty tcNative', '2.0.28.Final') { + group('io.netty') { + modules = [ + 'netty-tcnative-boringssl-static' + ] + } + } + library('NIO Multipart Parser', '1.1.0') { + group('org.synchronoss.cloud') { + modules = [ + 'nio-multipart-parser' + ] + } + } + library('OJDBC', '19.3.0.0') { + group('com.oracle.ojdbc') { + modules = [ + 'dms', + 'ojdbc10', + 'ojdbc10_g', + 'ojdbc10dms', + 'ojdbc10dms_g', + 'ojdbc8', + 'ojdbc8_g', + 'ojdbc8dms', + 'ojdbc8dms_g', + 'ons', + 'oraclepki', + 'orai18n', + 'osdt_cert', + 'osdt_core', + 'simplefan', + 'ucp', + 'xdb', + 'xmlparserv2' + ] + } + } + library('OkHttp3', '3.14.4') { + group('com.squareup.okhttp3') { + modules = [ + 'logging-interceptor', + 'mockwebserver', + 'okcurl', + 'okhttp', + 'okhttp-dnsoverhttps', + 'okhttp-sse', + 'okhttp-testing-support', + 'okhttp-tls', + 'okhttp-urlconnection' + ] + } + } + library('Pooled JMS', '1.1.0') { + group('org.messaginghub') { + modules = [ + 'pooled-jms' + ] + } + } + library('Postgresql', '42.2.8') { + group('org.postgresql') { + modules = [ + 'postgresql' + ] + } + } + library('Prometheus PushGateway', '0.8.0') { + group('io.prometheus') { + modules = [ + 'simpleclient_pushgateway' + ] + } + } + library('Quartz', '2.3.2') { + group('org.quartz-scheduler') { + modules = [ + 'quartz' { + exclude group: 'com.mchange', module: 'c3p0' + exclude group: 'com.zaxxer', module: '*' + }, + 'quartz-jobs' + ] + } + } + library('QueryDSL', '4.2.2') { + group('com.querydsl') { + modules = [ + 'querydsl-apt', + 'querydsl-collections', + 'querydsl-core', + 'querydsl-jpa', + 'querydsl-mongodb' { + exclude group: 'org.mongodb', module: 'mongo-java-driver' + } + ] + } + } + library('Rabbit AMQP Client', '5.7.3') { + group('com.rabbitmq') { + modules = [ + 'amqp-client' + ] + } + } + library('Reactive Streams', '1.0.3') { + group('org.reactivestreams') { + modules = [ + 'reactive-streams' + ] + } + } + library('Reactor Bom', 'Dysprosium-SR2') { + group('io.projectreactor') { + imports = [ + 'reactor-bom' + ] + } + } + library('REST Assured', '3.3.0') { + group('io.rest-assured') { + modules = [ + 'json-path', + 'json-schema-validator', + 'rest-assured', + 'scala-support', + 'spring-mock-mvc', + 'spring-web-test-client', + 'xml-path' + ] + } + } + library('RSocket', '1.0.0-RC5') { + group('io.rsocket') { + imports = [ + 'rsocket-bom' + ] + } + } + library('RxJava', '1.3.8') { + group('io.reactivex') { + modules = [ + 'rxjava' + ] + } + } + library('RxJava Adapter', '1.2.1') { + group('io.reactivex') { + modules = [ + 'rxjava-reactive-streams' + ] + } + } + library('RxJava2', '2.2.15') { + group('io.reactivex.rxjava2') { + modules = [ + 'rxjava' + ] + } + } + library('Spring Boot', '2.3.0.GRADLE-SNAPSHOT') { + group('org.springframework.boot') { + modules = [ + 'spring-boot', + 'spring-boot-test', + 'spring-boot-test-autoconfigure', + 'spring-boot-actuator', + 'spring-boot-actuator-autoconfigure', + 'spring-boot-autoconfigure', + 'spring-boot-autoconfigure-processor', + 'spring-boot-configuration-metadata', + 'spring-boot-configuration-processor', + 'spring-boot-devtools', + 'spring-boot-loader', + 'spring-boot-loader-tools', + 'spring-boot-properties-migrator', + 'spring-boot-starter', + 'spring-boot-starter-activemq', + 'spring-boot-starter-actuator', + 'spring-boot-starter-amqp', + 'spring-boot-starter-aop', + 'spring-boot-starter-artemis', + 'spring-boot-starter-batch', + 'spring-boot-starter-cache', + 'spring-boot-starter-cloud-connectors', + 'spring-boot-starter-data-cassandra', + 'spring-boot-starter-data-cassandra-reactive', + 'spring-boot-starter-data-couchbase', + 'spring-boot-starter-data-couchbase-reactive', + 'spring-boot-starter-data-elasticsearch', + 'spring-boot-starter-data-jdbc', + 'spring-boot-starter-data-jpa', + 'spring-boot-starter-data-ldap', + 'spring-boot-starter-data-mongodb', + 'spring-boot-starter-data-mongodb-reactive', + 'spring-boot-starter-data-redis', + 'spring-boot-starter-data-redis-reactive', + 'spring-boot-starter-data-neo4j', + 'spring-boot-starter-data-rest', + 'spring-boot-starter-data-solr', + 'spring-boot-starter-freemarker', + 'spring-boot-starter-groovy-templates', + 'spring-boot-starter-hateoas', + 'spring-boot-starter-integration', + 'spring-boot-starter-jdbc', + 'spring-boot-starter-jersey', + 'spring-boot-starter-jetty', + 'spring-boot-starter-jooq', + 'spring-boot-starter-json', + 'spring-boot-starter-jta-atomikos', + 'spring-boot-starter-jta-bitronix', + 'spring-boot-starter-log4j2', + 'spring-boot-starter-logging', + 'spring-boot-starter-mail', + 'spring-boot-starter-mustache', + 'spring-boot-starter-oauth2-client', + 'spring-boot-starter-oauth2-resource-server', + 'spring-boot-starter-quartz', + 'spring-boot-starter-reactor-netty', + 'spring-boot-starter-rsocket', + 'spring-boot-starter-security', + 'spring-boot-starter-test', + 'spring-boot-starter-thymeleaf', + 'spring-boot-starter-tomcat', + 'spring-boot-starter-undertow', + 'spring-boot-starter-validation', + 'spring-boot-starter-web', + 'spring-boot-starter-webflux', + 'spring-boot-starter-websocket', + 'spring-boot-starter-web-services' + ] + plugins = [ + 'spring-boot-maven-plugin' + ] + } + } + library('SAAJ Impl', '1.5.1') { + group('com.sun.xml.messaging.saaj') { + modules = [ + 'saaj-impl' + ] + } + } + library('Selenium', '3.141.59') { + group('org.seleniumhq.selenium') { + modules = [ + 'selenium-api', + 'selenium-chrome-driver', + 'selenium-edge-driver', + 'selenium-firefox-driver', + 'selenium-ie-driver', + 'selenium-java', + 'selenium-opera-driver', + 'selenium-remote-driver' { + exclude group: 'commons-logging', module: 'commons-logging' + }, + 'selenium-safari-driver', + 'selenium-support' { + exclude group: 'commons-logging', module: 'commons-logging' + } + ] + } + } + library('Selenium HtmlUnit', '2.36.0') { + group('org.seleniumhq.selenium') { + modules = [ + 'htmlunit-driver' + ] + } + } + library('SendGrid', '4.4.1') { + group('com.sendgrid') { + modules = [ + 'sendgrid-java' + ] + } + } + library('Servlet API', '4.0.1') { + group('javax.servlet') { + modules = [ + 'javax.servlet-api' + ] + } + } + library('SLF4J', '1.7.29') { + group('org.slf4j') { + modules = [ + 'jcl-over-slf4j', + 'jul-to-slf4j', + 'log4j-over-slf4j', + 'slf4j-api', + 'slf4j-ext', + 'slf4j-jcl', + 'slf4j-jdk14', + 'slf4j-log4j12', + 'slf4j-nop', + 'slf4j-simple' + ] + } + } + library('SnakeYAML', '1.25') { + group('org.yaml') { + modules = [ + 'snakeyaml' + ] + } + } + library('Solr', '8.2.0') { + group('org.apache.solr') { + modules = [ + 'solr-analysis-extras', + 'solr-analytics', + 'solr-cell', + 'solr-clustering', + 'solr-core', + 'solr-dataimporthandler', + 'solr-dataimporthandler-extras', + 'solr-langid', + 'solr-ltr', + 'solr-solrj' { + exclude group: 'org.slf4j', module: 'jcl-over-slf4j' + }, + 'solr-test-framework', + 'solr-velocity' + ] + } + } + library('Spring AMQP', '2.2.2.RELEASE') { + group('org.springframework.amqp') { + modules = [ + 'spring-amqp', + 'spring-rabbit', + 'spring-rabbit-junit', + 'spring-rabbit-test' + ] + } + } + library('Spring Batch', '4.2.1.RELEASE') { + group('org.springframework.batch') { + modules = [ + 'spring-batch-core', + 'spring-batch-infrastructure', + 'spring-batch-integration', + 'spring-batch-test' + ] + } + } + library('Spring Cloud Connectors', '2.0.7.RELEASE') { + group('org.springframework.cloud') { + modules = [ + 'spring-cloud-cloudfoundry-connector', + 'spring-cloud-connectors-core', + 'spring-cloud-heroku-connector', + 'spring-cloud-localconfig-connector', + 'spring-cloud-spring-service-connector' + ] + } + } + library('Spring Data Releasetrain', 'Moore-SR3') { + group('org.springframework.data') { + imports = [ + 'spring-data-releasetrain' + ] + } + } + library('Spring Framework', '5.2.3.BUILD-SNAPSHOT') { + group('org.springframework') { + imports = [ + 'spring-framework-bom' + ] + } + } + library('Spring HATEOAS', '1.0.2.RELEASE') { + group('org.springframework.hateoas') { + modules = [ + 'spring-hateoas' + ] + } + } + library('Spring Integration', '5.2.2.RELEASE') { + group('org.springframework.integration') { + modules = [ + 'spring-integration-http' { + exclude group: 'commons-logging', module: 'commons-logging' + exclude group: 'commons-logging', module: 'commons-logging-api' + } + ] + imports = [ + 'spring-integration-bom' + ] + } + } + library('Spring Kafka', '2.3.4.RELEASE') { + group('org.springframework.kafka') { + modules = [ + 'spring-kafka', + 'spring-kafka-test' + ] + } + } + library('Spring LDAP', '2.3.2.RELEASE') { + group('org.springframework.ldap') { + modules = [ + 'spring-ldap-core', + 'spring-ldap-core-tiger', + 'spring-ldap-ldif-batch', + 'spring-ldap-ldif-core', + 'spring-ldap-odm', + 'spring-ldap-test' + ] + } + } + library('Spring RESTDocs', '2.0.4.RELEASE') { + group('org.springframework.restdocs') { + modules = [ + 'spring-restdocs-asciidoctor', + 'spring-restdocs-core', + 'spring-restdocs-mockmvc', + 'spring-restdocs-restassured', + 'spring-restdocs-webtestclient' + ] + } + } + library('Spring Retry', '1.2.4.RELEASE') { + group('org.springframework.retry') { + modules = [ + 'spring-retry' + ] + } + } + library('Spring Security', '5.2.1.RELEASE') { + group('org.springframework.security') { + imports = [ + 'spring-security-bom' + ] + } + } + library('Spring Session Bom', 'Corn-RELEASE') { + group('org.springframework.session') { + imports = [ + 'spring-session-bom' + ] + } + } + library('Spring WS', '3.0.8.RELEASE') { + group('org.springframework.ws') { + modules = [ + 'spring-ws-core' { + exclude group: 'commons-logging', module: 'commons-logging' + }, + 'spring-ws-security' { + exclude group: 'commons-logging', module: 'commons-logging' + }, + 'spring-ws-support' { + exclude group: 'commons-logging', module: 'commons-logging' + }, + 'spring-ws-test' { + exclude group: 'commons-logging', module: 'commons-logging' + }, + 'spring-xml' + ] + } + } + library('SQLite JDBC', '3.28.0') { + group('org.xerial') { + modules = [ + 'sqlite-jdbc' + ] + } + } + library('Sun Mail', '1.6.4') { + group('com.sun.mail') { + modules = [ + 'jakarta.mail' + ] + } + } + library('Thymeleaf', '3.0.11.RELEASE') { + group('org.thymeleaf') { + modules = [ + 'thymeleaf', + 'thymeleaf-spring5' + ] + } + } + library('Thymeleaf Extras Data Attribute', '2.0.1') { + group('com.github.mxab.thymeleaf.extras') { + modules = [ + 'thymeleaf-extras-data-attribute' + ] + } + } + library('Thymeleaf Extras Java8Time', '3.0.4.RELEASE') { + group('org.thymeleaf.extras') { + modules = [ + 'thymeleaf-extras-java8time' + ] + } + } + library('Thymeleaf Extras SpringSecurity', '3.0.4.RELEASE') { + group('org.thymeleaf.extras') { + modules = [ + 'thymeleaf-extras-springsecurity5' + ] + } + } + library('Thymeleaf Layout Dialect', '2.4.1') { + group('nz.net.ultraq.thymeleaf') { + modules = [ + 'thymeleaf-layout-dialect' + ] + } + } + library('Tomcat', '9.0.30') { + group('org.apache.tomcat') { + modules = [ + 'tomcat-annotations-api', + 'tomcat-jdbc', + 'tomcat-jsp-api' + ] + } + group('org.apache.tomcat.embed') { + modules = [ + 'tomcat-embed-core', + 'tomcat-embed-el', + 'tomcat-embed-jasper', + 'tomcat-embed-websocket' + ] + } + } + library('UnboundID LDAPSDK', '4.0.13') { + group('com.unboundid') { + modules = [ + 'unboundid-ldapsdk' + ] + } + } + library('Undertow', '2.0.28.Final') { + group('io.undertow') { + modules = [ + 'undertow-core', + 'undertow-servlet', + 'undertow-websockets-jsr' + ] + } + } + library('Versions Maven Plugin', '2.7') { + group('org.codehaus.mojo') { + plugins = [ + 'versions-maven-plugin' + ] + } + } + library('WebJars HAL Browser', '3325375') { + group('org.webjars') { + modules = [ + 'hal-browser' + ] + } + } + library('WebJars Locator Core', '0.43') { + group('org.webjars') { + modules = [ + 'webjars-locator-core' + ] + } + } + library('WSDL4j', '1.6.3') { + group('wsdl4j') { + modules = [ + 'wsdl4j' + ] + } + } + library('XML Maven Plugin', '1.0.2') { + group('org.codehaus.mojo') { + plugins = [ + 'xml-maven-plugin' + ] + } + } + library('XmlUnit2', '2.6.3') { + group('org.xmlunit') { + modules = [ + 'xmlunit-assertj', + 'xmlunit-core', + 'xmlunit-legacy', + 'xmlunit-matchers', + 'xmlunit-placeholders' + ] + } + } +} diff --git a/spring-boot-project/spring-boot-dependencies/pom.xml b/spring-boot-project/spring-boot-dependencies/pom.xml deleted file mode 100644 index ce2763d9eb5d..000000000000 --- a/spring-boot-project/spring-boot-dependencies/pom.xml +++ /dev/null @@ -1,3531 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-build - ${revision} - ../.. - - spring-boot-dependencies - pom - Spring Boot Dependencies - Spring Boot Dependencies - https://projects.spring.io/spring-boot/# - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0 - - - - https://github.com/spring-projects/spring-boot - - - - Pivotal - info@pivotal.io - Pivotal Software, Inc. - https://www.spring.io - - - - ${basedir}/../.. - - 5.15.11 - 2.7.7 - 1.9.77 - 2.10.1 - 1.9.5 - 3.14.0 - 4.0.6 - 4.0.1 - 2.1.4 - 1.10.4 - 2.8.0 - 3.7.2 - 1.5.1 - 1.13 - 2.7.0 - 3.9 - 1.6 - 2.7.0 - 2.7.11 - 2.1.0 - 1.0.8.RELEASE - 11.5.0.0 - 10.14.2.0 - 4.1.1 - 2.10.6 - 3.8.1 - 2.2.0 - 6.1.3 - 2.3.29 - 6.8.5 - 3.0.3 - 2.3.2 - 2.5.8 - 2.8.6 - 1.4.200 - 2.2 - 3.12.4 - 1.3.2 - 5.4.9.Final - 6.1.0.Final - 3.4.1 - 2.5.0 - 2.36.0 - 4.1.4 - 4.5.10 - 4.4.12 - 9.4.16.Final - 2.16 - - 2.10.1 - ${jackson.version} - 1.2.1 - 1.3.5 - 2.0.3 - 1.1.6 - 1.0.2 - 1.6.4 - 2.2.3 - 4.0.3 - 2.3.5 - 1.2.7 - 1.3.3 - 2.0.1 - 1.1.2 - 2.1.6 - 2.3.2 - 2.3.2 - 3.1.0 - 1.2.0 - 1.3.2 - 1.1.1 - 2.3.1 - 2.3.1 - 2.0.1 - 1.1.4 - 1.0 - 1.6.2 - 1.0.3 - 2.2 - 1.3 - 2.0.1.Final - 1.1 - 1.2.0 - 3.0.8 - 3.4.1.Final - 7.6.0.Final - 2.0.6 - 3.1.0 - 2.29.1 - 6.3.1 - 9.4.24.v20191120 - 2.2.0.v201112011158 - 8.5.49 - 1.1.0 - 1.15 - 4.5.2 - 2.10.5 - 1.6.2 - - 1.2.2 - ${johnzon-jsonb.version} - 3.12.3 - 1.5.0 - 2.4.0 - 1.2 - 1.3.1 - 4.12 - 5.5.2 - 2.3.1 - 1.3.61 - 1.3.2 - 5.2.1.RELEASE - 3.8.2 - 2.12.1 - 1.2.3 - 1.18.10 - 2.5.2 - 1.3.1 - 1.9.12 - 3.2.0 - 1.12.0 - 3.11.2 - 7.4.1.jre8 - 8.0.18 - 1.9.22 - 3.2.3 - 4.1.43.Final - 2.0.28.Final - 1.1.0 - 19.3.0.0 - 3.14.4 - 1.1.0 - 42.2.8 - 0.8.0 - 2.3.2 - 4.2.2 - 5.7.3 - Dysprosium-SR2 - 3.3.0 - 1.0.3 - 1.0.0-RC5 - 1.3.8 - 1.2.1 - 2.2.15 - 3.141.59 - 2.36.0 - 4.4.1 - 4.0.1 - 1.7.29 - 1.25 - 8.2.0 - 2.2.2.RELEASE - 4.2.1.RELEASE - 2.0.7.RELEASE - Moore-SR3 - 5.2.3.BUILD-SNAPSHOT - 1.0.2.RELEASE - 5.2.2.RELEASE - 2.3.4.RELEASE - 2.3.2.RELEASE - 2.0.4.RELEASE - 1.2.4.RELEASE - 5.2.1.RELEASE - Corn-RELEASE - 3.0.8.RELEASE - 3.28.0 - ${jakarta-mail.version} - 1.5.1 - 3.0.11.RELEASE - 3.0.4.RELEASE - 2.4.1 - 2.0.1 - 3.0.4.RELEASE - 9.0.30 - 4.0.13 - 2.0.28.Final - 3325375 - 0.43 - 1.6.3 - 2.6.3 - - 3.0.0 - 1.6.0 - 3.0.1 - 1.8 - 3.2.0 - 3.1.0 - 3.8.1 - 3.1.1 - 2.8.2 - 3.0.0-M3 - 2.22.2 - 2.5.2 - 3.2.1 - 3.2.0 - 3.2.0 - 3.1.1 - 3.1.0 - 3.2.1 - 3.2.0 - 2.22.2 - 3.0.0 - 3.2.3 - 2.7 - 1.0.2 - 1.1.0 - - - - - - org.springframework.boot - spring-boot - ${revision} - - - org.springframework.boot - spring-boot-test - ${revision} - - - org.springframework.boot - spring-boot-test-autoconfigure - ${revision} - - - org.springframework.boot - spring-boot-actuator - ${revision} - - - org.springframework.boot - spring-boot-actuator-autoconfigure - ${revision} - - - org.springframework.boot - spring-boot-autoconfigure - ${revision} - - - org.springframework.boot - spring-boot-autoconfigure-processor - ${revision} - - - org.springframework.boot - spring-boot-configuration-metadata - ${revision} - - - org.springframework.boot - spring-boot-configuration-processor - ${revision} - - - org.springframework.boot - spring-boot-devtools - ${revision} - - - org.springframework.boot - spring-boot-loader - ${revision} - - - org.springframework.boot - spring-boot-loader-tools - ${revision} - - - org.springframework.boot - spring-boot-properties-migrator - ${revision} - - - org.springframework.boot - spring-boot-starter - ${revision} - - - org.springframework.boot - spring-boot-starter-activemq - ${revision} - - - org.springframework.boot - spring-boot-starter-actuator - ${revision} - - - org.springframework.boot - spring-boot-starter-amqp - ${revision} - - - org.springframework.boot - spring-boot-starter-aop - ${revision} - - - org.springframework.boot - spring-boot-starter-artemis - ${revision} - - - org.springframework.boot - spring-boot-starter-batch - ${revision} - - - org.springframework.boot - spring-boot-starter-cache - ${revision} - - - org.springframework.boot - spring-boot-starter-cloud-connectors - ${revision} - - - org.springframework.boot - spring-boot-starter-data-cassandra - ${revision} - - - org.springframework.boot - spring-boot-starter-data-cassandra-reactive - ${revision} - - - org.springframework.boot - spring-boot-starter-data-couchbase - ${revision} - - - org.springframework.boot - spring-boot-starter-data-couchbase-reactive - ${revision} - - - org.springframework.boot - spring-boot-starter-data-elasticsearch - ${revision} - - - org.springframework.boot - spring-boot-starter-data-jdbc - ${revision} - - - org.springframework.boot - spring-boot-starter-data-jpa - ${revision} - - - org.springframework.boot - spring-boot-starter-data-ldap - ${revision} - - - org.springframework.boot - spring-boot-starter-data-mongodb - ${revision} - - - org.springframework.boot - spring-boot-starter-data-mongodb-reactive - ${revision} - - - org.springframework.boot - spring-boot-starter-data-redis - ${revision} - - - org.springframework.boot - spring-boot-starter-data-redis-reactive - ${revision} - - - org.springframework.boot - spring-boot-starter-data-neo4j - ${revision} - - - org.springframework.boot - spring-boot-starter-data-rest - ${revision} - - - org.springframework.boot - spring-boot-starter-data-solr - ${revision} - - - org.springframework.boot - spring-boot-starter-freemarker - ${revision} - - - org.springframework.boot - spring-boot-starter-groovy-templates - ${revision} - - - org.springframework.boot - spring-boot-starter-hateoas - ${revision} - - - org.springframework.boot - spring-boot-starter-integration - ${revision} - - - org.springframework.boot - spring-boot-starter-jdbc - ${revision} - - - org.springframework.boot - spring-boot-starter-jersey - ${revision} - - - org.springframework.boot - spring-boot-starter-jetty - ${revision} - - - org.springframework.boot - spring-boot-starter-jooq - ${revision} - - - org.springframework.boot - spring-boot-starter-json - ${revision} - - - org.springframework.boot - spring-boot-starter-jta-atomikos - ${revision} - - - org.springframework.boot - spring-boot-starter-jta-bitronix - ${revision} - - - org.springframework.boot - spring-boot-starter-log4j2 - ${revision} - - - org.springframework.boot - spring-boot-starter-logging - ${revision} - - - org.springframework.boot - spring-boot-starter-mail - ${revision} - - - org.springframework.boot - spring-boot-starter-mustache - ${revision} - - - org.springframework.boot - spring-boot-starter-oauth2-client - ${revision} - - - org.springframework.boot - spring-boot-starter-oauth2-resource-server - ${revision} - - - org.springframework.boot - spring-boot-starter-quartz - ${revision} - - - org.springframework.boot - spring-boot-starter-reactor-netty - ${revision} - - - org.springframework.boot - spring-boot-starter-rsocket - ${revision} - - - org.springframework.boot - spring-boot-starter-security - ${revision} - - - org.springframework.boot - spring-boot-starter-test - ${revision} - - - org.springframework.boot - spring-boot-starter-thymeleaf - ${revision} - - - org.springframework.boot - spring-boot-starter-tomcat - ${revision} - - - org.springframework.boot - spring-boot-starter-undertow - ${revision} - - - org.springframework.boot - spring-boot-starter-validation - ${revision} - - - org.springframework.boot - spring-boot-starter-web - ${revision} - - - org.springframework.boot - spring-boot-starter-webflux - ${revision} - - - org.springframework.boot - spring-boot-starter-websocket - ${revision} - - - org.springframework.boot - spring-boot-starter-web-services - ${revision} - - - - antlr - antlr - ${antlr2.version} - - - ch.qos.logback - logback-access - ${logback.version} - - - ch.qos.logback - logback-classic - ${logback.version} - - - ch.qos.logback - logback-core - ${logback.version} - - - com.atomikos - transactions-jdbc - ${atomikos.version} - - - com.atomikos - transactions-jms - ${atomikos.version} - - - com.atomikos - transactions-jta - ${atomikos.version} - - - com.couchbase.client - java-client - ${couchbase-client.version} - - - com.couchbase.client - couchbase-spring-cache - ${couchbase-cache-client.version} - - - com.datastax.cassandra - cassandra-driver-core - ${cassandra-driver.version} - - - com.datastax.cassandra - cassandra-driver-mapping - ${cassandra-driver.version} - - - com.fasterxml - classmate - ${classmate.version} - - - com.fasterxml.jackson - jackson-bom - ${jackson-bom.version} - import - pom - - - com.github.ben-manes.caffeine - caffeine - ${caffeine.version} - - - com.github.ben-manes.caffeine - guava - ${caffeine.version} - - - com.github.ben-manes.caffeine - jcache - ${caffeine.version} - - - com.github.ben-manes.caffeine - simulator - ${caffeine.version} - - - com.github.mxab.thymeleaf.extras - thymeleaf-extras-data-attribute - ${thymeleaf-extras-data-attribute.version} - - - com.google.appengine - appengine-api-1.0-sdk - ${appengine-sdk.version} - - - com.google.code.gson - gson - ${gson.version} - - - com.h2database - h2 - ${h2.version} - - - com.hazelcast - hazelcast - ${hazelcast.version} - - - com.hazelcast - hazelcast-client - ${hazelcast.version} - - - com.hazelcast - hazelcast-hibernate52 - ${hazelcast-hibernate5.version} - - - com.hazelcast - hazelcast-hibernate53 - ${hazelcast-hibernate5.version} - - - com.hazelcast - hazelcast-spring - ${hazelcast.version} - - - com.ibm.db2 - jcc - ${db2-jdbc.version} - - - com.jayway.jsonpath - json-path - ${json-path.version} - - - com.jayway.jsonpath - json-path-assert - ${json-path.version} - - - com.microsoft.sqlserver - mssql-jdbc - ${mssql-jdbc.version} - - - com.oracle.ojdbc - dms - ${ojdbc.version} - - - com.oracle.ojdbc - ojdbc10 - ${ojdbc.version} - - - com.oracle.ojdbc - ojdbc10_g - ${ojdbc.version} - - - com.oracle.ojdbc - ojdbc10dms - ${ojdbc.version} - - - com.oracle.ojdbc - ojdbc10dms_g - ${ojdbc.version} - - - com.oracle.ojdbc - ojdbc8 - ${ojdbc.version} - - - com.oracle.ojdbc - ojdbc8_g - ${ojdbc.version} - - - com.oracle.ojdbc - ojdbc8dms - ${ojdbc.version} - - - com.oracle.ojdbc - ojdbc8dms_g - ${ojdbc.version} - - - com.oracle.ojdbc - ons - ${ojdbc.version} - - - com.oracle.ojdbc - oraclepki - ${ojdbc.version} - - - com.oracle.ojdbc - orai18n - ${ojdbc.version} - - - com.oracle.ojdbc - osdt_cert - ${ojdbc.version} - - - com.oracle.ojdbc - osdt_core - ${ojdbc.version} - - - com.oracle.ojdbc - simplefan - ${ojdbc.version} - - - com.oracle.ojdbc - ucp - ${ojdbc.version} - - - com.oracle.ojdbc - xdb - ${ojdbc.version} - - - com.oracle.ojdbc - xmlparserv2 - ${ojdbc.version} - - - com.querydsl - querydsl-apt - ${querydsl.version} - - - com.querydsl - querydsl-collections - ${querydsl.version} - - - com.querydsl - querydsl-core - ${querydsl.version} - - - com.querydsl - querydsl-jpa - ${querydsl.version} - - - com.querydsl - querydsl-mongodb - ${querydsl.version} - - - org.mongodb - mongo-java-driver - - - - - com.rabbitmq - amqp-client - ${rabbit-amqp-client.version} - - - com.samskivert - jmustache - ${jmustache.version} - - - com.sendgrid - sendgrid-java - ${sendgrid.version} - - - com.squareup.okhttp3 - logging-interceptor - ${okhttp3.version} - - - com.squareup.okhttp3 - mockwebserver - ${okhttp3.version} - - - com.squareup.okhttp3 - okcurl - ${okhttp3.version} - - - com.squareup.okhttp3 - okhttp - ${okhttp3.version} - - - com.squareup.okhttp3 - okhttp-dnsoverhttps - ${okhttp3.version} - - - com.squareup.okhttp3 - okhttp-sse - ${okhttp3.version} - - - com.squareup.okhttp3 - okhttp-testing-support - ${okhttp3.version} - - - com.squareup.okhttp3 - okhttp-tls - ${okhttp3.version} - - - com.squareup.okhttp3 - okhttp-urlconnection - ${okhttp3.version} - - - com.sun.activation - jakarta.activation - ${jakarta-activation.version} - - - com.sun.mail - jakarta.mail - ${sun-mail.version} - - - com.sun.xml.messaging.saaj - saaj-impl - ${saaj-impl.version} - - - com.unboundid - unboundid-ldapsdk - ${unboundid-ldapsdk.version} - - - com.zaxxer - HikariCP - ${hikaricp.version} - - - commons-codec - commons-codec - ${commons-codec.version} - - - commons-pool - commons-pool - ${commons-pool.version} - - - de.flapdoodle.embed - de.flapdoodle.embed.mongo - ${embedded-mongo.version} - - - io.dropwizard.metrics - metrics-annotation - ${dropwizard-metrics.version} - - - io.dropwizard.metrics - metrics-core - ${dropwizard-metrics.version} - - - io.dropwizard.metrics - metrics-ehcache - ${dropwizard-metrics.version} - - - io.dropwizard.metrics - metrics-graphite - ${dropwizard-metrics.version} - - - io.dropwizard.metrics - metrics-healthchecks - ${dropwizard-metrics.version} - - - io.dropwizard.metrics - metrics-httpasyncclient - ${dropwizard-metrics.version} - - - io.dropwizard.metrics - metrics-jdbi - ${dropwizard-metrics.version} - - - io.dropwizard.metrics - metrics-jersey2 - ${dropwizard-metrics.version} - - - io.dropwizard.metrics - metrics-jetty9 - ${dropwizard-metrics.version} - - - io.dropwizard.metrics - metrics-jmx - ${dropwizard-metrics.version} - - - io.dropwizard.metrics - metrics-json - ${dropwizard-metrics.version} - - - io.dropwizard.metrics - metrics-jvm - ${dropwizard-metrics.version} - - - io.dropwizard.metrics - metrics-log4j2 - ${dropwizard-metrics.version} - - - io.dropwizard.metrics - metrics-logback - ${dropwizard-metrics.version} - - - io.dropwizard.metrics - metrics-servlet - ${dropwizard-metrics.version} - - - io.dropwizard.metrics - metrics-servlets - ${dropwizard-metrics.version} - - - io.lettuce - lettuce-core - ${lettuce.version} - - - io.micrometer - micrometer-registry-stackdriver - ${micrometer.version} - - - javax.annotation - javax.annotation-api - - - - - io.micrometer - micrometer-bom - ${micrometer.version} - pom - import - - - io.netty - netty-bom - ${netty.version} - import - pom - - - io.netty - netty-tcnative-boringssl-static - ${netty-tcnative.version} - - - io.projectreactor - reactor-bom - ${reactor-bom.version} - import - pom - - - io.prometheus - simpleclient_pushgateway - ${prometheus-pushgateway.version} - - - io.reactivex - rxjava - ${rxjava.version} - - - io.reactivex - rxjava-reactive-streams - ${rxjava-adapter.version} - - - io.reactivex.rxjava2 - rxjava - ${rxjava2.version} - - - io.rest-assured - json-path - ${rest-assured.version} - - - io.rest-assured - json-schema-validator - ${rest-assured.version} - - - io.rest-assured - rest-assured - ${rest-assured.version} - - - io.rest-assured - scala-support - ${rest-assured.version} - - - io.rest-assured - spring-mock-mvc - ${rest-assured.version} - - - io.rest-assured - spring-web-test-client - ${rest-assured.version} - - - io.rest-assured - xml-path - ${rest-assured.version} - - - io.rsocket - rsocket-bom - ${rsocket.version} - pom - import - - - io.searchbox - jest - ${jest.version} - - - io.spring.gradle - dependency-management-plugin - ${dependency-management-plugin.version} - - - io.undertow - undertow-core - ${undertow.version} - - - io.undertow - undertow-servlet - ${undertow.version} - - - io.undertow - undertow-websockets-jsr - ${undertow.version} - - - jakarta.activation - jakarta.activation-api - ${jakarta-activation.version} - - - jakarta.annotation - jakarta.annotation-api - ${jakarta-annotation.version} - - - jakarta.jms - jakarta.jms-api - ${jakarta-jms.version} - - - jakarta.json - jakarta.json-api - ${jakarta-json.version} - - - jakarta.json.bind - jakarta.json.bind-api - ${jakarta-json-bind.version} - - - jakarta.mail - jakarta.mail-api - ${jakarta-mail.version} - - - jakarta.persistence - jakarta.persistence-api - ${jakarta-persistence.version} - - - jakarta.servlet - jakarta.servlet-api - ${jakarta-servlet.version} - - - jakarta.servlet.jsp.jstl - jakarta.servlet.jsp.jstl-api - ${jakarta-servlet-jsp-jstl.version} - - - jakarta.transaction - jakarta.transaction-api - ${jakarta-transaction.version} - - - jakarta.validation - jakarta.validation-api - ${jakarta-validation.version} - - - jakarta.websocket - jakarta.websocket-api - ${jakarta-websocket.version} - - - jakarta.ws.rs - jakarta.ws.rs-api - ${jakarta-ws-rs.version} - - - jakarta.xml.bind - jakarta.xml.bind-api - ${jakarta-xml-bind.version} - - - jakarta.xml.ws - jakarta.xml.ws-api - ${jakarta-xml-ws.version} - - - javax.activation - javax.activation-api - ${javax-activation.version} - - - javax.annotation - javax.annotation-api - ${javax-annotation.version} - - - javax.cache - cache-api - ${javax-cache.version} - - - javax.jms - javax.jms-api - ${javax-jms.version} - - - javax.json - javax.json-api - ${javax-json.version} - - - javax.json.bind - javax.json.bind-api - ${javax-jsonb.version} - - - javax.mail - javax.mail-api - ${javax-mail.version} - - - javax.money - money-api - ${javax-money.version} - - - javax.persistence - javax.persistence-api - ${javax-persistence.version} - - - javax.servlet - javax.servlet-api - ${servlet-api.version} - - - javax.servlet - jstl - ${jstl.version} - - - javax.transaction - javax.transaction-api - ${javax-transaction.version} - - - javax.validation - validation-api - ${javax-validation.version} - - - javax.websocket - javax.websocket-api - ${javax-websocket.version} - - - javax.xml.bind - jaxb-api - ${javax-jaxb.version} - - - javax.xml.ws - jaxws-api - ${javax-jaxws.version} - - - jaxen - jaxen - ${jaxen.version} - - - joda-time - joda-time - ${joda-time.version} - - - junit - junit - ${junit.version} - - - mysql - mysql-connector-java - ${mysql.version} - - - com.google.protobuf - protobuf-java - - - - - net.bytebuddy - byte-buddy - ${byte-buddy.version} - - - net.bytebuddy - byte-buddy-agent - ${byte-buddy.version} - - - net.java.dev.jna - jna - ${jna.version} - - - net.java.dev.jna - jna-platform - ${jna.version} - - - net.sf.ehcache - ehcache - ${ehcache.version} - - - net.sourceforge.htmlunit - htmlunit - ${htmlunit.version} - - - commons-logging - commons-logging - - - - - net.sourceforge.jtds - jtds - ${jtds.version} - - - net.sourceforge.nekohtml - nekohtml - ${nekohtml.version} - - - nz.net.ultraq.thymeleaf - thymeleaf-layout-dialect - ${thymeleaf-layout-dialect.version} - - - org.apache.activemq - activemq-amqp - ${activemq.version} - - - org.apache.activemq - activemq-blueprint - ${activemq.version} - - - org.apache.activemq - activemq-broker - ${activemq.version} - - - org.apache.activemq - activemq-camel - ${activemq.version} - - - org.apache.activemq - activemq-client - ${activemq.version} - - - org.apache.activemq - activemq-console - ${activemq.version} - - - commons-logging - commons-logging - - - - - org.apache.activemq - activemq-http - ${activemq.version} - - - org.apache.activemq - activemq-jaas - ${activemq.version} - - - org.apache.activemq - activemq-jdbc-store - ${activemq.version} - - - org.apache.activemq - activemq-jms-pool - ${activemq.version} - - - org.apache.activemq - activemq-kahadb-store - ${activemq.version} - - - org.apache.activemq - activemq-karaf - ${activemq.version} - - - org.apache.activemq - activemq-leveldb-store - ${activemq.version} - - - commons-logging - commons-logging - - - - - org.apache.activemq - activemq-log4j-appender - ${activemq.version} - - - org.apache.activemq - activemq-mqtt - ${activemq.version} - - - org.apache.activemq - activemq-openwire-generator - ${activemq.version} - - - org.apache.activemq - activemq-openwire-legacy - ${activemq.version} - - - org.apache.activemq - activemq-osgi - ${activemq.version} - - - org.apache.activemq - activemq-partition - ${activemq.version} - - - org.apache.activemq - activemq-pool - ${activemq.version} - - - org.apache.activemq - activemq-ra - ${activemq.version} - - - org.apache.activemq - activemq-run - ${activemq.version} - - - org.apache.activemq - activemq-runtime-config - ${activemq.version} - - - org.apache.activemq - activemq-shiro - ${activemq.version} - - - org.apache.activemq - activemq-spring - ${activemq.version} - - - commons-logging - commons-logging - - - - - org.apache.activemq - activemq-stomp - ${activemq.version} - - - org.apache.activemq - activemq-web - ${activemq.version} - - - org.apache.activemq - artemis-amqp-protocol - ${artemis.version} - - - org.apache.activemq - artemis-commons - ${artemis.version} - - - commons-logging - commons-logging - - - - - org.apache.activemq - artemis-core-client - ${artemis.version} - - - org.apache.geronimo.specs - geronimo-json_1.0_spec - - - - - org.apache.activemq - artemis-jms-client - ${artemis.version} - - - org.apache.geronimo.specs - geronimo-json_1.0_spec - - - - - org.apache.activemq - artemis-jms-server - ${artemis.version} - - - org.apache.geronimo.specs - geronimo-json_1.0_spec - - - - - org.apache.activemq - artemis-journal - ${artemis.version} - - - org.apache.activemq - artemis-selector - ${artemis.version} - - - org.apache.activemq - artemis-server - ${artemis.version} - - - commons-logging - commons-logging - - - org.apache.geronimo.specs - geronimo-json_1.0_spec - - - - - org.apache.activemq - artemis-service-extensions - ${artemis.version} - - - org.apache.commons - commons-dbcp2 - ${commons-dbcp2.version} - - - commons-logging - commons-logging - - - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - org.apache.commons - commons-pool2 - ${commons-pool2.version} - - - org.apache.derby - derby - ${derby.version} - - - org.apache.httpcomponents - httpasyncclient - ${httpasyncclient.version} - - - commons-logging - commons-logging - - - - - org.apache.httpcomponents - fluent-hc - ${httpclient.version} - - - org.apache.httpcomponents - httpclient - ${httpclient.version} - - - commons-logging - commons-logging - - - - - org.apache.httpcomponents - httpclient-cache - ${httpclient.version} - - - org.apache.httpcomponents - httpclient-osgi - ${httpclient.version} - - - org.apache.httpcomponents - httpclient-win - ${httpclient.version} - - - org.apache.httpcomponents - httpcore - ${httpcore.version} - - - org.apache.httpcomponents - httpcore-nio - ${httpcore.version} - - - org.apache.httpcomponents - httpmime - ${httpclient.version} - - - org.apache.johnzon - johnzon-core - ${johnzon.version} - - - org.apache.johnzon - johnzon-jaxrs - ${johnzon.version} - - - org.apache.johnzon - johnzon-jsonb - ${johnzon.version} - - - org.apache.johnzon - johnzon-jsonb-extras - ${johnzon.version} - - - org.apache.johnzon - johnzon-jsonschema - ${johnzon.version} - - - org.apache.johnzon - johnzon-mapper - ${johnzon.version} - - - org.apache.johnzon - johnzon-websocket - ${johnzon.version} - - - org.apache.kafka - connect-api - ${kafka.version} - - - org.apache.kafka - connect-basic-auth-extension - ${kafka.version} - - - org.apache.kafka - connect-file - ${kafka.version} - - - org.apache.kafka - connect-json - ${kafka.version} - - - org.apache.kafka - connect-runtime - ${kafka.version} - - - org.apache.kafka - connect-transforms - ${kafka.version} - - - org.apache.kafka - kafka-clients - ${kafka.version} - - - org.apache.kafka - kafka-log4j-appender - ${kafka.version} - - - org.apache.kafka - kafka-streams - ${kafka.version} - - - org.apache.kafka - kafka-streams-scala_2.11 - ${kafka.version} - - - org.apache.kafka - kafka-streams-scala_2.12 - ${kafka.version} - - - org.apache.kafka - kafka-streams-test-utils - ${kafka.version} - - - org.apache.kafka - kafka-tools - ${kafka.version} - - - org.apache.kafka - kafka_2.11 - ${kafka.version} - - - org.apache.kafka - kafka_2.12 - ${kafka.version} - - - org.apache.logging.log4j - log4j-bom - ${log4j2.version} - pom - import - - - org.apache.logging.log4j - log4j-to-slf4j - ${log4j2.version} - - - org.apache.solr - solr-analysis-extras - ${solr.version} - - - org.apache.solr - solr-analytics - ${solr.version} - - - org.apache.solr - solr-cell - ${solr.version} - - - org.apache.solr - solr-clustering - ${solr.version} - - - org.apache.solr - solr-core - ${solr.version} - - - org.apache.solr - solr-dataimporthandler - ${solr.version} - - - org.apache.solr - solr-dataimporthandler-extras - ${solr.version} - - - org.apache.solr - solr-langid - ${solr.version} - - - org.apache.solr - solr-ltr - ${solr.version} - - - org.apache.solr - solr-solrj - ${solr.version} - - - org.slf4j - jcl-over-slf4j - - - - - org.apache.solr - solr-test-framework - ${solr.version} - - - org.apache.solr - solr-velocity - ${solr.version} - - - org.apache.tomcat - tomcat-annotations-api - ${tomcat.version} - - - org.apache.tomcat - tomcat-jdbc - ${tomcat.version} - - - org.apache.tomcat - tomcat-jsp-api - ${tomcat.version} - - - org.apache.tomcat.embed - tomcat-embed-core - ${tomcat.version} - - - org.apache.tomcat.embed - tomcat-embed-el - ${tomcat.version} - - - org.apache.tomcat.embed - tomcat-embed-jasper - ${tomcat.version} - - - org.apache.tomcat.embed - tomcat-embed-websocket - ${tomcat.version} - - - org.aspectj - aspectjrt - ${aspectj.version} - - - org.aspectj - aspectjtools - ${aspectj.version} - - - org.aspectj - aspectjweaver - ${aspectj.version} - - - org.assertj - assertj-core - ${assertj.version} - - - org.awaitility - awaitility - ${awaitility.version} - - - org.awaitility - awaitility-groovy - ${awaitility.version} - - - org.awaitility - awaitility-kotlin - ${awaitility.version} - - - org.awaitility - awaitility-scala - ${awaitility.version} - - - org.codehaus.btm - btm - ${bitronix.version} - - - org.codehaus.groovy - groovy - ${groovy.version} - - - org.codehaus.groovy - groovy-ant - ${groovy.version} - - - org.codehaus.groovy - groovy-backports-compat23 - ${groovy.version} - - - org.codehaus.groovy - groovy-bsf - ${groovy.version} - - - org.codehaus.groovy - groovy-cli-commons - ${groovy.version} - - - org.codehaus.groovy - groovy-cli-picocli - ${groovy.version} - - - org.codehaus.groovy - groovy-console - ${groovy.version} - - - org.codehaus.groovy - groovy-datetime - ${groovy.version} - - - org.codehaus.groovy - groovy-dateutil - ${groovy.version} - - - org.codehaus.groovy - groovy-docgenerator - ${groovy.version} - - - org.codehaus.groovy - groovy-groovydoc - ${groovy.version} - - - org.codehaus.groovy - groovy-groovysh - ${groovy.version} - - - org.codehaus.groovy - groovy-jaxb - ${groovy.version} - - - org.codehaus.groovy - groovy-jmx - ${groovy.version} - - - org.codehaus.groovy - groovy-json - ${groovy.version} - - - org.codehaus.groovy - groovy-json-direct - ${groovy.version} - - - org.codehaus.groovy - groovy-jsr223 - ${groovy.version} - - - org.codehaus.groovy - groovy-macro - ${groovy.version} - - - org.codehaus.groovy - groovy-nio - ${groovy.version} - - - org.codehaus.groovy - groovy-servlet - ${groovy.version} - - - org.codehaus.groovy - groovy-sql - ${groovy.version} - - - org.codehaus.groovy - groovy-swing - ${groovy.version} - - - org.codehaus.groovy - groovy-templates - ${groovy.version} - - - org.codehaus.groovy - groovy-test - ${groovy.version} - - - org.codehaus.groovy - groovy-test-junit5 - ${groovy.version} - - - org.codehaus.groovy - groovy-testng - ${groovy.version} - - - org.codehaus.groovy - groovy-xml - ${groovy.version} - - - org.codehaus.janino - commons-compiler - ${janino.version} - - - org.codehaus.janino - commons-compiler-jdk - ${janino.version} - - - org.codehaus.janino - janino - ${janino.version} - - - org.eclipse.jetty - jetty-bom - ${jetty.version} - import - pom - - - org.eclipse.jetty - jetty-reactive-httpclient - ${jetty-reactive-httpclient.version} - - - org.eclipse.jetty.orbit - javax.servlet.jsp - ${jetty-jsp.version} - - - org.ehcache - ehcache - ${ehcache3.version} - - - org.ehcache - ehcache-clustered - ${ehcache3.version} - - - org.ehcache - ehcache-transactions - ${ehcache3.version} - - - org.elasticsearch - elasticsearch - ${elasticsearch.version} - - - org.elasticsearch.client - transport - ${elasticsearch.version} - - - org.elasticsearch.distribution.integ-test-zip - elasticsearch - ${elasticsearch.version} - zip - - - org.elasticsearch.plugin - transport-netty4-client - ${elasticsearch.version} - - - org.elasticsearch.client - elasticsearch-rest-client - ${elasticsearch.version} - - - commons-logging - commons-logging - - - - - org.elasticsearch.client - elasticsearch-rest-high-level-client - ${elasticsearch.version} - - - org.firebirdsql.jdbc - jaybird-jdk17 - ${jaybird.version} - - - org.firebirdsql.jdbc - jaybird-jdk18 - ${jaybird.version} - - - org.flywaydb - flyway-core - ${flyway.version} - - - org.freemarker - freemarker - ${freemarker.version} - - - org.glassfish - jakarta.el - ${glassfish-el.version} - - - org.glassfish.jaxb - codemodel - ${glassfish-jaxb.version} - - - org.glassfish.jaxb - codemodel-annotation-compiler - ${glassfish-jaxb.version} - - - org.glassfish.jaxb - jaxb-jxc - ${glassfish-jaxb.version} - - - org.glassfish.jaxb - jaxb-runtime - ${glassfish-jaxb.version} - - - org.glassfish.jaxb - jaxb-xjc - ${glassfish-jaxb.version} - - - org.glassfish.jaxb - txw2 - ${glassfish-jaxb.version} - - - org.glassfish.jaxb - txwc2 - ${glassfish-jaxb.version} - - - org.glassfish.jaxb - xsom - ${glassfish-jaxb.version} - - - org.glassfish.jersey - jersey-bom - ${jersey.version} - import - pom - - - org.hamcrest - hamcrest - ${hamcrest.version} - - - org.hamcrest - hamcrest-core - ${hamcrest.version} - - - org.hamcrest - hamcrest-library - ${hamcrest.version} - - - org.hibernate - hibernate-c3p0 - ${hibernate.version} - - - org.hibernate - hibernate-core - ${hibernate.version} - - - org.hibernate - hibernate-ehcache - ${hibernate.version} - - - org.hibernate - hibernate-entitymanager - ${hibernate.version} - - - org.hibernate - hibernate-envers - ${hibernate.version} - - - org.hibernate - hibernate-hikaricp - ${hibernate.version} - - - org.hibernate - hibernate-java8 - ${hibernate.version} - - - org.hibernate - hibernate-jcache - ${hibernate.version} - - - org.hibernate - hibernate-jpamodelgen - ${hibernate.version} - - - org.hibernate - hibernate-proxool - ${hibernate.version} - - - org.hibernate - hibernate-spatial - ${hibernate.version} - - - org.hibernate - hibernate-testing - ${hibernate.version} - - - org.hibernate - hibernate-vibur - ${hibernate.version} - - - org.hibernate.validator - hibernate-validator - ${hibernate-validator.version} - - - org.hibernate.validator - hibernate-validator-annotation-processor - ${hibernate-validator.version} - - - org.hsqldb - hsqldb - ${hsqldb.version} - - - org.infinispan - infinispan-cachestore-jdbc - ${infinispan.version} - - - org.infinispan - infinispan-cachestore-jpa - ${infinispan.version} - - - org.infinispan - infinispan-cachestore-leveldb - ${infinispan.version} - - - org.infinispan - infinispan-cachestore-remote - ${infinispan.version} - - - org.infinispan - infinispan-cachestore-rest - ${infinispan.version} - - - org.infinispan - infinispan-cachestore-rocksdb - ${infinispan.version} - - - org.infinispan - infinispan-cdi-common - ${infinispan.version} - - - org.infinispan - infinispan-cdi-embedded - ${infinispan.version} - - - org.infinispan - infinispan-cdi-remote - ${infinispan.version} - - - org.infinispan - infinispan-client-hotrod - ${infinispan.version} - - - org.infinispan - infinispan-cloud - ${infinispan.version} - - - org.infinispan - infinispan-clustered-counter - ${infinispan.version} - - - org.infinispan - infinispan-clustered-lock - ${infinispan.version} - - - org.infinispan - infinispan-commons - ${infinispan.version} - - - org.infinispan - infinispan-core - ${infinispan.version} - - - org.infinispan - infinispan-directory-provider - ${infinispan.version} - - - org.infinispan - infinispan-hibernate-cache-v53 - ${infinispan.version} - - - org.infinispan - infinispan-jcache - ${infinispan.version} - - - org.infinispan - infinispan-jcache-commons - ${infinispan.version} - - - org.infinispan - infinispan-jcache-remote - ${infinispan.version} - - - org.infinispan - infinispan-lucene-directory - ${infinispan.version} - - - org.infinispan - infinispan-objectfilter - ${infinispan.version} - - - org.infinispan - infinispan-osgi - ${infinispan.version} - - - org.infinispan - infinispan-persistence-cli - ${infinispan.version} - - - org.infinispan - infinispan-persistence-soft-index - ${infinispan.version} - - - org.infinispan - infinispan-query - ${infinispan.version} - - - org.infinispan - infinispan-query-dsl - ${infinispan.version} - - - org.infinispan - infinispan-remote-query-client - ${infinispan.version} - - - org.infinispan - infinispan-remote-query-server - ${infinispan.version} - - - org.infinispan - infinispan-scripting - ${infinispan.version} - - - org.infinispan - infinispan-server-core - ${infinispan.version} - - - org.infinispan - infinispan-server-hotrod - ${infinispan.version} - - - org.infinispan - infinispan-server-memcached - ${infinispan.version} - - - org.infinispan - infinispan-server-router - ${infinispan.version} - - - org.infinispan - infinispan-spring4-common - ${infinispan.version} - - - org.infinispan - infinispan-spring4-embedded - ${infinispan.version} - - - org.infinispan - infinispan-spring4-remote - ${infinispan.version} - - - org.infinispan - infinispan-spring5-common - ${infinispan.version} - - - org.infinispan - infinispan-spring5-embedded - ${infinispan.version} - - - org.infinispan - infinispan-spring5-remote - ${infinispan.version} - - - org.infinispan - infinispan-tasks - ${infinispan.version} - - - org.infinispan - infinispan-tasks-api - ${infinispan.version} - - - org.infinispan - infinispan-tools - ${infinispan.version} - - - org.infinispan - infinispan-tree - ${infinispan.version} - - - org.influxdb - influxdb-java - ${influxdb-java.version} - - - org.jboss - jboss-transaction-spi - ${jboss-transaction-spi.version} - - - org.jboss.logging - jboss-logging - ${jboss-logging.version} - - - org.jdom - jdom2 - ${jdom2.version} - - - org.jetbrains.kotlin - kotlin-bom - ${kotlin.version} - import - pom - - - org.jetbrains.kotlinx - kotlinx-coroutines-bom - ${kotlin-coroutines.version} - import - pom - - - org.jolokia - jolokia-core - ${jolokia.version} - - - org.jooq - jooq - ${jooq.version} - - - org.jooq - jooq-meta - ${jooq.version} - - - org.jooq - jooq-codegen - ${jooq.version} - - - org.junit - junit-bom - ${junit-jupiter.version} - import - pom - - - org.jvnet.mimepull - mimepull - ${mimepull.version} - - - org.liquibase - liquibase-core - ${liquibase.version} - - - ch.qos.logback - logback-classic - - - - - org.mariadb.jdbc - mariadb-java-client - ${mariadb.version} - - - org.messaginghub - pooled-jms - ${pooled-jms.version} - - - org.mockito - mockito-core - ${mockito.version} - - - org.mockito - mockito-inline - ${mockito.version} - - - org.mockito - mockito-junit-jupiter - ${mockito.version} - - - org.mongodb - bson - ${mongodb.version} - - - org.mongodb - mongodb-driver - ${mongodb.version} - - - org.mongodb - mongodb-driver-async - ${mongodb.version} - - - org.mongodb - mongodb-driver-core - ${mongodb.version} - - - org.mongodb - mongodb-driver-reactivestreams - ${mongo-driver-reactivestreams.version} - - - org.mongodb - mongo-java-driver - ${mongodb.version} - - - org.mortbay.jasper - apache-el - ${jetty-el.version} - - - org.neo4j - neo4j-ogm-api - ${neo4j-ogm.version} - - - org.neo4j - neo4j-ogm-bolt-driver - ${neo4j-ogm.version} - - - org.neo4j - neo4j-ogm-bolt-native-types - ${neo4j-ogm.version} - - - org.neo4j - neo4j-ogm-core - ${neo4j-ogm.version} - - - org.neo4j - neo4j-ogm-embedded-driver - ${neo4j-ogm.version} - - - org.neo4j - neo4j-ogm-embedded-native-types - ${neo4j-ogm.version} - - - org.neo4j - neo4j-ogm-http-driver - ${neo4j-ogm.version} - - - org.postgresql - postgresql - ${postgresql.version} - - - org.projectlombok - lombok - ${lombok.version} - - - org.quartz-scheduler - quartz - ${quartz.version} - - - com.mchange - c3p0 - - - com.zaxxer - * - - - - - org.quartz-scheduler - quartz-jobs - ${quartz.version} - - - org.reactivestreams - reactive-streams - ${reactive-streams.version} - - - org.seleniumhq.selenium - htmlunit-driver - ${selenium-htmlunit.version} - - - org.seleniumhq.selenium - selenium-api - ${selenium.version} - - - org.seleniumhq.selenium - selenium-chrome-driver - ${selenium.version} - - - org.seleniumhq.selenium - selenium-edge-driver - ${selenium.version} - - - org.seleniumhq.selenium - selenium-firefox-driver - ${selenium.version} - - - org.seleniumhq.selenium - selenium-ie-driver - ${selenium.version} - - - org.seleniumhq.selenium - selenium-java - ${selenium.version} - - - org.seleniumhq.selenium - selenium-opera-driver - ${selenium.version} - - - org.seleniumhq.selenium - selenium-remote-driver - ${selenium.version} - - - commons-logging - commons-logging - - - - - org.seleniumhq.selenium - selenium-safari-driver - ${selenium.version} - - - org.seleniumhq.selenium - selenium-support - ${selenium.version} - - - commons-logging - commons-logging - - - - - org.skyscreamer - jsonassert - ${jsonassert.version} - - - org.slf4j - jcl-over-slf4j - ${slf4j.version} - - - org.slf4j - jul-to-slf4j - ${slf4j.version} - - - org.slf4j - log4j-over-slf4j - ${slf4j.version} - - - org.slf4j - slf4j-api - ${slf4j.version} - - - org.slf4j - slf4j-ext - ${slf4j.version} - - - org.slf4j - slf4j-jcl - ${slf4j.version} - - - org.slf4j - slf4j-jdk14 - ${slf4j.version} - - - org.slf4j - slf4j-log4j12 - ${slf4j.version} - - - org.slf4j - slf4j-nop - ${slf4j.version} - - - org.slf4j - slf4j-simple - ${slf4j.version} - - - org.springframework - spring-framework-bom - ${spring-framework.version} - import - pom - - - org.springframework.amqp - spring-amqp - ${spring-amqp.version} - - - org.springframework.amqp - spring-rabbit - ${spring-amqp.version} - - - org.springframework.amqp - spring-rabbit-junit - ${spring-amqp.version} - - - org.springframework.amqp - spring-rabbit-test - ${spring-amqp.version} - - - org.springframework.batch - spring-batch-core - ${spring-batch.version} - - - org.springframework.batch - spring-batch-infrastructure - ${spring-batch.version} - - - org.springframework.batch - spring-batch-integration - ${spring-batch.version} - - - org.springframework.batch - spring-batch-test - ${spring-batch.version} - - - org.springframework.cloud - spring-cloud-cloudfoundry-connector - ${spring-cloud-connectors.version} - - - org.springframework.cloud - spring-cloud-connectors-core - ${spring-cloud-connectors.version} - - - org.springframework.cloud - spring-cloud-heroku-connector - ${spring-cloud-connectors.version} - - - org.springframework.cloud - spring-cloud-localconfig-connector - ${spring-cloud-connectors.version} - - - org.springframework.cloud - spring-cloud-spring-service-connector - ${spring-cloud-connectors.version} - - - org.springframework.data - spring-data-releasetrain - ${spring-data-releasetrain.version} - import - pom - - - org.springframework.hateoas - spring-hateoas - ${spring-hateoas.version} - - - org.springframework.integration - spring-integration-bom - ${spring-integration.version} - import - pom - - - org.springframework.integration - spring-integration-http - ${spring-integration.version} - - - commons-logging - commons-logging - - - commons-logging - commons-logging-api - - - - - org.springframework.kafka - spring-kafka - ${spring-kafka.version} - - - org.springframework.kafka - spring-kafka-test - ${spring-kafka.version} - - - org.springframework.ldap - spring-ldap-core - ${spring-ldap.version} - - - org.springframework.ldap - spring-ldap-core-tiger - ${spring-ldap.version} - - - org.springframework.ldap - spring-ldap-ldif-batch - ${spring-ldap.version} - - - org.springframework.ldap - spring-ldap-ldif-core - ${spring-ldap.version} - - - org.springframework.ldap - spring-ldap-odm - ${spring-ldap.version} - - - org.springframework.ldap - spring-ldap-test - ${spring-ldap.version} - - - org.springframework.restdocs - spring-restdocs-asciidoctor - ${spring-restdocs.version} - - - org.springframework.restdocs - spring-restdocs-core - ${spring-restdocs.version} - - - org.springframework.restdocs - spring-restdocs-mockmvc - ${spring-restdocs.version} - - - org.springframework.restdocs - spring-restdocs-restassured - ${spring-restdocs.version} - - - org.springframework.restdocs - spring-restdocs-webtestclient - ${spring-restdocs.version} - - - org.springframework.retry - spring-retry - ${spring-retry.version} - - - org.springframework.security - spring-security-bom - ${spring-security.version} - import - pom - - - org.springframework.session - spring-session-bom - ${spring-session-bom.version} - import - pom - - - org.springframework.ws - spring-ws-core - ${spring-ws.version} - - - commons-logging - commons-logging - - - - - org.springframework.ws - spring-ws-security - ${spring-ws.version} - - - commons-logging - commons-logging - - - - - org.springframework.ws - spring-ws-support - ${spring-ws.version} - - - commons-logging - commons-logging - - - - - org.springframework.ws - spring-ws-test - ${spring-ws.version} - - - commons-logging - commons-logging - - - - - org.springframework.ws - spring-xml - ${spring-ws.version} - - - org.synchronoss.cloud - nio-multipart-parser - ${nio-multipart-parser.version} - - - org.thymeleaf - thymeleaf - ${thymeleaf.version} - - - org.thymeleaf - thymeleaf-spring5 - ${thymeleaf.version} - - - org.thymeleaf.extras - thymeleaf-extras-java8time - ${thymeleaf-extras-java8time.version} - - - org.thymeleaf.extras - thymeleaf-extras-springsecurity5 - ${thymeleaf-extras-springsecurity.version} - - - org.webjars - hal-browser - ${webjars-hal-browser.version} - - - org.webjars - webjars-locator-core - ${webjars-locator-core.version} - - - org.xerial - sqlite-jdbc - ${sqlite-jdbc.version} - - - org.xmlunit - xmlunit-assertj - ${xmlunit2.version} - - - org.xmlunit - xmlunit-core - ${xmlunit2.version} - - - org.xmlunit - xmlunit-legacy - ${xmlunit2.version} - - - org.xmlunit - xmlunit-matchers - ${xmlunit2.version} - - - org.xmlunit - xmlunit-placeholders - ${xmlunit2.version} - - - org.yaml - snakeyaml - ${snakeyaml.version} - - - redis.clients - jedis - ${jedis.version} - - - wsdl4j - wsdl4j - ${wsdl4j.version} - - - - - - - - org.apache.johnzon - johnzon-maven-plugin - ${johnzon.version} - - - org.jetbrains.kotlin - kotlin-maven-plugin - ${kotlin.version} - - - org.jooq - jooq-codegen-maven - ${jooq.version} - - - org.springframework.boot - spring-boot-maven-plugin - ${revision} - - - org.apache.maven.plugins - maven-antrun-plugin - ${maven-antrun-plugin.version} - - - org.apache.maven.plugins - maven-assembly-plugin - ${maven-assembly-plugin.version} - - false - - - - org.apache.maven.plugins - maven-clean-plugin - ${maven-clean-plugin.version} - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - - org.apache.maven.plugins - maven-deploy-plugin - ${maven-deploy-plugin.version} - - - org.apache.maven.plugins - maven-dependency-plugin - ${maven-dependency-plugin.version} - - - org.apache.maven.plugins - maven-enforcer-plugin - ${maven-enforcer-plugin.version} - - - org.apache.maven.plugins - maven-failsafe-plugin - ${maven-failsafe-plugin.version} - - - org.apache.maven.plugins - maven-install-plugin - ${maven-install-plugin.version} - - - org.apache.maven.plugins - maven-invoker-plugin - ${maven-invoker-plugin.version} - - - org.apache.maven.plugins - maven-help-plugin - ${maven-help-plugin.version} - - - org.apache.maven.plugins - maven-jar-plugin - ${maven-jar-plugin.version} - - - org.apache.maven.plugins - maven-javadoc-plugin - ${maven-javadoc-plugin.version} - - - org.apache.maven.plugins - maven-resources-plugin - ${maven-resources-plugin.version} - - - org.apache.maven.plugins - maven-shade-plugin - ${maven-shade-plugin.version} - - - org.apache.maven.plugins - maven-source-plugin - ${maven-source-plugin.version} - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - org.apache.maven.plugins - maven-toolchains-plugin - ${maven-toolchains-plugin.version} - - - org.apache.maven.plugins - maven-war-plugin - ${maven-war-plugin.version} - - - org.codehaus.mojo - build-helper-maven-plugin - ${build-helper-maven-plugin.version} - - - org.codehaus.mojo - exec-maven-plugin - ${exec-maven-plugin.version} - - - org.codehaus.mojo - versions-maven-plugin - ${versions-maven-plugin.version} - - - org.codehaus.mojo - xml-maven-plugin - ${xml-maven-plugin.version} - - - org.codehaus.mojo - flatten-maven-plugin - ${flatten-maven-plugin.version} - - - org.flywaydb - flyway-maven-plugin - ${flyway.version} - - - org.infinispan - infinispan-protocol-parser-generator-maven-plugin - ${infinispan.version} - - - pl.project13.maven - git-commit-id-plugin - ${git-commit-id-plugin.version} - - - - - - org.codehaus.mojo - flatten-maven-plugin - false - - - - flatten-effective-pom - process-resources - - flatten - - - false - ${project.build.directory}/effective-pom - spring-boot-dependencies.xml - oss - - expand - expand - remove - remove - - - - - - flatten - process-resources - - flatten - - - true - bom - - keep - keep - remove - - - - - flatten-clean - clean - - clean - - - - - - org.codehaus.mojo - xml-maven-plugin - false - - - - post-process-effective-pom - process-resources - - transform - - - - - ${project.build.directory}/effective-pom - ${project.build.directory}/effective-pom - src/main/xslt/post-process-flattened-pom.xsl - - - indent - yes - - - - - - - - - post-process-flattened-pom - process-resources - - transform - - - - - ${project.basedir} - ${project.basedir} - .flattened-pom.xml - src/main/xslt/post-process-flattened-pom.xsl - - - indent - yes - - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - false - - - - attach-artifacts - package - - attach-artifact - - - - - ${project.build.directory}/effective-pom/spring-boot-dependencies.xml - effective-pom - - - - - - - - - diff --git a/spring-boot-project/spring-boot-devtools/build.gradle b/spring-boot-project/spring-boot-devtools/build.gradle new file mode 100644 index 000000000000..4120f22aea67 --- /dev/null +++ b/spring-boot-project/spring-boot-devtools/build.gradle @@ -0,0 +1,86 @@ +plugins { + id 'java-library' + id 'org.springframework.boot.auto-configuration' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.deployed' + id 'org.springframework.boot.integration-test' + id 'org.springframework.boot.optional-dependencies' +} + +description = 'Spring Boot Developer Tools' + +configurations { + intTestDependencies +} + +dependencies { + implementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + implementation project(':spring-boot-project:spring-boot') + implementation project(':spring-boot-project:spring-boot-autoconfigure') + + intTestDependencies project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + intTestImplementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + intTestImplementation project(':spring-boot-project:spring-boot-autoconfigure') + intTestImplementation project(':spring-boot-project:spring-boot-test') + intTestImplementation project(':spring-boot-project:spring-boot-tools:spring-boot-test-support') + intTestImplementation 'org.apache.httpcomponents:httpclient' + intTestImplementation 'org.assertj:assertj-core' + intTestImplementation 'org.awaitility:awaitility' + intTestImplementation 'org.junit.jupiter:junit-jupiter' + intTestImplementation 'net.bytebuddy:byte-buddy' + intTestRuntimeOnly 'org.springframework:spring-web' + + optional enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + optional 'javax.servlet:javax.servlet-api' + optional 'org.apache.derby:derby' + optional 'org.hibernate:hibernate-core' + optional 'org.springframework:spring-jdbc' + optional 'org.springframework:spring-orm' + optional 'org.springframework:spring-web' + optional 'org.springframework.security:spring-security-config' + optional 'org.springframework.security:spring-security-web' + optional 'org.springframework.data:spring-data-redis' + optional 'org.springframework.session:spring-session-core' + + testImplementation project(':spring-boot-project:spring-boot-tools:spring-boot-test-support') + testImplementation project(':spring-boot-project:spring-boot-test') + testImplementation 'ch.qos.logback:logback-classic' + testImplementation 'com.h2database:h2' + testImplementation 'com.zaxxer:HikariCP' + testImplementation 'org.apache.derby:derbyclient' + testImplementation 'org.apache.tomcat.embed:tomcat-embed-websocket' + testImplementation 'org.apache.tomcat.embed:tomcat-embed-core' + testImplementation 'org.apache.tomcat.embed:tomcat-embed-jasper' + testImplementation 'org.assertj:assertj-core' + testImplementation 'org.awaitility:awaitility' + testImplementation 'org.eclipse.jetty.websocket:websocket-client' + testImplementation 'org.hamcrest:hamcrest-library' + testImplementation 'org.hsqldb:hsqldb' + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.mockito:mockito-core' + testImplementation 'org.postgresql:postgresql' + testImplementation 'org.springframework:spring-test' + testImplementation 'org.springframework:spring-webmvc' + testImplementation 'org.springframework:spring-websocket' + testImplementation 'org.springframework.hateoas:spring-hateoas' + testImplementation 'org.springframework.security:spring-security-test' + testImplementation 'org.thymeleaf:thymeleaf' + testImplementation 'org.thymeleaf:thymeleaf-spring5' + testImplementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' + + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' + testRuntimeOnly 'org.yaml:snakeyaml' +} + +task copyIntTestDependencies(type: Copy) { + destinationDir = file("$buildDir/dependencies") + from { + configurations.intTestDependencies + } + from jar +} + +intTest { + dependsOn copyIntTestDependencies +} diff --git a/spring-boot-project/spring-boot-devtools/pom.xml b/spring-boot-project/spring-boot-devtools/pom.xml deleted file mode 100644 index 9af7e352ad79..000000000000 --- a/spring-boot-project/spring-boot-devtools/pom.xml +++ /dev/null @@ -1,220 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-parent - ${revision} - ../spring-boot-parent - - spring-boot-devtools - Spring Boot Developer Tools - Spring Boot Developer Tools - - ${basedir}/../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - org.springframework.boot - spring-boot - - - org.springframework.boot - spring-boot-autoconfigure - - - - jakarta.persistence - jakarta.persistence-api - true - - - jakarta.servlet - jakarta.servlet-api - true - - - org.apache.derby - derby - true - - - org.springframework - spring-jdbc - true - - - org.springframework - spring-orm - true - - - org.hibernate - hibernate-core - true - - - javax.activation - javax.activation-api - - - javax.xml.bind - jaxb-api - - - javax.persistence - javax.persistence-api - - - - - org.springframework - spring-web - true - - - org.springframework.security - spring-security-config - true - - - org.springframework.security - spring-security-web - true - - - org.springframework.data - spring-data-redis - true - - - org.springframework.session - spring-session-core - true - - - - org.springframework.boot - spring-boot-autoconfigure-processor - true - - - org.springframework.boot - spring-boot-configuration-processor - true - - - - org.springframework.boot - spring-boot-test-support - test - - - org.springframework.boot - spring-boot-test - test - - - ch.qos.logback - logback-classic - test - - - com.h2database - h2 - test - - - com.zaxxer - HikariCP - test - - - org.awaitility - awaitility - test - - - org.springframework - spring-webmvc - test - - - org.springframework - spring-websocket - test - - - org.springframework.hateoas - spring-hateoas - test - - - org.apache.derby - derbyclient - ${derby.version} - test - - - org.apache.tomcat.embed - tomcat-embed-websocket - test - - - org.apache.tomcat.embed - tomcat-embed-core - test - - - org.apache.tomcat.embed - tomcat-embed-jasper - test - - - org.eclipse.jetty.websocket - websocket-client - test - - - org.hsqldb - hsqldb - test - - - org.postgresql - postgresql - test - - - org.springframework.security - spring-security-test - test - - - org.thymeleaf - thymeleaf - test - - - org.thymeleaf - thymeleaf-spring5 - test - - - org.yaml - snakeyaml - test - - - nz.net.ultraq.thymeleaf - thymeleaf-layout-dialect - test - - - diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/com/example/ControllerOne.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/com/example/ControllerOne.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/com/example/ControllerOne.java rename to spring-boot-project/spring-boot-devtools/src/intTest/java/com/example/ControllerOne.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/com/example/DevToolsTestApplication.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/com/example/DevToolsTestApplication.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/com/example/DevToolsTestApplication.java rename to spring-boot-project/spring-boot-devtools/src/intTest/java/com/example/DevToolsTestApplication.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/AbstractApplicationLauncher.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/AbstractApplicationLauncher.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/AbstractApplicationLauncher.java rename to spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/AbstractApplicationLauncher.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java similarity index 98% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java rename to spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java index 4c816949a4ca..e8773240a6fe 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java +++ b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java @@ -70,7 +70,6 @@ protected int awaitServerPort() throws Exception { ApplicationState::hasServerPort) .getServerPort(); this.serverPortFile.delete(); - System.out.println("Got port " + port); this.launchedApplication.restartRemote(port); Thread.sleep(1000); return port; diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/ApplicationLauncher.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/ApplicationLauncher.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/ApplicationLauncher.java rename to spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/ApplicationLauncher.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/ApplicationState.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/ApplicationState.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/ApplicationState.java rename to spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/ApplicationState.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java similarity index 62% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java rename to spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java index 3bad93d99dca..91d52907830f 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java +++ b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java @@ -19,11 +19,15 @@ import java.io.File; import java.io.IOException; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.client.StandardHttpRequestRetryHandler; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.http.HttpStatus; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import static org.assertj.core.api.Assertions.assertThat; @@ -34,31 +38,33 @@ */ class DevToolsIntegrationTests extends AbstractDevToolsIntegrationTests { + private final TestRestTemplate template = new TestRestTemplate( + new RestTemplateBuilder().requestFactory(() -> new HttpComponentsClientHttpRequestFactory( + HttpClients.custom().setRetryHandler(new StandardHttpRequestRetryHandler(10, false)).build()))); + @ParameterizedTest(name = "{0}") @MethodSource("parameters") void addARequestMappingToAnExistingController(ApplicationLauncher applicationLauncher) throws Exception { launchApplication(applicationLauncher); - TestRestTemplate template = new TestRestTemplate(); String urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); - assertThat(template.getForEntity(urlBase + "/two", String.class).getStatusCode()) + assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); + assertThat(this.template.getForEntity(urlBase + "/two", String.class).getStatusCode()) .isEqualTo(HttpStatus.NOT_FOUND); controller("com.example.ControllerOne").withRequestMapping("one").withRequestMapping("two").build(); urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); - assertThat(template.getForObject(urlBase + "/two", String.class)).isEqualTo("two"); + assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); + assertThat(this.template.getForObject(urlBase + "/two", String.class)).isEqualTo("two"); } @ParameterizedTest(name = "{0}") @MethodSource("parameters") void removeARequestMappingFromAnExistingController(ApplicationLauncher applicationLauncher) throws Exception { launchApplication(applicationLauncher); - TestRestTemplate template = new TestRestTemplate(); String urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); + assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); controller("com.example.ControllerOne").build(); urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForEntity(urlBase + "/one", String.class).getStatusCode()) + assertThat(this.template.getForEntity(urlBase + "/one", String.class).getStatusCode()) .isEqualTo(HttpStatus.NOT_FOUND); } @@ -66,15 +72,14 @@ void removeARequestMappingFromAnExistingController(ApplicationLauncher applicati @MethodSource("parameters") void createAController(ApplicationLauncher applicationLauncher) throws Exception { launchApplication(applicationLauncher); - TestRestTemplate template = new TestRestTemplate(); String urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); - assertThat(template.getForEntity(urlBase + "/two", String.class).getStatusCode()) + assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); + assertThat(this.template.getForEntity(urlBase + "/two", String.class).getStatusCode()) .isEqualTo(HttpStatus.NOT_FOUND); controller("com.example.ControllerTwo").withRequestMapping("two").build(); urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); - assertThat(template.getForObject(urlBase + "/two", String.class)).isEqualTo("two"); + assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); + assertThat(this.template.getForObject(urlBase + "/two", String.class)).isEqualTo("two"); } @@ -82,18 +87,17 @@ void createAController(ApplicationLauncher applicationLauncher) throws Exception @MethodSource("parameters") void createAControllerAndThenAddARequestMapping(ApplicationLauncher applicationLauncher) throws Exception { launchApplication(applicationLauncher); - TestRestTemplate template = new TestRestTemplate(); String urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); - assertThat(template.getForEntity(urlBase + "/two", String.class).getStatusCode()) + assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); + assertThat(this.template.getForEntity(urlBase + "/two", String.class).getStatusCode()) .isEqualTo(HttpStatus.NOT_FOUND); controller("com.example.ControllerTwo").withRequestMapping("two").build(); urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); - assertThat(template.getForObject(urlBase + "/two", String.class)).isEqualTo("two"); + assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); + assertThat(this.template.getForObject(urlBase + "/two", String.class)).isEqualTo("two"); controller("com.example.ControllerTwo").withRequestMapping("two").withRequestMapping("three").build(); urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForObject(urlBase + "/three", String.class)).isEqualTo("three"); + assertThat(this.template.getForObject(urlBase + "/three", String.class)).isEqualTo("three"); } @ParameterizedTest(name = "{0}") @@ -101,33 +105,31 @@ void createAControllerAndThenAddARequestMapping(ApplicationLauncher applicationL void createAControllerAndThenAddARequestMappingToAnExistingController(ApplicationLauncher applicationLauncher) throws Exception { launchApplication(applicationLauncher); - TestRestTemplate template = new TestRestTemplate(); String urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); - assertThat(template.getForEntity(urlBase + "/two", String.class).getStatusCode()) + assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); + assertThat(this.template.getForEntity(urlBase + "/two", String.class).getStatusCode()) .isEqualTo(HttpStatus.NOT_FOUND); controller("com.example.ControllerTwo").withRequestMapping("two").build(); urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); - assertThat(template.getForObject(urlBase + "/two", String.class)).isEqualTo("two"); + assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); + assertThat(this.template.getForObject(urlBase + "/two", String.class)).isEqualTo("two"); controller("com.example.ControllerOne").withRequestMapping("one").withRequestMapping("three").build(); urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); - assertThat(template.getForObject(urlBase + "/two", String.class)).isEqualTo("two"); - assertThat(template.getForObject(urlBase + "/three", String.class)).isEqualTo("three"); + assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); + assertThat(this.template.getForObject(urlBase + "/two", String.class)).isEqualTo("two"); + assertThat(this.template.getForObject(urlBase + "/three", String.class)).isEqualTo("three"); } @ParameterizedTest(name = "{0}") @MethodSource("parameters") void deleteAController(ApplicationLauncher applicationLauncher) throws Exception { launchApplication(applicationLauncher); - TestRestTemplate template = new TestRestTemplate(); String urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); + assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); assertThat(new File(this.launchedApplication.getClassesDirectory(), "com/example/ControllerOne.class").delete()) .isTrue(); urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForEntity(urlBase + "/one", String.class).getStatusCode()) + assertThat(this.template.getForEntity(urlBase + "/one", String.class).getStatusCode()) .isEqualTo(HttpStatus.NOT_FOUND); } @@ -136,19 +138,18 @@ void deleteAController(ApplicationLauncher applicationLauncher) throws Exception @MethodSource("parameters") void createAControllerAndThenDeleteIt(ApplicationLauncher applicationLauncher) throws Exception { launchApplication(applicationLauncher); - TestRestTemplate template = new TestRestTemplate(); String urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); - assertThat(template.getForEntity(urlBase + "/two", String.class).getStatusCode()) + assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); + assertThat(this.template.getForEntity(urlBase + "/two", String.class).getStatusCode()) .isEqualTo(HttpStatus.NOT_FOUND); controller("com.example.ControllerTwo").withRequestMapping("two").build(); urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); - assertThat(template.getForObject(urlBase + "/two", String.class)).isEqualTo("two"); + assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); + assertThat(this.template.getForObject(urlBase + "/two", String.class)).isEqualTo("two"); assertThat(new File(this.launchedApplication.getClassesDirectory(), "com/example/ControllerTwo.class").delete()) .isTrue(); urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForEntity(urlBase + "/two", String.class).getStatusCode()) + assertThat(this.template.getForEntity(urlBase + "/two", String.class).getStatusCode()) .isEqualTo(HttpStatus.NOT_FOUND); } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsWithLazyInitializationIntegrationTests.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/DevToolsWithLazyInitializationIntegrationTests.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsWithLazyInitializationIntegrationTests.java rename to spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/DevToolsWithLazyInitializationIntegrationTests.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/Directories.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/Directories.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/Directories.java rename to spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/Directories.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/ExplodedRemoteApplicationLauncher.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/ExplodedRemoteApplicationLauncher.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/ExplodedRemoteApplicationLauncher.java rename to spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/ExplodedRemoteApplicationLauncher.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/FileContents.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/FileContents.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/FileContents.java rename to spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/FileContents.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/JarFileRemoteApplicationLauncher.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/JarFileRemoteApplicationLauncher.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/JarFileRemoteApplicationLauncher.java rename to spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/JarFileRemoteApplicationLauncher.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/JvmLauncher.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/JvmLauncher.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/JvmLauncher.java rename to spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/JvmLauncher.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/LaunchedApplication.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/LaunchedApplication.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/LaunchedApplication.java rename to spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/LaunchedApplication.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/LocalApplicationLauncher.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/LocalApplicationLauncher.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/LocalApplicationLauncher.java rename to spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/LocalApplicationLauncher.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/RemoteApplicationLauncher.java b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/RemoteApplicationLauncher.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/RemoteApplicationLauncher.java rename to spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/RemoteApplicationLauncher.java diff --git a/spring-boot-project/spring-boot-devtools/src/main/resources/META-INF/spring-devtools.properties b/spring-boot-project/spring-boot-devtools/src/main/resources/META-INF/spring-devtools.properties index 9810d8d63e5b..88ee28a8f83b 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/resources/META-INF/spring-devtools.properties +++ b/spring-boot-project/spring-boot-devtools/src/main/resources/META-INF/spring-devtools.properties @@ -1,6 +1,6 @@ -restart.exclude.spring-boot=/spring-boot/target/classes/ -restart.exclude.spring-boot-devtools=/spring-boot-devtools/target/classes/ -restart.exclude.spring-boot-autoconfigure=/spring-boot-autoconfigure/target/classes/ -restart.exclude.spring-boot-actuator=/spring-boot-actuator/target/classes/ -restart.exclude.spring-boot-starter=/spring-boot-starter/target/classes/ +restart.exclude.spring-boot=/spring-boot/(bin|build|out)/ +restart.exclude.spring-boot-devtools=/spring-boot-devtools/(bin|build|out)/ +restart.exclude.spring-boot-autoconfigure=/spring-boot-autoconfigure/(bin|build|out)/ +restart.exclude.spring-boot-actuator=/spring-boot-actuator/(bin|build|out)/ +restart.exclude.spring-boot-starter=/spring-boot-starter/(bin|build|out)/ restart.exclude.spring-boot-starters=/spring-boot-starter-[\\w-]+/ diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java index f698822000e4..e82daac47779 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java @@ -100,11 +100,12 @@ void sourceFolderMustNotBeNull() { } @Test - void sourceFolderMustNotBeAFile() { - File folder = new File("pom.xml"); - assertThat(folder.isFile()).isTrue(); - assertThatIllegalArgumentException().isThrownBy(() -> this.watcher.addSourceFolder(new File("pom.xml"))) - .withMessageContaining("Folder 'pom.xml' must not be a file"); + void sourceFolderMustNotBeAFile() throws IOException { + File file = new File(this.tempDir, "file"); + assertThat(file.createNewFile()).isTrue(); + assertThat(file.isFile()).isTrue(); + assertThatIllegalArgumentException().isThrownBy(() -> this.watcher.addSourceFolder(file)) + .withMessageContaining("Folder '" + file + "' must not be a file"); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/ChangeableUrlsTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/ChangeableUrlsTests.java index 85567ef2c5d2..f51b34b42235 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/ChangeableUrlsTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/ChangeableUrlsTests.java @@ -104,7 +104,7 @@ void urlsFromJarClassPathAreConsidered() throws Exception { private URL makeUrl(String name) throws IOException { File file = new File(this.tempDir, UUID.randomUUID().toString()); file = new File(file, name); - file = new File(file, "target"); + file = new File(file, "build"); file = new File(file, "classes"); file.mkdirs(); return file.toURI().toURL(); diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/DefaultRestartInitializerTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/DefaultRestartInitializerTests.java index 9602bfc0c4b3..4b1edbbdac0d 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/DefaultRestartInitializerTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/DefaultRestartInitializerTests.java @@ -16,6 +16,10 @@ package org.springframework.boot.devtools.restart; +import java.io.IOException; +import java.net.URL; +import java.net.URLClassLoader; + import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; @@ -82,8 +86,17 @@ void threadNotUsingAppClassLoader() { } @Test - void urlsCanBeRetrieved() { - assertThat(new DefaultRestartInitializer().getUrls(Thread.currentThread())).isNotEmpty(); + void urlsCanBeRetrieved() throws IOException { + Thread thread = Thread.currentThread(); + ClassLoader classLoader = thread.getContextClassLoader(); + try (URLClassLoader contextClassLoader = new URLClassLoader( + new URL[] { new URL("file:test-app/build/classes/main/") }, classLoader)) { + thread.setContextClassLoader(contextClassLoader); + assertThat(new DefaultRestartInitializer().getUrls(thread)).isNotEmpty(); + } + finally { + thread.setContextClassLoader(classLoader); + } } protected void testSkippedStacks(String s) { diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/settings/DevToolsSettingsTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/settings/DevToolsSettingsTests.java index 590536d4c82d..5f0ca3809452 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/settings/DevToolsSettingsTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/settings/DevToolsSettingsTests.java @@ -62,7 +62,7 @@ void defaultIncludePatterns(@TempDir File tempDir) throws Exception { private URL makeUrl(File file, String name) throws IOException { file = new File(file, name); - file = new File(file, "target"); + file = new File(file, "build"); file = new File(file, "classes"); file.mkdirs(); return file.toURI().toURL(); diff --git a/spring-boot-project/spring-boot-docs/build.gradle b/spring-boot-project/spring-boot-docs/build.gradle new file mode 100644 index 000000000000..69fb5da90c54 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -0,0 +1,241 @@ +plugins { + id 'java-base' + id 'org.asciidoctor.jvm.convert' + id 'org.asciidoctor.jvm.pdf' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.deployed' +} + +configurations { + actuatorApiDocumentation + autoConfiguration + configurationProperties + gradlePluginDocumentation + mavenPluginDocumentation + testSlices +} + +dependencies { + testSlices project(path: ':spring-boot-project:spring-boot-test-autoconfigure', configuration: 'testSliceMetadata') + autoConfiguration project(path: ':spring-boot-project:spring-boot-autoconfigure', configuration: 'autoConfigurationMetadata') + autoConfiguration project(path: ':spring-boot-project:spring-boot-actuator-autoconfigure', configuration: 'autoConfigurationMetadata') + autoConfiguration project(path: ':spring-boot-project:spring-boot-devtools', configuration: 'autoConfigurationMetadata') + configurationProperties project(path: ':spring-boot-project:spring-boot', configuration: 'configurationPropertiesMetadata') + configurationProperties project(path: ':spring-boot-project:spring-boot-actuator', configuration: 'configurationPropertiesMetadata') + configurationProperties project(path: ':spring-boot-project:spring-boot-actuator-autoconfigure', configuration: 'configurationPropertiesMetadata') + configurationProperties project(path: ':spring-boot-project:spring-boot-autoconfigure', configuration: 'configurationPropertiesMetadata') + configurationProperties project(path: ':spring-boot-project:spring-boot-devtools', configuration: 'configurationPropertiesMetadata') + gradlePluginDocumentation project(path: ':spring-boot-project:spring-boot-tools:spring-boot-gradle-plugin', configuration: 'documentation') + actuatorApiDocumentation project(path: ':spring-boot-project:spring-boot-actuator-autoconfigure', configuration: 'documentation') + mavenPluginDocumentation project(path: ':spring-boot-project:spring-boot-tools:spring-boot-maven-plugin', configuration: 'documentation') +} + +task dependencyVersions(type: org.springframework.boot.build.constraints.ExtractVersionConstraints) { + enforcedPlatform(':spring-boot-project:spring-boot-dependencies') +} + +task javadoc(type: Javadoc) { + dependsOn dependencyVersions + project.rootProject.gradle.projectsEvaluated { + Set publishedProjects = rootProject.subprojects.findAll { it != project} + .findAll { it.plugins.hasPlugin(JavaPlugin) && it.plugins.hasPlugin(MavenPublishPlugin) } + .findAll { it.name != 'spring-boot-maven-plugin' && it.name != 'spring-boot-gradle-plugin' } + dependsOn publishedProjects.javadoc + source publishedProjects.javadoc.source + classpath = project.files(publishedProjects.javadoc.classpath) + destinationDir = project.file "$buildDir/docs/javadoc" + options { + author = true + docTitle = "Spring Boot ${project.version} API" + encoding = 'UTF-8' + memberLevel = 'protected' + outputLevel = 'quiet' + source = '1.8' + splitIndex = true + stylesheetFile = file('src/main/javadoc/spring-javadoc.css') + use = true + windowTitle = "Spring Boot ${project.version} API" + } + doFirst { + def versionConstraints = dependencyVersions.versionConstraints + options.links = [ + 'https://docs.oracle.com/javase/8/docs/api/', + 'https://docs.oracle.com/javaee/7/api/', + "https://docs.spring.io/spring-framework/docs/${versionConstraints['org.springframework:spring-core']}/javadoc-api/", + "https://docs.spring.io/spring-security/site/docs/${versionConstraints['org.springframework.security:spring-security-core']}/api/", + 'https://tomcat.apache.org/tomcat-9.0-doc/api/', + "https://www.eclipse.org/jetty/javadoc/${versionConstraints['org.eclipse.jetty:jetty-server']}/", + "https://www.thymeleaf.org/apidocs/thymeleaf/${versionConstraints['org.thymeleaf:thymeleaf']}/" + ] as String[] + } + } +} + +task documentTestSlices(type: org.springframework.boot.build.test.autoconfigure.DocumentTestSlices) { + testSlices = configurations.testSlices + outputFile = file("$buildDir/docs/generated/test-slice-auto-configuration.adoc") +} + +task documentStarters(type: org.springframework.boot.build.starters.DocumentStarters) { + outputDir = file("$buildDir/docs/generated/starters/") +} + +task documentAutoConfigurationClasses(type: org.springframework.boot.build.autoconfigure.DocumentAutoConfigurationClasses) { + autoConfiguration = configurations.autoConfiguration + outputDir = file("$buildDir/docs/generated/auto-configuration-classes/") +} + +task documentDependencyVersions(type: org.springframework.boot.build.constraints.DocumentConstrainedVersions) { + dependsOn dependencyVersions + constrainedVersions.set(providers.provider { dependencyVersions.constrainedVersions }) + outputFile = file("$buildDir/docs/generated/dependency-versions.adoc") +} + +task documentConfigurationProperties(type: org.springframework.boot.build.context.properties.DocumentConfigurationProperties) { + configurationPropertyMetadata = configurations.configurationProperties + outputDir = file("$buildDir/docs/generated/config-docs/") +} + +tasks.withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask) { + dependsOn dependencyVersions + baseDirFollowsSourceDir() + doFirst { + def versionConstraints = dependencyVersions.versionConstraints + attributes 'jetty-version': versionConstraints['org.eclipse.jetty:jetty-server'], + 'jooq-version': versionConstraints['org.jooq:jooq'], + 'spring-amqp-version': versionConstraints['org.springframework.amqp:spring-amqp'], + 'spring-batch-version': versionConstraints['org.springframework.batch:spring-batch-core'], + 'spring-boot-version': project.version, + 'spring-data-commons-version': versionConstraints['org.springframework.data:spring-data-commons'], + 'spring-data-couchbase-version': versionConstraints['org.springframework.data:spring-data-couchbase'], + 'spring-data-jdbc-version': versionConstraints['org.springframework.data:spring-data-jdbc'], + 'spring-data-jpa-version': versionConstraints['org.springframework.data:spring-data-jpa'], + 'spring-data-mongodb-version': versionConstraints['org.springframework.data:spring-data-mongodb'], + 'spring-data-neo4j-version': versionConstraints['org.springframework.data:spring-data-neo4j'], + 'spring-data-rest-version': versionConstraints['org.springframework.data:spring-data-rest-core'], + 'spring-data-solr-version': versionConstraints['org.springframework.data:spring-data-solr'], + 'spring-framework-version': versionConstraints['org.springframework:spring-core'], + 'spring-integration-version': versionConstraints['org.springframework.integration:spring-integration-core'], + 'spring-security-version': versionConstraints['org.springframework.security:spring-security-core'], + 'spring-webservices-version': versionConstraints['org.springframework.ws:spring-ws-core'] + } +} + +asciidoctor { + sources { + include '*.htmlsingleadoc' + } +} + +asciidoctorPdf { + sources { + include '*.pdfadoc' + } +} + +task asciidoctorMultipage(type: org.asciidoctor.gradle.jvm.AsciidoctorTask) { + sources { + include '*.htmladoc' + include '*.adoc' + } +} + +syncDocumentationSourceForAsciidoctor { + dependsOn documentTestSlices + dependsOn documentStarters + dependsOn documentAutoConfigurationClasses + dependsOn documentDependencyVersions + dependsOn documentConfigurationProperties + from("$buildDir/docs/generated") { + into 'asciidoc' + } + from ("src/main/java") { + into 'main/java' + } + from ("src/test/java") { + into 'test/java' + } +} + +syncDocumentationSourceForAsciidoctorMultipage { + dependsOn documentTestSlices + dependsOn documentStarters + dependsOn documentAutoConfigurationClasses + dependsOn documentDependencyVersions + dependsOn documentConfigurationProperties + from("$buildDir/docs/generated") { + into 'asciidoc' + } + from ("src/main/java") { + into 'main/java' + } + from ("src/test/java") { + into 'test/java' + } +} + +syncDocumentationSourceForAsciidoctorPdf { + dependsOn documentTestSlices + dependsOn documentStarters + dependsOn documentAutoConfigurationClasses + dependsOn documentDependencyVersions + dependsOn documentConfigurationProperties + from("$buildDir/docs/generated") { + into 'asciidoc' + } + from ("src/main/java") { + into 'main/java' + } + from ("src/test/java") { + into 'test/java' + } +} + +task zip(type: Zip) { + dependsOn asciidoctor, + asciidoctorMultipage, + asciidoctorPdf, + configurations.gradlePluginDocumentation, + configurations.actuatorApiDocumentation, + configurations.mavenPluginDocumentation + duplicatesStrategy 'fail' + from(asciidoctor.outputDir) { + into 'reference/htmlsingle' + } + from(asciidoctorPdf.outputDir) { + into 'reference/pdf' + } + from(asciidoctorMultipage.outputDir) { + into 'reference/html' + } + from(javadoc) { + into 'api' + } + into('gradle-plugin') { + from { + zipTree(configurations.gradlePluginDocumentation.singleFile) + } + } + into('actuator-api') { + from { + zipTree(configurations.actuatorApiDocumentation.singleFile) + } + } + into('maven-plugin') { + from { + zipTree(configurations.mavenPluginDocumentation.singleFile) + } + } +} + +artifacts { + archives zip +} + +publishing { + publications { + deployment(MavenPublication) { + artifact zip + } + } +} diff --git a/spring-boot-project/spring-boot-docs/pom.xml b/spring-boot-project/spring-boot-docs/pom.xml deleted file mode 100644 index 1ff020f12812..000000000000 --- a/spring-boot-project/spring-boot-docs/pom.xml +++ /dev/null @@ -1,1760 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-parent - ${revision} - ../spring-boot-parent - - spring-boot-docs - Spring Boot Docs - Spring Boot Docs - - ${basedir}/../.. - ${project.build.directory}/refdocs/ - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot - - - org.springframework.boot - spring-boot-actuator - - - org.springframework.boot - spring-boot-actuator-autoconfigure - - - org.springframework.boot - spring-boot-autoconfigure - - - org.springframework.boot - spring-boot-cli - ${revision} - - - org.springframework.boot - spring-boot-starters - ${revision} - pom - - - org.springframework.boot - spring-boot-devtools - - - org.springframework.boot - spring-boot-loader - - - org.springframework.boot - spring-boot-loader-tools - - - org.springframework.boot - spring-boot-configuration-docs - ${revision} - - - org.springframework.boot - spring-boot-test - - - org.springframework.boot - spring-boot-test-autoconfigure - - - jakarta.persistence - jakarta.persistence-api - - - jakarta.ws.rs - jakarta.ws.rs-api - - - io.rest-assured - rest-assured - - - javax.xml.bind - jaxb-api - - - javax.activation - activation - - - org.hamcrest - hamcrest-core - - - org.hamcrest - hamcrest-library - - - - - org.springframework.restdocs - spring-restdocs-restassured - - - - ch.qos.logback - logback-classic - true - - - com.atomikos - transactions-jms - true - - - com.atomikos - transactions-jta - true - - - com.atomikos - transactions-jdbc - true - - - com.couchbase.client - java-client - true - - - com.couchbase.client - couchbase-spring-cache - true - - - com.fasterxml.jackson.core - jackson-databind - true - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - true - - - com.fasterxml.jackson.dataformat - jackson-dataformat-cbor - true - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - true - - - com.fasterxml.jackson.module - jackson-module-parameter-names - true - - - com.github.ben-manes.caffeine - caffeine - true - - - com.google.code.gson - gson - true - - - com.hazelcast - hazelcast - true - - - com.hazelcast - hazelcast-client - true - - - com.hazelcast - hazelcast-spring - true - - - com.h2database - h2 - true - - - com.jayway.jsonpath - json-path - true - - - com.samskivert - jmustache - true - - - com.sendgrid - sendgrid-java - true - - - com.unboundid - unboundid-ldapsdk - true - - - com.zaxxer - HikariCP - true - - - de.flapdoodle.embed - de.flapdoodle.embed.mongo - true - - - io.dropwizard.metrics - metrics-core - true - - - io.lettuce - lettuce-core - true - - - io.micrometer - micrometer-core - true - - - io.micrometer - micrometer-jersey2 - true - - - io.micrometer - micrometer-registry-appoptics - true - - - io.micrometer - micrometer-registry-atlas - true - - - io.micrometer - micrometer-registry-datadog - true - - - io.micrometer - micrometer-registry-dynatrace - true - - - io.micrometer - micrometer-registry-elastic - true - - - io.micrometer - micrometer-registry-ganglia - true - - - io.micrometer - micrometer-registry-graphite - true - - - io.micrometer - micrometer-registry-humio - true - - - io.micrometer - micrometer-registry-influx - true - - - io.micrometer - micrometer-registry-jmx - true - - - io.micrometer - micrometer-registry-kairos - true - - - io.micrometer - micrometer-registry-new-relic - true - - - io.micrometer - micrometer-registry-prometheus - true - - - io.micrometer - micrometer-registry-signalfx - true - - - io.micrometer - micrometer-registry-stackdriver - true - - - io.micrometer - micrometer-registry-statsd - true - - - io.micrometer - micrometer-registry-wavefront - true - - - io.projectreactor - reactor-tools - true - - - io.projectreactor.netty - reactor-netty - true - - - io.rsocket - rsocket-core - true - - - io.rsocket - rsocket-transport-netty - true - - - io.prometheus - simpleclient_pushgateway - true - - - io.reactivex - rxjava-reactive-streams - true - - - io.undertow - undertow-servlet - true - - - jboss-servlet-api_3.1_spec - org.jboss.spec.javax.servlet - - - - - io.searchbox - jest - true - - - io.undertow - undertow-websockets-jsr - true - - - undertow-servlet - io.undertow - - - - - jakarta.jms - jakarta.jms-api - true - - - jakarta.json.bind - jakarta.json.bind-api - true - - - jakarta.mail - jakarta.mail-api - true - - - jakarta.servlet - jakarta.servlet-api - true - - - jakarta.validation - jakarta.validation-api - true - - - javax.cache - cache-api - true - - - junit - junit - true - - - org.hamcrest - hamcrest-core - - - - - org.junit.jupiter - junit-jupiter-api - true - - - net.sf.ehcache - ehcache - true - - - net.sourceforge.htmlunit - htmlunit - true - - - nz.net.ultraq.thymeleaf - thymeleaf-layout-dialect - true - - - org.apache.activemq - activemq-client - true - - - geronimo-jms_1.1_spec - org.apache.geronimo.specs - - - - - org.apache.activemq - artemis-jms-client - true - - - geronimo-jms_2.0_spec - org.apache.geronimo.specs - - - - - org.apache.activemq - activemq-jms-pool - true - - - geronimo-jms_1.1_spec - org.apache.geronimo.specs - - - - - org.apache.activemq - artemis-jms-server - true - - - geronimo-jms_2.0_spec - org.apache.geronimo.specs - - - - - org.apache.activemq - activemq-pool - true - - - org.apache.commons - commons-pool2 - true - - - org.apache.commons - commons-dbcp2 - true - - - org.apache.derby - derby - true - - - org.apache.kafka - kafka-streams - true - - - javax.ws.rs - javax.ws.rs-api - - - - - org.apache.logging.log4j - log4j-api - true - - - org.apache.logging.log4j - log4j-core - true - - - org.apache.httpcomponents - httpclient - true - - - org.apache.tomcat.embed - tomcat-embed-core - true - - - org.apache.tomcat.embed - tomcat-embed-jasper - true - - - org.apache.tomcat.embed - tomcat-embed-websocket - true - - - org.apache.tomcat - tomcat-jdbc - true - - - org.aspectj - aspectjweaver - true - - - org.assertj - assertj-core - true - - - org.codehaus.btm - btm - true - - - javax.transaction - jta - - - - - org.codehaus.groovy - groovy - true - - - org.codehaus.groovy - groovy-xml - true - - - org.codehaus.groovy - groovy-templates - true - - - org.eclipse.jetty - jetty-util - true - - - org.eclipse.jetty - jetty-servlets - true - - - org.eclipse.jetty - jetty-webapp - true - - - org.eclipse.jetty.websocket - javax-websocket-server-impl - true - - - javax.annotation - javax.annotation-api - - - javax.servlet - javax.servlet-api - - - javax.websocket - javax.websocket-api - - - javax.websocket - javax.websocket-client-api - - - - - org.eclipse.jetty - jetty-alpn-conscrypt-server - true - - - org.eclipse.jetty - jetty-reactive-httpclient - true - - - org.eclipse.jetty.http2 - http2-server - true - - - javax.servlet - javax.servlet-api - - - - - org.elasticsearch.client - elasticsearch-rest-high-level-client - true - - - org.flywaydb - flyway-core - true - - - org.freemarker - freemarker - true - - - org.glassfish.jersey.containers - jersey-container-servlet-core - true - - - javax.validation - validation-api - - - - - org.glassfish.jersey.ext - jersey-spring5 - true - - - org.glassfish.jersey.media - jersey-media-json-jackson - true - - - org.hamcrest - hamcrest - true - - - org.jboss - jboss-transaction-spi - true - - - org.jboss.logging - jboss-logging - true - - - org.jetbrains.kotlin - kotlin-reflect - true - - - org.jetbrains.kotlin - kotlin-stdlib - true - - - org.jooq - jooq - true - - - javax.activation - javax.activation-api - - - javax.xml.bind - jaxb-api - - - - - org.hibernate - hibernate-core - true - - - javax.activation - javax.activation-api - - - javax.persistence - javax.persistence-api - - - javax.xml.bind - jaxb-api - - - - - org.hibernate - hibernate-jcache - true - - - org.hibernate.validator - hibernate-validator - true - - - javax.validation - validation-api - - - - - org.infinispan - infinispan-jcache - true - - - org.infinispan - infinispan-spring5-embedded - true - - - org.influxdb - influxdb-java - true - - - org.jolokia - jolokia-core - true - - - org.liquibase - liquibase-core - true - - - org.messaginghub - pooled-jms - true - - - org.mockito - mockito-core - true - - - org.mongodb - mongodb-driver-async - true - - - org.mongodb - mongodb-driver-reactivestreams - true - - - org.quartz-scheduler - quartz - true - - - org.skyscreamer - jsonassert - true - - - org.slf4j - slf4j-api - true - - - org.slf4j - jul-to-slf4j - true - - - org.seleniumhq.selenium - selenium-api - true - - - org.seleniumhq.selenium - htmlunit-driver - true - - - org.springframework - spring-context-support - true - - - org.springframework - spring-jms - true - - - org.springframework - spring-messaging - true - - - org.springframework - spring-orm - true - - - org.springframework - spring-test - true - - - org.springframework - spring-web - true - - - org.springframework - spring-webflux - true - - - org.springframework - spring-webmvc - true - - - org.springframework - spring-websocket - true - - - org.springframework.amqp - spring-rabbit - true - - - org.springframework.batch - spring-batch-core - true - - - org.springframework.cloud - spring-cloud-connectors-core - true - - - org.springframework.cloud - spring-cloud-spring-service-connector - true - - - org.springframework.integration - spring-integration-core - true - - - org.springframework.integration - spring-integration-jdbc - true - - - org.springframework.integration - spring-integration-jmx - true - - - org.springframework.kafka - spring-kafka - true - - - org.springframework.security - spring-security-config - true - - - org.springframework.security - spring-security-oauth2-client - true - - - javax.activation - activation - - - com.sun.mail - javax.mail - - - - - org.springframework.security - spring-security-oauth2-jose - true - - - org.springframework.security - spring-security-oauth2-resource-server - true - - - org.springframework.security - spring-security-rsocket - - - org.springframework.security - spring-security-saml2-service-provider - true - - - org.springframework.security - spring-security-test - true - - - org.springframework.session - spring-session-core - true - - - org.springframework.session - spring-session-hazelcast - true - - - javax.annotation - javax.annotation-api - - - - - org.springframework.session - spring-session-jdbc - true - - - org.springframework.session - spring-session-data-mongodb - true - - - org.springframework.session - spring-session-data-redis - true - - - org.springframework.data - spring-data-cassandra - true - - - org.springframework.data - spring-data-commons - true - - - org.springframework.data - spring-data-couchbase - true - - - org.springframework.data - spring-data-elasticsearch - true - - - org.springframework.data - spring-data-jdbc - true - - - org.springframework.data - spring-data-jpa - true - - - org.springframework.data - spring-data-ldap - true - - - org.springframework.data - spring-data-mongodb - true - - - org.springframework.data - spring-data-neo4j - true - - - org.springframework.data - spring-data-redis - true - - - org.springframework.data - spring-data-rest-core - true - - - org.springframework.data - spring-data-rest-webmvc - true - - - org.springframework.data - spring-data-solr - true - - - org.springframework.hateoas - spring-hateoas - true - - - org.springframework.restdocs - spring-restdocs-mockmvc - true - - - javax.servlet - javax.servlet-api - - - - - org.springframework.restdocs - spring-restdocs-webtestclient - true - - - org.springframework.security - spring-security-data - true - - - javax.xml.bind - jaxb-api - - - - - org.springframework.security - spring-security-web - true - - - org.springframework.ws - spring-ws-core - true - - - org.thymeleaf - thymeleaf-spring5 - true - - - com.github.mxab.thymeleaf.extras - thymeleaf-extras-data-attribute - true - - - org.thymeleaf.extras - thymeleaf-extras-java8time - true - - - org.thymeleaf.extras - thymeleaf-extras-springsecurity5 - true - - - org.yaml - snakeyaml - true - - - redis.clients - jedis - true - - - - org.springframework.boot - spring-boot-test-support - test - - - org.springframework.boot - spring-boot-starter-web - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - ** - - - - - - - - full - - - full - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - attach-javadocs - - jar - - prepare-package - - true - - ${project.groupId}:* - - org/springframework/boot/docs/**/*.java - false - true - ${basedir}/src/main/javadoc/spring-javadoc.css - - https://docs.oracle.com/javase/8/docs/api/ - https://docs.oracle.com/javaee/7/api/ - https://docs.spring.io/spring-framework/docs/${spring-framework.version}/javadoc-api/ - https://docs.spring.io/spring-security/site/docs/${spring-security.version}/api/ - https://tomcat.apache.org/tomcat-9.0-doc/api/ - https://www.eclipse.org/jetty/javadoc/${jetty.version}/ - https://www.thymeleaf.org/apidocs/thymeleaf/${thymeleaf.version}/ - - - - - - - com.googlecode.maven-download-plugin - download-maven-plugin - - - unpack-doc-resources - generate-resources - - wget - - - ${spring-doc-resources.url} - true - ${refdocs.build.directory} - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-starters-pom - generate-resources - - copy - - - - - org.springframework.boot - spring-boot-starters - ${revision} - pom - true - ${project.build.directory}/external-resources - starters-effective-pom.xml - - - - - - unpack-maven-plugin - generate-resources - - unpack - - - - - org.springframework.boot - spring-boot-maven-plugin - ${revision} - docs - zip - - ${project.build.directory}/contents/maven-plugin - - META-INF/** - - - org.springframework.boot - spring-boot-gradle-plugin - ${revision} - docs - zip - ${project.build.directory}/contents/gradle-plugin - META-INF/** - - - org.springframework.boot - spring-boot-actuator-autoconfigure - ${revision} - docs - zip - ${project.build.directory}/contents/actuator-api - META-INF/** - - - - - - copy-dependencies-effective-pom - generate-resources - - copy - - - - - org.springframework.boot - spring-boot-dependencies - ${revision} - effective-pom - true - ${project.build.directory}/external-resources - effective-pom.xml - - - - - - unpack-spring-factories - generate-resources - - unpack - - - - - org.springframework.boot - spring-boot-autoconfigure - ${revision} - - ${project.build.directory}/auto-config/spring-boot-autoconfigure - - META-INF/spring.factories - - - org.springframework.boot - spring-boot-actuator-autoconfigure - ${revision} - - ${project.build.directory}/auto-config/spring-boot-actuator-autoconfigure - - META-INF/spring.factories - - - - - - unpack-starter-poms - generate-resources - - unpack - - - - - org.springframework.boot - spring-boot-starters - ${revision} - zip - starter-poms - ${project.build.directory}/external-resources/starter-poms - - - - - - unpack-test-slices - generate-resources - - unpack - - - - - org.springframework.boot - spring-boot-test-autoconfigure - ${revision} - - ${project.build.directory}/test-auto-config - - - - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - copy-asciidoc-resources - generate-resources - - copy-resources - - - ${refdocs.build.directory} - - - src/main/asciidoc - false - - - - - - - - org.codehaus.mojo - xml-maven-plugin - 1.0.1 - - - transform-effective-pom - - transform - - - - - ${project.build.directory}/external-resources - - effective-pom.xml - - src/main/xslt/dependencyVersions.xsl - - - .adoc - - - ${project.build.directory}/generated-resources - - - - - - transform-flattened-pom - process-resources - - transform - - - - - ${project.basedir} - - .flattened-pom.xml - - src/main/xslt/versionProperties.xsl - - - .properties - - - ${project.build.directory}/generated-resources - - - - - - - - org.codehaus.gmavenplus - gmavenplus-plugin - - - - execute - - generate-resources - - - - - - - - - - - - - org.codehaus.groovy - groovy - ${groovy.version} - - - org.codehaus.groovy - groovy-ant - ${groovy.version} - - - org.springframework - spring-core - ${spring-framework.version} - - - - - org.codehaus.mojo - properties-maven-plugin - 1.0.0 - - - read-flattenedpom-versions - prepare-package - - read-project-properties - - false - - - ${project.build.directory}/generated-resources/.flattened-pom.properties - - - - - - - org.asciidoctor - asciidoctor-maven-plugin - - ${refdocs.build.directory} - - - ${refdocs.build.directory} - - **/*.*adoc - - - - - ${spring-boot-artifactory-repo} - ${github-tag} - ${project.basedir}/src - ${project.basedir}/src/main/asciidoc - ${project.basedir}/target/generated-resources - ${jetty.version} - ${jooq.version} - ${revision} - ${spring-amqp.version} - ${spring-batch.version} - ${flattenedpom.version.org.springframework.data.spring-data-couchbase} - ${flattenedpom.version.org.springframework.data.spring-data-commons} - ${flattenedpom.version.org.springframework.data.spring-data-jpa} - ${flattenedpom.version.org.springframework.data.spring-data-jdbc} - ${flattenedpom.version.org.springframework.data.spring-data-mongodb} - ${flattenedpom.version.org.springframework.data.spring-data-neo4j} - ${flattenedpom.version.org.springframework.data.spring-data-rest-core} - ${flattenedpom.version.org.springframework.data.spring-data-solr} - ${spring-framework.version} - ${spring-integration.version} - ${spring-security.version} - ${spring-ws.version} - - - - - io.spring.asciidoctor - spring-asciidoctor-extensions-spring-boot - ${spring-asciidoctor-extensions.version} - - - org.springframework.boot - spring-boot-actuator-autoconfigure - ${revision} - - - org.springframework.boot - spring-boot-autoconfigure - ${revision} - - - org.springframework.boot - spring-boot-devtools - ${revision} - - - - - generate-html-documentation - prepare-package - - process-asciidoc - - - html5 - - .adoc - .htmladoc - - ${project.build.directory}/generated-docs/reference/html - highlight.js - book - - js/highlight - github - true - ./images - font - css/ - spring.css - warn - - - false - - INFO - - - - - - generate-htmlsingle-documentation - prepare-package - - process-asciidoc - - - html5 - - .htmlsingleadoc - - ${project.build.directory}/generated-docs/reference/htmlsingle - highlight.js - book - - js/highlight - github - true - ./images - font - css/ - spring.css - - - false - - INFO - - - - - - generate-pdf-documentation - prepare-package - - process-asciidoc - - - pdf - - pdfadoc - - ${project.build.directory}/generated-docs/reference/pdf - - - ${refdocs.build.directory} - - **/* - - - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - ant-contrib - ant-contrib - 1.0b3 - - - ant - ant - - - - - org.apache.ant - ant-nodeps - 1.8.1 - - - org.tigris.antelope - antelopetasks - 3.2.10 - - - - - package-and-attach-docs-zip - package - - run - - - - - - - - - - - - - setup-maven-properties - validate - - run - - - true - - - - - - - - - - - - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-zip - - attach-artifact - - - - - ${project.build.directory}/${project.artifactId}-${project.version}.zip - zip - - - - - - - - - - - diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-application-properties.adoc similarity index 51% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-application-properties.adoc index 1afb9c5e9279..723b3f609e06 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-application-properties.adoc @@ -2,7 +2,7 @@ [appendix] [[common-application-properties]] = Common Application properties -include::{asciidoc-sources-root}/attributes.adoc[] +include::attributes.adoc[] Various properties can be specified inside your `application.properties` file, inside your `application.yml` file, or as command line switches. This appendix provides a list of common Spring Boot properties and references to the underlying classes that consume them. @@ -15,64 +15,64 @@ Also, you can define your own properties. == Core properties -include::{generated-resources-root}/config-docs/core.adoc[] +include::config-docs/core.adoc[] == Cache properties -include::{generated-resources-root}/config-docs/cache.adoc[] +include::config-docs/cache.adoc[] == Mail properties -include::{generated-resources-root}/config-docs/mail.adoc[] +include::config-docs/mail.adoc[] == JSON properties -include::{generated-resources-root}/config-docs/json.adoc[] +include::config-docs/json.adoc[] == Data properties -include::{generated-resources-root}/config-docs/data.adoc[] +include::config-docs/data.adoc[] == Transaction properties -include::{generated-resources-root}/config-docs/transaction.adoc[] +include::config-docs/transaction.adoc[] == Data migration properties -include::{generated-resources-root}/config-docs/data-migration.adoc[] +include::config-docs/data-migration.adoc[] == Integration properties -include::{generated-resources-root}/config-docs/integration.adoc[] +include::config-docs/integration.adoc[] == Web properties -include::{generated-resources-root}/config-docs/web.adoc[] +include::config-docs/web.adoc[] == Templating properties -include::{generated-resources-root}/config-docs/templating.adoc[] +include::config-docs/templating.adoc[] == Server properties -include::{generated-resources-root}/config-docs/server.adoc[] +include::config-docs/server.adoc[] == Security properties -include::{generated-resources-root}/config-docs/security.adoc[] +include::config-docs/security.adoc[] == RSocket properties -include::{generated-resources-root}/config-docs/rsocket.adoc[] +include::config-docs/rsocket.adoc[] == Actuator properties -include::{generated-resources-root}/config-docs/actuator.adoc[] +include::config-docs/actuator.adoc[] == Devtools properties -include::{generated-resources-root}/config-docs/devtools.adoc[] +include::config-docs/devtools.adoc[] == Testing properties -include::{generated-resources-root}/config-docs/testing.adoc[] +include::config-docs/testing.adoc[] diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-auto-configuration-classes.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-auto-configuration-classes.adoc similarity index 76% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-auto-configuration-classes.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-auto-configuration-classes.adoc index bfcbcf21012c..a098131beabe 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-auto-configuration-classes.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-auto-configuration-classes.adoc @@ -1,7 +1,7 @@ [appendix] [[auto-configuration-classes]] = Auto-configuration Classes -include::{asciidoc-sources-root}/attributes.adoc[] +include::attributes.adoc[] This appendix contains details of all of the auto-configuration classes provided by Spring Boot, with links to documentation and source code. Remember to also look at the conditions report in your application for more details of which features are switched on. @@ -13,7 +13,7 @@ Remember to also look at the conditions report in your application for more deta == `spring-boot-autoconfigure` The following auto-configuration classes are from the `spring-boot-autoconfigure` module: -include::{generated-resources-root}/auto-configuration-classes-spring-boot-autoconfigure.adoc[] +include::auto-configuration-classes/spring-boot-autoconfigure.adoc[] @@ -21,4 +21,4 @@ include::{generated-resources-root}/auto-configuration-classes-spring-boot-autoc == `spring-boot-actuator-autoconfigure` The following auto-configuration classes are from the `spring-boot-actuator-autoconfigure` module: -include::{generated-resources-root}/auto-configuration-classes-spring-boot-actuator-autoconfigure.adoc[] +include::auto-configuration-classes/spring-boot-actuator-autoconfigure.adoc[] diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-configuration-metadata.adoc similarity index 99% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-configuration-metadata.adoc index 83c266bb29de..899c323cc712 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-configuration-metadata.adoc @@ -1,7 +1,7 @@ [appendix] [[configuration-metadata]] = Configuration Metadata -include::{asciidoc-sources-root}/attributes.adoc[] +include::attributes.adoc[] Spring Boot jars include metadata files that provide details of all supported configuration properties. The files are designed to let IDE developers offer contextual help and "`code completion`" as users are working with `application.properties` or `application.yml` files. diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-dependency-versions.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-dependency-versions.adoc similarity index 83% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-dependency-versions.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-dependency-versions.adoc index 32653b9dfab9..e5049c86dc12 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-dependency-versions.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-dependency-versions.adoc @@ -1,7 +1,7 @@ [appendix] [[dependency-versions]] = Dependency versions -include::{asciidoc-sources-root}/attributes.adoc[] +include::attributes.adoc[] This appendix provides details of the dependencies that are managed by Spring Boot. @@ -11,4 +11,4 @@ This appendix provides details of the dependencies that are managed by Spring Bo The following table provides details of all of the dependency versions that are provided by Spring Boot in its CLI (Command Line Interface), Maven dependency management, and Gradle plugin. When you declare a dependency on one of these artifacts without declaring a version, the version listed in the table is used. -include::{generated-resources-root}/effective-pom.adoc[] +include::dependency-versions.adoc[] diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-executable-jar-format.adoc similarity index 99% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-executable-jar-format.adoc index 048aaee57c6a..dda383d71e7e 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-executable-jar-format.adoc @@ -1,7 +1,7 @@ [appendix] [[executable-jar]] = The Executable Jar Format -include::{asciidoc-sources-root}/attributes.adoc[] +include::attributes.adoc[] The `spring-boot-loader` modules lets Spring Boot support executable jar and war files. If you use the Maven plugin or the Gradle plugin, executable jars are automatically generated, and you generally do not need to know the details of how they work. diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-test-auto-configuration.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-test-auto-configuration.adoc similarity index 77% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-test-auto-configuration.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-test-auto-configuration.adoc index a354ff5081fe..dc33154eae1b 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-test-auto-configuration.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-test-auto-configuration.adoc @@ -1,7 +1,7 @@ [appendix] [[test-auto-configuration]] = Test Auto-configuration Annotations -include::{asciidoc-sources-root}/attributes.adoc[] +include::attributes.adoc[] This appendix describes the `@…Test` auto-configuration annotations that Spring Boot provides to test slices of your application. @@ -10,4 +10,4 @@ This appendix describes the `@…Test` auto-configuration annotations that Sprin The following table lists the various `@…Test` annotations that can be used to test slices of your application and the auto-configuration that they import by default: -include::{generated-resources-root}/test-slice-auto-configuration.adoc[] +include::test-slice-auto-configuration.adoc[] diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/attributes.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc similarity index 98% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/attributes.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc index a7ba01498741..fb0f1f30ef92 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/attributes.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc @@ -20,8 +20,8 @@ :github-issues: https://github.com/{github-repo}/issues/ :github-wiki: https://github.com/{github-repo}/wiki -:code-examples: {sources-root}/main/java/org/springframework/boot/docs -:test-examples: {sources-root}/test/java/org/springframework/boot/docs +:code-examples: ../main/java/org/springframework/boot/docs +:test-examples: ../test/java/org/springframework/boot/docs :spring-boot-code: https://github.com/{github-repo}/tree/{github-tag} :spring-boot-api: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/api/ diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins.adoc similarity index 100% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/build-tool-plugins.adoc diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/deployment.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment.adoc similarity index 100% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/deployment.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/deployment.adoc diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/documentation-overview.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/documentation-overview.adoc similarity index 100% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/documentation-overview.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/documentation-overview.adoc diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/getting-started.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started.adoc similarity index 100% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/getting-started.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started.adoc diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc similarity index 100% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/index-docinfo.xml b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/index-docinfo.xml similarity index 100% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/index-docinfo.xml rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/index-docinfo.xml diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/index.htmladoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/index.htmladoc similarity index 100% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/index.htmladoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/index.htmladoc diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/index.htmlsingleadoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/index.htmlsingleadoc similarity index 100% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/index.htmlsingleadoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/index.htmlsingleadoc diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/legal.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/legal.adoc similarity index 100% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/legal.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/legal.adoc diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc similarity index 100% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-cli.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-cli.adoc similarity index 100% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-cli.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-cli.adoc diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc similarity index 100% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-reference.pdfadoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-reference.pdfadoc similarity index 100% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-reference.pdfadoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-reference.pdfadoc diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using-spring-boot.adoc similarity index 99% rename from spring-boot-project/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc rename to spring-boot-project/spring-boot-docs/src/docs/asciidoc/using-spring-boot.adoc index b9977e9a3172..04a6b817a9c9 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using-spring-boot.adoc @@ -258,17 +258,17 @@ For example, a third-party starter project called `thirdpartyproject` would typi The following application starters are provided by Spring Boot under the `org.springframework.boot` group: .Spring Boot application starters -include::{generated-resources-root}/application-starters.adoc[] +include::starters/application-starters.adoc[] In addition to the application starters, the following starters can be used to add _<>_ features: .Spring Boot production starters -include::{generated-resources-root}/production-starters.adoc[] +include::starters/production-starters.adoc[] Finally, Spring Boot also includes the following starters that can be used if you want to exclude or swap specific technical facets: .Spring Boot technical starters -include::{generated-resources-root}/technical-starters.adoc[] +include::starters/technical-starters.adoc[] TIP: For a list of additional community contributed starters, see the {spring-boot-master-code}/spring-boot-project/spring-boot-starters/README.adoc[README file] in the `spring-boot-starters` module on GitHub. diff --git a/spring-boot-project/spring-boot-parent/build.gradle b/spring-boot-project/spring-boot-parent/build.gradle new file mode 100644 index 000000000000..a01df3f02526 --- /dev/null +++ b/spring-boot-project/spring-boot-parent/build.gradle @@ -0,0 +1,41 @@ +plugins { + id 'java-platform' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.deployed' +} + +description = 'Spring Boot Parent' + +javaPlatform { + allowDependencies() +} + +dependencies { + api enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies")) + api enforcedPlatform('org.testcontainers:testcontainers-bom:1.12.4') + constraints { + api 'com.vaadin.external.google:android-json:0.0.20131108.vaadin1' + api 'commons-fileupload:commons-fileupload:1.4' + api 'io.mockk:mockk:1.9.3' + api 'jline:jline:2.11' + api 'net.sf.jopt-simple:jopt-simple:5.0.4' + api 'org.apache.maven:maven-plugin-api:3.6.3' + api 'org.apache.maven:maven-resolver-provider:3.6.3' + api 'org.apache.maven:maven-settings-builder:3.6.3' + api 'org.apache.maven.resolver:maven-resolver-connector-basic:1.4.1' + api 'org.apache.maven.resolver:maven-resolver-impl:1.4.1' + api 'org.apache.maven.resolver:maven-resolver-transport-file:1.4.1' + api 'org.apache.maven.resolver:maven-resolver-transport-http:1.4.1' + api 'org.apache.maven.plugin-tools:maven-plugin-annotations:3.6.0' + api 'org.apache.maven.plugins:maven-shade-plugin:3.2.1' + api 'org.apache.maven.shared:maven-common-artifact-filters:3.1.0' + api 'org.apache.maven.shared:maven-invoker:3.0.1' + api 'org.sonatype.plexus:plexus-build-api:0.0.7' + api 'org.sonatype.plexus:plexus-sec-dispatcher:1.4' + api 'org.sonatype.sisu:sisu-inject-plexus:2.6.0' + api 'org.spockframework:spock-core:1.3-groovy-2.5' + api 'org.spockframework:spock-spring:1.3-groovy-2.5' + api 'org.testng:testng:6.14.3' + + } +} \ No newline at end of file diff --git a/spring-boot-project/spring-boot-parent/pom.xml b/spring-boot-project/spring-boot-parent/pom.xml deleted file mode 100644 index b9076dc95a18..000000000000 --- a/spring-boot-project/spring-boot-parent/pom.xml +++ /dev/null @@ -1,559 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-dependencies - ${revision} - ../spring-boot-dependencies - - spring-boot-parent - pom - Spring Boot Parent - Spring Boot Parent - - Pivotal Software, Inc. - https://spring.io - - - ${basedir}/../.. - false - https://github.com/spring-projects/spring-boot - scm:git:git://github.com/spring-projects/spring-boot.git - scm:git:ssh://git@github.com/spring-projects/spring-boot.git - 1.8 - UTF-8 - UTF-8 - 3.5.4 - 1.1.1 - 1.3-groovy-2.5 - 0.3.0.RELEASE - 0.1.4.BUILD-20191119.185717-2 - https://repo.spring.io/snapshot/io/spring/docresources/spring-doc-resources/0.1.4.BUILD-SNAPSHOT/spring-doc-resources-${spring-doc-resources.version}.zip - 1.12.4 - 6.14.3 - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - Github - https://github.com/spring-projects/spring-boot/issues - - - - - - org.springframework.boot - spring-boot-test-support - ${revision} - - - - - log4j - log4j - 1.2.17 - - - commons-fileupload - commons-fileupload - 1.4 - - - io.mockk - mockk - 1.9.3 - - - org.sonatype.plexus - plexus-sec-dispatcher - 1.4 - - - org.sonatype.sisu - sisu-inject-plexus - 2.6.0 - - - com.vaadin.external.google - android-json - 0.0.20131108.vaadin1 - - - jline - jline - 2.11 - - - net.sf.jopt-simple - jopt-simple - 5.0.4 - - - org.apache.commons - commons-compress - 1.19 - - - org.apache.ivy - ivy - 2.4.0 - - - org.apache.maven - maven-archiver - 3.4.0 - - - org.apache.maven - maven-artifact - ${maven.version} - - - org.apache.maven - maven-core - ${maven.version} - - - org.apache.maven - maven-model - ${maven.version} - - - org.apache.maven - maven-plugin-api - ${maven.version} - - - org.apache.maven - maven-settings - ${maven.version} - - - org.apache.maven - maven-settings-builder - ${maven.version} - - - org.apache.maven - maven-model-builder - ${maven.version} - - - org.apache.maven - maven-resolver-provider - ${maven.version} - - - org.apache.maven.resolver - maven-resolver-connector-basic - ${maven-resolver.version} - - - org.apache.maven.resolver - maven-resolver-transport-file - ${maven-resolver.version} - - - org.apache.maven.resolver - maven-resolver-transport-http - ${maven-resolver.version} - - - org.apache.maven.resolver - maven-resolver-impl - ${maven-resolver.version} - - - org.apache.maven.shared - maven-common-artifact-filters - 3.1.0 - - - org.apache.maven.plugins - maven-shade-plugin - ${maven-shade-plugin.version} - - - org.apache.maven.plugin-tools - maven-plugin-annotations - 3.6.0 - - - org.codehaus.plexus - plexus-archiver - 3.7.0 - - - org.codehaus.plexus - plexus-utils - 3.1.0 - - - org.sonatype.plexus - plexus-build-api - 0.0.7 - - - org.spockframework - spock-core - ${spock.version} - - - org.spockframework - spock-spring - ${spock.version} - - - org.testcontainers - testcontainers-bom - ${testcontainers.version} - import - pom - - - org.testng - testng - ${testng.version} - - - org.zeroturnaround - zt-zip - 1.13 - - - - - - - org.junit.jupiter - junit-jupiter - test - - - org.junit.vintage - junit-vintage-engine - test - - - org.hamcrest - hamcrest-core - - - - - org.mockito - mockito-junit-jupiter - test - - - org.assertj - assertj-core - test - - - org.mockito - mockito-core - test - - - org.hamcrest - hamcrest - test - - - org.springframework - spring-test - test - - - - - - - com.googlecode.maven-download-plugin - download-maven-plugin - 1.4.2 - - - org.jetbrains.kotlin - kotlin-maven-plugin - ${kotlin.version} - - ${java.version} - true - - - - org.asciidoctor - asciidoctor-maven-plugin - 1.6.0 - - - org.asciidoctor - asciidoctorj-pdf - 1.5.0-alpha.18 - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - - integration-test - verify - - - - - - org.apache.maven.plugins - maven-plugin-plugin - 3.6.0 - - - org.basepom.maven - duplicate-finder-maven-plugin - 1.3.0 - - - org.codehaus.cargo - cargo-maven2-plugin - 1.7.7 - - - org.codehaus.gmavenplus - gmavenplus-plugin - 1.8.0 - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - regex-property - - regex-property - - - modulename - ${project.artifactId} - - - . - true - - - - - - org.codehaus.mojo - flatten-maven-plugin - true - - - - flatten - process-resources - - flatten - - - true - oss - - expand - remove - remove - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - true - - - - org.apache.maven.plugins - maven-enforcer-plugin - - - enforce-rules - - enforce - - - - - - com.zaxxer:HikariCP-* - org.hamcrest:hamcrest-* - javax.*:*:* - - - javax.batch:*:* - javax.cache:*:* - javax.inject:*:* - javax.money:*:* - - true - - - [1.8,) - - - [3.5.0,) - - - main.basedir - - - project.name - - - project.description - - - true - - - true - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - false - - false - false - - - ${project.name} - ${modulename} - ${project.version} - Spring - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*Tests.java - - - **/Abstract*.java - - - file:/dev/./urandom - true - - -Xmx1024m - false - true - alphabetical - - - - org.apache.maven.plugins - maven-war-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar-no-fork - - - - - - - - - fast - - - fast - - - - true - - - - full - - - full - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - ${java.version} - - - - attach-javadocs - - jar - - true - - - - - org.apache.commons - commons-lang3 - 3.7 - - - - - - - - eclipse.profile - - - m2e.version - - - - false - false - false - false - - - - diff --git a/spring-boot-project/spring-boot-properties-migrator/build.gradle b/spring-boot-project/spring-boot-properties-migrator/build.gradle new file mode 100644 index 000000000000..5ef68ecb1030 --- /dev/null +++ b/spring-boot-project/spring-boot-properties-migrator/build.gradle @@ -0,0 +1,18 @@ +plugins { + id 'java-library' + id 'maven-publish' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Properties Migrator' + +dependencies { + implementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + implementation project(':spring-boot-project:spring-boot') + implementation project(':spring-boot-project:spring-boot-tools:spring-boot-configuration-metadata') + + testImplementation project(':spring-boot-project:spring-boot-test') + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.assertj:assertj-core' + testImplementation 'org.springframework:spring-test' +} \ No newline at end of file diff --git a/spring-boot-project/spring-boot-properties-migrator/pom.xml b/spring-boot-project/spring-boot-properties-migrator/pom.xml deleted file mode 100644 index da34e62b70e3..000000000000 --- a/spring-boot-project/spring-boot-properties-migrator/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-parent - ${revision} - ../spring-boot-parent - - spring-boot-properties-migrator - Spring Boot Properties Migrator - Spring Boot Properties Migrator - - ${basedir}/../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - org.springframework.boot - spring-boot - - - org.springframework.boot - spring-boot-configuration-metadata - - - - org.springframework.boot - spring-boot-test - test - - - diff --git a/spring-boot-project/spring-boot-starters/pom.xml b/spring-boot-project/spring-boot-starters/pom.xml deleted file mode 100644 index 6bffde0ba0fb..000000000000 --- a/spring-boot-project/spring-boot-starters/pom.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-parent - ${revision} - ../spring-boot-parent - - spring-boot-starters - pom - Spring Boot Starters - Spring Boot Starters - - ${basedir}/../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - spring-boot-starter - spring-boot-starter-activemq - spring-boot-starter-amqp - spring-boot-starter-aop - spring-boot-starter-artemis - spring-boot-starter-batch - spring-boot-starter-cache - spring-boot-starter-cloud-connectors - spring-boot-starter-data-cassandra - spring-boot-starter-data-cassandra-reactive - spring-boot-starter-data-couchbase - spring-boot-starter-data-couchbase-reactive - spring-boot-starter-data-elasticsearch - spring-boot-starter-data-jdbc - spring-boot-starter-data-jpa - spring-boot-starter-data-ldap - spring-boot-starter-data-mongodb - spring-boot-starter-data-mongodb-reactive - spring-boot-starter-data-neo4j - spring-boot-starter-data-redis - spring-boot-starter-data-redis-reactive - spring-boot-starter-data-rest - spring-boot-starter-data-solr - spring-boot-starter-freemarker - spring-boot-starter-groovy-templates - spring-boot-starter-hateoas - spring-boot-starter-integration - spring-boot-starter-jdbc - spring-boot-starter-jersey - spring-boot-starter-jetty - spring-boot-starter-jooq - spring-boot-starter-json - spring-boot-starter-jta-atomikos - spring-boot-starter-jta-bitronix - spring-boot-starter-logging - spring-boot-starter-log4j2 - spring-boot-starter-mail - spring-boot-starter-mustache - spring-boot-starter-actuator - spring-boot-starter-oauth2-client - spring-boot-starter-oauth2-resource-server - spring-boot-starter-parent - spring-boot-starter-quartz - spring-boot-starter-reactor-netty - spring-boot-starter-rsocket - spring-boot-starter-security - spring-boot-starter-test - spring-boot-starter-thymeleaf - spring-boot-starter-tomcat - spring-boot-starter-undertow - spring-boot-starter-validation - spring-boot-starter-web - spring-boot-starter-webflux - spring-boot-starter-websocket - spring-boot-starter-web-services - - - - - org.apache.maven.plugins - maven-enforcer-plugin - - - enforce-rules - - enforce - - - - - - commons-logging:*:* - org.hibernate:hibernate-validator:* - - true - - - - true - - - - - - maven-assembly-plugin - false - - - assemble-starter-poms - generate-resources - - single - - - - src/main/assembly/starter-poms-assembly.xml - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - - checkstyle-validation - validate - - check - - - true - - - - - - org.apache.maven.plugins - maven-source-plugin - - true - - - - org.basepom.maven - duplicate-finder-maven-plugin - - - duplicate-dependencies - validate - - check - - - true - - .*module-info - - - changelog.txt - about.html - - - - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-activemq/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-activemq/build.gradle new file mode 100644 index 000000000000..aac1103f14ae --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-activemq/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for JMS messaging using Apache ActiveMQ" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.springframework:spring-jms' + api ('org.apache.activemq:activemq-broker') { + exclude group: 'org.apache.geronimo.specs', module: 'geronimo-jms_1.1_spec' + } + api 'jakarta.jms:jakarta.jms-api' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-activemq/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-activemq/pom.xml deleted file mode 100644 index 11bfe14e5be7..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-activemq/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-activemq - Spring Boot ActiveMQ Starter - Starter for JMS messaging using Apache ActiveMQ - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework - spring-jms - - - org.apache.activemq - activemq-broker - - - geronimo-jms_1.1_spec - org.apache.geronimo.specs - - - - - jakarta.jms - jakarta.jms-api - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-actuator/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-actuator/build.gradle new file mode 100644 index 000000000000..96a273b712ec --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-actuator/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Spring Boot's Actuator which provides production ready features to help you monitor and manage your application" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api project(':spring-boot-project:spring-boot-actuator-autoconfigure') + api 'io.micrometer:micrometer-core' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-actuator/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-actuator/pom.xml deleted file mode 100644 index c381b6c5df3e..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-actuator/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-actuator - Spring Boot Actuator Starter - Starter for using Spring Boot's Actuator which provides production - ready features to help you monitor and manage your application - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-actuator-autoconfigure - - - io.micrometer - micrometer-core - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-amqp/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-amqp/build.gradle new file mode 100644 index 000000000000..83197a3b1882 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-amqp/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Spring AMQP and Rabbit MQ" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.springframework:spring-messaging' + api 'org.springframework.amqp:spring-rabbit' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-amqp/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-amqp/pom.xml deleted file mode 100644 index d3d470ad7093..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-amqp/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-amqp - Spring Boot AMQP Starter - Starter for using Spring AMQP and Rabbit MQ - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework - spring-messaging - - - org.springframework.amqp - spring-rabbit - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-aop/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-aop/build.gradle new file mode 100644 index 000000000000..c5959cadb6cc --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-aop/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for aspect-oriented programming with Spring AOP and AspectJ" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.springframework:spring-aop' + api 'org.aspectj:aspectjweaver' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-aop/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-aop/pom.xml deleted file mode 100644 index bb697fb54fba..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-aop/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-aop - Spring Boot AOP Starter - Starter for aspect-oriented programming with Spring AOP and AspectJ - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework - spring-aop - - - org.aspectj - aspectjweaver - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/build.gradle new file mode 100644 index 000000000000..033a409c9303 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/build.gradle @@ -0,0 +1,18 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for JMS messaging using Apache Artemis" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'jakarta.jms:jakarta.jms-api' + api 'jakarta.json:jakarta.json-api' + api 'org.springframework:spring-jms' + api ('org.apache.activemq:artemis-jms-client') { + exclude group: 'commons-logging', module: 'commons-logging' + exclude group: 'org.apache.geronimo.specs', module: 'geronimo-jms_2.0_spec' + exclude group: 'org.apache.geronimo.specs', module: 'geronimo-json_1.0_spec' + } +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/pom.xml deleted file mode 100644 index e9d8dffdddd4..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-artemis - Spring Boot Artemis Starter - Starter for JMS messaging using Apache Artemis - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework - spring-jms - - - org.apache.activemq - artemis-jms-client - - - geronimo-jms_2.0_spec - org.apache.geronimo.specs - - - - - jakarta.jms - jakarta.jms-api - - - jakarta.json - jakarta.json-api - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-batch/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-batch/build.gradle new file mode 100644 index 000000000000..36eeadbba9cc --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-batch/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Spring Batch" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jdbc') + api 'org.springframework.batch:spring-batch-core' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-batch/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-batch/pom.xml deleted file mode 100644 index 24d24994959c..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-batch/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-batch - Spring Boot Batch Starter - Starter for using Spring Batch - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-jdbc - - - org.springframework.batch - spring-batch-core - - - - - - org.basepom.maven - duplicate-finder-maven-plugin - - - duplicate-dependencies - validate - - check - - - - - - - xpp3 - xpp3_min - - - xmlpull - xmlpull - - - - - - - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-cache/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-cache/build.gradle new file mode 100644 index 000000000000..14614a195d27 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-cache/build.gradle @@ -0,0 +1,11 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Spring Framework's caching support" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.springframework:spring-context-support' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-cache/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-cache/pom.xml deleted file mode 100644 index 45c6796929d3..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-cache/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-cache - Spring Boot Cache Starter - Starter for using Spring Framework's caching support - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework - spring-context-support - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-cloud-connectors/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-cloud-connectors/build.gradle new file mode 100644 index 000000000000..50400b156608 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-cloud-connectors/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Spring Cloud Connectors which simplifies connecting to services in cloud platforms like Cloud Foundry and Heroku" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.springframework.cloud:spring-cloud-spring-service-connector' + api 'org.springframework.cloud:spring-cloud-cloudfoundry-connector' + api 'org.springframework.cloud:spring-cloud-heroku-connector' + api 'org.springframework.cloud:spring-cloud-localconfig-connector' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-cloud-connectors/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-cloud-connectors/pom.xml deleted file mode 100644 index 012ad1756700..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-cloud-connectors/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-cloud-connectors - Spring Boot Spring Cloud Connectors Starter - Starter for using Spring Cloud Connectors which simplifies connecting - to services in cloud platforms like Cloud Foundry and Heroku. Deprecated in - favor of Java CFEnv - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.cloud - spring-cloud-spring-service-connector - - - org.springframework.cloud - spring-cloud-cloudfoundry-connector - - - org.springframework.cloud - spring-cloud-heroku-connector - - - org.springframework.cloud - spring-cloud-localconfig-connector - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-cassandra-reactive/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-cassandra-reactive/build.gradle new file mode 100644 index 000000000000..0f870c33e62f --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-cassandra-reactive/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Cassandra distributed database and Spring Data Cassandra Reactive" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.springframework:spring-tx' + api 'org.springframework.data:spring-data-cassandra' + api 'io.projectreactor:reactor-core' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-cassandra-reactive/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-cassandra-reactive/pom.xml deleted file mode 100644 index 8202656b75eb..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-cassandra-reactive/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-data-cassandra-reactive - Spring Boot Data Cassandra Reactive Starter - Starter for using Cassandra distributed database and Spring Data - Cassandra Reactive - - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework - spring-tx - - - org.springframework.data - spring-data-cassandra - - - org.slf4j - jcl-over-slf4j - - - - - io.projectreactor - reactor-core - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-cassandra/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-cassandra/build.gradle new file mode 100644 index 000000000000..06219aed300f --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-cassandra/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Cassandra distributed database and Spring Data Cassandra" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.springframework:spring-tx' + api 'org.springframework.data:spring-data-cassandra' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-cassandra/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-cassandra/pom.xml deleted file mode 100644 index 12524d9c2d1f..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-cassandra/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-data-cassandra - Spring Boot Data Cassandra Starter - Starter for using Cassandra distributed database and Spring Data - Cassandra - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework - spring-tx - - - org.springframework.data - spring-data-cassandra - - - org.slf4j - jcl-over-slf4j - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase-reactive/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase-reactive/build.gradle new file mode 100644 index 000000000000..b2969f80c3b4 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase-reactive/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Couchbase document-oriented database and Spring Data Couchbase Reactive" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'io.projectreactor:reactor-core' + api 'io.reactivex:rxjava-reactive-streams' + api ('org.springframework.data:spring-data-couchbase') { + exclude group: 'com.couchbase.client', module: 'encryption' + } +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase-reactive/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase-reactive/pom.xml deleted file mode 100644 index 6e159e0447ad..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase-reactive/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-data-couchbase-reactive - Spring Boot Data Couchbase Reactive Starter - Starter for using Couchbase document-oriented database and Spring Data - Couchbase Reactive - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.data - spring-data-couchbase - - - org.slf4j - jcl-over-slf4j - - - com.couchbase.mock - CouchbaseMock - - - com.couchbase.client - encryption - - - - - io.projectreactor - reactor-core - - - io.reactivex - rxjava-reactive-streams - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase/build.gradle new file mode 100644 index 000000000000..b551d5888032 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Couchbase document-oriented database and Spring Data Couchbase" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api ('org.springframework.data:spring-data-couchbase') { + exclude group: 'com.couchbase.client', module: 'encryption' + } +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase/pom.xml deleted file mode 100644 index 62f40f704acc..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - 4.0.0 - - spring-boot-starters - org.springframework.boot - ${revision} - - spring-boot-starter-data-couchbase - Spring Boot Data Couchbase Starter - Starter for using Couchbase document-oriented database and Spring Data - Couchbase - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.data - spring-data-couchbase - - - org.slf4j - jcl-over-slf4j - - - com.couchbase.mock - CouchbaseMock - - - com.couchbase.client - encryption - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-elasticsearch/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-elasticsearch/build.gradle new file mode 100644 index 000000000000..bc78b8ba5084 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-elasticsearch/build.gradle @@ -0,0 +1,11 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Elasticsearch search and analytics engine and Spring Data Elasticsearch" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.springframework.data:spring-data-elasticsearch' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-elasticsearch/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-elasticsearch/pom.xml deleted file mode 100644 index 18e4b779b797..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-elasticsearch/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-data-elasticsearch - Spring Boot Data Elasticsearch Starter - Starter for using Elasticsearch search and analytics engine and Spring - Data Elasticsearch - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.data - spring-data-elasticsearch - - - org.slf4j - jcl-over-slf4j - - - org.apache.logging.log4j - log4j-core - - - - - - - - org.basepom.maven - duplicate-finder-maven-plugin - - - duplicate-dependencies - validate - - check - - - - org.joda.time.base.BaseDateTime - .*module-info - - - changelog.txt - - - - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jdbc/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jdbc/build.gradle new file mode 100644 index 000000000000..010e9a905efe --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jdbc/build.gradle @@ -0,0 +1,11 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Spring Data JDBC" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jdbc') + api 'org.springframework.data:spring-data-jdbc' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jdbc/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jdbc/pom.xml deleted file mode 100644 index 0e6e909c8c18..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jdbc/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-data-jdbc - Spring Boot Data JDBC Starter - Starter for using Spring Data JDBC - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter-jdbc - - - org.springframework.data - spring-data-jdbc - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jpa/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jpa/build.gradle new file mode 100644 index 000000000000..0b74593c60ee --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jpa/build.gradle @@ -0,0 +1,23 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Spring Data JPA with Hibernate" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-aop') + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jdbc') + api 'jakarta.transaction:jakarta.transaction-api' + api 'jakarta.persistence:jakarta.persistence-api' + api ('org.hibernate:hibernate-core') { + exclude group: 'javax.activation', module: 'javax.activation-api' + exclude group: 'javax.persistence', module: 'javax.persistence-api' + exclude group: 'javax.xml.bind', module: 'jaxb-api' + exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.2_spec' + } + api ('org.springframework.data:spring-data-jpa') { + exclude group: 'org.aspectj', module: 'aspectjrt' + } + api 'org.springframework:spring-aspects' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jpa/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jpa/pom.xml deleted file mode 100644 index 1a4c0ba8fcbb..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jpa/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-data-jpa - Spring Boot Data JPA Starter - Starter for using Spring Data JPA with Hibernate - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter-aop - - - org.springframework.boot - spring-boot-starter-jdbc - - - jakarta.activation - jakarta.activation-api - - - jakarta.persistence - jakarta.persistence-api - - - jakarta.transaction - jakarta.transaction-api - - - org.hibernate - hibernate-core - - - org.jboss.spec.javax.transaction - jboss-transaction-api_1.2_spec - - - javax.activation - javax.activation-api - - - javax.persistence - javax.persistence-api - - - javax.xml.bind - jaxb-api - - - - - org.springframework.data - spring-data-jpa - - - org.aspectj - aspectjrt - - - org.slf4j - jcl-over-slf4j - - - - - org.springframework - spring-aspects - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-ldap/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-ldap/build.gradle new file mode 100644 index 000000000000..397e51d579c8 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-ldap/build.gradle @@ -0,0 +1,11 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Spring Data LDAP" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.springframework.data:spring-data-ldap' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-ldap/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-ldap/pom.xml deleted file mode 100644 index fbdda52b11a9..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-ldap/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - - spring-boot-starters - org.springframework.boot - ${revision} - - spring-boot-starter-data-ldap - Spring Boot Data LDAP Starter - Starter for using Spring Data LDAP - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.data - spring-data-ldap - - - org.slf4j - jcl-over-slf4j - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-mongodb-reactive/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-mongodb-reactive/build.gradle new file mode 100644 index 000000000000..e32f7f97a349 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-mongodb-reactive/build.gradle @@ -0,0 +1,17 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using MongoDB document-oriented database and Spring Data MongoDB Reactive" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'io.projectreactor:reactor-core' + api 'org.mongodb:mongodb-driver' + api 'org.mongodb:mongodb-driver-async' + api 'org.mongodb:mongodb-driver-reactivestreams' + api ('org.springframework.data:spring-data-mongodb') { + exclude group: 'org.mongodb', module: 'mongo-java-driver' + } +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-mongodb-reactive/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-mongodb-reactive/pom.xml deleted file mode 100644 index 54162c3f1a65..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-mongodb-reactive/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-data-mongodb-reactive - Spring Boot Data MongoDB Reactive Starter - Starter for using MongoDB document-oriented database and Spring Data - MongoDB Reactive - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.data - spring-data-mongodb - - - org.mongodb - mongo-java-driver - - - org.slf4j - jcl-over-slf4j - - - - - org.mongodb - mongodb-driver - - - org.mongodb - mongodb-driver-async - - - org.mongodb - mongodb-driver-reactivestreams - - - io.projectreactor - reactor-core - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-mongodb/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-mongodb/build.gradle new file mode 100644 index 000000000000..b6b001fc8455 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-mongodb/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using MongoDB document-oriented database and Spring Data MongoDB" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.mongodb:mongodb-driver' + api ('org.springframework.data:spring-data-mongodb') { + exclude group: 'org.mongodb', module: 'mongo-java-driver' + } +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-mongodb/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-mongodb/pom.xml deleted file mode 100644 index 0c6824c04d4d..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-mongodb/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-data-mongodb - Spring Boot Data MongoDB Starter - Starter for using MongoDB document-oriented database and Spring Data - MongoDB - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.mongodb - mongodb-driver - - - org.springframework.data - spring-data-mongodb - - - org.mongodb - mongo-java-driver - - - org.slf4j - jcl-over-slf4j - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-neo4j/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-neo4j/build.gradle new file mode 100644 index 000000000000..b4fabd9c6617 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-neo4j/build.gradle @@ -0,0 +1,11 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Neo4j graph database and Spring Data Neo4j" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.springframework.data:spring-data-neo4j' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-neo4j/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-neo4j/pom.xml deleted file mode 100644 index 5beaa0a27145..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-neo4j/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-data-neo4j - Spring Boot Data Neo4j Starter - Starter for using Neo4j graph database and Spring Data Neo4j - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.data - spring-data-neo4j - - - org.slf4j - jcl-over-slf4j - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis-reactive/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis-reactive/build.gradle new file mode 100644 index 000000000000..6c1219bd4d95 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis-reactive/build.gradle @@ -0,0 +1,10 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Redis key-value data store with Spring Data Redis reactive and the Lettuce client" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-redis') +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis-reactive/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis-reactive/pom.xml deleted file mode 100644 index adef6cad1ba2..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis-reactive/pom.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-data-redis-reactive - Spring Boot Data Redis Reactive Starter - Starter for using Redis key-value data store with Spring Data Redis - reactive and the Lettuce client - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter-data-redis - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis/build.gradle new file mode 100644 index 000000000000..34dd4d4a10e7 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Redis key-value data store with Spring Data Redis and the Lettuce client" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.springframework.data:spring-data-redis' + api 'io.lettuce:lettuce-core' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis/pom.xml deleted file mode 100644 index 84b5b9e36105..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-data-redis - Spring Boot Data Redis Starter - Starter for using Redis key-value data store with Spring Data Redis and - the Lettuce client - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.data - spring-data-redis - - - org.slf4j - jcl-over-slf4j - - - - - io.lettuce - lettuce-core - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-rest/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-rest/build.gradle new file mode 100644 index 000000000000..6258a7bb8df0 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-rest/build.gradle @@ -0,0 +1,11 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for exposing Spring Data repositories over REST using Spring Data REST" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + api 'org.springframework.data:spring-data-rest-webmvc' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-rest/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-rest/pom.xml deleted file mode 100644 index fb21cd4b301b..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-rest/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-data-rest - Spring Boot Data REST Starter - Starter for exposing Spring Data repositories over REST using Spring - Data REST - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.data - spring-data-rest-webmvc - - - org.slf4j - jcl-over-slf4j - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-solr/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-solr/build.gradle new file mode 100644 index 000000000000..287a62e3b622 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-solr/build.gradle @@ -0,0 +1,17 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using the Apache Solr search platform with Spring Data Solr" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api ('org.apache.solr:solr-solrj') { + exclude group: 'org.slf4j', module: 'jcl-over-slf4j' + } + api 'org.springframework.data:spring-data-solr' + api ('org.apache.httpcomponents:httpmime') { + exclude group: 'commons-logging', module: 'commons-logging' + } +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-solr/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-data-solr/pom.xml deleted file mode 100644 index 87c474c8ad3c..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-data-solr/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-data-solr - Spring Boot Data Solr Starter - Starter for using the Apache Solr search platform with Spring Data - Solr - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.apache.solr - solr-solrj - - - org.springframework.data - spring-data-solr - - - org.slf4j - jcl-over-slf4j - - - - - org.apache.httpcomponents - httpmime - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-freemarker/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-freemarker/build.gradle new file mode 100644 index 000000000000..e6151b55d3b8 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-freemarker/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for building MVC web applications using FreeMarker views" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.freemarker:freemarker' + api 'org.springframework:spring-context-support' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-freemarker/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-freemarker/pom.xml deleted file mode 100644 index f480476e4425..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-freemarker/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-freemarker - Spring Boot FreeMarker Starter - Starter for building MVC web applications using FreeMarker views - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.freemarker - freemarker - - - org.springframework - spring-context-support - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-groovy-templates/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-groovy-templates/build.gradle new file mode 100644 index 000000000000..640b44e5f658 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-groovy-templates/build.gradle @@ -0,0 +1,11 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for building MVC web applications using Groovy Templates views" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + api 'org.codehaus.groovy:groovy-templates' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-groovy-templates/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-groovy-templates/pom.xml deleted file mode 100644 index 0ab1b3459e5c..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-groovy-templates/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-groovy-templates - Spring Boot Groovy Templates Starter - Starter for building MVC web applications using Groovy Templates views - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter-web - - - org.codehaus.groovy - groovy-templates - - - - - - org.basepom.maven - duplicate-finder-maven-plugin - - - duplicate-dependencies - validate - - check - - - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-hateoas/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-hateoas/build.gradle new file mode 100644 index 000000000000..ca4129e0f09b --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-hateoas/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for building hypermedia-based RESTful web application with Spring MVC and Spring HATEOAS" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + api 'org.springframework.hateoas:spring-hateoas' + api 'org.springframework.plugin:spring-plugin-core' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-hateoas/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-hateoas/pom.xml deleted file mode 100644 index d23fa1563ad7..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-hateoas/pom.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-hateoas - Spring Boot HATEOAS Starter - Starter for building hypermedia-based RESTful web application with - Spring MVC and Spring HATEOAS - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.hateoas - spring-hateoas - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-integration/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-integration/build.gradle new file mode 100644 index 000000000000..7141809230f0 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-integration/build.gradle @@ -0,0 +1,11 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Spring Integration" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-aop') + api 'org.springframework.integration:spring-integration-core' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-integration/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-integration/pom.xml deleted file mode 100644 index 6918380b3f42..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-integration/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-integration - Spring Boot Integration Starter - Starter for using Spring Integration - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter-aop - - - org.springframework.integration - spring-integration-core - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-jdbc/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-jdbc/build.gradle new file mode 100644 index 000000000000..71132155c6a7 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-jdbc/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using JDBC with the HikariCP connection pool" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'com.zaxxer:HikariCP' + api 'org.springframework:spring-jdbc' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-jdbc/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-jdbc/pom.xml deleted file mode 100644 index 5c1a9978583f..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-jdbc/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-jdbc - Spring Boot JDBC Starter - Starter for using JDBC with the HikariCP connection pool - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - com.zaxxer - HikariCP - - - org.springframework - spring-jdbc - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-jersey/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-jersey/build.gradle new file mode 100644 index 000000000000..dc8b36a02e42 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-jersey/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for building RESTful web applications using JAX-RS and Jersey. An alternative to spring-boot-starter-web" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-json') + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat') + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-validation') + api 'org.springframework:spring-web' + api 'org.glassfish.jersey.core:jersey-server' + api 'org.glassfish.jersey.containers:jersey-container-servlet-core' + api 'org.glassfish.jersey.containers:jersey-container-servlet' + api ('org.glassfish.jersey.ext:jersey-bean-validation') { + exclude group: 'jakarta.el', module: 'jakarta.el-api' + exclude group: 'org.glassfish', module: 'jakarta.el' + } + api 'org.glassfish.jersey.ext:jersey-spring4' + api 'org.glassfish.jersey.media:jersey-media-json-jackson' +} + +checkRuntimeClasspathForConflicts { + ignore { name -> name.startsWith('org/aopalliance/intercept/') } + ignore { name -> name.startsWith('org/aopalliance/aop/') } +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-jersey/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-jersey/pom.xml deleted file mode 100644 index ee33ee1264e2..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-jersey/pom.xml +++ /dev/null @@ -1,176 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-jersey - Spring Boot Jersey Starter - Starter for building RESTful web applications using JAX-RS and Jersey. - An alternative to spring-boot-starter-web - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter-json - - - org.springframework.boot - spring-boot-starter-tomcat - - - org.springframework.boot - spring-boot-starter-validation - - - jakarta.annotation - jakarta.annotation-api - - - jakarta.ws.rs - jakarta.ws.rs-api - - - org.springframework - spring-web - - - org.glassfish.jersey.core - jersey-server - - - javax.validation - validation-api - - - - - org.glassfish.jersey.containers - jersey-container-servlet-core - - - org.glassfish.hk2.external - jakarta.inject - - - - - org.glassfish.jersey.containers - jersey-container-servlet - - - javax.ws.rs - javax.ws.rs-api - - - - - org.glassfish.jersey.ext - jersey-bean-validation - - - javax.validation - validation-api - - - org.glassfish - jakarta.el - - - org.hibernate - hibernate-validator - - - jakarta.el - jakarta.el-api - - - - - org.glassfish.jersey.ext - jersey-spring5 - - - org.jvnet - tiger-types - - - org.glassfish.hk2.external - bean-validator - - - org.hibernate - hibernate-validator - - - - - org.glassfish.jersey.media - jersey-media-json-jackson - - - jakarta.activation - jakarta.activation-api - - - - - jakarta.xml.bind - jakarta.xml.bind-api - - - - - - org.basepom.maven - duplicate-finder-maven-plugin - - - duplicate-dependencies - validate - - check - - - - org.aopalliance.* - javax.annotation.* - .*module-info - - - - - - - - - - jdk11+ - - [11,) - - - - jakarta.xml.bind - jakarta.xml.bind-api - - - jakarta.activation - jakarta.activation-api - - - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/build.gradle new file mode 100644 index 000000000000..c44bae26787b --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/build.gradle @@ -0,0 +1,25 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Jetty as the embedded servlet container. An alternative to spring-boot-starter-tomcat" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api 'jakarta.servlet:jakarta.servlet-api' + api 'jakarta.websocket:jakarta.websocket-api' + api 'org.eclipse.jetty:jetty-servlets' + api ('org.eclipse.jetty:jetty-webapp') { + exclude group: 'javax.servlet', module: 'javax.servlet-api' + } + api ('org.eclipse.jetty.websocket:websocket-server') { + exclude group: 'javax.servlet', module: 'javax.servlet-api' + } + api ('org.eclipse.jetty.websocket:javax-websocket-server-impl') { + exclude group: 'javax.annotation', module: 'javax.annotation-api' + exclude group: 'javax.servlet', module: 'javax.servlet-api' + exclude group: 'javax.websocket', module: 'javax.websocket-api' + exclude group: 'javax.websocket', module: 'javax.websocket-client-api' + } + api 'org.mortbay.jasper:apache-el' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/pom.xml deleted file mode 100644 index f9bf5d3a8634..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/pom.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-jetty - Spring Boot Jetty Starter - Starter for using Jetty as the embedded servlet container. An - alternative to spring-boot-starter-tomcat - - ${basedir}/../../.. - 3.1.0 - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - jakarta.servlet - jakarta.servlet-api - - - jakarta.websocket - jakarta.websocket-api - - - org.eclipse.jetty - jetty-servlets - - - org.eclipse.jetty - jetty-webapp - - - javax.servlet - javax.servlet-api - - - - - org.eclipse.jetty.websocket - websocket-server - - - javax.servlet - javax.servlet-api - - - - - org.eclipse.jetty.websocket - javax-websocket-server-impl - - - javax.annotation - javax.annotation-api - - - javax.websocket - javax.websocket-client-api - - - javax.websocket - javax.websocket-api - - - org.eclipse.jetty - jetty-jndi - - - - - org.mortbay.jasper - apache-el - - - - - - org.basepom.maven - duplicate-finder-maven-plugin - - - duplicate-dependencies - validate - - check - - - - .*module-info - - - about.html - - - - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-jooq/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-jooq/build.gradle new file mode 100644 index 000000000000..244f4391f70c --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-jooq/build.gradle @@ -0,0 +1,17 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using jOOQ to access SQL databases. An alternative to spring-boot-starter-data-jpa or spring-boot-starter-jdbc" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jdbc') + api 'jakarta.activation:jakarta.activation-api' + api 'jakarta.xml.bind:jakarta.xml.bind-api' + api 'org.springframework:spring-tx' + api ('org.jooq:jooq') { + exclude group: 'javax.activation', module: 'javax.activation-api' + exclude group: 'javax.xml.bind', module: 'jaxb-api' + } +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-jooq/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-jooq/pom.xml deleted file mode 100644 index 0d938f17ddcd..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-jooq/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-jooq - Spring Boot JOOQ Starter - Starter for using jOOQ to access SQL databases. An alternative to - spring-boot-starter-data-jpa or spring-boot-starter-jdbc - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter-jdbc - - - jakarta.activation - jakarta.activation-api - - - jakarta.xml.bind - jakarta.xml.bind-api - - - org.springframework - spring-tx - - - org.jooq - jooq - - - javax.activation - javax.activation-api - - - javax.xml.bind - jaxb-api - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-json/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-json/build.gradle new file mode 100644 index 000000000000..3d2633702bd1 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-json/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for reading and writing json" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.springframework:spring-web' + api 'com.fasterxml.jackson.core:jackson-databind' + api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8' + api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310' + api 'com.fasterxml.jackson.module:jackson-module-parameter-names' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-json/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-json/pom.xml deleted file mode 100644 index ba198fc5f178..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-json/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-json - Spring Boot Json Starter - Starter for reading and writing json - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework - spring-web - - - com.fasterxml.jackson.core - jackson-databind - - - com.fasterxml.jackson.datatype - jackson-datatype-jdk8 - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - - - com.fasterxml.jackson.module - jackson-module-parameter-names - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-atomikos/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-atomikos/build.gradle new file mode 100644 index 000000000000..9dbb58221695 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-atomikos/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for JTA transactions using Atomikos" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'com.atomikos:transactions-jms' + api 'com.atomikos:transactions-jta' + api 'com.atomikos:transactions-jdbc' + api 'jakarta.transaction:jakarta.transaction-api' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-atomikos/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-atomikos/pom.xml deleted file mode 100644 index 952efd70e16f..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-atomikos/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-jta-atomikos - Spring Boot Atomikos JTA Starter - Starter for JTA transactions using Atomikos - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - com.atomikos - transactions-jms - - - com.atomikos - transactions-jta - - - org.apache.geronimo.specs - geronimo-jta_1.0.1B_spec - - - - - com.atomikos - transactions-jdbc - - - jakarta.transaction - jakarta.transaction-api - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-bitronix/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-bitronix/build.gradle new file mode 100644 index 000000000000..81967090902d --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-bitronix/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for JTA transactions using Bitronix" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'jakarta.jms:jakarta.jms-api' + api 'jakarta.transaction:jakarta.transaction-api' + api ('org.codehaus.btm:btm') { + exclude group: 'javax.transaction', module: 'jta' + } +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-bitronix/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-bitronix/pom.xml deleted file mode 100644 index 374205006a1b..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-bitronix/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-jta-bitronix - Spring Boot Bitronix JTA Starter - Starter for JTA transactions using Bitronix - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - jakarta.jms - jakarta.jms-api - - - jakarta.transaction - jakarta.transaction-api - - - org.codehaus.btm - btm - - - javax.transaction - jta - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-log4j2/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-log4j2/build.gradle new file mode 100644 index 000000000000..5490015749d1 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-log4j2/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Log4j2 for logging. An alternative to spring-boot-starter-logging" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api 'org.apache.logging.log4j:log4j-slf4j-impl' + api 'org.apache.logging.log4j:log4j-core' + api 'org.apache.logging.log4j:log4j-jul' + api 'org.slf4j:jul-to-slf4j' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-log4j2/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-log4j2/pom.xml deleted file mode 100644 index 3f6bb33c49fc..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-log4j2/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-log4j2 - Spring Boot Log4j 2 Starter - Starter for using Log4j2 for logging. An alternative to - spring-boot-starter-logging - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.apache.logging.log4j - log4j-slf4j-impl - - - org.apache.logging.log4j - log4j-core - - - org.apache.logging.log4j - log4j-jul - - - org.slf4j - jul-to-slf4j - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-logging/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-logging/build.gradle new file mode 100644 index 000000000000..a38b29fd62ed --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-logging/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for logging using Logback. Default logging starter" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api 'ch.qos.logback:logback-classic' + api 'org.apache.logging.log4j:log4j-to-slf4j' + api 'org.slf4j:jul-to-slf4j' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-logging/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-logging/pom.xml deleted file mode 100644 index 80dc82f26f82..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-logging/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-logging - Spring Boot Logging Starter - Starter for logging using Logback. Default logging starter - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - ch.qos.logback - logback-classic - - - org.apache.logging.log4j - log4j-to-slf4j - - - org.slf4j - jul-to-slf4j - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-mail/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-mail/build.gradle new file mode 100644 index 000000000000..641440d7be7e --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-mail/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Java Mail and Spring Framework's email sending support" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.springframework:spring-context-support' + api 'com.sun.mail:jakarta.mail' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-mail/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-mail/pom.xml deleted file mode 100644 index 2378dfa55156..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-mail/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-mail - Spring Boot Mail Starter - Starter for using Java Mail and Spring Framework's email sending - support - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework - spring-context-support - - - com.sun.mail - jakarta.mail - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-mustache/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-mustache/build.gradle new file mode 100644 index 000000000000..83a4f7c7ed38 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-mustache/build.gradle @@ -0,0 +1,11 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for building web applications using Mustache views" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'com.samskivert:jmustache' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-mustache/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-mustache/pom.xml deleted file mode 100644 index c71dcaa464e3..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-mustache/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-mustache - Spring Boot Mustache Starter - Starter for building web applications using Mustache views - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - com.samskivert - jmustache - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-oauth2-client/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-oauth2-client/build.gradle new file mode 100644 index 000000000000..d31b8573ae31 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-oauth2-client/build.gradle @@ -0,0 +1,17 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Spring Security's OAuth2/OpenID Connect client features" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'com.sun.mail:jakarta.mail' + api 'org.springframework.security:spring-security-config' + api 'org.springframework.security:spring-security-core' + api ('org.springframework.security:spring-security-oauth2-client') { + exclude group: 'com.sun.mail', module: 'javax.mail' + } + api 'org.springframework.security:spring-security-oauth2-jose' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-oauth2-client/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-oauth2-client/pom.xml deleted file mode 100644 index 63ecdd1d49e5..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-oauth2-client/pom.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-oauth2-client - Spring Boot OAuth2/OpenID Connect Client Starter - Starter for using Spring Security's OAuth2/OpenID Connect client features - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - com.sun.mail - jakarta.mail - - - org.springframework.security - spring-security-config - - - org.springframework.security - spring-security-core - - - org.springframework.security - spring-security-oauth2-client - - - com.sun.mail - javax.mail - - - - - org.springframework.security - spring-security-oauth2-jose - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-oauth2-resource-server/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-oauth2-resource-server/build.gradle new file mode 100644 index 000000000000..39685e87b0f2 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-oauth2-resource-server/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Spring Security's OAuth2 resource server features" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.springframework.security:spring-security-config' + api 'org.springframework.security:spring-security-core' + api 'org.springframework.security:spring-security-oauth2-resource-server' + api 'org.springframework.security:spring-security-oauth2-jose' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-oauth2-resource-server/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-oauth2-resource-server/pom.xml deleted file mode 100644 index 0a4f791f0f8d..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-oauth2-resource-server/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-oauth2-resource-server - Spring Boot OAuth2 Resource Server Starter - Starter for using Spring Security's OAuth2 resource server features - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.security - spring-security-config - - - org.springframework.security - spring-security-core - - - org.springframework.security - spring-security-oauth2-resource-server - - - org.springframework.security - spring-security-oauth2-jose - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-parent/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-parent/build.gradle new file mode 100644 index 000000000000..00a9bf070f67 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-parent/build.gradle @@ -0,0 +1,226 @@ +plugins { + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.deployed' + id 'org.springframework.boot.maven-repository' +} + +description = "Parent pom providing dependency and plugin management for applications built with Maven" + +publishing.publications.withType(MavenPublication) { + pom.withXml { xml -> + def root = xml.asNode() + root.groupId.replaceNode { + parent { + delegate.groupId("${project.group}") + delegate.artifactId("spring-boot-dependencies") + delegate.version("${project.version}") + } + } + root.remove(root.version) + root.description.plus { + properties { + delegate.'java.version'('1.8') + delegate.'resource.delimiter'('@') + delegate.'maven.compiler.source'('${java.version}') + delegate.'maven.compiler.target'('${java.version}') + } + } + root.issueManagement.plus { + build { + resources { + resource { + delegate.directory('${basedir}/src/main/resources') + delegate.filtering('true') + includes { + delegate.include('**/application*.yml') + delegate.include('**/application*.yaml') + delegate.include('**/application*.properties') + } + } + resource { + delegate.directory('${basedir}/src/main/resources') + excludes { + delegate.exclude('**/application*.yml') + delegate.exclude('**/application*.yaml') + delegate.exclude('**/application*.properties') + } + } + } + pluginManagement { + plugins { + plugin { + delegate.groupId('org.jetbrains.kotlin') + delegate.artifactId('kotlin-maven-plugin') + delegate.version('${kotlin.version}') + configuration { + delegate.jvmTarget('${java.version}') + delegate.javaParameters('true') + } + executions { + execution { + delegate.id('compile') + delegate.phase('compile') + goals { + delegate.goal('compile') + } + } + execution { + delegate.id('test-compile') + delegate.phase('test-compile') + goals { + delegate.goal('test-compile') + } + } + } + } + plugin { + delegate.groupId('org.apache.maven.plugins') + delegate.artifactId('maven-compiler-plugin') + configuration { + delegate.parameters('true') + } + } + plugin { + delegate.groupId('org.apache.maven.plugins') + delegate.artifactId('maven-failsafe-plugin') + executions { + execution { + goals { + delegate.goal('integration-test') + delegate.goal('verify') + } + } + } + configuration { + delegate.classesDirectory('${project.build.outputDirectory}') + } + } + plugin { + delegate.groupId('org.apache.maven.plugins') + delegate.artifactId('maven-jar-plugin') + configuration { + archive { + manifest { + delegate.mainClass('${start-class}') + delegate.addDefaultImplementationEntries('true') + } + } + } + } + plugin { + delegate.groupId('org.apache.maven.plugins') + delegate.artifactId('maven-war-plugin') + configuration { + archive { + manifest { + delegate.mainClass('${start-class}') + delegate.addDefaultImplementationEntries('true') + } + } + } + } + plugin { + delegate.groupId('org.codehaus.mojo') + delegate.artifactId('exec-maven-plugin') + configuration { + delegate.mainClass('${start-class}') + } + } + plugin { + delegate.groupId('org.apache.maven.plugins') + delegate.artifactId('maven-resources-plugin') + configuration { + delimiters { + delegate.delimiter('${resource.delimiter}') + } + delegate.useDefaultDelimiters('false') + } + } + plugin { + delegate.groupId('pl.project13.maven') + delegate.artifactId('git-commit-id-plugin') + executions { + execution { + goals { + delegate.goal('revision') + } + } + } + configuration { + delegate.verbose('true') + delegate.dateFormat("yyyy-MM-dd'T'HH:mm:ssZ") + delegate.generateGitPropertiesFile('true') + delegate.generateGitPropertiesFilename('${project.build.outputDirectory}/git.properties') + } + } + plugin { + delegate.groupId('org.springframework.boot') + delegate.artifactId('spring-boot-maven-plugin') + executions { + execution { + delegate.id('repackage') + goals { + delegate.goal('repackage') + } + } + } + configuration { + delegate.mainClass('${start-class}') + } + } + plugin { + delegate.groupId('org.apache.maven.plugins') + delegate.artifactId('maven-shade-plugin') + configuration { + delegate.keepDependenciesWithProvidedScope('true') + delegate.createDependencyReducedPom('true') + filters { + filter { + delegate.artifact('*:*') + excludes { + delegate.exclude('META-INF/*.SF') + delegate.exclude('META-INF/*.DSA') + delegate.exclude('META-INF/*.RSA') + } + } + } + } + delegate.dependencies { + dependency { + delegate.groupId('org.springframework.boot') + delegate.artifactId('spring-boot-maven-plugin') + delegate.version('${revision}') + } + } + executions { + execution { + delegate.phase('package') + goals { + delegate.goal('shade') + } + configuration { + transformers { + transformer { + delegate.resource('META-INF/spring.handlers') + } + transformer { + delegate.resource('META-INF/spring.factories') + } + transformer { + delegate.resource('META-INF/spring.schemas') + } + delegate.transformer('') + transformer { + delegate.mainClass('${start-class}') + } + } + } + } + } + } + } + } + } + } + } +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-parent/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-parent/pom.xml deleted file mode 100644 index 23b32d80e758..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-parent/pom.xml +++ /dev/null @@ -1,297 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-dependencies - ${revision} - ../../spring-boot-dependencies - - spring-boot-starter-parent - pom - Spring Boot Starter Parent - Parent pom providing dependency and plugin management for applications - built with Maven - - ${basedir}/../../.. - 1.8 - @ - UTF-8 - UTF-8 - ${java.version} - ${java.version} - - - - - - ${basedir}/src/main/resources - true - - **/application*.yml - **/application*.yaml - **/application*.properties - - - - ${basedir}/src/main/resources - - **/application*.yml - **/application*.yaml - **/application*.properties - - - - - - - - org.jetbrains.kotlin - kotlin-maven-plugin - ${kotlin.version} - - ${java.version} - true - - - - compile - compile - - compile - - - - test-compile - test-compile - - test-compile - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - true - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - - integration-test - verify - - - - - ${project.build.outputDirectory} - - - - org.apache.maven.plugins - maven-jar-plugin - - - - ${start-class} - true - - - - - - org.apache.maven.plugins - maven-war-plugin - - - - ${start-class} - true - - - - - - org.codehaus.mojo - exec-maven-plugin - - ${start-class} - - - - org.apache.maven.plugins - maven-resources-plugin - - - ${resource.delimiter} - - false - - - - pl.project13.maven - git-commit-id-plugin - - - - revision - - - - - true - yyyy-MM-dd'T'HH:mm:ssZ - true - ${project.build.outputDirectory}/git.properties - - - - - org.springframework.boot - spring-boot-maven-plugin - - - repackage - - repackage - - - - - ${start-class} - - - - - org.apache.maven.plugins - maven-shade-plugin - - true - true - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${revision} - - - - - package - - shade - - - - - META-INF/spring.handlers - - - META-INF/spring.factories - - - META-INF/spring.schemas - - - - ${start-class} - - - - - - - - - - - org.codehaus.mojo - flatten-maven-plugin - false - - - - flatten - process-resources - - flatten - - - true - - expand - keep - keep - expand - keep - keep - keep - keep - - - - - flatten-clean - clean - - clean - - - - - - org.codehaus.mojo - xml-maven-plugin - false - - - - post-process-flattened-pom - process-resources - - transform - - - - - ${project.basedir} - ${project.basedir} - .flattened-pom.xml - src/main/xslt/post-process-flattened-pom.xsl - - - indent - yes - - - - - - - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-quartz/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-quartz/build.gradle new file mode 100644 index 000000000000..c00a3a016696 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-quartz/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using the Quartz scheduler" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.springframework:spring-context-support' + api 'org.springframework:spring-tx' + api 'org.quartz-scheduler:quartz' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-quartz/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-quartz/pom.xml deleted file mode 100644 index 7edae6ae0d4c..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-quartz/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-quartz - Spring Boot Quartz Starter - Starter for using the Quartz scheduler - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework - spring-context-support - - - org.springframework - spring-tx - - - org.quartz-scheduler - quartz - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-reactor-netty/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-reactor-netty/build.gradle new file mode 100644 index 000000000000..b3c8171ac44d --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-reactor-netty/build.gradle @@ -0,0 +1,10 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Reactor Netty as the embedded reactive HTTP server." + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api 'io.projectreactor.netty:reactor-netty' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-reactor-netty/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-reactor-netty/pom.xml deleted file mode 100644 index fa72cb97ddb1..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-reactor-netty/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-reactor-netty - Spring Boot Reactor Netty Starter - Starter for using Reactor Netty as the embedded reactive HTTP server. - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - io.projectreactor.netty - reactor-netty - - - org.glassfish - jakarta.el - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-rsocket/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-rsocket/build.gradle new file mode 100644 index 000000000000..abc5ee6b579b --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-rsocket/build.gradle @@ -0,0 +1,18 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for building RSocket clients and servers" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-json') + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-reactor-netty') + api 'com.fasterxml.jackson.dataformat:jackson-dataformat-cbor' + api 'io.rsocket:rsocket-core' + api 'io.rsocket:rsocket-transport-netty' + api 'org.springframework:spring-messaging' + api 'org.springframework.security:spring-security-config' + api 'org.springframework.security:spring-security-web' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-rsocket/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-rsocket/pom.xml deleted file mode 100644 index b83a43efcecb..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-rsocket/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-rsocket - Spring Boot RSocket Starter - Starter for building RSocket clients and servers. - - ${basedir}/../../.. - - - - org.springframework.boot - spring-boot-starter - - - org.springframework - spring-messaging - - - io.rsocket - rsocket-core - - - io.rsocket - rsocket-transport-netty - - - org.springframework.boot - spring-boot-starter-reactor-netty - - - org.springframework.boot - spring-boot-starter-json - - - com.fasterxml.jackson.dataformat - jackson-dataformat-cbor - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-security/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-security/build.gradle new file mode 100644 index 000000000000..598adca06571 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-security/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Spring Security" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.springframework:spring-aop' + api 'org.springframework.security:spring-security-config' + api 'org.springframework.security:spring-security-web' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-security/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-security/pom.xml deleted file mode 100644 index 7b3112de86a4..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-security/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-security - Spring Boot Security Starter - Starter for using Spring Security - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework - spring-aop - - - org.springframework.security - spring-security-config - - - org.springframework.security - spring-security-web - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-test/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-test/build.gradle new file mode 100644 index 000000000000..881298767420 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-test/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for testing Spring Boot applications with libraries including JUnit, Hamcrest and Mockito" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api project(':spring-boot-project:spring-boot-test') + api project(':spring-boot-project:spring-boot-test-autoconfigure') + + api 'com.jayway.jsonpath:json-path' + api 'jakarta.xml.bind:jakarta.xml.bind-api' + api 'org.assertj:assertj-core' + api 'org.hamcrest:hamcrest' + api 'org.junit.jupiter:junit-jupiter' + api('org.junit.vintage:junit-vintage-engine') { + exclude group: 'org.hamcrest', module: 'hamcrest-core' + } + api 'org.mockito:mockito-core' + api 'org.mockito:mockito-junit-jupiter' + api 'org.skyscreamer:jsonassert' + api 'org.springframework:spring-core' + api 'org.springframework:spring-test' + api('org.xmlunit:xmlunit-core') { + exclude group: 'javax.xml.bind', module: 'jaxb-api' + } +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-test/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-test/pom.xml deleted file mode 100644 index 03f9a83d7b5b..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-test/pom.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-test - Spring Boot Test Starter - Starter for testing Spring Boot applications with libraries including - JUnit, Hamcrest and Mockito - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-test - - - org.springframework.boot - spring-boot-test-autoconfigure - - - com.jayway.jsonpath - json-path - - - jakarta.xml.bind - jakarta.xml.bind-api - - - org.junit.jupiter - junit-jupiter - - - org.junit.vintage - junit-vintage-engine - - - org.hamcrest - hamcrest-core - - - - - org.mockito - mockito-junit-jupiter - - - org.assertj - assertj-core - - - org.hamcrest - hamcrest - - - org.mockito - mockito-core - - - org.skyscreamer - jsonassert - - - org.springframework - spring-core - - - org.springframework - spring-test - - - org.xmlunit - xmlunit-core - - - javax.xml.bind - jaxb-api - - - - - - - - org.basepom.maven - duplicate-finder-maven-plugin - - - duplicate-dependencies - validate - - check - - - - - - - org.ow2.asm - asm - - - net.minidev - accessors-smart - - - - - - - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-thymeleaf/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-thymeleaf/build.gradle new file mode 100644 index 000000000000..eefd35fbf18b --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-thymeleaf/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for building MVC web applications using Thymeleaf views" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.thymeleaf:thymeleaf-spring5' + api 'org.thymeleaf.extras:thymeleaf-extras-java8time' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-thymeleaf/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-thymeleaf/pom.xml deleted file mode 100644 index 303066ffb246..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-thymeleaf/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-thymeleaf - Spring Boot Thymeleaf Starter - Starter for building MVC web applications using Thymeleaf views - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.thymeleaf - thymeleaf-spring5 - - - org.thymeleaf.extras - thymeleaf-extras-java8time - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-tomcat/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-tomcat/build.gradle new file mode 100644 index 000000000000..5454e244cf93 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-tomcat/build.gradle @@ -0,0 +1,17 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Tomcat as the embedded servlet container. Default servlet container starter used by spring-boot-starter-web" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api 'jakarta.annotation:jakarta.annotation-api' + api ('org.apache.tomcat.embed:tomcat-embed-core') { + exclude group: 'org.apache.tomcat', module: 'tomcat-annotations-api' + } + api 'org.apache.tomcat.embed:tomcat-embed-el' + api ('org.apache.tomcat.embed:tomcat-embed-websocket') { + exclude group: 'org.apache.tomcat', module: 'tomcat-annotations-api' + } +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-tomcat/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-tomcat/pom.xml deleted file mode 100644 index 679367648466..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-tomcat/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-tomcat - Spring Boot Tomcat Starter - Starter for using Tomcat as the embedded servlet container. Default - servlet container starter used by spring-boot-starter-web - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - jakarta.annotation - jakarta.annotation-api - - - org.apache.tomcat.embed - tomcat-embed-core - - - org.apache.tomcat - tomcat-annotations-api - - - - - org.apache.tomcat.embed - tomcat-embed-el - - - org.apache.tomcat.embed - tomcat-embed-websocket - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/build.gradle new file mode 100644 index 000000000000..9c0f4b05b7e1 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/build.gradle @@ -0,0 +1,20 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Undertow as the embedded servlet container. An alternative to spring-boot-starter-tomcat" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api 'io.undertow:undertow-core' + api ('io.undertow:undertow-servlet') { + exclude group: 'org.jboss.spec.javax.annotation', module: 'jboss-annotations-api_1.2_spec' + exclude group: 'org.jboss.spec.javax.servlet', module: 'jboss-servlet-api_4.0_spec' + } + api ('io.undertow:undertow-websockets-jsr') { + exclude group: 'org.jboss.spec.javax.annotation', module: 'jboss-annotations-api_1.2_spec' + exclude group: 'org.jboss.spec.javax.servlet', module: 'jboss-servlet-api_4.0_spec' + } + api 'jakarta.servlet:jakarta.servlet-api' + api 'org.glassfish:jakarta.el' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/pom.xml deleted file mode 100644 index 83d5a29bdc75..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-undertow - Spring Boot Undertow Starter - Starter for using Undertow as the embedded servlet container. An - alternative to spring-boot-starter-tomcat - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - io.undertow - undertow-core - - - io.undertow - undertow-servlet - - - org.jboss.spec.javax.servlet - jboss-servlet-api_4.0_spec - - - - - io.undertow - undertow-websockets-jsr - - - jakarta.servlet - jakarta.servlet-api - - - org.glassfish - jakarta.el - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-validation/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-validation/build.gradle new file mode 100644 index 000000000000..c8f959aca514 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-validation/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Java Bean Validation with Hibernate Validator" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api 'org.apache.tomcat.embed:tomcat-embed-el' + api 'org.hibernate.validator:hibernate-validator' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-validation/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-validation/pom.xml deleted file mode 100644 index 542f96b06701..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-validation/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-validation - Spring Boot Validation Starter - Starter for using Java Bean Validation with Hibernate - Validator - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - jakarta.validation - jakarta.validation-api - - - org.apache.tomcat.embed - tomcat-embed-el - - - org.hibernate.validator - hibernate-validator - - - javax.validation - validation-api - - - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/build.gradle new file mode 100644 index 000000000000..5cf4d06251c7 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for using Spring Web Services" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + api 'com.sun.xml.messaging.saaj:saaj-impl' + api 'jakarta.xml.ws:jakarta.xml.ws-api' + api 'org.springframework:spring-oxm' + api 'org.springframework.ws:spring-ws-core' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/pom.xml deleted file mode 100644 index 8e191dae28e0..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-web-services - Spring Boot Web Services Starter - Starter for using Spring Web Services - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter-web - - - com.sun.xml.messaging.saaj - saaj-impl - - - javax.activation - activation - - - - - jakarta.xml.ws - jakarta.xml.ws-api - - - org.springframework - spring-oxm - - - org.springframework.ws - spring-ws-core - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-web/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-web/build.gradle new file mode 100644 index 000000000000..85adc9003dac --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-web/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for building web, including RESTful, applications using Spring MVC. Uses Tomcat as the default embedded container" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-json') + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat') + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-validation') + api 'org.hibernate.validator:hibernate-validator' + api 'org.springframework:spring-web' + api 'org.springframework:spring-webmvc' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-web/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-web/pom.xml deleted file mode 100644 index 94a0b6d4da0a..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-web/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-web - Spring Boot Web Starter - Starter for building web, including RESTful, applications using Spring - MVC. Uses Tomcat as the default embedded container - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-json - - - org.springframework.boot - spring-boot-starter-tomcat - - - org.springframework.boot - spring-boot-starter-validation - - - org.apache.tomcat.embed - tomcat-embed-el - - - - - org.springframework - spring-web - - - org.springframework - spring-webmvc - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-webflux/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-webflux/build.gradle new file mode 100644 index 000000000000..dbfa136c5061 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-webflux/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for building WebFlux applications using Spring Framework's Reactive Web support" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-json') + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-reactor-netty') + api 'org.hibernate.validator:hibernate-validator' + api 'org.springframework:spring-web' + api 'org.springframework:spring-webflux' + api 'org.synchronoss.cloud:nio-multipart-parser' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-webflux/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-webflux/pom.xml deleted file mode 100644 index b159eec6cb66..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-webflux/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-webflux - Spring Boot WebFlux Starter - Starter for building WebFlux applications using Spring Framework's - Reactive Web support - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-json - - - org.springframework.boot - spring-boot-starter-reactor-netty - - - org.springframework.boot - spring-boot-starter-validation - - - org.apache.tomcat.embed - tomcat-embed-el - - - - - org.springframework - spring-web - - - org.springframework - spring-webflux - - - org.synchronoss.cloud - nio-multipart-parser - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-websocket/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-websocket/build.gradle new file mode 100644 index 000000000000..5b78056e502c --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-websocket/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Starter for building WebSocket applications using Spring Framework's WebSocket support" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + api 'org.springframework:spring-messaging' + api 'org.springframework:spring-websocket' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-websocket/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter-websocket/pom.xml deleted file mode 100644 index 6e6755ce7d61..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-websocket/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter-websocket - Spring Boot WebSocket Starter - Starter for building WebSocket applications using Spring Framework's - WebSocket support - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework - spring-messaging - - - org.springframework - spring-websocket - - - diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter/build.gradle new file mode 100644 index 000000000000..5629d533d521 --- /dev/null +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter/build.gradle @@ -0,0 +1,17 @@ +plugins { + id 'org.springframework.boot.starter' +} + +description = "Core starter, including auto-configuration support, logging and YAML" + +dependencies { + api enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + + api project(':spring-boot-project:spring-boot') + api project(':spring-boot-project:spring-boot-autoconfigure') + api project(':spring-boot-project:spring-boot-starters:spring-boot-starter-logging') + + api 'jakarta.annotation:jakarta.annotation-api' + api 'org.springframework:spring-core' + api 'org.yaml:snakeyaml' +} diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter/pom.xml b/spring-boot-project/spring-boot-starters/spring-boot-starter/pom.xml deleted file mode 100644 index a4029e66556c..000000000000 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starters - ${revision} - - spring-boot-starter - Spring Boot Starter - Core starter, including auto-configuration support, logging and YAML - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot - - - org.springframework.boot - spring-boot-autoconfigure - - - org.springframework.boot - spring-boot-starter-logging - - - jakarta.annotation - jakarta.annotation-api - - - org.springframework - spring-core - - - org.yaml - snakeyaml - runtime - - - diff --git a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle new file mode 100644 index 000000000000..e6e7364e86b3 --- /dev/null +++ b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle @@ -0,0 +1,96 @@ +plugins { + id 'java-library' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.deployed' + id 'org.springframework.boot.optional-dependencies' +} + +description = 'Spring Boot Test AutoConfigure' + +dependencies { + implementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + implementation project(':spring-boot-project:spring-boot') + implementation project(':spring-boot-project:spring-boot-test') + implementation project(':spring-boot-project:spring-boot-autoconfigure') + + optional enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + optional 'javax.json.bind:javax.json.bind-api' + optional 'javax.servlet:javax.servlet-api' + optional 'javax.transaction:javax.transaction-api' + optional 'com.fasterxml.jackson.core:jackson-databind' + optional 'com.google.code.gson:gson' + optional 'com.jayway.jsonpath:json-path' + optional 'io.rest-assured:rest-assured' + optional 'net.sourceforge.htmlunit:htmlunit' + optional 'org.hibernate:hibernate-core' + optional 'org.junit.jupiter:junit-jupiter-api' + optional 'org.seleniumhq.selenium:htmlunit-driver' + optional 'org.seleniumhq.selenium:selenium-api' + optional 'org.springframework:spring-orm' + optional 'org.springframework:spring-test' + optional 'org.springframework:spring-web' + optional 'org.springframework:spring-webmvc' + optional 'org.springframework:spring-webflux' + optional 'org.springframework.data:spring-data-jdbc' + optional 'org.springframework.data:spring-data-jpa' + optional 'org.springframework.data:spring-data-ldap' + optional 'org.springframework.data:spring-data-mongodb' + optional 'org.springframework.data:spring-data-neo4j' + optional 'org.springframework.data:spring-data-redis' + optional 'org.springframework.restdocs:spring-restdocs-mockmvc' + optional 'org.springframework.restdocs:spring-restdocs-restassured' + optional 'org.springframework.restdocs:spring-restdocs-webtestclient' + optional 'org.springframework.security:spring-security-config' + optional 'org.springframework.security:spring-security-test' + optional 'org.apache.tomcat.embed:tomcat-embed-core' + optional 'org.mongodb:mongodb-driver-async' + optional 'org.mongodb:mongodb-driver-reactivestreams' + + testImplementation enforcedPlatform(project(':spring-boot-project:spring-boot-parent')) + testImplementation project(':spring-boot-project:spring-boot-tools:spring-boot-test-support') + testImplementation 'ch.qos.logback:logback-classic' + testImplementation 'com.fasterxml.jackson.module:jackson-module-parameter-names' + testImplementation 'com.h2database:h2' + testImplementation 'com.unboundid:unboundid-ldapsdk' + testImplementation 'de.flapdoodle.embed:de.flapdoodle.embed.mongo' + testImplementation 'io.lettuce:lettuce-core' + testImplementation 'io.projectreactor:reactor-core' + testImplementation 'javax.json:javax.json-api' + testImplementation 'org.apache.commons:commons-pool2' + testImplementation 'org.apache.johnzon:johnzon-jsonb' + testImplementation 'org.apache.tomcat.embed:tomcat-embed-el' + testImplementation 'org.aspectj:aspectjrt' + testImplementation 'org.aspectj:aspectjweaver' + testImplementation 'org.assertj:assertj-core' + testImplementation 'org.hibernate.validator:hibernate-validator' + testImplementation 'org.hsqldb:hsqldb' + testImplementation 'org.jooq:jooq' + testImplementation 'org.junit.platform:junit-platform-engine' + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.mockito:mockito-core' + testImplementation 'org.skyscreamer:jsonassert' + testImplementation 'org.springframework.hateoas:spring-hateoas' + testImplementation 'org.springframework.plugin:spring-plugin-core' + testImplementation 'org.testcontainers:junit-jupiter' + testImplementation 'org.testcontainers:neo4j' + testImplementation 'org.testcontainers:testcontainers' + + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' +} + +compileJava { + options.compilerArgs << '-parameters' +} + +compileTestJava { + options.compilerArgs << '-parameters' +} + +test { + include '**/*Tests.class' +} + +task testSliceMetadata(type: org.springframework.boot.build.test.autoconfigure.TestSliceMetadata) { + sourceSet = sourceSets.main + outputFile = file("$buildDir/test-slice-metadata.properties") +} diff --git a/spring-boot-project/spring-boot-test-autoconfigure/pom.xml b/spring-boot-project/spring-boot-test-autoconfigure/pom.xml deleted file mode 100644 index 1af6f9b2996c..000000000000 --- a/spring-boot-project/spring-boot-test-autoconfigure/pom.xml +++ /dev/null @@ -1,384 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-parent - ${revision} - ../spring-boot-parent - - spring-boot-test-autoconfigure - Spring Boot Test Auto-Configure - Spring Boot Test Auto-Configure - - ${basedir}/../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - org.springframework.boot - spring-boot-test - - - org.springframework.boot - spring-boot-autoconfigure - - - - com.fasterxml.jackson.core - jackson-databind - true - - - com.google.code.gson - gson - true - - - com.jayway.jsonpath - json-path - true - - - io.rest-assured - rest-assured - true - - - javax.xml.bind - jaxb-api - - - javax.activation - activation - - - org.hamcrest - hamcrest-core - - - org.hamcrest - hamcrest-library - - - - - jakarta.json.bind - jakarta.json.bind-api - true - - - jakarta.persistence - jakarta.persistence-api - true - - - jakarta.servlet - jakarta.servlet-api - true - - - jakarta.transaction - jakarta.transaction-api - true - - - net.sourceforge.htmlunit - htmlunit - true - - - org.hibernate - hibernate-core - - - org.jboss.spec.javax.transaction - jboss-transaction-api_1.2_spec - - - javax.activation - javax.activation-api - - - javax.persistence - javax.persistence-api - - - javax.xml.bind - jaxb-api - - - true - - - org.junit.jupiter - junit-jupiter-api - true - - - org.seleniumhq.selenium - htmlunit-driver - true - - - org.seleniumhq.selenium - selenium-api - true - - - org.springframework - spring-orm - true - - - org.springframework - spring-test - true - - - org.springframework - spring-web - true - - - org.springframework - spring-webmvc - true - - - org.springframework - spring-webflux - true - - - org.springframework.data - spring-data-jdbc - true - - - org.springframework.data - spring-data-jpa - - - org.aspectj - aspectjrt - - - true - - - org.springframework.data - spring-data-ldap - true - - - org.springframework.data - spring-data-mongodb - true - - - org.springframework.data - spring-data-neo4j - true - - - org.springframework.data - spring-data-redis - true - - - org.springframework.restdocs - spring-restdocs-mockmvc - true - - - javax.servlet - javax.servlet-api - - - - - org.springframework.restdocs - spring-restdocs-restassured - true - - - org.springframework.restdocs - spring-restdocs-webtestclient - true - - - org.springframework.security - spring-security-config - true - - - org.springframework.security - spring-security-test - true - - - - org.springframework.boot - spring-boot-test-support - test - - - ch.qos.logback - logback-classic - test - - - com.fasterxml.jackson.module - jackson-module-parameter-names - test - - - com.h2database - h2 - test - - - com.unboundid - unboundid-ldapsdk - test - - - de.flapdoodle.embed - de.flapdoodle.embed.mongo - test - - - io.lettuce - lettuce-core - test - - - io.projectreactor - reactor-core - test - - - jakarta.json - jakarta.json-api - test - - - jakarta.validation - jakarta.validation-api - test - - - org.apache.commons - commons-pool2 - test - - - org.apache.johnzon - johnzon-jsonb - test - - - org.apache.tomcat.embed - tomcat-embed-core - true - - - org.apache.tomcat.embed - tomcat-embed-el - test - - - org.aspectj - aspectjrt - test - - - org.aspectj - aspectjweaver - test - - - org.hibernate.validator - hibernate-validator - test - - - javax.validation - validation-api - - - - - org.hsqldb - hsqldb - test - - - org.jooq - jooq - test - - - javax.xml.bind - jaxb-api - - - - - org.mongodb - mongodb-driver-async - true - - - org.mongodb - mongodb-driver-reactivestreams - true - - - org.skyscreamer - jsonassert - test - - - org.springframework.hateoas - spring-hateoas - test - - - org.testcontainers - junit-jupiter - test - - - org.testcontainers - neo4j - test - - - org.testcontainers - testcontainers - test - - - javax.annotation - javax.annotation-api - - - javax.xml.bind - jaxb-api - - - org.hamcrest - hamcrest-core - - - - - diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestIntegrationTests.java index eba313f1ab75..c85884237565 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestIntegrationTests.java @@ -16,6 +16,8 @@ package org.springframework.boot.test.autoconfigure.data.neo4j; +import java.time.Duration; + import org.junit.jupiter.api.Test; import org.neo4j.ogm.session.Session; import org.testcontainers.containers.Neo4jContainer; @@ -46,7 +48,8 @@ class DataNeo4jTestIntegrationTests { @Container - static final Neo4jContainer neo4j = new Neo4jContainer<>().withoutAuthentication(); + static final Neo4jContainer neo4j = new Neo4jContainer<>().withoutAuthentication() + .withStartupTimeout(Duration.ofMinutes(10)); @Autowired private Session session; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestPropertiesIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestPropertiesIntegrationTests.java index 642c536f1364..5b46d62339e5 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestPropertiesIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestPropertiesIntegrationTests.java @@ -16,6 +16,8 @@ package org.springframework.boot.test.autoconfigure.data.neo4j; +import java.time.Duration; + import org.junit.jupiter.api.Test; import org.testcontainers.containers.Neo4jContainer; import org.testcontainers.junit.jupiter.Container; @@ -42,7 +44,8 @@ class DataNeo4jTestPropertiesIntegrationTests { @Container - static final Neo4jContainer neo4j = new Neo4jContainer<>().withoutAuthentication(); + static final Neo4jContainer neo4j = new Neo4jContainer<>().withoutAuthentication() + .withStartupTimeout(Duration.ofMinutes(10)); @Autowired private Environment environment; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestWithIncludeFilterIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestWithIncludeFilterIntegrationTests.java index e82fba702ccd..4a12980b10c5 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestWithIncludeFilterIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestWithIncludeFilterIntegrationTests.java @@ -16,6 +16,8 @@ package org.springframework.boot.test.autoconfigure.data.neo4j; +import java.time.Duration; + import org.junit.jupiter.api.Test; import org.testcontainers.containers.Neo4jContainer; import org.testcontainers.junit.jupiter.Container; @@ -43,7 +45,8 @@ class DataNeo4jTestWithIncludeFilterIntegrationTests { @Container - static final Neo4jContainer neo4j = new Neo4jContainer<>().withoutAuthentication(); + static final Neo4jContainer neo4j = new Neo4jContainer<>().withoutAuthentication() + .withStartupTimeout(Duration.ofMinutes(10)); @Autowired private ExampleService service; diff --git a/spring-boot-project/spring-boot-test/build.gradle b/spring-boot-project/spring-boot-test/build.gradle new file mode 100644 index 000000000000..f8033155f18e --- /dev/null +++ b/spring-boot-project/spring-boot-test/build.gradle @@ -0,0 +1,55 @@ +plugins { + id 'java-library' + id 'org.jetbrains.kotlin.jvm' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.deployed' + id 'org.springframework.boot.optional-dependencies' +} + +description = 'Spring Boot Test' + +dependencies { + implementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + implementation project(':spring-boot-project:spring-boot') + + optional enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + optional 'com.fasterxml.jackson.core:jackson-databind' + optional 'com.google.code.gson:gson' + optional 'com.jayway.jsonpath:json-path' + optional 'io.projectreactor.netty:reactor-netty' + optional 'javax.json.bind:javax.json.bind-api' + optional 'javax.servlet:javax.servlet-api' + optional 'junit:junit' + optional 'org.apache.httpcomponents:httpclient' + optional 'org.assertj:assertj-core' + optional 'org.hamcrest:hamcrest-core' + optional 'org.hamcrest:hamcrest-library' + optional 'org.jetbrains.kotlin:kotlin-stdlib' + optional 'org.jetbrains.kotlin:kotlin-reflect' + optional 'org.junit.jupiter:junit-jupiter-api' + optional 'org.mockito:mockito-core' + optional 'org.skyscreamer:jsonassert' + optional 'org.seleniumhq.selenium:htmlunit-driver' + optional 'org.seleniumhq.selenium:selenium-api' + optional 'org.springframework:spring-test' + optional 'org.springframework:spring-web' + optional 'org.springframework:spring-webflux' + optional 'net.sourceforge.htmlunit:htmlunit' + + testImplementation enforcedPlatform(project(':spring-boot-project:spring-boot-parent')) + testImplementation project(':spring-boot-project:spring-boot-tools:spring-boot-test-support') + testImplementation 'io.mockk:mockk' + testImplementation 'javax.json:javax.json-api' + testImplementation 'ch.qos.logback:logback-classic' + testImplementation 'org.apache.tomcat.embed:tomcat-embed-core' + testImplementation 'org.codehaus.groovy:groovy' + testImplementation 'org.codehaus.groovy:groovy-xml' + testImplementation 'org.apache.johnzon:johnzon-jsonb' + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.slf4j:slf4j-api' + testImplementation 'org.spockframework:spock-core' + testImplementation 'org.springframework:spring-webmvc' + testImplementation 'org.testng:testng' + + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' +} \ No newline at end of file diff --git a/spring-boot-project/spring-boot-test/pom.xml b/spring-boot-project/spring-boot-test/pom.xml deleted file mode 100644 index 2e59fa5bdebf..000000000000 --- a/spring-boot-project/spring-boot-test/pom.xml +++ /dev/null @@ -1,288 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-parent - ${revision} - ../spring-boot-parent - - spring-boot-test - Spring Boot Test - Spring Boot Test - - ${basedir}/../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - org.springframework.boot - spring-boot - - - - com.fasterxml.jackson.core - jackson-databind - true - - - com.google.code.gson - gson - true - - - com.jayway.jsonpath - json-path - true - - - io.projectreactor.netty - reactor-netty - true - - - jakarta.json.bind - jakarta.json.bind-api - true - - - jakarta.servlet - jakarta.servlet-api - true - - - junit - junit - true - - - org.hamcrest - hamcrest-core - - - - - org.apache.httpcomponents - httpclient - true - - - org.assertj - assertj-core - true - - - org.hamcrest - hamcrest - true - - - org.jetbrains.kotlin - kotlin-stdlib - true - - - org.jetbrains.kotlin - kotlin-reflect - true - - - org.junit.jupiter - junit-jupiter-api - true - - - org.mockito - mockito-core - true - - - org.skyscreamer - jsonassert - true - - - org.seleniumhq.selenium - htmlunit-driver - true - - - org.seleniumhq.selenium - selenium-api - true - - - org.springframework - spring-test - true - - - org.springframework - spring-web - true - - - org.springframework - spring-webflux - true - - - net.sourceforge.htmlunit - htmlunit - true - - - - org.springframework.boot - spring-boot-test-support - test - - - ch.qos.logback - logback-classic - test - - - io.mockk - mockk - test - - - jakarta.json - jakarta.json-api - test - - - org.apache.tomcat.embed - tomcat-embed-core - test - - - org.codehaus.groovy - groovy - test - - - org.codehaus.groovy - groovy-xml - true - test - - - org.apache.johnzon - johnzon-jsonb - test - - - org.slf4j - slf4j-api - test - - - org.spockframework - spock-core - test - - - org.springframework - spring-webmvc - test - - - org.testng - testng - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - test-jar - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - org.apache.maven.surefire - surefire-junit-platform - ${maven-surefire-plugin.version} - - - - - org.jetbrains.kotlin - kotlin-maven-plugin - - - compile - compile - - compile - - - - ${project.basedir}/src/main/kotlin - ${project.basedir}/src/main/java - - - - - test-compile - test-compile - - test-compile - - - - ${project.basedir}/src/test/kotlin - ${project.basedir}/src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - default-compile - none - - - default-testCompile - none - - - java-compile - compile - - compile - - - - java-test-compile - test-compile - - testCompile - - - - - - - diff --git a/spring-boot-project/spring-boot-tools/org.springframework.boot.gradle.plugin/pom.xml b/spring-boot-project/spring-boot-tools/org.springframework.boot.gradle.plugin/pom.xml deleted file mode 100644 index 754672d7467e..000000000000 --- a/spring-boot-project/spring-boot-tools/org.springframework.boot.gradle.plugin/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-tools - ${revision} - - org.springframework.boot.gradle.plugin - pom - Spring Boot Gradle Plugin Marker Artifact - Spring Boot Gradle Plugin Marker Artifact - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-gradle-plugin - ${project.version} - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - regex-property - - regex-property - - - false - - - - - - - diff --git a/spring-boot-project/spring-boot-tools/pom.xml b/spring-boot-project/spring-boot-tools/pom.xml deleted file mode 100644 index 1dd0d293d635..000000000000 --- a/spring-boot-project/spring-boot-tools/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-parent - ${revision} - ../spring-boot-parent - - spring-boot-tools - pom - Spring Boot Tools - Spring Boot Tools - - ${basedir}/../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - org.springframework.boot.gradle.plugin - spring-boot-antlib - spring-boot-autoconfigure-processor - spring-boot-configuration-docs - spring-boot-configuration-metadata - spring-boot-configuration-processor - spring-boot-gradle-plugin - spring-boot-loader - spring-boot-loader-tools - spring-boot-maven-plugin - spring-boot-test-support - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-antlib/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-antlib/build.gradle new file mode 100644 index 000000000000..db29b70576c4 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-antlib/build.gradle @@ -0,0 +1,75 @@ +plugins { + id 'java-library' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.deployed' +} + +description = 'Spring Boot Antlib' + +ext { + antVersion = "1.9.3" +} + +configurations { + antUnit + antIvy +} + +dependencies { + antUnit "org.apache.ant:ant-antunit:1.3" + antIvy "org.apache.ivy:ivy:2.4.0" + + compileOnly project(":spring-boot-project:spring-boot-tools:spring-boot-loader") + compileOnly "org.apache.ant:ant:${antVersion}" + + implementation enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies")) + implementation project(":spring-boot-project:spring-boot-tools:spring-boot-loader-tools") + implementation "org.springframework:spring-core" +} + +task copyIntegrationTestSources(type: Copy) { + from file("src/it") + into "${buildDir}/it" +} + +processResources { + eachFile { + filter { it.replace('${spring-boot.version}', project.version) } + } +} + +task integrationTest { + dependsOn copyIntegrationTestSources, jar + def resultsDir = file("${buildDir}/test-results/integrationTest") + inputs.dir file("src/it") + inputs.files sourceSets.main.runtimeClasspath + outputs.dirs resultsDir + doLast { + ant.with { + taskdef(resource: "org/apache/ant/antunit/antlib.xml", + classpath: configurations.antUnit.asPath) + taskdef(resource: "org/apache/ivy/ant/antlib.xml", + classpath: configurations.antIvy.asPath) + taskdef(resource: "org/springframework/boot/ant/antlib.xml", + classpath: sourceSets.main.runtimeClasspath.asPath, + uri: "antlib:org.springframework.boot.ant") + ant.property(name: "ivy.class.path", value: configurations.antIvy.asPath) + ant.property(name: "antunit.class.path", value: configurations.antUnit.asPath) + antunit { + propertyset { + ant.propertyref(name: "build.compiler") + ant.propertyref(name: "antunit.class.path") + ant.propertyref(name: "ivy.class.path") + } + plainlistener() + file("${buildDir}/test-results/integrationTest").mkdirs() + xmllistener(toDir: resultsDir) + fileset(dir: "${buildDir}/it", includes: "**/build.xml") + } + } + } +} + +check { + dependsOn integrationTest +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-antlib/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-antlib/pom.xml deleted file mode 100644 index d40a79a8ead8..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-antlib/pom.xml +++ /dev/null @@ -1,155 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-tools - ${revision} - - spring-boot-antlib - Spring Boot Antlib - Spring Boot Antlib - - ${basedir}/../../.. - 1.9.3 - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - org.springframework.boot - spring-boot-loader-tools - compile - - - - org.springframework.boot - spring-boot-loader - provided - - - org.apache.ant - ant - ${ant.version} - provided - - - - - - org.apache.maven.plugins - maven-shade-plugin - - - - org.springframework.boot:spring-boot-loader-tools - org.springframework:spring-core - - - true - false - true - false - - - - shade-runtime-dependencies - package - - shade - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - antunit - integration-test - - - - - - - - - - - - - - - - - - - - - ${skipTests} - - - run - - - - - - org.apache.ant - ant - ${ant.version} - - - org.apache.ant - ant-launcher - ${ant.version} - - - org.apache.ant - ant-antunit - 1.3 - - - org.apache.ivy - ivy - 2.4.0 - - - org.eclipse.jdt.core.compiler - ecj - 4.6.1 - - - - - - - - java-8 - - [1.8,1.9) - - - org.eclipse.jdt.core.JDTCompilerAdapter - - - - java-9 - - [1.9,) - - - modern - - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-antlib/src/it/sample/build.xml b/spring-boot-project/spring-boot-tools/spring-boot-antlib/src/it/sample/build.xml index c6992bb33eca..1ea131312e56 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-antlib/src/it/sample/build.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-antlib/src/it/sample/build.xml @@ -6,11 +6,16 @@ + + + - + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/build.gradle new file mode 100644 index 000000000000..40eafac68b67 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'java-library' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.deployed' +} + +description = 'Spring Boot AutoConfigure Annotation Processor' + +dependencies { + testImplementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + testImplementation project(':spring-boot-project:spring-boot-tools:spring-boot-test-support') + testImplementation 'org.assertj:assertj-core' + testImplementation 'org.springframework:spring-core' + testImplementation 'org.junit.jupiter:junit-jupiter' + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/pom.xml deleted file mode 100644 index 6e9fd42e10c8..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/pom.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-tools - ${revision} - - spring-boot-autoconfigure-processor - Spring Boot Auto-Configure Annotation Processor - Spring Auto-Configure Annotation Processor - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - org.springframework.boot - spring-boot-test-support - test - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - none - - - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/pom.xml deleted file mode 100644 index a2af1b413cc5..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/pom.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-tools - ${revision} - - spring-boot-configuration-docs - Spring Boot Configuration Docs - Spring Boot Configuration Docs - - ${basedir}/../../.. - - - - org.springframework.boot - spring-boot-configuration-metadata - - - org.springframework.boot - spring-boot-test-support - test - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/package-info.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/package-info.java deleted file mode 100644 index 1c9c21ac81fa..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Support for generating documentation of configuration properties. - */ -package org.springframework.boot.configurationdocs; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/build.gradle new file mode 100644 index 000000000000..6e651c7df65b --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'java-library' + id 'maven-publish' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Configuration Metadata' + +dependencies { + implementation enforcedPlatform(project(path: ":spring-boot-project:spring-boot-parent")) + implementation "com.vaadin.external.google:android-json" + + testImplementation "org.junit.jupiter:junit-jupiter" + testImplementation "org.assertj:assertj-core" + testImplementation "org.springframework:spring-core" +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/pom.xml deleted file mode 100644 index 68862f4c88b8..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/pom.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-tools - ${revision} - - spring-boot-configuration-metadata - Spring Boot Configuration Metadata - Spring Boot Configuration Metadata - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - com.vaadin.external.google - android-json - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/build.gradle new file mode 100644 index 000000000000..c358dab7113b --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'java-library' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.deployed' +} + +description = 'Spring Boot Configuration Annotation Processor' + +sourceSets { + main { + java { + srcDir file("src/json-shade/java") + } + } +} + +dependencies { + testImplementation enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies")) + testImplementation project(":spring-boot-project:spring-boot-tools:spring-boot-test-support") + testImplementation "javax.validation:validation-api" + testImplementation "org.assertj:assertj-core" + testImplementation "org.hamcrest:hamcrest-library" + testImplementation "org.junit.jupiter:junit-jupiter" + testImplementation "org.mockito:mockito-core" + testImplementation "org.projectlombok:lombok" + testImplementation "org.springframework:spring-core" +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/pom.xml deleted file mode 100644 index 09c2e751120a..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-tools - ${revision} - - spring-boot-configuration-processor - Spring Boot Configuration Processor - Spring Boot Configuration Processor - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - org.projectlombok - lombok - test - - - jakarta.validation - jakarta.validation-api - test - - - org.springframework.boot - spring-boot-test-support - test - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - none - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-json-shade-source - generate-sources - - add-source - - - - ${basedir}/src/json-shade/java - - - - - - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSON.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSON.java index f8876a599d5b..f207c3912d1f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSON.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSON.java @@ -102,24 +102,21 @@ static String toString(Object value) { return null; } - public static JSONException typeMismatch(Object indexOrName, Object actual, - String requiredType) throws JSONException { + public static JSONException typeMismatch(Object indexOrName, Object actual, String requiredType) + throws JSONException { if (actual == null) { throw new JSONException("Value at " + indexOrName + " is null."); } - throw new JSONException("Value " + actual + " at " + indexOrName + " of type " - + actual.getClass().getName() + " cannot be converted to " - + requiredType); + throw new JSONException("Value " + actual + " at " + indexOrName + " of type " + actual.getClass().getName() + + " cannot be converted to " + requiredType); } - public static JSONException typeMismatch(Object actual, String requiredType) - throws JSONException { + public static JSONException typeMismatch(Object actual, String requiredType) throws JSONException { if (actual == null) { throw new JSONException("Value is null."); } - throw new JSONException( - "Value " + actual + " of type " + actual.getClass().getName() - + " cannot be converted to " + requiredType); + throw new JSONException("Value " + actual + " of type " + actual.getClass().getName() + + " cannot be converted to " + requiredType); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java index 06d3a2c4b7de..ebd63c4be025 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java @@ -127,7 +127,6 @@ public int length() { /** * Appends {@code value} to the end of this array. - * * @param value the value * @return this array. */ @@ -138,7 +137,6 @@ public JSONArray put(boolean value) { /** * Appends {@code value} to the end of this array. - * * @param value a finite value. May not be {@link Double#isNaN() NaNs} or * {@link Double#isInfinite() infinities}. * @return this array. @@ -171,7 +169,6 @@ public JSONArray put(long value) { /** * Appends {@code value} to the end of this array. - * * @param value a {@link JSONObject}, {@link JSONArray}, String, Boolean, Integer, * Long, Double, {@link JSONObject#NULL}, or {@code null}. May not be * {@link Double#isNaN() NaNs} or {@link Double#isInfinite() infinities}. Unsupported @@ -288,8 +285,7 @@ public Object get(int index) throws JSONException { return value; } catch (IndexOutOfBoundsException e) { - throw new JSONException( - "Index " + index + " out of range [0.." + this.values.size() + ")"); + throw new JSONException("Index " + index + " out of range [0.." + this.values.size() + ")"); } } @@ -444,7 +440,6 @@ public int optInt(int index, int fallback) { * a long. * @param index the index to get the value from * @return the {@code value} - * * @throws JSONException if the value at {@code index} doesn't exist or cannot be * coerced to a long. */ @@ -642,7 +637,6 @@ public String toString() { * 94043, * 90210 * ] - * * @param indentSpaces the number of spaces to indent for each level of nesting. * @return a human readable JSON string of this array * @throws JSONException if processing of json failed diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java index e2377bec6d73..b7a34606bb65 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java @@ -41,11 +41,11 @@ *
  • When the requested type is an int, other {@link Number} types will be coerced using * {@link Number#intValue() intValue}. Strings that can be coerced using * {@link Double#valueOf(String)} will be, and then cast to int. - *
  • When the requested type is a long, other {@link Number} types will - * be coerced using {@link Number#longValue() longValue}. Strings that can be coerced - * using {@link Double#valueOf(String)} will be, and then cast to long. This two-step - * conversion is lossy for very large values. For example, the string - * "9223372036854775806" yields the long 9223372036854775807. + *
  • When the requested type is a long, other {@link Number} types will be + * coerced using {@link Number#longValue() longValue}. Strings that can be coerced using + * {@link Double#valueOf(String)} will be, and then cast to long. This two-step conversion + * is lossy for very large values. For example, the string "9223372036854775806" yields + * the long 9223372036854775807. *
  • When the requested type is a String, other non-null values will be coerced using * {@link String#valueOf(Object)}. Although null cannot be coerced, the sentinel value * {@link JSONObject#NULL} is coerced to the string "null". @@ -117,7 +117,6 @@ public JSONObject() { /** * Creates a new {@code JSONObject} by copying all name/value mappings from the given * map. - * * @param copyFrom a map whose keys are of type {@link String} and whose values are of * supported types. * @throws NullPointerException if any of the map's keys are null. @@ -334,7 +333,6 @@ String checkName(String name) throws JSONException { /** * Removes the named mapping if it exists; does nothing otherwise. - * * @param name the name of the property * @return the value previously mapped by {@code name}, or null if there was no such * mapping. @@ -430,7 +428,6 @@ public boolean optBoolean(String name, boolean fallback) { /** * Returns the value mapped by {@code name} if it exists and is a double or can be * coerced to a double. - * * @param name the name of the property * @return the value * @throws JSONException if the mapping doesn't exist or cannot be coerced to a @@ -690,8 +687,7 @@ public Iterator keys() { * @return the array */ public JSONArray names() { - return this.nameValuePairs.isEmpty() ? null - : new JSONArray(new ArrayList<>(this.nameValuePairs.keySet())); + return this.nameValuePairs.isEmpty() ? null : new JSONArray(new ArrayList<>(this.nameValuePairs.keySet())); } /** @@ -823,9 +819,9 @@ else if (o.getClass().isArray()) { if (o instanceof Map) { return new JSONObject((Map) o); } - if (o instanceof Boolean || o instanceof Byte || o instanceof Character - || o instanceof Double || o instanceof Float || o instanceof Integer - || o instanceof Long || o instanceof Short || o instanceof String) { + if (o instanceof Boolean || o instanceof Byte || o instanceof Character || o instanceof Double + || o instanceof Float || o instanceof Integer || o instanceof Long || o instanceof Short + || o instanceof String) { return o; } if (o.getClass().getPackage().getName().startsWith("java.")) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java index df2c8d7ec493..c3d73a970ace 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONStringer.java @@ -191,8 +191,7 @@ JSONStringer open(Scope empty, String openBracket) throws JSONException { * @return the JSON stringer * @throws JSONException if processing of json failed */ - JSONStringer close(Scope empty, Scope nonempty, String closeBracket) - throws JSONException { + JSONStringer close(Scope empty, Scope nonempty, String closeBracket) throws JSONException { Scope context = peek(); if (context != nonempty && context != empty) { throw new JSONException("Nesting problem"); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java index 6bc692e71ef5..2a47e73e94ad 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java @@ -375,8 +375,8 @@ else if (first != -1) { throw syntaxError("Names cannot be null"); } else { - throw syntaxError("Names must be strings, but " + name - + " is of type " + name.getClass().getName()); + throw syntaxError( + "Names must be strings, but " + name + " is of type " + name.getClass().getName()); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle index 85454c1f9db8..b5ca902545f1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle @@ -1,71 +1,112 @@ -buildscript { - repositories { - mavenLocal() - mavenCentral() - } - dependencies { - classpath("io.spring.javaformat:spring-javaformat-gradle-plugin:0.0.15") - } -} - plugins { - id 'java' - id 'eclipse' + id 'java-gradle-plugin' + id 'maven-publish' + id 'org.asciidoctor.jvm.convert' + id 'org.asciidoctor.jvm.pdf' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.maven-repository' + id 'org.springframework.boot.optional-dependencies' } -apply plugin: 'io.spring.javaformat' +description = 'Spring Boot Gradle Plugin' + +configurations { + asciidoctorExtensions + documentation +} repositories { - mavenLocal() - mavenCentral() + maven { + url 'https://repo.spring.io/release' + mavenContent { + includeGroup 'io.spring.asciidoctor' + } + } } dependencies { - implementation localGroovy() - implementation gradleApi() - implementation fileTree(dir: 'target/dependencies/compile', include: '*.jar') - testImplementation gradleTestKit() - testImplementation 'org.apache.commons:commons-compress:1.13' - testImplementation fileTree(dir: 'target/dependencies/test', include: '*.jar') + asciidoctorExtensions 'io.spring.asciidoctor:spring-asciidoctor-extensions-block-switch:0.3.0.RELEASE' + implementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + implementation project(':spring-boot-project:spring-boot-tools:spring-boot-loader-tools') + implementation 'io.spring.gradle:dependency-management-plugin' + implementation 'org.apache.commons:commons-compress' + implementation 'org.springframework:spring-core' + + optional enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + optional 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50' + + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.assertj:assertj-core' + testImplementation 'org.mockito:mockito-core' +} + +gradlePlugin { + plugins { + springBootPlugin { + id = 'org.springframework.boot' + implementationClass = 'org.springframework.boot.gradle.plugin.SpringBootPlugin' + } + } } jar { manifest { - attributes 'Implementation-Version': (version ? version : 'unknown') + attributes 'Implementation-Version': project.version } } -test { - useJUnitPlatform() - testLogging { - events "passed", "skipped", "failed" +task dependencyVersions(type: org.springframework.boot.build.constraints.ExtractVersionConstraints) { + enforcedPlatform(':spring-boot-project:spring-boot-dependencies') +} + +tasks.withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask) { + dependsOn dependencyVersions + doFirst { + attributes 'dependency-management-plugin-version': dependencyVersions.versionConstraints['io.spring.gradle:dependency-management-plugin'] } } -javadoc { - options { - author() - stylesheetFile = file('src/main/javadoc/spring-javadoc.css') - links = [ - 'https://docs.oracle.com/javase/8/docs/api/', - 'https://docs.gradle.org/current/javadoc/' - ] - source = '8' +asciidoctor { + configurations 'asciidoctorExtensions' + sources { + include 'index.adoc' + } + attributes 'stylesheet': 'css/style.css' +} + +asciidoctorPdf { + sources { + include 'index.adoc' } - title = "${project.description} $version API" } -task sourcesJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allSource +javadoc { + options { + author = true + docTitle = "Spring Boot Gradle Plugin ${project.version} API" + encoding = 'UTF-8' + memberLevel = 'protected' + outputLevel = 'quiet' + splitIndex = true + use = true + windowTitle = "Spring Boot Gradle Plugin ${project.version} API" + } } -task javadocJar(type: Jar) { - classifier = "javadoc" - from javadoc +task zip(type: Zip) { + dependsOn asciidoctor, asciidoctorPdf + duplicatesStrategy 'fail' + from(asciidoctorPdf.outputDir) { + into 'reference/pdf' + } + from(asciidoctor.outputDir) { + into 'reference/html' + } + from(javadoc) { + into 'api' + } } artifacts { - archives sourcesJar - archives javadocJar + 'documentation' zip } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradle.properties b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradle.properties deleted file mode 100644 index 6b1823d86a69..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.daemon=false diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradle/wrapper/gradle-wrapper.jar b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 135367700529..000000000000 Binary files a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/pom.xml deleted file mode 100644 index 94a48efafa53..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/pom.xml +++ /dev/null @@ -1,399 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-tools - ${revision} - - spring-boot-gradle-plugin - pom - Spring Boot Gradle Plugin - Spring Boot Gradle Plugin - - ${basedir}/../../.. - ./gradlew - build - ${project.build.directory}/refdocs/ - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - org.springframework.boot - spring-boot-loader-tools - - - io.spring.gradle - dependency-management-plugin - - - org.apache.commons - commons-compress - - - org.jetbrains.kotlin - kotlin-gradle-plugin - ${kotlin.version} - true - - - - - - com.googlecode.maven-download-plugin - download-maven-plugin - - - unpack-doc-resources - generate-resources - - wget - - - ${spring-doc-resources.url} - true - ${refdocs.build.directory}/asciidoc - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-compile-dependencies - generate-resources - - copy-dependencies - - false - - compile - ${project.build.directory}/dependencies/compile - - - - copy-test-dependencies - generate-resources - - copy-dependencies - - false - - test - ${project.build.directory}/dependencies/test - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - copy-asciidoc-resources - generate-resources - - copy-resources - - - ${refdocs.build.directory}/asciidoc - - - src/main/asciidoc - false - - - - - - copy-gradle-resources - generate-resources - - copy-resources - - - ${refdocs.build.directory}/gradle - - - src/main/gradle - false - - - - - - - - org.codehaus.mojo - exec-maven-plugin - - - gradle - prepare-package - - ${gradle.executable} - - clean - ${gradle.task} - -Pversion=${project.version} - -Pdescription=${project.description} - -S - - - - exec - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - package - - attach-artifact - - - - - build/libs/${project.artifactId}-${project.version}.jar - jar - - - build/libs/${project.artifactId}-${project.version}-javadoc.jar - jar - javadoc - - - build/libs/${project.artifactId}-${project.version}-sources.jar - jar - sources - - - - - - - - - - - windows - - - windows - - - - gradlew.bat - - - - skipTests - - - skipTests - true - - - - assemble - - - - full - - - full - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - ant-contrib - ant-contrib - 1.0b3 - - - ant - ant - - - - - org.apache.ant - ant-nodeps - 1.8.1 - - - org.tigris.antelope - antelopetasks - 3.2.10 - - - - - set-up-maven-properties - prepare-package - - run - - - true - - - - - - - - - - - - - - - package-docs-zip - package - - run - - - - - - - - - - - - - - - - - - org.asciidoctor - asciidoctor-maven-plugin - - - generate-html-documentation - prepare-package - - process-asciidoc - - - html5 - ${project.build.directory}/generated-docs/reference/html - highlight.js - book - - js/highlight - github - true - ./images - font - css/ - style.css - warn - - - true - - DEBUG - - - - - - generate-pdf-documentation - prepare-package - - process-asciidoc - - - pdf - ${project.build.directory}/generated-docs/reference/pdf - - - - - ${refdocs.build.directory}/asciidoc - index.adoc - - ${github-tag} - ${version-type} - ${project.version} - ${dependency-management-plugin.version} - - - - - io.spring.asciidoctor - spring-asciidoctor-extensions-block-switch - ${spring-asciidoctor-extensions.version} - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-zip - - attach-artifact - - - - - ${project.build.directory}/${project.artifactId}-${project.version}-docs.zip - zip - docs - - - - - - - - - - - java13 - - 13 - - - assemble - - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/css/style.css b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/css/style.css similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/css/style.css rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/css/style.css diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/getting-started.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/getting-started.adoc similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/getting-started.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/getting-started.adoc diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/index.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/index.adoc similarity index 96% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/index.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/index.adoc index c13bb7fdc08d..efe4d2e371e6 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/index.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/index.adoc @@ -22,7 +22,7 @@ Andy Wilkinson :maven-publish-plugin: {gradle-userguide}/maven_publish_plugin.html :software-component: {gradle-userguide}/software_model_extend.html :kotlin-plugin: https://kotlinlang.org/docs/reference/using-gradle.html -:spring-boot-docs: https://docs.spring.io/spring-boot/docs/{version} +:spring-boot-docs: https://docs.spring.io/spring-boot/docs/{gradle-project-version} :api-documentation: {spring-boot-docs}/gradle-plugin/api :spring-boot-reference: {spring-boot-docs}/reference/htmlsingle :build-info-javadoc: {api-documentation}/org/springframework/boot/gradle/tasks/buildinfo/BuildInfo.html diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/integrating-with-actuator.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/integrating-with-actuator.adoc similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/integrating-with-actuator.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/integrating-with-actuator.adoc diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/managing-dependencies.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/managing-dependencies.adoc similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/managing-dependencies.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/managing-dependencies.adoc diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/packaging.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging.adoc similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/packaging.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging.adoc diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/publishing.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/publishing.adoc similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/publishing.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/publishing.adoc diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/reacting.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/reacting.adoc similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/reacting.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/reacting.adoc diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/running.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/running.adoc similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/running.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/running.adoc diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/apply-plugin-release.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/apply-plugin-release.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/apply-plugin-release.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/apply-plugin-release.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/apply-plugin-release.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/apply-plugin-release.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/apply-plugin-release.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/apply-plugin-release.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/apply-plugin-snapshot.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/apply-plugin-snapshot.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/apply-plugin-snapshot.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/apply-plugin-snapshot.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/milestone-settings.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/milestone-settings.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/milestone-settings.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/milestone-settings.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/milestone-settings.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/milestone-settings.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/milestone-settings.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/milestone-settings.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/snapshot-settings.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/snapshot-settings.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/snapshot-settings.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/snapshot-settings.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/snapshot-settings.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/snapshot-settings.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/snapshot-settings.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/snapshot-settings.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/typical-plugins.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/typical-plugins.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/typical-plugins.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/typical-plugins.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/typical-plugins.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/typical-plugins.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/getting-started/typical-plugins.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/getting-started/typical-plugins.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-additional.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-additional.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-additional.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-additional.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-additional.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-additional.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-additional.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-additional.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-basic.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-basic.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-basic.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-basic.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-basic.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-basic.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-basic.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-basic.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-custom-values.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-custom-values.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-custom-values.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-custom-values.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-custom-values.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-custom-values.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/integrating-with-actuator/build-info-custom-values.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/integrating-with-actuator/build-info-custom-values.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/configure-bom-with-plugins.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom-with-plugins.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/configure-bom-with-plugins.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom-with-plugins.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/configure-bom.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/configure-bom.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/configure-bom.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/configure-bom.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/configure-bom.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/custom-version.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/custom-version.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/custom-version.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/custom-version.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/custom-version.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/depend-on-plugin-milestone.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-milestone.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/depend-on-plugin-milestone.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-milestone.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/depend-on-plugin-release.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-release.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/depend-on-plugin-release.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-release.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/depend-on-plugin-release.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-release.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/depend-on-plugin-release.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-release.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/depend-on-plugin-snapshot.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-snapshot.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/depend-on-plugin-snapshot.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/depend-on-plugin-snapshot.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/dependencies.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/dependencies.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/dependencies.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/dependencies.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/dependencies.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/dependencies.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/managing-dependencies/dependencies.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/managing-dependencies/dependencies.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/application-plugin-main-class.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/application-plugin-main-class.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/application-plugin-main-class.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/application-plugin-main-class.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/application-plugin-main-class.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/application-plugin-main-class.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/application-plugin-main-class.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/application-plugin-main-class.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-and-jar.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-and-jar.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-and-jar.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-and-jar.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-and-jar.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-custom-launch-script.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-custom-launch-script.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-custom-launch-script.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-custom-launch-script.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-custom-launch-script.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-include-launch-script.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-include-launch-script.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-include-launch-script.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-include-launch-script.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-include-launch-script.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-launch-script-properties.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-launch-script-properties.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-launch-script-properties.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-launch-script-properties.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-launch-script-properties.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-main-class.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-main-class.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-main-class.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-main-class.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-main-class.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-manifest-main-class.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-manifest-main-class.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-manifest-main-class.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-manifest-main-class.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-manifest-main-class.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-manifest-main-class.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-manifest-main-class.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-manifest-main-class.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-requires-unpack.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-requires-unpack.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-requires-unpack.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-jar-requires-unpack.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-jar-requires-unpack.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-war-include-devtools.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-war-include-devtools.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-war-include-devtools.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-war-include-devtools.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-include-devtools.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-war-properties-launcher.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-war-properties-launcher.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-war-properties-launcher.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/boot-war-properties-launcher.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/boot-war-properties-launcher.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/spring-boot-dsl-main-class.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/spring-boot-dsl-main-class.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/spring-boot-dsl-main-class.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/spring-boot-dsl-main-class.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/spring-boot-dsl-main-class.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/war-container-dependency.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/war-container-dependency.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/war-container-dependency.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/war-container-dependency.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/war-container-dependency.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/war-container-dependency.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/packaging/war-container-dependency.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/packaging/war-container-dependency.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/publishing/maven-publish.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/publishing/maven-publish.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/publishing/maven-publish.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/publishing/maven-publish.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/publishing/maven-publish.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/publishing/maven-publish.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/publishing/maven-publish.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/publishing/maven-publish.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/publishing/maven.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/publishing/maven.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/publishing/maven.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/publishing/maven.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/publishing/maven.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/publishing/maven.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/publishing/maven.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/publishing/maven.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/application-plugin-main-class-name.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/application-plugin-main-class-name.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/application-plugin-main-class-name.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/application-plugin-main-class-name.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/application-plugin-main-class-name.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/application-plugin-main-class-name.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/application-plugin-main-class-name.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/application-plugin-main-class-name.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-disable-optimized-launch.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-disable-optimized-launch.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-disable-optimized-launch.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-disable-optimized-launch.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-disable-optimized-launch.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-disable-optimized-launch.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-disable-optimized-launch.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-disable-optimized-launch.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-main.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-main.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-main.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-main.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-main.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-main.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-main.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-main.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-source-resources.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-source-resources.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-source-resources.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-source-resources.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-source-resources.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-source-resources.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/boot-run-source-resources.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/boot-run-source-resources.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/spring-boot-dsl-main-class-name.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/spring-boot-dsl-main-class-name.gradle rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/spring-boot-dsl-main-class-name.gradle.kts b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle.kts similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/gradle/running/spring-boot-dsl-main-class-name.gradle.kts rename to spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/gradle/running/spring-boot-dsl-main-class-name.gradle.kts diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/resources/META-INF/gradle-plugins/org.springframework.boot.properties b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/resources/META-INF/gradle-plugins/org.springframework.boot.properties deleted file mode 100644 index 730938f5c3b3..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/resources/META-INF/gradle-plugins/org.springframework.boot.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.springframework.boot.gradle.plugin.SpringBootPlugin diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/GettingStartedDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/GettingStartedDocumentationTests.java index 1d52c421af39..2176bc64f3ec 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/GettingStartedDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/GettingStartedDocumentationTests.java @@ -38,7 +38,7 @@ class GettingStartedDocumentationTests { @TestTemplate void typicalPluginsAppliesExceptedPlugins() { - this.gradleBuild.script("src/main/gradle/getting-started/typical-plugins").build("verify"); + this.gradleBuild.script("src/docs/gradle/getting-started/typical-plugins").build("verify"); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java index 02579592db29..a11e84eb071d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java @@ -42,14 +42,14 @@ class IntegratingWithActuatorDocumentationTests { @TestTemplate void basicBuildInfo() throws IOException { - this.gradleBuild.script("src/main/gradle/integrating-with-actuator/build-info-basic").build("bootBuildInfo"); + this.gradleBuild.script("src/docs/gradle/integrating-with-actuator/build-info-basic").build("bootBuildInfo"); assertThat(new File(this.gradleBuild.getProjectDir(), "build/resources/main/META-INF/build-info.properties")) .isFile(); } @TestTemplate void buildInfoCustomValues() throws IOException { - this.gradleBuild.script("src/main/gradle/integrating-with-actuator/build-info-custom-values") + this.gradleBuild.script("src/docs/gradle/integrating-with-actuator/build-info-custom-values") .build("bootBuildInfo"); File file = new File(this.gradleBuild.getProjectDir(), "build/resources/main/META-INF/build-info.properties"); assertThat(file).isFile(); @@ -62,7 +62,7 @@ void buildInfoCustomValues() throws IOException { @TestTemplate void buildInfoAdditional() throws IOException { - this.gradleBuild.script("src/main/gradle/integrating-with-actuator/build-info-additional") + this.gradleBuild.script("src/docs/gradle/integrating-with-actuator/build-info-additional") .build("bootBuildInfo"); File file = new File(this.gradleBuild.getProjectDir(), "build/resources/main/META-INF/build-info.properties"); assertThat(file).isFile(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/ManagingDependenciesDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/ManagingDependenciesDocumentationTests.java index 91d43545c573..1b75a2ac625a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/ManagingDependenciesDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/ManagingDependenciesDocumentationTests.java @@ -39,18 +39,18 @@ class ManagingDependenciesDocumentationTests { @TestTemplate void dependenciesExampleEvaluatesSuccessfully() { - this.gradleBuild.script("src/main/gradle/managing-dependencies/dependencies").build(); + this.gradleBuild.script("src/docs/gradle/managing-dependencies/dependencies").build(); } @TestTemplate void customManagedVersions() { - assertThat(this.gradleBuild.script("src/main/gradle/managing-dependencies/custom-version").build("slf4jVersion") + assertThat(this.gradleBuild.script("src/docs/gradle/managing-dependencies/custom-version").build("slf4jVersion") .getOutput()).contains("1.7.20"); } @TestTemplate void dependencyManagementInIsolation() { - assertThat(this.gradleBuild.script("src/main/gradle/managing-dependencies/configure-bom") + assertThat(this.gradleBuild.script("src/docs/gradle/managing-dependencies/configure-bom") .build("dependencyManagement").getOutput()).contains("org.springframework.boot:spring-boot-starter "); } @@ -58,7 +58,7 @@ void dependencyManagementInIsolation() { void dependencyManagementInIsolationWithPluginsBlock() { assumingThat(this.gradleBuild.getDsl() == Dsl.KOTLIN, () -> assertThat( - this.gradleBuild.script("src/main/gradle/managing-dependencies/configure-bom-with-plugins") + this.gradleBuild.script("src/docs/gradle/managing-dependencies/configure-bom-with-plugins") .build("dependencyManagement").getOutput()) .contains("org.springframework.boot:spring-boot-starter TEST-SNAPSHOT")); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java index badd51274569..5f06a97597fd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java @@ -49,12 +49,12 @@ class PackagingDocumentationTests { @TestTemplate void warContainerDependencyEvaluatesSuccessfully() { - this.gradleBuild.script("src/main/gradle/packaging/war-container-dependency").build(); + this.gradleBuild.script("src/docs/gradle/packaging/war-container-dependency").build(); } @TestTemplate void bootJarMainClass() throws IOException { - this.gradleBuild.script("src/main/gradle/packaging/boot-jar-main-class").build("bootJar"); + this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-main-class").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -66,7 +66,7 @@ void bootJarMainClass() throws IOException { @TestTemplate void bootJarManifestMainClass() throws IOException { - this.gradleBuild.script("src/main/gradle/packaging/boot-jar-manifest-main-class").build("bootJar"); + this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-manifest-main-class").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -78,7 +78,7 @@ void bootJarManifestMainClass() throws IOException { @TestTemplate void applicationPluginMainClass() throws IOException { - this.gradleBuild.script("src/main/gradle/packaging/application-plugin-main-class").build("bootJar"); + this.gradleBuild.script("src/docs/gradle/packaging/application-plugin-main-class").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -90,7 +90,7 @@ void applicationPluginMainClass() throws IOException { @TestTemplate void springBootDslMainClass() throws IOException { - this.gradleBuild.script("src/main/gradle/packaging/spring-boot-dsl-main-class").build("bootJar"); + this.gradleBuild.script("src/docs/gradle/packaging/spring-boot-dsl-main-class").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -103,7 +103,7 @@ void springBootDslMainClass() throws IOException { @TestTemplate void bootWarIncludeDevtools() throws IOException { jarFile(new File(this.gradleBuild.getProjectDir(), "spring-boot-devtools-1.2.3.RELEASE.jar")); - this.gradleBuild.script("src/main/gradle/packaging/boot-war-include-devtools").build("bootWar"); + this.gradleBuild.script("src/docs/gradle/packaging/boot-war-include-devtools").build("bootWar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".war"); assertThat(file).isFile(); @@ -114,7 +114,7 @@ void bootWarIncludeDevtools() throws IOException { @TestTemplate void bootJarRequiresUnpack() throws IOException { - this.gradleBuild.script("src/main/gradle/packaging/boot-jar-requires-unpack").build("bootJar"); + this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-requires-unpack").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -127,7 +127,7 @@ void bootJarRequiresUnpack() throws IOException { @TestTemplate void bootJarIncludeLaunchScript() throws IOException { - this.gradleBuild.script("src/main/gradle/packaging/boot-jar-include-launch-script").build("bootJar"); + this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-include-launch-script").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -136,7 +136,7 @@ void bootJarIncludeLaunchScript() throws IOException { @TestTemplate void bootJarLaunchScriptProperties() throws IOException { - this.gradleBuild.script("src/main/gradle/packaging/boot-jar-launch-script-properties").build("bootJar"); + this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-launch-script-properties").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -148,7 +148,7 @@ void bootJarCustomLaunchScript() throws IOException { File customScriptFile = new File(this.gradleBuild.getProjectDir(), "src/custom.script"); customScriptFile.getParentFile().mkdirs(); FileCopyUtils.copy("custom", new FileWriter(customScriptFile)); - this.gradleBuild.script("src/main/gradle/packaging/boot-jar-custom-launch-script").build("bootJar"); + this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-custom-launch-script").build("bootJar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(file).isFile(); @@ -157,7 +157,7 @@ void bootJarCustomLaunchScript() throws IOException { @TestTemplate void bootWarPropertiesLauncher() throws IOException { - this.gradleBuild.script("src/main/gradle/packaging/boot-war-properties-launcher").build("bootWar"); + this.gradleBuild.script("src/docs/gradle/packaging/boot-war-properties-launcher").build("bootWar"); File file = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".war"); assertThat(file).isFile(); @@ -169,7 +169,7 @@ void bootWarPropertiesLauncher() throws IOException { @TestTemplate void bootJarAndJar() { - this.gradleBuild.script("src/main/gradle/packaging/boot-jar-and-jar").build("assemble"); + this.gradleBuild.script("src/docs/gradle/packaging/boot-jar-and-jar").build("assemble"); File jar = new File(this.gradleBuild.getProjectDir(), "build/libs/" + this.gradleBuild.getProjectDir().getName() + ".jar"); assertThat(jar).isFile(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PublishingDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PublishingDocumentationTests.java index 0e3fd00c2916..f1d4bb2014a7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PublishingDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PublishingDocumentationTests.java @@ -39,13 +39,13 @@ class PublishingDocumentationTests { @TestTemplate void mavenUpload() throws IOException { - assertThat(this.gradleBuild.script("src/main/gradle/publishing/maven").build("deployerRepository").getOutput()) + assertThat(this.gradleBuild.script("src/docs/gradle/publishing/maven").build("deployerRepository").getOutput()) .contains("https://repo.example.com"); } @TestTemplate void mavenPublish() throws IOException { - assertThat(this.gradleBuild.script("src/main/gradle/publishing/maven-publish").build("publishingConfiguration") + assertThat(this.gradleBuild.script("src/docs/gradle/publishing/maven-publish").build("publishingConfiguration") .getOutput()).contains("MavenPublication").contains("https://repo.example.com"); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java index cad05fca05f9..cf666000e73a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java @@ -20,6 +20,8 @@ import java.io.IOException; import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.condition.DisabledOnJre; +import org.junit.jupiter.api.condition.JRE; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.boot.gradle.junit.GradleMultiDslExtension; @@ -39,32 +41,35 @@ class RunningDocumentationTests { GradleBuild gradleBuild; @TestTemplate + @DisabledOnJre(JRE.JAVA_13) void bootRunMain() throws IOException { - assertThat(this.gradleBuild.script("src/main/gradle/running/boot-run-main").build("configuredMainClass") - .getOutput()).contains("com.example.ExampleApplication"); + // TODO Testing of convention mappings is flakey in 5.2+ + // https://github.com/gradle/gradle/issues/11323 + assertThat(this.gradleBuild.gradleVersion("5.1.1").script("src/docs/gradle/running/boot-run-main") + .build("configuredMainClass").getOutput()).contains("com.example.ExampleApplication"); } @TestTemplate void applicationPluginMainClassName() { - assertThat(this.gradleBuild.script("src/main/gradle/running/application-plugin-main-class-name") + assertThat(this.gradleBuild.script("src/docs/gradle/running/application-plugin-main-class-name") .build("configuredMainClass").getOutput()).contains("com.example.ExampleApplication"); } @TestTemplate void springBootDslMainClassName() throws IOException { - assertThat(this.gradleBuild.script("src/main/gradle/running/spring-boot-dsl-main-class-name") + assertThat(this.gradleBuild.script("src/docs/gradle/running/spring-boot-dsl-main-class-name") .build("configuredMainClass").getOutput()).contains("com.example.ExampleApplication"); } @TestTemplate void bootRunSourceResources() throws IOException { - assertThat(this.gradleBuild.script("src/main/gradle/running/boot-run-source-resources") + assertThat(this.gradleBuild.script("src/docs/gradle/running/boot-run-source-resources") .build("configuredClasspath").getOutput()).contains(new File("src/main/resources").getPath()); } @TestTemplate void bootRunDisableOptimizedLaunch() throws IOException { - assertThat(this.gradleBuild.script("src/main/gradle/running/boot-run-disable-optimized-launch") + assertThat(this.gradleBuild.script("src/docs/gradle/running/boot-run-disable-optimized-launch") .build("optimizedLaunch").getOutput()).contains("false"); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilityExtension.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilityExtension.java index 3ad999ec1286..8d84f1dc6fae 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilityExtension.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilityExtension.java @@ -17,9 +17,11 @@ package org.springframework.boot.gradle.junit; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.stream.Stream; +import org.gradle.api.JavaVersion; import org.junit.jupiter.api.TestTemplate; import org.junit.jupiter.api.extension.Extension; import org.junit.jupiter.api.extension.ExtensionContext; @@ -38,8 +40,17 @@ */ public final class GradleCompatibilityExtension implements TestTemplateInvocationContextProvider { - private static final List GRADLE_VERSIONS = Arrays.asList("default", "5.0", "5.1.1", "5.2.1", "5.3.1", - "5.4.1", "5.5.1", "5.6.4", "6.0.1"); + private static final List GRADLE_VERSIONS; + + static { + if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_13)) { + GRADLE_VERSIONS = Collections.singletonList("default"); + } + else { + GRADLE_VERSIONS = Arrays.asList("4.10.3", "5.0", "5.1.1", "5.2.1", "5.3.1", "5.4.1", "5.5.1", "5.6.4", + "default"); + } + } @Override public Stream provideTestTemplateInvocationContexts(ExtensionContext context) { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java index 9b2ecd048ccd..0735d55ded55 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java @@ -99,8 +99,7 @@ void createTask() { void basicArchiveCreation() throws IOException { this.task.setMainClassName("com.example.Main"); executeTask(); - assertThat(this.task.getArchivePath()).exists(); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getManifest().getMainAttributes().getValue("Main-Class")).isEqualTo(this.launcherClass); assertThat(jarFile.getManifest().getMainAttributes().getValue("Start-Class")).isEqualTo("com.example.Main"); assertThat(jarFile.getManifest().getMainAttributes().getValue("Spring-Boot-Classes")) @@ -115,7 +114,7 @@ void classpathJarsArePackagedBeneathLibPath() throws IOException { this.task.setMainClassName("com.example.Main"); this.task.classpath(jarFile("one.jar"), jarFile("two.jar")); executeTask(); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry(this.libPath + "one.jar")).isNotNull(); assertThat(jarFile.getEntry(this.libPath + "two.jar")).isNotNull(); } @@ -130,7 +129,7 @@ void classpathFoldersArePackagedBeneathClassesPath() throws IOException { applicationClass.createNewFile(); this.task.classpath(classpathFolder); executeTask(); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry(this.classesPath + "com/example/Application.class")).isNotNull(); } } @@ -146,8 +145,8 @@ void moduleInfoClassIsPackagedInTheRootOfTheArchive() throws IOException { applicationClass.getParentFile().mkdirs(); applicationClass.createNewFile(); this.task.classpath(classpathFolder); - this.task.execute(); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + executeTask(); + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry(this.classesPath + "com/example/Application.class")).isNotNull(); assertThat(jarFile.getEntry("com/example/Application.class")).isNull(); assertThat(jarFile.getEntry("module-info.class")).isNotNull(); @@ -161,7 +160,7 @@ void classpathCanBeSetUsingAFileCollection() throws IOException { this.task.classpath(jarFile("one.jar")); this.task.setClasspath(this.task.getProject().files(jarFile("two.jar"))); executeTask(); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry(this.libPath + "one.jar")).isNull(); assertThat(jarFile.getEntry(this.libPath + "two.jar")).isNotNull(); } @@ -173,7 +172,7 @@ void classpathCanBeSetUsingAnObject() throws IOException { this.task.classpath(jarFile("one.jar")); this.task.setClasspath(jarFile("two.jar")); executeTask(); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry(this.libPath + "one.jar")).isNull(); assertThat(jarFile.getEntry(this.libPath + "two.jar")).isNotNull(); } @@ -183,8 +182,8 @@ void classpathCanBeSetUsingAnObject() throws IOException { void filesOnTheClasspathThatAreNotZipFilesAreSkipped() throws IOException { this.task.setMainClassName("com.example.Main"); this.task.classpath(new File("test.pom")); - this.task.execute(); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + executeTask(); + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry(this.libPath + "/test.pom")).isNull(); } } @@ -193,12 +192,13 @@ void filesOnTheClasspathThatAreNotZipFilesAreSkipped() throws IOException { void loaderIsWrittenToTheRootOfTheJarAfterManifest() throws IOException { this.task.setMainClassName("com.example.Main"); executeTask(); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry("org/springframework/boot/loader/LaunchedURLClassLoader.class")).isNotNull(); assertThat(jarFile.getEntry("org/springframework/boot/loader/")).isNotNull(); } // gh-16698 - try (ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(this.task.getArchivePath()))) { + try (ZipInputStream zipInputStream = new ZipInputStream( + new FileInputStream(this.task.getArchiveFile().get().getAsFile()))) { assertThat(zipInputStream.getNextEntry().getName()).isEqualTo("META-INF/"); assertThat(zipInputStream.getNextEntry().getName()).isEqualTo("META-INF/MANIFEST.MF"); } @@ -209,7 +209,7 @@ void loaderIsWrittenToTheRootOfTheJarWhenUsingThePropertiesLauncher() throws IOE this.task.setMainClassName("com.example.Main"); executeTask(); this.task.getManifest().getAttributes().put("Main-Class", "org.springframework.boot.loader.PropertiesLauncher"); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry("org/springframework/boot/loader/LaunchedURLClassLoader.class")).isNotNull(); assertThat(jarFile.getEntry("org/springframework/boot/loader/")).isNotNull(); } @@ -221,7 +221,7 @@ void unpackCommentIsAddedToEntryIdentifiedByAPattern() throws IOException { this.task.classpath(jarFile("one.jar"), jarFile("two.jar")); this.task.requiresUnpack("**/one.jar"); executeTask(); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry(this.libPath + "one.jar").getComment()).startsWith("UNPACK:"); assertThat(jarFile.getEntry(this.libPath + "two.jar").getComment()).isNull(); } @@ -233,7 +233,7 @@ void unpackCommentIsAddedToEntryIdentifiedByASpec() throws IOException { this.task.classpath(jarFile("one.jar"), jarFile("two.jar")); this.task.requiresUnpack((element) -> element.getName().endsWith("two.jar")); executeTask(); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry(this.libPath + "two.jar").getComment()).startsWith("UNPACK:"); assertThat(jarFile.getEntry(this.libPath + "one.jar").getComment()).isNull(); } @@ -245,13 +245,14 @@ void launchScriptCanBePrepended() throws IOException { this.task.launchScript(); executeTask(); Map properties = new HashMap<>(); - properties.put("initInfoProvides", this.task.getBaseName()); + properties.put("initInfoProvides", this.task.getArchiveBaseName().get()); properties.put("initInfoShortDescription", this.project.getDescription()); properties.put("initInfoDescription", this.project.getDescription()); - assertThat(Files.readAllBytes(this.task.getArchivePath().toPath())) + assertThat(Files.readAllBytes(this.task.getArchiveFile().get().getAsFile().toPath())) .startsWith(new DefaultLaunchScript(null, properties).toByteArray()); try { - Set permissions = Files.getPosixFilePermissions(this.task.getArchivePath().toPath()); + Set permissions = Files + .getPosixFilePermissions(this.task.getArchiveFile().get().getAsFile().toPath()); assertThat(permissions).contains(PosixFilePermission.OWNER_EXECUTE); } catch (UnsupportedOperationException ex) { @@ -266,7 +267,8 @@ void customLaunchScriptCanBePrepended() throws IOException { Files.write(customScript.toPath(), Arrays.asList("custom script"), StandardOpenOption.CREATE); this.task.launchScript((configuration) -> configuration.setScript(customScript)); executeTask(); - assertThat(Files.readAllBytes(this.task.getArchivePath().toPath())).startsWith("custom script".getBytes()); + assertThat(Files.readAllBytes(this.task.getArchiveFile().get().getAsFile().toPath())) + .startsWith("custom script".getBytes()); } @Test @@ -278,7 +280,7 @@ void launchScriptInitInfoPropertiesCanBeCustomized() throws IOException { configuration.getProperties().put("initInfoDescription", "description"); }); executeTask(); - byte[] bytes = Files.readAllBytes(this.task.getArchivePath().toPath()); + byte[] bytes = Files.readAllBytes(this.task.getArchiveFile().get().getAsFile().toPath()); assertThat(bytes).containsSequence("Provides: provides".getBytes()); assertThat(bytes).containsSequence("Short-Description: short description".getBytes()); assertThat(bytes).containsSequence("Description: description".getBytes()); @@ -289,8 +291,8 @@ void customMainClassInTheManifestIsHonored() throws IOException { this.task.setMainClassName("com.example.Main"); this.task.getManifest().getAttributes().put("Main-Class", "com.example.CustomLauncher"); executeTask(); - assertThat(this.task.getArchivePath()).exists(); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + assertThat(this.task.getArchiveFile().get().getAsFile()).exists(); + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getManifest().getMainAttributes().getValue("Main-Class")) .isEqualTo("com.example.CustomLauncher"); assertThat(jarFile.getManifest().getMainAttributes().getValue("Start-Class")).isEqualTo("com.example.Main"); @@ -303,8 +305,8 @@ void customStartClassInTheManifestIsHonored() throws IOException { this.task.setMainClassName("com.example.Main"); this.task.getManifest().getAttributes().put("Start-Class", "com.example.CustomMain"); executeTask(); - assertThat(this.task.getArchivePath()).exists(); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + assertThat(this.task.getArchiveFile().get().getAsFile()).exists(); + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getManifest().getMainAttributes().getValue("Main-Class")).isEqualTo(this.launcherClass); assertThat(jarFile.getManifest().getMainAttributes().getValue("Start-Class")) .isEqualTo("com.example.CustomMain"); @@ -316,8 +318,8 @@ void fileTimestampPreservationCanBeDisabled() throws IOException { this.task.setMainClassName("com.example.Main"); this.task.setPreserveFileTimestamps(false); executeTask(); - assertThat(this.task.getArchivePath()).exists(); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + assertThat(this.task.getArchiveFile().get().getAsFile()).exists(); + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { Enumeration entries = jarFile.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); @@ -332,9 +334,9 @@ void reproducibleOrderingCanBeEnabled() throws IOException { this.task.from(newFile("bravo.txt"), newFile("alpha.txt"), newFile("charlie.txt")); this.task.setReproducibleFileOrder(true); executeTask(); - assertThat(this.task.getArchivePath()).exists(); + assertThat(this.task.getArchiveFile().get().getAsFile()).exists(); List textFiles = new ArrayList<>(); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { Enumeration entries = jarFile.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); @@ -351,8 +353,8 @@ void devtoolsJarIsExcludedByDefault() throws IOException { this.task.setMainClassName("com.example.Main"); this.task.classpath(newFile("spring-boot-devtools-0.1.2.jar")); executeTask(); - assertThat(this.task.getArchivePath()).exists(); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + assertThat(this.task.getArchiveFile().get().getAsFile()).exists(); + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry(this.libPath + "spring-boot-devtools-0.1.2.jar")).isNull(); } } @@ -363,8 +365,8 @@ void devtoolsJarCanBeIncluded() throws IOException { this.task.classpath(jarFile("spring-boot-devtools-0.1.2.jar")); this.task.setExcludeDevtools(false); executeTask(); - assertThat(this.task.getArchivePath()).exists(); - try (JarFile jarFile = new JarFile(this.task.getArchivePath())) { + assertThat(this.task.getArchiveFile().get().getAsFile()).exists(); + try (JarFile jarFile = new JarFile(this.task.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry(this.libPath + "spring-boot-devtools-0.1.2.jar")).isNotNull(); } } @@ -379,7 +381,7 @@ void allEntriesUseUnixPlatformAndUtf8NameEncoding() throws IOException { resource.createNewFile(); this.task.classpath(classpathFolder); executeTask(); - File archivePath = this.task.getArchivePath(); + File archivePath = this.task.getArchiveFile().get().getAsFile(); try (ZipFile zip = new ZipFile(archivePath)) { Enumeration entries = zip.getEntries(); while (entries.hasMoreElements()) { @@ -401,9 +403,10 @@ void loaderIsWrittenFirstThenApplicationClassesThenLibraries() throws IOExceptio jarFile("third-library.jar")); this.task.requiresUnpack("second-library.jar"); executeTask(); - assertThat(getEntryNames(this.task.getArchivePath())).containsSubsequence("org/springframework/boot/loader/", - this.classesPath + "com/example/Application.class", this.libPath + "first-library.jar", - this.libPath + "second-library.jar", this.libPath + "third-library.jar"); + assertThat(getEntryNames(this.task.getArchiveFile().get().getAsFile())).containsSubsequence( + "org/springframework/boot/loader/", this.classesPath + "com/example/Application.class", + this.libPath + "first-library.jar", this.libPath + "second-library.jar", + this.libPath + "third-library.jar"); } protected File jarFile(String name) throws IOException { @@ -418,10 +421,10 @@ protected File jarFile(String name) throws IOException { private T configure(T task) throws IOException { AbstractArchiveTask archiveTask = task; - archiveTask.setBaseName("test"); + archiveTask.getArchiveBaseName().set("test"); File destination = new File(this.temp, "destination"); destination.mkdirs(); - archiveTask.setDestinationDir(destination); + archiveTask.getDestinationDirectory().set(destination); return task; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java index 5fae9e8d1336..141c992dca2f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java @@ -41,7 +41,7 @@ void contentCanBeAddedToBootInfUsingCopySpecFromGetter() throws IOException { bootJar.setMainClassName("com.example.Application"); bootJar.getBootInf().into("test").from(new File("build.gradle").getAbsolutePath()); bootJar.copy(); - try (JarFile jarFile = new JarFile(bootJar.getArchivePath())) { + try (JarFile jarFile = new JarFile(bootJar.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getJarEntry("BOOT-INF/test/build.gradle")).isNotNull(); } } @@ -52,7 +52,7 @@ void contentCanBeAddedToBootInfUsingCopySpecAction() throws IOException { bootJar.setMainClassName("com.example.Application"); bootJar.bootInf((copySpec) -> copySpec.into("test").from(new File("build.gradle").getAbsolutePath())); bootJar.copy(); - try (JarFile jarFile = new JarFile(bootJar.getArchivePath())) { + try (JarFile jarFile = new JarFile(bootJar.getArchiveFile().get().getAsFile())) { assertThat(jarFile.getJarEntry("BOOT-INF/test/build.gradle")).isNotNull(); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootWarTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootWarTests.java index 107a8272837b..e29ca6a0a3a4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootWarTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootWarTests.java @@ -40,7 +40,7 @@ void providedClasspathJarsArePackagedInWebInfLibProvided() throws IOException { getTask().setMainClassName("com.example.Main"); getTask().providedClasspath(jarFile("one.jar"), jarFile("two.jar")); executeTask(); - try (JarFile jarFile = new JarFile(getTask().getArchivePath())) { + try (JarFile jarFile = new JarFile(getTask().getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry("WEB-INF/lib-provided/one.jar")).isNotNull(); assertThat(jarFile.getEntry("WEB-INF/lib-provided/two.jar")).isNotNull(); } @@ -52,7 +52,7 @@ void providedClasspathCanBeSetUsingAFileCollection() throws IOException { getTask().providedClasspath(jarFile("one.jar")); getTask().setProvidedClasspath(getTask().getProject().files(jarFile("two.jar"))); executeTask(); - try (JarFile jarFile = new JarFile(getTask().getArchivePath())) { + try (JarFile jarFile = new JarFile(getTask().getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry("WEB-INF/lib-provided/one.jar")).isNull(); assertThat(jarFile.getEntry("WEB-INF/lib-provided/two.jar")).isNotNull(); } @@ -64,7 +64,7 @@ void providedClasspathCanBeSetUsingAnObject() throws IOException { getTask().providedClasspath(jarFile("one.jar")); getTask().setProvidedClasspath(jarFile("two.jar")); executeTask(); - try (JarFile jarFile = new JarFile(getTask().getArchivePath())) { + try (JarFile jarFile = new JarFile(getTask().getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry("WEB-INF/lib-provided/one.jar")).isNull(); assertThat(jarFile.getEntry("WEB-INF/lib-provided/two.jar")).isNotNull(); } @@ -75,8 +75,7 @@ void devtoolsJarIsExcludedByDefaultWhenItsOnTheProvidedClasspath() throws IOExce getTask().setMainClassName("com.example.Main"); getTask().providedClasspath(newFile("spring-boot-devtools-0.1.2.jar")); executeTask(); - assertThat(getTask().getArchivePath()).exists(); - try (JarFile jarFile = new JarFile(getTask().getArchivePath())) { + try (JarFile jarFile = new JarFile(getTask().getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry("WEB-INF/lib-provided/spring-boot-devtools-0.1.2.jar")).isNull(); } } @@ -87,8 +86,7 @@ void devtoolsJarCanBeIncludedWhenItsOnTheProvidedClasspath() throws IOException getTask().providedClasspath(jarFile("spring-boot-devtools-0.1.2.jar")); getTask().setExcludeDevtools(false); executeTask(); - assertThat(getTask().getArchivePath()).exists(); - try (JarFile jarFile = new JarFile(getTask().getArchivePath())) { + try (JarFile jarFile = new JarFile(getTask().getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry("WEB-INF/lib-provided/spring-boot-devtools-0.1.2.jar")).isNotNull(); } } @@ -103,8 +101,7 @@ void webappResourcesInDirectoriesThatOverlapWithLoaderCanBePackaged() throws IOE getTask().from(webappFolder); getTask().setMainClassName("com.example.Main"); executeTask(); - assertThat(getTask().getArchivePath()).exists(); - try (JarFile jarFile = new JarFile(getTask().getArchivePath())) { + try (JarFile jarFile = new JarFile(getTask().getArchiveFile().get().getAsFile())) { assertThat(jarFile.getEntry("org/")).isNotNull(); assertThat(jarFile.getEntry("org/foo.txt")).isNotNull(); } @@ -116,8 +113,8 @@ void libProvidedEntriesAreWrittenAfterLibEntries() throws IOException { getTask().classpath(jarFile("library.jar")); getTask().providedClasspath(jarFile("provided-library.jar")); executeTask(); - assertThat(getEntryNames(getTask().getArchivePath())).containsSubsequence("WEB-INF/lib/library.jar", - "WEB-INF/lib-provided/provided-library.jar"); + assertThat(getEntryNames(getTask().getArchiveFile().get().getAsFile())) + .containsSubsequence("WEB-INF/lib/library.jar", "WEB-INF/lib-provided/provided-library.jar"); } @Override diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/LaunchScriptConfigurationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/LaunchScriptConfigurationTests.java index bbff7099e922..895cde6b3ddb 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/LaunchScriptConfigurationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/LaunchScriptConfigurationTests.java @@ -17,6 +17,7 @@ package org.springframework.boot.gradle.tasks.bundling; import org.gradle.api.Project; +import org.gradle.api.provider.Property; import org.gradle.api.tasks.bundling.AbstractArchiveTask; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -43,7 +44,8 @@ void setUp() { @Test void initInfoProvidesUsesArchiveBaseNameByDefault() { - given(this.task.getBaseName()).willReturn("base-name"); + Property baseName = stringProperty("base-name"); + given(this.task.getArchiveBaseName()).willReturn(baseName); assertThat(new LaunchScriptConfiguration(this.task).getProperties()).containsEntry("initInfoProvides", "base-name"); } @@ -57,7 +59,8 @@ void initInfoShortDescriptionUsesDescriptionByDefault() { @Test void initInfoShortDescriptionUsesArchiveBaseNameWhenDescriptionIsNull() { - given(this.task.getBaseName()).willReturn("base-name"); + Property baseName = stringProperty("base-name"); + given(this.task.getArchiveBaseName()).willReturn(baseName); assertThat(new LaunchScriptConfiguration(this.task).getProperties()).containsEntry("initInfoShortDescription", "base-name"); } @@ -71,7 +74,8 @@ void initInfoShortDescriptionUsesSingleLineVersionOfMultiLineProjectDescription( @Test void initInfoDescriptionUsesArchiveBaseNameWhenDescriptionIsNull() { - given(this.task.getBaseName()).willReturn("base-name"); + Property baseName = stringProperty("base-name"); + given(this.task.getArchiveBaseName()).willReturn(baseName); assertThat(new LaunchScriptConfiguration(this.task).getProperties()).containsEntry("initInfoDescription", "base-name"); } @@ -90,4 +94,11 @@ void initInfoDescriptionUsesCorrectlyFormattedMultiLineProjectDescription() { "The\n# project\n# description"); } + @SuppressWarnings("unchecked") + private Property stringProperty(String value) { + Property property = mock(Property.class); + given(property.get()).willReturn(value); + return property; + } + } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests.java index b4cccc4276f5..0b56478f6b9a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests.java @@ -19,6 +19,7 @@ import java.io.File; import java.io.IOException; +import org.gradle.api.JavaVersion; import org.gradle.testkit.runner.BuildResult; import org.gradle.testkit.runner.TaskOutcome; import org.junit.jupiter.api.TestTemplate; @@ -88,7 +89,12 @@ void defaultJvmArgs() throws IOException { copyJvmArgsApplication(); BuildResult result = this.gradleBuild.build("bootRun"); assertThat(result.task(":bootRun").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); - assertThat(result.getOutput()).contains("1. -Xverify:none").contains("2. -XX:TieredStopAtLevel=1"); + if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_13)) { + assertThat(result.getOutput()).contains("1. -XX:TieredStopAtLevel=1"); + } + else { + assertThat(result.getOutput()).contains("1. -Xverify:none").contains("2. -XX:TieredStopAtLevel=1"); + } } @TestTemplate @@ -104,8 +110,14 @@ void applicationPluginJvmArgumentsAreUsed() throws IOException { copyJvmArgsApplication(); BuildResult result = this.gradleBuild.build("bootRun"); assertThat(result.task(":bootRun").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); - assertThat(result.getOutput()).contains("1. -Dcom.bar=baz").contains("2. -Dcom.foo=bar") - .contains("3. -Xverify:none").contains("4. -XX:TieredStopAtLevel=1"); + if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_13)) { + assertThat(result.getOutput()).contains("1. -Dcom.bar=baz").contains("2. -Dcom.foo=bar") + .contains("3. -XX:TieredStopAtLevel=1"); + } + else { + assertThat(result.getOutput()).contains("1. -Dcom.bar=baz").contains("2. -Dcom.foo=bar") + .contains("3. -Xverify:none").contains("4. -XX:TieredStopAtLevel=1"); + } } private void copyClasspathApplication() throws IOException { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle new file mode 100644 index 000000000000..161f106bb2f6 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle @@ -0,0 +1,50 @@ +plugins { + id 'java-library' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.deployed' +} + +description = 'Spring Boot Loader Tools' + +def generatedResources = "${buildDir}/generated-resources/main" + +configurations { + loader +} + +dependencies { + api "org.apache.commons:commons-compress:1.19" + + compileOnly "ch.qos.logback:logback-classic" + + implementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + implementation "org.springframework:spring-core" + + loader project(":spring-boot-project:spring-boot-tools:spring-boot-loader") + + testImplementation "org.assertj:assertj-core" + testImplementation "org.junit.jupiter:junit-jupiter" + testImplementation "org.mockito:mockito-core" + testImplementation "org.zeroturnaround:zt-zip:1.13" +} + +sourceSets { + main { + output.dir(generatedResources, builtBy: 'reproducibleLoaderJar') + } +} + +task reproducibleLoaderJar(type: Jar) { + dependsOn configurations.loader + from { + zipTree(configurations.loader.incoming.files.filter {it.name.startsWith "spring-boot-loader" }.singleFile) + } + reproducibleFileOrder = true + preserveFileTimestamps = false + archiveFileName = 'spring-boot-loader.jar' + destinationDirectory = file("${generatedResources}/META-INF/loader") +} + +jar { + dependsOn reproducibleLoaderJar +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/pom.xml deleted file mode 100644 index 889fc90bfe52..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/pom.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-tools - ${revision} - - spring-boot-loader-tools - Spring Boot Loader Tools - Spring Boot Loader Tools - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - org.springframework - spring-core - - - org.apache.commons - commons-compress - - - - org.springframework.boot - spring-boot-loader - provided - - - ch.qos.logback - logback-classic - provided - - - - org.zeroturnaround - zt-zip - test - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - include-loader-jar - generate-resources - - copy - - - - - org.springframework.boot - spring-boot-loader - ${project.version} - spring-boot-loader.jar - - - ${basedir}/target/generated-resources/loader/META-INF/loader - false - true - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-resources - generate-resources - - add-resource - - - - - ${basedir}/target/generated-resources/loader - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - ${git.commit.id} - - - - - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-loader/build.gradle new file mode 100644 index 000000000000..b80575d23b78 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/build.gradle @@ -0,0 +1,26 @@ +plugins { + id 'java-library' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.deployed' +} + +description = 'Spring Boot Loader' + +dependencies { + compileOnly "org.springframework:spring-core" + + implementation enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies")) + + testImplementation project(":spring-boot-project:spring-boot-tools:spring-boot-test-support") + + testImplementation "org.assertj:assertj-core" + testImplementation "org.awaitility:awaitility" + testImplementation "org.junit.jupiter:junit-jupiter" + testImplementation "org.mockito:mockito-core" + testImplementation "org.springframework:spring-test" + + testRuntimeOnly "ch.qos.logback:logback-classic" + testRuntimeOnly "org.bouncycastle:bcprov-jdk16:1.46" + testRuntimeOnly "org.slf4j:jcl-over-slf4j" + testRuntimeOnly "org.springframework:spring-webmvc" +} \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-loader/pom.xml deleted file mode 100644 index 09f459c6ef8b..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/pom.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-tools - ${revision} - - spring-boot-loader - Spring Boot Loader - Spring Boot Loader - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - org.springframework - spring-core - true - - - - org.springframework.boot - spring-boot-test-support - test - - - ch.qos.logback - logback-classic - test - - - org.awaitility - awaitility - test - - - - org.bouncycastle - bcprov-jdk16 - 1.46 - test - - - org.springframework - spring-webmvc - test - - - - - integration - - true - - - - - org.apache.maven.plugins - maven-invoker-plugin - - ${project.build.directory}/local-repo - - - - prepare-integration-test - pre-integration-test - - install - - - - integration-test - - run - - - ${project.build.directory}/it - src/it/settings.xml - verify - true - ${skipTests} - true - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - cleanup-local-integration-repo - pre-integration-test - - run - - - - - - - - - - - - - - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/application.properties b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/application.properties deleted file mode 100644 index 42acafa985f1..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -loader.path: target,target/lib,. -loader.main: org.springframework.boot.load.it.jar.EmbeddedJarStarter \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/pom.xml deleted file mode 100644 index 62ccd436bd42..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/pom.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - 4.0.0 - org.springframework.boot.launcher.it - executable-dir - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - org.apache.maven.plugins - maven-compiler-plugin - @maven-compiler-plugin.version@ - - - org.apache.maven.plugins - maven-dependency-plugin - @maven-dependency-plugin.version@ - - - unpack - prepare-package - - copy - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - jar - - - ${project.build.directory}/lib - - - - copy - prepare-package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - org.apache.maven.plugins - maven-surefire-plugin - @maven-surefire-plugin.version@ - - - org.codehaus.mojo - exec-maven-plugin - @exec-maven-plugin.version@ - - java - - -cp - ${project.build.directory}/lib/@project.artifactId@-@project.version@.jar - org.springframework.boot.loader.PropertiesLauncher - - - - - - - - org.eclipse.jetty - jetty-webapp - @jetty.version@ - - - org.eclipse.jetty - jetty-annotations - @jetty.version@ - - - org.springframework - spring-webmvc - @spring-framework.version@ - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/src/main/java/org/springframework/launcher/it/jar/EmbeddedJarStarter.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/src/main/java/org/springframework/launcher/it/jar/EmbeddedJarStarter.java deleted file mode 100644 index 86afc3a61ec5..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/src/main/java/org/springframework/launcher/it/jar/EmbeddedJarStarter.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.load.it.jar; - -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.servlet.ServletContextHandler; -import org.eclipse.jetty.servlet.ServletHolder; -import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; -import org.springframework.web.servlet.DispatcherServlet; - -/** - * Main class to start the embedded server. - * - * @author Phillip Webb - */ -public final class EmbeddedJarStarter { - - public static void main(String[] args) throws Exception { - Server server = new Server(8080); - - ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS); - context.setContextPath("/"); - server.setHandler(context); - - AnnotationConfigWebApplicationContext webApplicationContext = new AnnotationConfigWebApplicationContext(); - webApplicationContext.register(SpringConfiguration.class); - DispatcherServlet dispatcherServlet = new DispatcherServlet(webApplicationContext); - context.addServlet(new ServletHolder(dispatcherServlet), "/*"); - - server.start(); - server.join(); - } -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/src/main/java/org/springframework/launcher/it/jar/SpringConfiguration.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/src/main/java/org/springframework/launcher/it/jar/SpringConfiguration.java deleted file mode 100644 index c7c0d0bf2019..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/src/main/java/org/springframework/launcher/it/jar/SpringConfiguration.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.load.it.jar; - -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; - -/** - * Spring configuration. - * - * @author Phillip Webb - */ -@Configuration(proxyBeanMethods = false) -@EnableWebMvc -@ComponentScan -public class SpringConfiguration { - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/pom.xml deleted file mode 100644 index 7111e1f2178f..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/pom.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - 4.0.0 - org.springframework.boot.launcher.it - executable-jar - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - maven-assembly-plugin - @maven-assembly-plugin.version@ - - - src/main/assembly/jar-with-dependencies.xml - - false - - - org.springframework.boot.loader.JarLauncher - - - org.springframework.boot.load.it.jar.EmbeddedJarStarter - - - - - - jar-with-dependencies - package - - single - - - - - - org.apache.maven.plugins - maven-compiler-plugin - @maven-compiler-plugin.version@ - - - org.apache.maven.plugins - maven-dependency-plugin - @maven-dependency-plugin.version@ - - - unpack - prepare-package - - unpack - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - jar - - - ${project.build.directory}/assembly - - - - copy - prepare-package - - copy-dependencies - - - ${project.build.directory}/assembly/lib - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - org.apache.maven.plugins - maven-surefire-plugin - @maven-surefire-plugin.version@ - - - - - - org.eclipse.jetty - jetty-webapp - @jetty.version@ - - - org.eclipse.jetty - jetty-annotations - @jetty.version@ - - - org.springframework - spring-webmvc - @spring-framework.version@ - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/src/main/assembly/jar-with-dependencies.xml b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/src/main/assembly/jar-with-dependencies.xml deleted file mode 100644 index 1f7cf8ec13a4..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/src/main/assembly/jar-with-dependencies.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - full - - jar - - false - - - - - ${project.groupId}:${project.artifactId} - - true - - - - - ${project.build.directory}/assembly - / - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/src/main/java/org/springframework/launcher/it/jar/EmbeddedJarStarter.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/src/main/java/org/springframework/launcher/it/jar/EmbeddedJarStarter.java deleted file mode 100644 index 86afc3a61ec5..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/src/main/java/org/springframework/launcher/it/jar/EmbeddedJarStarter.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.load.it.jar; - -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.servlet.ServletContextHandler; -import org.eclipse.jetty.servlet.ServletHolder; -import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; -import org.springframework.web.servlet.DispatcherServlet; - -/** - * Main class to start the embedded server. - * - * @author Phillip Webb - */ -public final class EmbeddedJarStarter { - - public static void main(String[] args) throws Exception { - Server server = new Server(8080); - - ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS); - context.setContextPath("/"); - server.setHandler(context); - - AnnotationConfigWebApplicationContext webApplicationContext = new AnnotationConfigWebApplicationContext(); - webApplicationContext.register(SpringConfiguration.class); - DispatcherServlet dispatcherServlet = new DispatcherServlet(webApplicationContext); - context.addServlet(new ServletHolder(dispatcherServlet), "/*"); - - server.start(); - server.join(); - } -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/src/main/java/org/springframework/launcher/it/jar/SpringConfiguration.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/src/main/java/org/springframework/launcher/it/jar/SpringConfiguration.java deleted file mode 100644 index c7c0d0bf2019..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/src/main/java/org/springframework/launcher/it/jar/SpringConfiguration.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.load.it.jar; - -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; - -/** - * Spring configuration. - * - * @author Phillip Webb - */ -@Configuration(proxyBeanMethods = false) -@EnableWebMvc -@ComponentScan -public class SpringConfiguration { - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/loader.properties b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/loader.properties deleted file mode 100644 index 48a576ba043d..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/loader.properties +++ /dev/null @@ -1 +0,0 @@ -loader.path=jar:file:target/executable-props-lib-0.0.1.BUILD-SNAPSHOT-dependencies.jar/!BOOT-INF/lib \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/pom.xml deleted file mode 100644 index c466d86f44d9..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/pom.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - 4.0.0 - org.springframework.boot.launcher.it - executable-props-lib - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - maven-assembly-plugin - @maven-assembly-plugin.version@ - - - app - package - - single - - - - src/main/assembly/app.xml - - false - - - org.springframework.boot.loader.PropertiesLauncher - - - org.springframework.boot.launcher.it.props.EmbeddedJarStarter - - - - - - depedendencies - package - - single - - - - src/main/assembly/dependencies.xml - - false - - - - - - org.apache.maven.plugins - maven-compiler-plugin - @maven-compiler-plugin.version@ - - - org.apache.maven.plugins - maven-dependency-plugin - @maven-dependency-plugin.version@ - - - unpack - prepare-package - - unpack - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - jar - - - ${project.build.directory}/app-assembly - - - - copy - prepare-package - - copy-dependencies - - - ${project.build.directory}/dependencies-assembly/BOOT-INF/lib - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - org.apache.maven.plugins - maven-surefire-plugin - @maven-surefire-plugin.version@ - - - - - - org.springframework - spring-context - @spring-framework.version@ - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/src/main/assembly/app.xml b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/src/main/assembly/app.xml deleted file mode 100644 index 83a4f927e243..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/src/main/assembly/app.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - app - - jar - - false - - - - - ${project.groupId}:${project.artifactId} - - BOOT-INF/classes - true - - - - - ${project.build.directory}/app-assembly - / - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/src/main/assembly/dependencies.xml b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/src/main/assembly/dependencies.xml deleted file mode 100644 index 306b55e4e9c6..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/src/main/assembly/dependencies.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - dependencies - - jar - - false - - - ${project.build.directory}/dependencies-assembly - / - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/src/main/java/org/springframework/boot/launcher/it/props/EmbeddedJarStarter.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/src/main/java/org/springframework/boot/launcher/it/props/EmbeddedJarStarter.java deleted file mode 100644 index 23a4a38fd061..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/src/main/java/org/springframework/boot/launcher/it/props/EmbeddedJarStarter.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.launcher.it.props; - -import org.springframework.context.annotation.AnnotationConfigApplicationContext; - -/** - * Main class to start the embedded server. - * - * @author Dave Syer - */ -public final class EmbeddedJarStarter { - - public static void main(String[] args) throws Exception { - AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SpringConfiguration.class); - context.getBean(SpringConfiguration.class).run(args); - context.close(); - } - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/src/main/java/org/springframework/boot/launcher/it/props/SpringConfiguration.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/src/main/java/org/springframework/boot/launcher/it/props/SpringConfiguration.java deleted file mode 100644 index 9bdd06d44764..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/src/main/java/org/springframework/boot/launcher/it/props/SpringConfiguration.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.launcher.it.props; - -import java.io.IOException; -import java.util.Properties; - -import org.springframework.beans.factory.InitializingBean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.io.ClassPathResource; - -/** - * Spring configuration. - * - * @author Dave Syer - */ -@Configuration(proxyBeanMethods = false) -@ComponentScan -public class SpringConfiguration implements InitializingBean { - - private String message = "Jar"; - - @Override - public void afterPropertiesSet() throws IOException { - Properties props = new Properties(); - props.load(new ClassPathResource("application.properties").getInputStream()); - String value = props.getProperty("message"); - if (value!=null) { - this.message = value; - } - - } - - public void run(String... args) { - System.err.println("Hello Embedded " + this.message + "!"); - } - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/src/main/resources/application.properties b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/src/main/resources/application.properties deleted file mode 100644 index c11051e34771..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -message: World \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/verify.groovy deleted file mode 100644 index b855fbe7c7a7..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props-lib/verify.groovy +++ /dev/null @@ -1,17 +0,0 @@ -def jarfile = './target/executable-props-lib-0.0.1.BUILD-SNAPSHOT-app.jar' - -new File("${basedir}/application.properties").delete() - -String exec(String command) { - def proc = command.execute([], basedir) - proc.waitFor() - proc.err.text -} - -String out = exec("java -jar ${jarfile}") -assert out.contains('Hello Embedded World!'), - 'Using -jar my.jar should load dependencies from separate jar and use the application.properties from the jar\n' + out - -out = exec("java -cp ${jarfile} org.springframework.boot.loader.PropertiesLauncher") -assert out.contains('Hello Embedded World!'), - 'Using -cp my.jar with PropertiesLauncher should load dependencies from separate jar and use the application.properties from the jar\n' + out diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/pom.xml deleted file mode 100644 index 3e2a75482ca1..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/pom.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - 4.0.0 - org.springframework.boot.launcher.it - executable-props - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - maven-assembly-plugin - @maven-assembly-plugin.version@ - - - src/main/assembly/jar-with-dependencies.xml - - false - - - org.springframework.boot.loader.PropertiesLauncher - - - org.springframework.boot.load.it.props.EmbeddedJarStarter - - - - - - jar-with-dependencies - package - - single - - - - - - org.apache.maven.plugins - maven-compiler-plugin - @maven-compiler-plugin.version@ - - - org.apache.maven.plugins - maven-dependency-plugin - @maven-dependency-plugin.version@ - - - unpack - prepare-package - - unpack - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - jar - - - ${project.build.directory}/assembly - - - - copy - prepare-package - - copy-dependencies - - - ${project.build.directory}/assembly/BOOT-INF/lib - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - org.apache.maven.plugins - maven-surefire-plugin - @maven-surefire-plugin.version@ - - - - - - org.springframework - spring-context - @spring-framework.version@ - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/assembly/jar-with-dependencies.xml b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/assembly/jar-with-dependencies.xml deleted file mode 100644 index 2dbf0f3a5021..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/assembly/jar-with-dependencies.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - full - - jar - - false - - - - - ${project.groupId}:${project.artifactId} - - BOOT-INF/classes - true - - - - - ${project.build.directory}/assembly - / - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/java/org/springframework/launcher/it/props/EmbeddedJarStarter.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/java/org/springframework/launcher/it/props/EmbeddedJarStarter.java deleted file mode 100644 index 1837293b5223..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/java/org/springframework/launcher/it/props/EmbeddedJarStarter.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.load.it.props; - -import org.springframework.context.annotation.AnnotationConfigApplicationContext; - -/** - * Main class to start the embedded server. - * - * @author Dave Syer - */ -public final class EmbeddedJarStarter { - - public static void main(String[] args) throws Exception { - AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SpringConfiguration.class); - context.getBean(SpringConfiguration.class).run(args); - context.close(); - } - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/java/org/springframework/launcher/it/props/SpringConfiguration.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/java/org/springframework/launcher/it/props/SpringConfiguration.java deleted file mode 100644 index eb5bc598b11c..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/java/org/springframework/launcher/it/props/SpringConfiguration.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.load.it.props; - -import java.io.IOException; -import java.util.Properties; - -import org.springframework.beans.factory.InitializingBean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.io.ClassPathResource; - -/** - * Spring configuration. - * - * @author Dave Syer - */ -@Configuration(proxyBeanMethods = false) -@ComponentScan -public class SpringConfiguration implements InitializingBean { - - private String message = "Jar"; - - @Override - public void afterPropertiesSet() throws IOException { - Properties props = new Properties(); - props.load(new ClassPathResource("application.properties").getInputStream()); - String value = props.getProperty("message"); - if (value!=null) { - this.message = value; - } - - } - - public void run(String... args) { - System.err.println("Hello Embedded " + this.message + "!"); - } - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/resources/application.properties b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/resources/application.properties deleted file mode 100644 index c11051e34771..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -message: World \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/verify.groovy deleted file mode 100644 index 0a0c034267a9..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-props/verify.groovy +++ /dev/null @@ -1,31 +0,0 @@ -def jarfile = './target/executable-props-0.0.1.BUILD-SNAPSHOT-full.jar' - -new File("${basedir}/application.properties").delete() - -String exec(String command) { - def proc = command.execute([], basedir) - proc.waitFor() - proc.err.text -} - -String out = exec("java -jar ${jarfile}") -assert out.contains('Hello Embedded World!'), - 'Using -jar my.jar should use the application.properties from the jar\n' + out - -out = exec("java -cp ${jarfile} org.springframework.boot.loader.PropertiesLauncher") -assert out.contains('Hello Embedded World!'), - 'Using -cp my.jar with PropertiesLauncher should use the application.properties from the jar\n' + out - -new File("${basedir}/application.properties").withWriter { it -> it << "message: Foo" } -out = exec("java -jar ${jarfile}") -assert out.contains('Hello Embedded World!'), - 'Should use the application.properties from the jar in preference to local filesystem\n' + out - -out = exec("java -Dloader.path=.,lib -jar ${jarfile}") -assert out.contains('Hello Embedded Foo!'), - 'With loader.path=.,lib should use the application.properties from the local filesystem\n' + out - -new File("${basedir}/target/application.properties").withWriter { it -> it << "message: Spam" } -out = exec("java -Dloader.path=target,.,lib -jar ${jarfile}") -assert out.contains('Hello Embedded Spam!'), - 'With loader.path=target,.,lib should use the application.properties from the target directory\n' + out \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/pom.xml deleted file mode 100644 index af6d71231e52..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/pom.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - 4.0.0 - org.springframework.boot.launcher.it - executable-war - 0.0.1.BUILD-SNAPSHOT - war - - UTF-8 - @java.version@ - @java.version@ - - - - - org.apache.maven.plugins - maven-compiler-plugin - @maven-compiler-plugin.version@ - - - org.apache.maven.plugins - maven-dependency-plugin - @maven-dependency-plugin.version@ - - - unpack - prepare-package - - unpack - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - jar - - - ${project.build.directory}/${project.artifactId}-${project.version} - - - - - - org.apache.maven.plugins - maven-surefire-plugin - @maven-surefire-plugin.version@ - - - org.apache.maven.plugins - maven-war-plugin - @maven-war-plugin.version@ - - - - org.springframework.boot.loader.WarLauncher - - - org.springframework.boot.load.it.war.embedded.EmbeddedWarStarter - - - - - - - - - org.eclipse.jetty - jetty-webapp - @jetty.version@ - - - org.eclipse.jetty - jetty-plus - @jetty.version@ - - - org.eclipse.jetty - jetty-annotations - @jetty.version@ - - - org.springframework - spring-webmvc - @spring-framework.version@ - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/SpringConfiguration.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/SpringConfiguration.java deleted file mode 100644 index 1bc22a2efd5b..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/SpringConfiguration.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.load.it.war; - -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; - -/** - * Spring configuration. - * - * @author Phillip Webb - */ -@Configuration(proxyBeanMethods = false) -@EnableWebMvc -@ComponentScan -public class SpringConfiguration { - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/SpringInitializer.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/SpringInitializer.java deleted file mode 100644 index ee0cf7f8824c..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/SpringInitializer.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.load.it.war; - -import javax.servlet.ServletContext; -import javax.servlet.ServletException; - -import org.springframework.web.WebApplicationInitializer; -import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; -import org.springframework.web.servlet.DispatcherServlet; - -/** - * Spring {@link WebApplicationInitializer} for classic WAR deployment. - * - * @author Phillip Webb - */ -public class SpringInitializer implements WebApplicationInitializer { - - @Override - public void onStartup(ServletContext servletContext) throws ServletException { - AnnotationConfigWebApplicationContext webApplicationContext = new AnnotationConfigWebApplicationContext(); - webApplicationContext.register(SpringConfiguration.class); - servletContext.addServlet("dispatcherServlet", - new DispatcherServlet(webApplicationContext)).addMapping("/*"); - } - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/embedded/EmbeddedWarStarter.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/embedded/EmbeddedWarStarter.java deleted file mode 100644 index 4aac0a7dc692..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/embedded/EmbeddedWarStarter.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.load.it.war.embedded; - -import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.webapp.Configuration; -import org.eclipse.jetty.webapp.WebAppContext; -import org.springframework.boot.load.it.war.SpringInitializer; - -/** - * Starter to launch the embedded server. NOTE: Jetty annotation scanning is not - * compatible with executable WARs so we must specify the {@link SpringInitializer}. - * - * @author Phillip Webb - */ -public final class EmbeddedWarStarter { - - public static void main(String[] args) throws Exception { - Server server = new Server(8080); - - WebAppContext webAppContext = new WebAppContext(); - webAppContext.setContextPath("/"); - webAppContext.setConfigurations(new Configuration[] { - new WebApplicationInitializersConfiguration(SpringInitializer.class) }); - - webAppContext.setParentLoaderPriority(true); - server.setHandler(webAppContext); - server.start(); - - server.join(); - } -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/embedded/WebApplicationInitializersConfiguration.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/embedded/WebApplicationInitializersConfiguration.java deleted file mode 100644 index 0d544e30763e..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/embedded/WebApplicationInitializersConfiguration.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.load.it.war.embedded; - -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; - -import org.eclipse.jetty.webapp.AbstractConfiguration; -import org.eclipse.jetty.webapp.Configuration; -import org.eclipse.jetty.webapp.WebAppContext; -import org.springframework.util.Assert; -import org.springframework.web.WebApplicationInitializer; - -/** - * Jetty {@link Configuration} that allows Spring {@link WebApplicationInitializer} to be - * started. This is required because Jetty annotation scanning does not work with packaged - * WARs. - * - * @author Phillip Webb - */ -public class WebApplicationInitializersConfiguration extends AbstractConfiguration { - - private Class[] webApplicationInitializers; - - public WebApplicationInitializersConfiguration(Class webApplicationInitializer, - Class... webApplicationInitializers) { - this.webApplicationInitializers = new Class[webApplicationInitializers.length + 1]; - this.webApplicationInitializers[0] = webApplicationInitializer; - System.arraycopy(webApplicationInitializers, 0, this.webApplicationInitializers, - 1, webApplicationInitializers.length); - for (Class i : webApplicationInitializers) { - Assert.notNull(i, "WebApplicationInitializer must not be null"); - Assert.isAssignable(WebApplicationInitializer.class, i); - } - } - - @Override - public void configure(WebAppContext context) throws Exception { - context.getServletContext().addListener(new ServletContextListener() { - - @Override - public void contextInitialized(ServletContextEvent sce) { - try { - for (Class webApplicationInitializer : webApplicationInitializers) { - WebApplicationInitializer initializer = (WebApplicationInitializer) webApplicationInitializer.newInstance(); - initializer.onStartup(sce.getServletContext()); - } - } - catch (Exception ex) { - throw new RuntimeException(ex); - } - } - - @Override - public void contextDestroyed(ServletContextEvent sce) { - } - }); - } - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java index 71fce7118402..177791276567 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java @@ -269,13 +269,19 @@ private List archives() throws Exception { List archives = new ArrayList<>(); String path = System.getProperty("java.class.path"); for (String url : path.split(File.pathSeparator)) { - archives.add(archive(url)); + Archive archive = archive(url); + if (archive != null) { + archives.add(archive); + } } return archives; } private Archive archive(String url) throws IOException { File file = new FileSystemResource(url).getFile(); + if (!file.exists()) { + return null; + } if (url.endsWith(".jar")) { return new JarFileArchive(file); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/build.gradle new file mode 100644 index 000000000000..aa76c5c44730 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/build.gradle @@ -0,0 +1,88 @@ +plugins { + id 'org.asciidoctor.jvm.convert' + id 'org.asciidoctor.jvm.pdf' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.maven-plugin' + id 'org.springframework.boot.optional-dependencies' +} + +description = "Spring Boot Maven Plugin" + +configurations { + documentation +} + +dependencies { + compileOnly 'org.apache.maven.plugin-tools:maven-plugin-annotations' + compileOnly 'org.sonatype.plexus:plexus-build-api' + + implementation enforcedPlatform(project(':spring-boot-project:spring-boot-parent')) + implementation project(':spring-boot-project:spring-boot-tools:spring-boot-loader-tools') + implementation 'org.apache.maven.shared:maven-common-artifact-filters' + implementation 'org.apache.maven:maven-plugin-api' + + intTestImplementation enforcedPlatform(project(':spring-boot-project:spring-boot-parent')) + intTestImplementation 'org.apache.maven.shared:maven-invoker' + intTestImplementation 'org.assertj:assertj-core' + intTestImplementation 'org.junit.jupiter:junit-jupiter' + + optional enforcedPlatform(project(':spring-boot-project:spring-boot-parent')) + optional 'org.apache.maven.plugins:maven-shade-plugin' + + runtimeOnly 'org.sonatype.plexus:plexus-build-api' + + testImplementation enforcedPlatform(project(':spring-boot-project:spring-boot-parent')) + testImplementation 'org.assertj:assertj-core' + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.mockito:mockito-core' + testImplementation 'org.springframework:spring-core' +} + +syncDocumentationSourceForAsciidoctor { + from(documentPluginGoals) { + into 'asciidoc/goals' + } +} + +asciidoctor { + sources { + include 'index.adoc' + } +} + +syncDocumentationSourceForAsciidoctorPdf { + from(documentPluginGoals) { + into 'asciidoc/goals' + } +} + +asciidoctorPdf { + sources { + include 'index.adoc' + } +} + +tasks.withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask) { + attributes 'maven-jar-plugin-version': '1.2.3', + 'maven-failsafe-plugin-version': '1.2.3', + 'build-helper-maven-plugin-version': '1.2.3' +} + +task zip(type: Zip) { + dependsOn asciidoctor, asciidoctorPdf + duplicatesStrategy 'fail' + from(asciidoctorPdf.outputDir) { + into 'pdf' + } + from(asciidoctor.outputDir) { + into 'html' + } +} + +prepareMavenBinaries { + versions '3.6.2', '3.5.4' +} + +artifacts { + 'documentation' zip +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/pom.xml deleted file mode 100644 index 10d5f0dc7b33..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/pom.xml +++ /dev/null @@ -1,499 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-tools - ${revision} - - spring-boot-maven-plugin - maven-plugin - Spring Boot Maven Plugin - Spring Boot Maven Plugin - - ${basedir}/../../.. - 3.3.9 - ${project.build.directory}/refdocs/ - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - org.springframework.boot - spring-boot-loader-tools - - - org.apache.maven - maven-archiver - - - org.apache.maven - maven-artifact - - - org.apache.maven - maven-core - - - javax.enterprise - cdi-api - - - - - org.apache.maven - maven-model - - - org.apache.maven - maven-plugin-api - - - org.apache.maven - maven-settings - - - org.apache.maven.shared - maven-common-artifact-filters - - - javax.enterprise - cdi-api - - - - - org.codehaus.plexus - plexus-archiver - - - org.codehaus.plexus - plexus-container-default - - - org.codehaus.plexus - plexus-component-api - - - - - org.codehaus.plexus - plexus-utils - - - org.sonatype.plexus - plexus-build-api - - - - org.apache.maven.plugins - maven-shade-plugin - true - - - - org.apache.maven.plugin-tools - maven-plugin-annotations - provided - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - org.apache.maven.plugins - maven-plugin-plugin - - spring-boot - true - - - - generate-descriptor - - descriptor - - - - generated-helpmojo - - helpmojo - - - - - - - - - integration - - true - - - - - org.apache.maven.plugins - maven-invoker-plugin - - ${project.build.directory}/local-repo - - - - prepare-integration-test - pre-integration-test - - install - - - - integration-test - - run - - - ${project.build.directory}/it - src/it/settings.xml - verify - true - ${skipTests} - true - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - cleanup-local-integration-repo - pre-integration-test - - run - - - - - - - - - - - - - - - - full - - - full - - - - - - org.apache.maven.plugins - maven-invoker-plugin - - ${project.build.directory}/local-repo - - - - prepare-integration-test - pre-integration-test - - install - - - - integration-test - - run - - - ${project.build.directory}/it - src/it/settings.xml - verify - true - ${skipTests} - true - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - ant-contrib - ant-contrib - 1.0b3 - - - ant - ant - - - - - org.apache.ant - ant-nodeps - 1.8.1 - - - org.tigris.antelope - antelopetasks - 3.2.10 - - - - - cleanup-local-integration-repo - pre-integration-test - - run - - - - - - - - - - - set-up-maven-properties - prepare-package - - run - - - true - - - - - - - - - - - - - - - package-docs-zip - package - - run - - - - - - - - - - - - - - - - - com.googlecode.maven-download-plugin - download-maven-plugin - - - unpack-doc-resources - generate-resources - - wget - - - ${spring-doc-resources.url} - true - ${refdocs.build.directory} - - - - - - org.codehaus.gmavenplus - gmavenplus-plugin - - - - execute - - prepare-package - - - - - - - - - - org.codehaus.groovy - groovy-ant - ${groovy.version} - - - org.codehaus.groovy - groovy-xml - ${groovy.version} - - - - - org.asciidoctor - asciidoctor-maven-plugin - - - generate-html-documentation - prepare-package - - process-asciidoc - - - html5 - ${project.build.directory}/generated-docs/reference/html - highlight.js - book - - js/highlight - github - true - ./images - font - css/ - spring.css - warn - - - true - - DEBUG - - - - - - generate-pdf-documentation - prepare-package - - process-asciidoc - - - pdf - ${project.build.directory}/generated-docs/reference/pdf - - - - - ${refdocs.build.directory} - index.adoc - - ${project.version} - ${build-helper-maven-plugin.version} - ${maven-failsafe-plugin.version} - ${maven-jar-plugin.version} - ${project.basedir}/target/generated-resources - - - - - org.asciidoctor - asciidoctorj-pdf - 1.5.0-alpha.18 - - - - - org.apache.maven.plugins - maven-resources-plugin - - - copy-asciidoc-resources - generate-resources - - copy-resources - - - ${refdocs.build.directory} - - - src/main/asciidoc - false - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-zip - - attach-artifact - - - - - ${project.build.directory}/${project.artifactId}-${project.version}-docs.zip - zip - docs - - - - - - - - - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/build-info.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/build-info.adoc similarity index 95% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/build-info.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/build-info.adoc index 487b24d61c46..f51b71b6a0a1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/build-info.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/build-info.adoc @@ -38,4 +38,4 @@ This configuration will generate a `build-info.properties` at the expected locat Note that `maven.compiler.source` and `maven.compiler.target` are expected to be regular properties available in the project. They will be interpolated as you would expect. -include::{generated-resources-root}/goals/build-info.adoc[leveloffset=+1] +include::goals/build-info.adoc[leveloffset=+1] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/getting-started.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/getting-started.adoc similarity index 60% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/getting-started.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/getting-started.adoc index 6501051115bb..e3121cbeac4c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/getting-started.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/getting-started.adoc @@ -3,5 +3,5 @@ The Spring Boot Plugin has the following goals: -include::{generated-resources-root}/goals/overview.adoc[] +include::goals/overview.adoc[] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/help.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/help.adoc similarity index 65% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/help.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/help.adoc index 49d5452ea4ed..79eb182a2363 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/help.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/help.adoc @@ -2,4 +2,4 @@ == Help information The `help` goal is a standard goal that displays information on the capabilities of the plugin. -include::{generated-resources-root}/goals/help.adoc[leveloffset=+1] +include::goals/help.adoc[leveloffset=+1] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/index.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/index.adoc similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/index.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/index.adoc diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/integration-tests.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/integration-tests.adoc similarity index 97% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/integration-tests.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/integration-tests.adoc index 31317f42983e..19155961559b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/integration-tests.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/integration-tests.adoc @@ -35,9 +35,9 @@ Such setup can now use the https://maven.apache.org/surefire/maven-failsafe-plug You could also configure a more advanced setup to skip the integration tests when a specific property has been set, see <>. -include::{generated-resources-root}/goals/start.adoc[leveloffset=+1] +include::goals/start.adoc[leveloffset=+1] -include::{generated-resources-root}/goals/stop.adoc[leveloffset=+1] +include::goals/stop.adoc[leveloffset=+1] [[integration-tests-example]] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/packaging.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging.adoc similarity index 99% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/packaging.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging.adoc index 495dca330f79..9a9aa22dee01 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/packaging.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging.adoc @@ -71,7 +71,7 @@ The `layout` property defaults to a guess based on the archive type (`jar` or `w * `ZIP` (alias to `DIR`): similar to the `JAR` layout using `PropertiesLauncher`. * `NONE`: Bundle all dependencies and project resources. Does not bundle a bootstrap loader. -include::{generated-resources-root}/goals/repackage.adoc[leveloffset=+1] +include::goals/repackage.adoc[leveloffset=+1] [[repackage-examples]] === Examples diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/running.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/running.adoc similarity index 99% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/running.adoc rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/running.adoc index 59f5918eed3f..cf9cfcfe5983 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/running.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/running.adoc @@ -78,7 +78,7 @@ For example, if you want to run your application in a test mode that uses stub c If you wish to do this, you can set the `useTestClasspath` parameter to true. Note that this is only applied when you run an application: the `repackage` goal will not add test dependencies to the resulting JAR/WAR. -include::{generated-resources-root}/goals/run.adoc[leveloffset=+1] +include::goals/run.adoc[leveloffset=+1] [[run-examples]] === Examples diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/AbstractArchiveIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/AbstractArchiveIntegrationTests.java new file mode 100644 index 000000000000..8a373314a272 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/AbstractArchiveIntegrationTests.java @@ -0,0 +1,173 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.boot.maven; + +import java.io.File; +import java.io.IOException; +import java.util.Collections; +import java.util.Optional; +import java.util.function.Consumer; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.jar.Manifest; +import java.util.stream.Stream; + +import org.assertj.core.api.AbstractAssert; +import org.assertj.core.api.AssertProvider; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.contentOf; + +/** + * Base class for archive (jar or war) related Maven plugin integration tests. + * + * @author Andy Wilkinson + */ +abstract class AbstractArchiveIntegrationTests { + + protected String buildLog(File project) { + return contentOf(new File(project, "target/build.log")); + } + + protected String launchScript(File jar) { + String content = contentOf(jar); + return content.substring(0, content.indexOf(new String(new byte[] { 0x50, 0x4b, 0x03, 0x04 }))); + } + + protected AssertProvider jar(File file) { + return new AssertProvider() { + + @Override + @Deprecated + public JarAssert assertThat() { + return new JarAssert(file); + } + + }; + } + + static final class JarAssert extends AbstractAssert { + + private JarAssert(File actual) { + super(actual, JarAssert.class); + assertThat(actual.exists()); + } + + JarAssert doesNotHaveEntryWithName(String name) { + withJarFile((jarFile) -> { + withEntries(jarFile, (entries) -> { + Optional match = entries.filter((entry) -> entry.getName().equals(name)).findFirst(); + assertThat(match).isNotPresent(); + }); + }); + return this; + } + + JarAssert hasEntryWithName(String name) { + withJarFile((jarFile) -> { + withEntries(jarFile, (entries) -> { + Optional match = entries.filter((entry) -> entry.getName().equals(name)).findFirst(); + assertThat(match).hasValueSatisfying((entry) -> assertThat(entry.getComment()).isNull()); + }); + }); + return this; + } + + JarAssert hasEntryWithNameStartingWith(String prefix) { + withJarFile((jarFile) -> { + withEntries(jarFile, (entries) -> { + Optional match = entries.filter((entry) -> entry.getName().startsWith(prefix)) + .findFirst(); + assertThat(match).hasValueSatisfying((entry) -> assertThat(entry.getComment()).isNull()); + }); + }); + return this; + } + + JarAssert hasUnpackEntryWithNameStartingWith(String prefix) { + withJarFile((jarFile) -> { + withEntries(jarFile, (entries) -> { + Optional match = entries.filter((entry) -> entry.getName().startsWith(prefix)) + .findFirst(); + assertThat(match).as("Name starting with %s", prefix) + .hasValueSatisfying((entry) -> assertThat(entry.getComment()).startsWith("UNPACK:")); + }); + }); + return this; + } + + JarAssert doesNotHaveEntryWithNameStartingWith(String prefix) { + withJarFile((jarFile) -> { + withEntries(jarFile, (entries) -> { + Optional match = entries.filter((entry) -> entry.getName().startsWith(prefix)) + .findFirst(); + assertThat(match).isNotPresent(); + }); + }); + return this; + } + + JarAssert manifest(Consumer consumer) { + withJarFile((jarFile) -> { + try { + consumer.accept(new ManifestAssert(jarFile.getManifest())); + } + catch (IOException ex) { + throw new RuntimeException(ex); + } + }); + return this; + } + + void withJarFile(Consumer consumer) { + try (JarFile jarFile = new JarFile(this.actual)) { + consumer.accept(jarFile); + } + catch (Exception ex) { + throw new RuntimeException(ex); + } + } + + void withEntries(JarFile jarFile, Consumer> entries) { + entries.accept(Collections.list(jarFile.entries()).stream()); + } + + static final class ManifestAssert extends AbstractAssert { + + private ManifestAssert(Manifest actual) { + super(actual, ManifestAssert.class); + } + + ManifestAssert hasStartClass(String expected) { + assertThat(this.actual.getMainAttributes().getValue("Start-Class")).isEqualTo(expected); + return this; + } + + ManifestAssert hasMainClass(String expected) { + assertThat(this.actual.getMainAttributes().getValue("Main-Class")).isEqualTo(expected); + return this; + } + + ManifestAssert hasAttribute(String name, String value) { + assertThat(this.actual.getMainAttributes().getValue(name)).isEqualTo(value); + return this; + } + + } + + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildInfoIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildInfoIntegrationTests.java new file mode 100644 index 000000000000..ac36d2eba290 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildInfoIntegrationTests.java @@ -0,0 +1,147 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.boot.maven; + +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.Properties; +import java.util.function.Consumer; + +import org.assertj.core.api.AbstractMapAssert; +import org.assertj.core.api.AssertProvider; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Integration tests for the Maven plugin's build info support. + * + * @author Andy Wilkinson + */ +@ExtendWith(MavenBuildExtension.class) +public class BuildInfoIntegrationTests { + + @TestTemplate + void buildInfoPropertiesAreGenerated(MavenBuild mavenBuild) { + mavenBuild.project("build-info").execute(buildInfo((buildInfo) -> assertThat(buildInfo) + .hasBuildGroup("org.springframework.boot.maven.it").hasBuildArtifact("build-info") + .hasBuildName("Generate build info").hasBuildVersion("0.0.1.BUILD-SNAPSHOT").containsBuildTime())); + } + + @TestTemplate + void generatedBuildInfoIncludesAdditionalProperties(MavenBuild mavenBuild) { + mavenBuild.project("build-info-additional-properties").execute(buildInfo((buildInfo) -> assertThat(buildInfo) + .hasBuildGroup("org.springframework.boot.maven.it").hasBuildArtifact("build-info-additional-properties") + .hasBuildName("Generate build info with additional properties").hasBuildVersion("0.0.1.BUILD-SNAPSHOT") + .containsBuildTime().containsEntry("build.foo", "bar").containsEntry("build.encoding", "UTF-8") + .containsEntry("build.java.source", "1.8"))); + } + + @TestTemplate + void generatedBuildInfoUsesCustomBuildTime(MavenBuild mavenBuild) { + mavenBuild.project("build-info-custom-build-time").execute(buildInfo((buildInfo) -> assertThat(buildInfo) + .hasBuildGroup("org.springframework.boot.maven.it").hasBuildArtifact("build-info-custom-build-time") + .hasBuildName("Generate build info with custom build time").hasBuildVersion("0.0.1.BUILD-SNAPSHOT") + .hasBuildTime("2019-07-08T08:00:00Z"))); + } + + @TestTemplate + void buildInfoPropertiesAreGeneratedToCustomOutputLocation(MavenBuild mavenBuild) { + mavenBuild.project("build-info-custom-file") + .execute(buildInfo("target/build.info", + (buildInfo) -> assertThat(buildInfo).hasBuildGroup("org.springframework.boot.maven.it") + .hasBuildArtifact("build-info-custom-file").hasBuildName("Generate custom build info") + .hasBuildVersion("0.0.1.BUILD-SNAPSHOT").containsBuildTime())); + } + + @TestTemplate + void whenBuildTimeIsDisabledIfDoesNotAppearInGeneratedBuildInfo(MavenBuild mavenBuild) { + mavenBuild.project("build-info-disable-build-time").execute(buildInfo((buildInfo) -> assertThat(buildInfo) + .hasBuildGroup("org.springframework.boot.maven.it").hasBuildArtifact("build-info-disable-build-time") + .hasBuildName("Generate build info with disabled build time").hasBuildVersion("0.0.1.BUILD-SNAPSHOT") + .doesNotContainBuildTime())); + } + + private Consumer buildInfo(Consumer> buildInfo) { + return buildInfo("target/classes/META-INF/build-info.properties", buildInfo); + } + + private Consumer buildInfo(String location, Consumer> buildInfo) { + return (project) -> buildInfo.accept((buildInfo(project, location))); + } + + private AssertProvider buildInfo(File project, String buildInfo) { + return new AssertProvider() { + + @Override + @Deprecated + public BuildInfoAssert assertThat() { + return new BuildInfoAssert(new File(project, buildInfo)); + } + + }; + } + + private static final class BuildInfoAssert extends AbstractMapAssert { + + private BuildInfoAssert(File actual) { + super(loadProperties(actual), BuildInfoAssert.class); + } + + private static Properties loadProperties(File file) { + try (FileReader reader = new FileReader(file)) { + Properties properties = new Properties(); + properties.load(reader); + return properties; + } + catch (IOException ex) { + throw new RuntimeException(ex); + } + } + + BuildInfoAssert hasBuildGroup(String expected) { + return containsEntry("build.group", expected); + } + + BuildInfoAssert hasBuildArtifact(String expected) { + return containsEntry("build.artifact", expected); + } + + BuildInfoAssert hasBuildName(String expected) { + return containsEntry("build.name", expected); + } + + BuildInfoAssert hasBuildVersion(String expected) { + return containsEntry("build.version", expected); + } + + BuildInfoAssert containsBuildTime() { + return containsKey("build.time"); + } + + BuildInfoAssert doesNotContainBuildTime() { + return doesNotContainKey("build.time"); + } + + BuildInfoAssert hasBuildTime(String expected) { + return containsEntry("build.time", expected); + } + + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java new file mode 100644 index 000000000000..f05dcc475068 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java @@ -0,0 +1,283 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.boot.maven; + +import java.io.File; + +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Integration tests for the Maven plugin's jar support. + * + * @author Andy Wilkinson + */ +@ExtendWith(MavenBuildExtension.class) +class JarIntegrationTests extends AbstractArchiveIntegrationTests { + + @TestTemplate + void whenJarIsRepackagedInPlaceOnlyRepackagedJarIsInstalled(MavenBuild mavenBuild) { + mavenBuild.project("jar").goals("install").execute((project) -> { + File original = new File(project, "target/jar-0.0.1.BUILD-SNAPSHOT.jar.original"); + assertThat(original).isFile(); + File repackaged = new File(project, "target/jar-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(launchScript(repackaged)).isEmpty(); + assertThat(jar(repackaged)).manifest((manifest) -> { + manifest.hasMainClass("org.springframework.boot.loader.JarLauncher"); + manifest.hasStartClass("some.random.Main"); + manifest.hasAttribute("Not-Used", "Foo"); + }).hasEntryWithNameStartingWith("BOOT-INF/lib/spring-context") + .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-core") + .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-jcl") + .hasEntryWithNameStartingWith("BOOT-INF/lib/jakarta.servlet-api-4") + .hasEntryWithName("BOOT-INF/classes/org/test/SampleApplication.class") + .hasEntryWithName("org/springframework/boot/loader/JarLauncher.class"); + assertThat(buildLog(project)).contains("Replacing main artifact with repackaged archive") + .contains("Installing " + repackaged + " to").doesNotContain("Installing " + original + " to"); + }); + } + + @TestTemplate + void whenAttachIsDisabledOnlyTheOriginalJarIsInstalled(MavenBuild mavenBuild) { + mavenBuild.project("jar-attach-disabled").goals("install").execute((project) -> { + File original = new File(project, "target/jar-attach-disabled-0.0.1.BUILD-SNAPSHOT.jar.original"); + assertThat(original).isFile(); + File main = new File(project, "target/jar-attach-disabled-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(main).isFile(); + assertThat(buildLog(project)).contains("Updating main artifact " + main + " to " + original) + .contains("Installing " + original + " to").doesNotContain("Installing " + main + " to"); + }); + } + + @TestTemplate + void whenAClassifierIsConfiguredTheRepackagedJarHasAClassifierAndBothItAndTheOriginalAreInstalled( + MavenBuild mavenBuild) { + mavenBuild.project("jar-classifier-main").goals("install").execute((project) -> { + assertThat(new File(project, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT.jar.original")) + .doesNotExist(); + File main = new File(project, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(main).isFile(); + File repackaged = new File(project, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT-test.jar"); + assertThat(jar(repackaged)).hasEntryWithNameStartingWith("BOOT-INF/classes/"); + assertThat(buildLog(project)) + .contains("Attaching repackaged archive " + repackaged + " with classifier test") + .doesNotContain("Creating repackaged archive " + repackaged + " with classifier test") + .contains("Installing " + main + " to").contains("Installing " + repackaged + " to"); + }); + } + + @TestTemplate + void whenBothJarsHaveTheSameClassifierRepackagingIsDoneInPlaceAndOnlyRepackagedJarIsInstalled( + MavenBuild mavenBuild) { + mavenBuild.project("jar-classifier-source").goals("install").execute((project) -> { + File original = new File(project, "target/jar-classifier-source-0.0.1.BUILD-SNAPSHOT-test.jar.original"); + assertThat(original).isFile(); + File repackaged = new File(project, "target/jar-classifier-source-0.0.1.BUILD-SNAPSHOT-test.jar"); + assertThat(jar(repackaged)).hasEntryWithNameStartingWith("BOOT-INF/classes/"); + assertThat(buildLog(project)).contains("Replacing artifact with classifier test with repackaged archive") + .doesNotContain("Installing " + original + " to").contains("Installing " + repackaged + " to"); + }); + } + + @TestTemplate + void whenBothJarsHaveTheSameClassifierAndAttachIsDisabledOnlyTheOriginalJarIsInstalled(MavenBuild mavenBuild) { + mavenBuild.project("jar-classifier-source-attach-disabled").goals("install").execute((project) -> { + File original = new File(project, + "target/jar-classifier-source-attach-disabled-0.0.1.BUILD-SNAPSHOT-test.jar.original"); + assertThat(original).isFile(); + File repackaged = new File(project, + "target/jar-classifier-source-attach-disabled-0.0.1.BUILD-SNAPSHOT-test.jar"); + assertThat(jar(repackaged)).hasEntryWithNameStartingWith("BOOT-INF/classes/"); + assertThat(buildLog(project)) + .doesNotContain("Attaching repackaged archive " + repackaged + " with classifier test") + .contains("Updating artifact with classifier test " + repackaged + " to " + original) + .contains("Installing " + original + " to").doesNotContain("Installing " + repackaged + " to"); + }); + } + + @TestTemplate + void whenAClassifierAndAnOutputDirectoryAreConfiguredTheRepackagedJarHasAClassifierAndIsWrittenToTheOutputDirectory( + MavenBuild mavenBuild) { + mavenBuild.project("jar-create-dir").goals("install").execute((project) -> { + File repackaged = new File(project, "target/foo/jar-create-dir-0.0.1.BUILD-SNAPSHOT-foo.jar"); + assertThat(jar(repackaged)).hasEntryWithNameStartingWith("BOOT-INF/classes/"); + assertThat(buildLog(project)).contains("Installing " + repackaged + " to"); + }); + } + + @TestTemplate + void whenAnOutputDirectoryIsConfiguredTheRepackagedJarIsWrittenToIt(MavenBuild mavenBuild) { + mavenBuild.project("jar-custom-dir").goals("install").execute((project) -> { + File repackaged = new File(project, "target/foo/jar-custom-dir-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(jar(repackaged)).hasEntryWithNameStartingWith("BOOT-INF/classes/"); + assertThat(buildLog(project)).contains("Installing " + repackaged + " to"); + }); + } + + @TestTemplate + void whenACustomLaunchScriptIsConfiguredItAppearsInTheRepackagedJar(MavenBuild mavenBuild) { + mavenBuild.project("jar-custom-launcher").goals("install").execute((project) -> { + File repackaged = new File(project, "target/jar-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(jar(repackaged)).hasEntryWithNameStartingWith("BOOT-INF/classes/"); + assertThat(launchScript(repackaged)).contains("Hello world"); + }); + } + + @TestTemplate + void whenAnEntryIsExcludedItDoesNotAppearInTheRepackagedJar(MavenBuild mavenBuild) { + mavenBuild.project("jar-exclude-entry").goals("install").execute((project) -> { + File repackaged = new File(project, "target/jar-exclude-entry-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(jar(repackaged)).hasEntryWithNameStartingWith("BOOT-INF/classes/") + .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-context") + .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-core") + .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-jcl") + .doesNotHaveEntryWithName("BOOT-INF/lib/servlet-api-2.5.jar"); + }); + } + + @TestTemplate + void whenAGroupIsExcludedNoEntriesInThatGroupAppearInTheRepackagedJar(MavenBuild mavenBuild) { + mavenBuild.project("jar-exclude-group").goals("install").execute((project) -> { + File repackaged = new File(project, "target/jar-exclude-group-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(jar(repackaged)).hasEntryWithNameStartingWith("BOOT-INF/classes/") + .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-context") + .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-core") + .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-jcl") + .doesNotHaveEntryWithName("BOOT-INF/lib/log4j-api-2.4.1.jar"); + }); + } + + @TestTemplate + void whenAJarIsExecutableItBeginsWithTheDefaultLaunchScript(MavenBuild mavenBuild) { + mavenBuild.project("jar-executable").execute((project) -> { + File repackaged = new File(project, "target/jar-executable-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(jar(repackaged)).hasEntryWithNameStartingWith("BOOT-INF/classes/"); + assertThat(launchScript(repackaged)).contains("Spring Boot Startup Script") + .contains("MyFullyExecutableJarName").contains("MyFullyExecutableJarDesc"); + }); + } + + @TestTemplate + void whenAJarIsBuiltWithLibrariesWithConflictingNamesTheyAreMadeUniqueUsingTheirGroupIds(MavenBuild mavenBuild) { + mavenBuild.project("jar-lib-name-conflict").execute((project) -> { + File repackaged = new File(project, "test-project/target/test-project-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(jar(repackaged)).hasEntryWithNameStartingWith("BOOT-INF/classes/") + .hasEntryWithName( + "BOOT-INF/lib/org.springframework.boot.maven.it-acme-lib-0.0.1.BUILD-SNAPSHOT.jar") + .hasEntryWithName( + "BOOT-INF/lib/org.springframework.boot.maven.it.another-acme-lib-0.0.1.BUILD-SNAPSHOT.jar"); + }); + } + + @TestTemplate + void whenAProjectUsesPomPackagingRepackagingIsSkipped(MavenBuild mavenBuild) { + mavenBuild.project("jar-pom").execute((project) -> { + File target = new File(project, "target"); + assertThat(target.listFiles()).containsExactly(new File(target, "build.log")); + }); + } + + @TestTemplate + void whenRepackagingIsSkippedTheJarIsNotRepackaged(MavenBuild mavenBuild) { + mavenBuild.project("jar-skip").execute((project) -> { + File main = new File(project, "target/jar-skip-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(jar(main)).doesNotHaveEntryWithNameStartingWith("org/springframework/boot"); + assertThat(new File(project, "target/jar-skip-0.0.1.BUILD-SNAPSHOT.jar.original")).doesNotExist(); + + }); + } + + @TestTemplate + void whenADependencyHasSystemScopeAndInclusionOfSystemScopeDependenciesIsEnabledItIsIncludedInTheRepackagedJar( + MavenBuild mavenBuild) { + mavenBuild.project("jar-system-scope").execute((project) -> { + File main = new File(project, "target/jar-system-scope-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(jar(main)).hasEntryWithName("BOOT-INF/lib/sample-1.0.0.jar"); + + }); + } + + @TestTemplate + void whenADependencyHasSystemScopeItIsNotIncludedInTheRepackagedJar(MavenBuild mavenBuild) { + mavenBuild.project("jar-system-scope-default").execute((project) -> { + File main = new File(project, "target/jar-system-scope-default-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(jar(main)).doesNotHaveEntryWithName("BOOT-INF/lib/sample-1.0.0.jar"); + + }); + } + + @TestTemplate + void whenADependendencyHasTestScopeItIsNotIncludedInTheRepackagedJar(MavenBuild mavenBuild) { + mavenBuild.project("jar-test-scope").execute((project) -> { + File main = new File(project, "target/jar-test-scope-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(jar(main)).doesNotHaveEntryWithNameStartingWith("BOOT-INF/lib/log4j") + .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-"); + }); + } + + @TestTemplate + void whenAProjectUsesKotlinItsModuleMetadataIsRepackagedIntoBootInfClasses(MavenBuild mavenBuild) { + mavenBuild.project("jar-with-kotlin-module").execute((project) -> { + File main = new File(project, "target/jar-with-kotlin-module-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(jar(main)).hasEntryWithName("BOOT-INF/classes/META-INF/jar-with-kotlin-module.kotlin_module"); + }); + } + + @TestTemplate + void whenAProjectIsBuiltWithALayoutPropertyTheSpecifiedLayoutIsUsed(MavenBuild mavenBuild) { + mavenBuild.project("jar-with-layout-property").goals("package", "-Dspring-boot.repackage.layout=ZIP") + .execute((project) -> { + File main = new File(project, "target/jar-with-layout-property-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(jar(main)).manifest( + (manifest) -> manifest.hasMainClass("org.springframework.boot.loader.PropertiesLauncher") + .hasStartClass("org.test.SampleApplication")); + assertThat(buildLog(project)).contains("Layout: ZIP"); + }); + } + + @TestTemplate + void whenALayoutIsConfiguredTheSpecifiedLayoutIsUsed(MavenBuild mavenBuild) { + mavenBuild.project("jar-with-zip-layout").execute((project) -> { + File main = new File(project, "target/jar-with-zip-layout-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(jar(main)) + .manifest((manifest) -> manifest.hasMainClass("org.springframework.boot.loader.PropertiesLauncher") + .hasStartClass("org.test.SampleApplication")); + assertThat(buildLog(project)).contains("Layout: ZIP"); + }); + } + + @TestTemplate + void whenRequiresUnpackConfigurationIsProvidedItIsReflectedInTheRepackagedJar(MavenBuild mavenBuild) { + mavenBuild.project("jar-with-unpack").execute((project) -> { + File main = new File(project, "target/jar-with-unpack-0.0.1.BUILD-SNAPSHOT.jar"); + assertThat(jar(main)).hasUnpackEntryWithNameStartingWith("BOOT-INF/lib/spring-core-") + .hasEntryWithNameStartingWith("BOOT-INF/lib/spring-context-"); + }); + } + + @TestTemplate + void whenJarIsRepackagedWithACustomLayoutTheJarUsesTheLayout(MavenBuild mavenBuild) { + mavenBuild.project("jar-custom-layout").execute((project) -> { + assertThat(jar(new File(project, "custom/target/custom-0.0.1.BUILD-SNAPSHOT.jar"))) + .hasEntryWithName("custom"); + assertThat(jar(new File(project, "default/target/default-0.0.1.BUILD-SNAPSHOT.jar"))) + .hasEntryWithName("sample"); + }); + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/MavenBuild.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/MavenBuild.java new file mode 100644 index 000000000000..7c1609b34e43 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/MavenBuild.java @@ -0,0 +1,202 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.maven; + +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.Reader; +import java.nio.charset.StandardCharsets; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.StandardCopyOption; +import java.nio.file.StandardOpenOption; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Properties; +import java.util.function.Consumer; + +import org.apache.maven.shared.invoker.DefaultInvocationRequest; +import org.apache.maven.shared.invoker.DefaultInvoker; +import org.apache.maven.shared.invoker.InvocationOutputHandler; +import org.apache.maven.shared.invoker.InvocationRequest; +import org.apache.maven.shared.invoker.InvocationResult; +import org.apache.maven.shared.invoker.Invoker; +import org.apache.maven.shared.invoker.MavenInvocationException; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.contentOf; + +/** + * Helper class for executing a Maven build. + * + * @author Andy Wilkinson + * + */ +class MavenBuild { + + private final File home; + + private final File temp; + + private final Map pomReplacements = new HashMap<>(); + + private final List goals = new ArrayList<>(); + + private final Properties properties = new Properties(); + + private File projectDir; + + MavenBuild(File home) { + this.home = home; + try { + this.temp = Files.createTempDirectory("maven-build").toFile().getCanonicalFile(); + } + catch (IOException ex) { + throw new RuntimeException(ex); + } + this.pomReplacements.put("java.version", "1.8"); + this.pomReplacements.put("project.groupId", "org.springframework.boot"); + this.pomReplacements.put("project.artifactId", "spring-boot-maven-plugin"); + this.pomReplacements.put("project.version", determineVersion()); + this.pomReplacements.put("log4j2.version", "2.12.1"); + this.pomReplacements.put("maven-jar-plugin.version", "3.2.0"); + this.pomReplacements.put("maven-toolchains-plugin.version", "3.0.0"); + this.pomReplacements.put("maven-war-plugin.version", "3.2.3"); + this.pomReplacements.put("build-helper-maven-plugin.version", "3.0.0"); + this.pomReplacements.put("spring-framework.version", "5.2.1.RELEASE"); + this.pomReplacements.put("jakarta-servlet.version", "4.0.2"); + this.pomReplacements.put("kotlin.version", "1.3.60"); + } + + MavenBuild project(String project) { + this.projectDir = new File("src/intTest/projects/" + project); + return this; + } + + MavenBuild goals(String... goals) { + this.goals.addAll(Arrays.asList(goals)); + return this; + } + + MavenBuild systemProperty(String name, String value) { + this.properties.setProperty(name, value); + return this; + } + + void execute(Consumer callback) { + Invoker invoker = new DefaultInvoker(); + invoker.setMavenHome(this.home); + InvocationRequest request = new DefaultInvocationRequest(); + try { + Path destination = this.temp.toPath(); + Path source = this.projectDir.toPath(); + Files.walkFileTree(source, new SimpleFileVisitor() { + + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { + Files.createDirectories(destination.resolve(source.relativize(dir))); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + if (file.toFile().getName().equals("pom.xml")) { + String pomXml = new String(Files.readAllBytes(file), StandardCharsets.UTF_8); + for (Entry replacement : MavenBuild.this.pomReplacements.entrySet()) { + pomXml = pomXml.replace("@" + replacement.getKey() + "@", replacement.getValue()); + } + Files.write(destination.resolve(source.relativize(file)), + pomXml.getBytes(StandardCharsets.UTF_8), StandardOpenOption.CREATE_NEW); + } + else { + Files.copy(file, destination.resolve(source.relativize(file)), + StandardCopyOption.REPLACE_EXISTING); + } + return FileVisitResult.CONTINUE; + } + + }); + String settingsXml = new String(Files.readAllBytes(Paths.get("src", "intTest", "projects", "settings.xml")), + StandardCharsets.UTF_8) + .replace("@localCentralUrl@", + new File("build/int-test-maven-repository").toURI().toURL().toString()) + .replace("@localRepositoryPath@", + new File("build/local-maven-repository").getAbsolutePath()); + Files.write(destination.resolve("settings.xml"), settingsXml.getBytes(StandardCharsets.UTF_8), + StandardOpenOption.CREATE_NEW); + request.setBaseDirectory(this.temp); + request.setProperties(this.properties); + request.setGoals(this.goals.isEmpty() ? Collections.singletonList("package") : this.goals); + request.setUserSettingsFile(new File(this.temp, "settings.xml")); + request.setUpdateSnapshots(true); + request.setBatchMode(true); + File target = new File(this.temp, "target"); + target.mkdirs(); + File buildLogFile = new File(target, "build.log"); + try (PrintWriter buildLog = new PrintWriter(new FileWriter(buildLogFile))) { + request.setOutputHandler(new InvocationOutputHandler() { + + @Override + public void consumeLine(String line) { + buildLog.println(line); + buildLog.flush(); + } + + }); + try { + InvocationResult result = invoker.execute(request); + assertThat(result.getExitCode()).as(contentOf(buildLogFile)).isEqualTo(0); + } + catch (MavenInvocationException ex) { + throw new RuntimeException(ex); + } + } + callback.accept(this.temp); + } + catch (Exception ex) { + throw new RuntimeException(ex); + } + } + + private String determineVersion() { + File gradleProperties = new File("gradle.properties").getAbsoluteFile(); + while (!gradleProperties.isFile()) { + gradleProperties = new File(gradleProperties.getParentFile().getParentFile(), "gradle.properties"); + } + Properties properties = new Properties(); + try (Reader reader = new FileReader(gradleProperties)) { + properties.load(reader); + return properties.getProperty("version"); + } + catch (IOException ex) { + throw new RuntimeException(ex); + } + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/MavenBuildExtension.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/MavenBuildExtension.java new file mode 100644 index 000000000000..a9e0f668c5b5 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/MavenBuildExtension.java @@ -0,0 +1,100 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.maven; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Stream; + +import org.junit.jupiter.api.extension.Extension; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.ParameterContext; +import org.junit.jupiter.api.extension.ParameterResolutionException; +import org.junit.jupiter.api.extension.ParameterResolver; +import org.junit.jupiter.api.extension.TestTemplateInvocationContext; +import org.junit.jupiter.api.extension.TestTemplateInvocationContextProvider; + +/** + * An {@link Extension} for templated tests that use {@link MavenBuild}. Each templated + * test is run against multiple versions of Maven. + * + * @author Andy Wilkinson + */ +class MavenBuildExtension implements TestTemplateInvocationContextProvider { + + @Override + public boolean supportsTestTemplate(ExtensionContext context) { + return true; + } + + @Override + public Stream provideTestTemplateInvocationContexts(ExtensionContext context) { + try { + return Files.list(Paths.get("build/maven-binaries")).map(MavenVersionTestTemplateInvocationContext::new); + } + catch (IOException ex) { + throw new RuntimeException(ex); + } + } + + private static final class MavenVersionTestTemplateInvocationContext implements TestTemplateInvocationContext { + + private final Path mavenHome; + + private MavenVersionTestTemplateInvocationContext(Path mavenHome) { + this.mavenHome = mavenHome; + } + + @Override + public String getDisplayName(int invocationIndex) { + return this.mavenHome.getFileName().toString(); + } + + @Override + public List getAdditionalExtensions() { + return Arrays.asList(new MavenBuildParameterResolver(this.mavenHome)); + } + + } + + private static final class MavenBuildParameterResolver implements ParameterResolver { + + private final Path mavenHome; + + private MavenBuildParameterResolver(Path mavenHome) { + this.mavenHome = mavenHome; + } + + @Override + public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext) + throws ParameterResolutionException { + return parameterContext.getParameter().getType().equals(MavenBuild.class); + } + + @Override + public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) + throws ParameterResolutionException { + return new MavenBuild(this.mavenHome.toFile()); + } + + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/RunIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/RunIntegrationTests.java new file mode 100644 index 000000000000..9c20e96fa646 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/RunIntegrationTests.java @@ -0,0 +1,145 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.maven; + +import java.io.File; +import java.lang.reflect.Method; + +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.condition.DisabledOnOs; +import org.junit.jupiter.api.condition.OS; +import org.junit.jupiter.api.extension.ExtendWith; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.contentOf; + +/** + * Integration tests for the Maven plugin's run goal. + * + * @author Andy Wilkinson + */ +@ExtendWith(MavenBuildExtension.class) +class RunIntegrationTests { + + @TestTemplate + void whenTheRunGoalIsExecutedTheApplicationIsForkedWithOptimizedJvmArguments(MavenBuild mavenBuild) { + mavenBuild.project("run").goals("spring-boot:run", "-X").execute((project) -> { + String jvmArguments = isJava13OrLater() ? "JVM argument(s): -XX:TieredStopAtLevel=1" + : "JVM argument(s): -Xverify:none -XX:TieredStopAtLevel=1"; + assertThat(buildLog(project)).contains("I haz been run").contains(jvmArguments); + }); + } + + @TestTemplate + void whenForkingIsDisabledAndDevToolsIsPresentDevToolsIsDisabled(MavenBuild mavenBuild) { + mavenBuild.project("run-devtools").goals("spring-boot:run").execute((project) -> assertThat(buildLog(project)) + .contains("I haz been run").contains("Fork mode disabled, devtools will be disabled")); + } + + @TestTemplate + void whenForkingIsDisabledJvmArgumentsAndWorkingDirectoryAreIgnored(MavenBuild mavenBuild) { + mavenBuild.project("run-disable-fork").goals("spring-boot:run") + .execute((project) -> assertThat(buildLog(project)).contains("I haz been run").contains( + "Fork mode disabled, ignoring JVM argument(s) [-Dproperty1=value1 -Dproperty2 -Dfoo=bar]") + .contains("Fork mode disabled, ignoring working directory configuration")); + } + + @TestTemplate + void whenEnvironmentVariablesAreConfiguredTheyAreAvailableToTheApplication(MavenBuild mavenBuild) { + mavenBuild.project("run-envargs").goals("spring-boot:run") + .execute((project) -> assertThat(buildLog(project)).contains("I haz been run")); + } + + @TestTemplate + void whenExclusionsAreConfiguredExcludedDependenciesDoNotAppearOnTheClasspath(MavenBuild mavenBuild) { + mavenBuild.project("run-exclude").goals("spring-boot:run") + .execute((project) -> assertThat(buildLog(project)).contains("I haz been run")); + } + + @TestTemplate + void whenSystemPropertiesAreConfiguredTheyAreAvailableToTheApplication(MavenBuild mavenBuild) { + mavenBuild.project("run-jvm-system-props").goals("spring-boot:run") + .execute((project) -> assertThat(buildLog(project)).contains("I haz been run")); + } + + @TestTemplate + void whenJvmArgumentsAreConfiguredTheyAreAvailableToTheApplication(MavenBuild mavenBuild) { + mavenBuild.project("run-jvmargs").goals("spring-boot:run") + .execute((project) -> assertThat(buildLog(project)).contains("I haz been run")); + } + + @TestTemplate + void whenProfilesAreConfiguredTheyArePassedToTheApplication(MavenBuild mavenBuild) { + mavenBuild.project("run-profiles").goals("spring-boot:run", "-X").execute( + (project) -> assertThat(buildLog(project)).contains("I haz been run with profile(s) 'foo,bar'")); + } + + @TestTemplate + void whenProfilesAreConfiguredAndForkingIsDisabledTheyArePassedToTheApplication(MavenBuild mavenBuild) { + mavenBuild.project("run-profiles-fork-disabled").goals("spring-boot:run").execute( + (project) -> assertThat(buildLog(project)).contains("I haz been run with profile(s) 'foo,bar'")); + } + + @TestTemplate + void whenUseTestClasspathIsEnabledTheApplicationHasTestDependenciesOnItsClasspath(MavenBuild mavenBuild) { + mavenBuild.project("run-use-test-classpath").goals("spring-boot:run") + .execute((project) -> assertThat(buildLog(project)).contains("I haz been run")); + } + + @TestTemplate + void whenAWorkingDirectoryIsConfiguredTheApplicationIsRunFromThatDirectory(MavenBuild mavenBuild) { + mavenBuild.project("run-working-directory").goals("spring-boot:run") + .execute((project) -> assertThat(buildLog(project)).contains("I haz been run")); + } + + @TestTemplate + @DisabledOnOs(OS.WINDOWS) + void whenAToolchainIsConfiguredItIsUsedToRunTheApplication(MavenBuild mavenBuild) { + mavenBuild.project("run-toolchains").goals("verify", "-t", "toolchains.xml") + .execute((project) -> assertThat(buildLog(project)).contains("The Maven Toolchains is awesome!")); + } + + @TestTemplate + void whenPomSpecifiesRunArgumentsContainingCommasTheyArePassedToTheApplicationCorrectly(MavenBuild mavenBuild) { + mavenBuild.project("run-arguments").goals("spring-boot:run").execute((project) -> assertThat(buildLog(project)) + .contains("I haz been run with profile(s) 'foo,bar' and endpoint(s) 'prometheus,info'")); + } + + @TestTemplate + void whenCommandLineSpecifiesRunArgumentsContainingCommasTheyArePassedToTheApplicationCorrectly( + MavenBuild mavenBuild) { + mavenBuild.project("run-arguments-commandline").goals("spring-boot:run").systemProperty( + "spring-boot.run.arguments", + "--management.endpoints.web.exposure.include=prometheus,info,health,metrics --spring.profiles.active=foo,bar") + .execute((project) -> assertThat(buildLog(project)).contains( + "I haz been run with profile(s) 'foo,bar' and endpoint(s) 'prometheus,info,health,metrics'")); + } + + private String buildLog(File project) { + return contentOf(new File(project, "target/build.log")); + } + + private boolean isJava13OrLater() { + for (Method method : String.class.getMethods()) { + if (method.getName().equals("stripIndent")) { + return true; + } + } + return false; + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/StartStopIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/StartStopIntegrationTests.java new file mode 100644 index 000000000000..34736018c3fe --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/StartStopIntegrationTests.java @@ -0,0 +1,57 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.maven; + +import java.io.File; + +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.contentOf; + +/** + * Integration tests for the Maven plugin's war support. + * + * @author Andy Wilkinson + */ +@ExtendWith(MavenBuildExtension.class) +class StartStopIntegrationTests { + + @TestTemplate + void startStopWithForkDisabledWaitsForApplicationToBeReadyAndThenRequestsShutdown(MavenBuild mavenBuild) { + mavenBuild.project("start-stop-fork-disabled").goals("verify").execute( + (project) -> assertThat(buildLog(project)).contains("isReady: true").contains("Shutdown requested")); + } + + @TestTemplate + void startStopWaitsForApplicationToBeReadyAndThenRequestsShutdown(MavenBuild mavenBuild) { + mavenBuild.project("start-stop").goals("verify").execute( + (project) -> assertThat(buildLog(project)).contains("isReady: true").contains("Shutdown requested")); + } + + @TestTemplate + void whenSkipIsTrueStartAndStopAreSkipped(MavenBuild mavenBuild) { + mavenBuild.project("start-stop-skip").goals("verify").execute((project) -> assertThat(buildLog(project)) + .doesNotContain("Ooops, I haz been run").doesNotContain("Stopping application")); + } + + private String buildLog(File project) { + return contentOf(new File(project, "target/build.log")); + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/WarIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/WarIntegrationTests.java new file mode 100644 index 000000000000..63c89ac53895 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/WarIntegrationTests.java @@ -0,0 +1,66 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.maven; + +import java.io.File; + +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Integration tests for the Maven plugin's war support. + * + * @author Andy Wilkinson + */ +@ExtendWith(MavenBuildExtension.class) +class WarIntegrationTests extends AbstractArchiveIntegrationTests { + + @TestTemplate + void warRepackaging(MavenBuild mavenBuild) { + mavenBuild.project("war") + .execute((project) -> assertThat(jar(new File(project, "target/war-0.0.1.BUILD-SNAPSHOT.war"))) + .hasEntryWithNameStartingWith("WEB-INF/lib/spring-context") + .hasEntryWithNameStartingWith("WEB-INF/lib/spring-core") + .hasEntryWithNameStartingWith("WEB-INF/lib/spring-jcl") + .hasEntryWithNameStartingWith("WEB-INF/lib-provided/jakarta.servlet-api-4") + .hasEntryWithName("org/springframework/boot/loader/WarLauncher.class") + .hasEntryWithName("WEB-INF/classes/org/test/SampleApplication.class") + .hasEntryWithName("index.html") + .manifest((manifest) -> manifest.hasMainClass("org.springframework.boot.loader.WarLauncher") + .hasStartClass("org.test.SampleApplication").hasAttribute("Not-Used", "Foo"))); + } + + @TestTemplate + void jarDependencyWithCustomFinalNameBuiltInSameReactorIsPackagedUsingArtifactIdAndVersion(MavenBuild mavenBuild) { + mavenBuild.project("war-reactor") + .execute(((project) -> assertThat(jar(new File(project, "war/target/war-0.0.1.BUILD-SNAPSHOT.war"))) + .hasEntryWithName("WEB-INF/lib/jar-0.0.1.BUILD-SNAPSHOT.jar") + .doesNotHaveEntryWithName("WEB-INF/lib/jar.jar"))); + } + + @TestTemplate + void whenRequiresUnpackConfigurationIsProvidedItIsReflectedInTheRepackagedWar(MavenBuild mavenBuild) { + mavenBuild.project("war-with-unpack").execute( + (project) -> assertThat(jar(new File(project, "target/war-with-unpack-0.0.1.BUILD-SNAPSHOT.war"))) + .hasUnpackEntryWithNameStartingWith("WEB-INF/lib/spring-core-") + .hasEntryWithNameStartingWith("WEB-INF/lib/spring-context-") + .hasEntryWithNameStartingWith("WEB-INF/lib/spring-jcl-")); + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-additional-properties/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-additional-properties/pom.xml similarity index 74% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-additional-properties/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-additional-properties/pom.xml index 1b5cd9fcb9b4..e6ba60b03a49 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-additional-properties/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-additional-properties/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot.maven.it build-info-additional-properties 0.0.1.BUILD-SNAPSHOT - Generate build info + Generate build info with additional properties UTF-8 @java.version@ @@ -34,17 +34,4 @@ - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-additional-properties/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-additional-properties/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-additional-properties/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-additional-properties/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-devtools/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-custom-build-time/pom.xml similarity index 81% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-devtools/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-custom-build-time/pom.xml index eeac82763d24..c5668a93c92a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-devtools/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-custom-build-time/pom.xml @@ -3,15 +3,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.boot.maven.it - run-devtools + build-info-custom-build-time 0.0.1.BUILD-SNAPSHOT + Generate build info with custom build time UTF-8 @java.version@ @java.version@ - @@ -20,13 +19,12 @@ @project.version@ - package - - run - - false + + + build-info + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-build-time/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-custom-build-time/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-build-time/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-custom-build-time/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-custom-file/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-custom-file/pom.xml new file mode 100644 index 000000000000..3e20c5c9c16b --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-custom-file/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + org.springframework.boot.maven.it + build-info-custom-file + 0.0.1.BUILD-SNAPSHOT + Generate custom build info + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + build-info + + + ${project.build.directory}/build.info + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-file/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-custom-file/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-file/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-custom-file/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-disable-build-time/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-disable-build-time/pom.xml similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-disable-build-time/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-disable-build-time/pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-disable-build-time/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-disable-build-time/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-disable-build-time/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-disable-build-time/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info/pom.xml new file mode 100644 index 000000000000..9f0e5a1503dc --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + org.springframework.boot.maven.it + build-info + 0.0.1.BUILD-SNAPSHOT + Generate build info + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + build-info + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-attach-disabled/pom.xml similarity index 89% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-attach-disabled/pom.xml index 19743c2c37a1..d6fa5cf6afa7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-attach-disabled/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.boot.maven.it - run + jar-attach-disabled 0.0.1.BUILD-SNAPSHOT UTF-8 @@ -18,12 +18,11 @@ @project.version@ - package - run + repackage - false + false diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-attach-disabled/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-attach-disabled/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-attach-disabled/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-attach-disabled/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-main-attach-disabled/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-main-attach-disabled/pom.xml new file mode 100644 index 000000000000..3fd4d7b8df8c --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-main-attach-disabled/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + org.springframework.boot.maven.it + jar-classifier-main-attach-disabled + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + repackage + + + test + false + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main-attach-disabled/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-main-attach-disabled/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main-attach-disabled/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-main-attach-disabled/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-main/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-main/pom.xml new file mode 100644 index 000000000000..d05d5c4488c4 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-main/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + org.springframework.boot.maven.it + jar-classifier-main + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + repackage + + + test + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-main/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-main/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-source-attach-disabled/pom.xml similarity index 74% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-source-attach-disabled/pom.xml index 33b21884ec9a..357399d589e2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-source-attach-disabled/pom.xml @@ -24,11 +24,6 @@ package test - - - Foo - - @@ -51,17 +46,4 @@ - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-source-attach-disabled/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-source-attach-disabled/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-source/pom.xml similarity index 74% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-source/pom.xml index a7b24d9cda77..98d744d15118 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-source/pom.xml @@ -24,11 +24,6 @@ package test - - - Foo - - @@ -50,17 +45,4 @@ - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-source/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-source/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-create-dir/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-create-dir/pom.xml new file mode 100644 index 000000000000..0920206fd4fa --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-create-dir/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + org.springframework.boot.maven.it + jar-create-dir + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + repackage + + + ${project.build.directory}/foo + foo + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-create-dir/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-create-dir/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-create-dir/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-create-dir/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvmargs/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-dir/pom.xml similarity index 86% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvmargs/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-dir/pom.xml index d7f82c8cd44c..f6a0ab30dbee 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvmargs/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-dir/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.boot.maven.it - run-jvmargs + jar-custom-dir 0.0.1.BUILD-SNAPSHOT UTF-8 @@ -18,12 +18,11 @@ @project.version@ - package - run + repackage - -Dfoo="value 1" -Dbar=value2 + ${project.build.directory}/foo diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-dir/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-dir/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-dir/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-dir/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-launcher/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-launcher/pom.xml new file mode 100644 index 000000000000..6e78c3ea63a1 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-launcher/pom.xml @@ -0,0 +1,35 @@ + + + 4.0.0 + org.springframework.boot.maven.it + jar + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + repackage + + + ${basedir}/src/launcher/custom.script + + world + + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-launcher/src/launcher/custom.script b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-launcher/src/launcher/custom.script similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-launcher/src/launcher/custom.script rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-launcher/src/launcher/custom.script diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-launcher/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-launcher/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-launcher/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-launcher/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/custom/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/custom/pom.xml similarity index 89% rename from spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/custom/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/custom/pom.xml index 2216ebfca8b4..e64b294529fa 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/custom/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/custom/pom.xml @@ -30,9 +30,9 @@ - @project.groupId@ - @project.artifactId@ - @project.version@ + org.springframework.boot.maven.it + layout + 0.0.1.BUILD-SNAPSHOT diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/custom/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/custom/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/default/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/default/pom.xml similarity index 88% rename from spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/default/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/default/pom.xml index 3937a72a21e8..f568c759e31b 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/default/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/default/pom.xml @@ -25,9 +25,9 @@ - @project.groupId@ - @project.artifactId@ - @project.version@ + org.springframework.boot.maven.it + layout + 0.0.1.BUILD-SNAPSHOT diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/default/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/default/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/layout/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/layout/pom.xml new file mode 100644 index 000000000000..965a8b8d9dc0 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/layout/pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + + org.springframework.boot.maven.it + jar-custom-layout + 0.0.1.BUILD-SNAPSHOT + + jar + layout + + + org.springframework.boot + spring-boot-loader-tools + @project.version@ + + + diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/main/java/smoketest/layout/SampleLayout.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/layout/src/main/java/smoketest/layout/SampleLayout.java similarity index 100% rename from spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/main/java/smoketest/layout/SampleLayout.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/layout/src/main/java/smoketest/layout/SampleLayout.java diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/main/java/smoketest/layout/SampleLayoutFactory.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/layout/src/main/java/smoketest/layout/SampleLayoutFactory.java similarity index 100% rename from spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/main/java/smoketest/layout/SampleLayoutFactory.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/layout/src/main/java/smoketest/layout/SampleLayoutFactory.java diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/layout/src/main/resources/META-INF/spring.factories similarity index 100% rename from spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/main/resources/META-INF/spring.factories rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/layout/src/main/resources/META-INF/spring.factories diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/pom.xml new file mode 100644 index 000000000000..7022544d5735 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + org.springframework.boot.maven.it + jar-custom-layout + 0.0.1.BUILD-SNAPSHOT + pom + + UTF-8 + @java.version@ + @java.version@ + + + layout + custom + default + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-file/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-exclude-entry/pom.xml similarity index 78% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-file/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-exclude-entry/pom.xml index 65bf4155f34f..d37e11e1528c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-file/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-exclude-entry/pom.xml @@ -3,9 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.boot.maven.it - build-info-custom-file + jar-exclude-entry 0.0.1.BUILD-SNAPSHOT - Generate custom build info UTF-8 @java.version@ @@ -20,10 +19,15 @@ - build-info + repackage - ${project.build.directory}/build.info + + + javax.servlet + servlet-api + + @@ -37,9 +41,9 @@ @spring-framework.version@ - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ + javax.servlet + servlet-api + 2.5 provided diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-executable/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-exclude-entry/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-executable/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-exclude-entry/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-exclude-group/pom.xml similarity index 90% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-exclude-group/pom.xml index 19ae153fdfe8..4da81b2f08a6 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-exclude-group/pom.xml @@ -47,12 +47,6 @@ spring-context @spring-framework.version@ - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - org.apache.logging.log4j log4j-api diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/test-project/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-exclude-group/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/test-project/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-exclude-group/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-executable/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-executable/pom.xml similarity index 75% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-executable/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-executable/pom.xml index f0147318109b..802d166a273f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-executable/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-executable/pom.xml @@ -38,25 +38,9 @@ some.random.Main - - Foo - - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-non-executable/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-executable/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-non-executable/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-executable/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/acme-lib/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-lib-name-conflict/acme-lib/pom.xml similarity index 71% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/acme-lib/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-lib-name-conflict/acme-lib/pom.xml index 25d2c815b5fb..f0c7626623e8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/acme-lib/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-lib-name-conflict/acme-lib/pom.xml @@ -10,11 +10,4 @@ 0.0.1.BUILD-SNAPSHOT - - - org.springframework - spring-context - @spring-framework.version@ - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/another-acme-lib/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-lib-name-conflict/another-acme-lib/pom.xml similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/another-acme-lib/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-lib-name-conflict/another-acme-lib/pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-lib-name-conflict/pom.xml similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-lib-name-conflict/pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/test-project/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-lib-name-conflict/test-project/pom.xml similarity index 73% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/test-project/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-lib-name-conflict/test-project/pom.xml index 65d9663c2422..535fedc387ac 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/test-project/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-lib-name-conflict/test-project/pom.xml @@ -24,18 +24,6 @@ - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - Foo - - - - @@ -50,11 +38,5 @@ acme-lib 0.0.1.BUILD-SNAPSHOT - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope-default/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-lib-name-conflict/test-project/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope-default/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-lib-name-conflict/test-project/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-pom/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-pom/pom.xml similarity index 69% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-pom/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-pom/pom.xml index bbf54cebee22..f8eb3dae581e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-pom/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-pom/pom.xml @@ -25,17 +25,4 @@ - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-skip/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-skip/pom.xml similarity index 97% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-skip/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-skip/pom.xml index 23021a8af882..15eea089cbf4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-skip/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-skip/pom.xml @@ -21,7 +21,7 @@ repackage - true + true diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-system-scope-default/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-system-scope-default/pom.xml new file mode 100644 index 000000000000..f455d43879dc --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-system-scope-default/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + org.springframework.boot.maven.it + jar-system-scope-default + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + repackage + + + + + + + + + com.example + sample + 1.0.0 + system + ${project.basedir}/sample-1.0.0.jar + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope-default/sample-1.0.0.jar b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-system-scope-default/sample-1.0.0.jar similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope-default/sample-1.0.0.jar rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-system-scope-default/sample-1.0.0.jar diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-system-scope-default/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-system-scope-default/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-disable-fork/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-system-scope/pom.xml similarity index 71% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-disable-fork/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-system-scope/pom.xml index 4d7d9a226d27..2a5de56091f6 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-disable-fork/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-system-scope/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.boot.maven.it - run-disable-fork + jar-system-scope 0.0.1.BUILD-SNAPSHOT UTF-8 @@ -18,22 +18,24 @@ @project.version@ - package - run + repackage - false - -Dfoo=bar - ${project.build.sourceDirectory} - - value1 - - + true + + + com.example + sample + 1.0.0 + system + ${project.basedir}/sample-1.0.0.jar + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope/sample-1.0.0.jar b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-system-scope/sample-1.0.0.jar similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope/sample-1.0.0.jar rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-system-scope/sample-1.0.0.jar diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-system-scope/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-system-scope/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-test-scope/pom.xml similarity index 81% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-test-scope/pom.xml index 1f83522c8f8e..5ea032cdd7d2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-test-scope/pom.xml @@ -3,9 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.boot.maven.it - build-info + jar-test-scope 0.0.1.BUILD-SNAPSHOT - Generate build info UTF-8 @java.version@ @@ -20,7 +19,7 @@ - build-info + repackage @@ -34,10 +33,10 @@ @spring-framework.version@ - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided + org.apache.logging.log4j + log4j-api + @log4j2.version@ + test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-test-scope/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-test-scope/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-kotlin-module/pom.xml similarity index 66% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-kotlin-module/pom.xml index 770402c9d6f2..eea70adbfdd3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-kotlin-module/pom.xml @@ -23,29 +23,9 @@ repackage - - - - org.jetbrains.kotlin - kotlin-compiler - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - Foo - - - - org.jetbrains.kotlin kotlin-maven-plugin @@ -70,23 +50,6 @@ - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - - org.apache.logging.log4j - log4j-api - @log4j2.version@ - - org.jetbrains.kotlin kotlin-stdlib-jdk8 diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/src/main/kotlin/org/test/SampleApplication.kt b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-kotlin-module/src/main/kotlin/org/test/SampleApplication.kt similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/src/main/kotlin/org/test/SampleApplication.kt rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-kotlin-module/src/main/kotlin/org/test/SampleApplication.kt diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-layout-property/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-layout-property/pom.xml similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-layout-property/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-layout-property/pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-layout-property/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-layout-property/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-layout-property/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-layout-property/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-unpack/pom.xml similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-unpack/pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-unpack/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-unpack/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-working-directory/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-zip-layout/pom.xml similarity index 84% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-working-directory/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-zip-layout/pom.xml index c82a150c74a1..e4171d27cbd1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-working-directory/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-zip-layout/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.boot.maven.it - run-working-directory + jar-with-zip-layout 0.0.1.BUILD-SNAPSHOT UTF-8 @@ -18,12 +18,11 @@ @project.version@ - package - run + repackage - ${project.build.sourceDirectory} + ZIP diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/prop/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-zip-layout/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/prop/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-zip-layout/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar/pom.xml similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar/pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/war/src/main/java/com/example/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/war/src/main/java/com/example/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments-commandline/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-arguments-commandline/pom.xml similarity index 85% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments-commandline/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-arguments-commandline/pom.xml index af5471f4dedd..041d9b2ff79a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments-commandline/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-arguments-commandline/pom.xml @@ -16,14 +16,6 @@ @project.groupId@ @project.artifactId@ @project.version@ - - - package - - run - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments-commandline/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-arguments-commandline/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments-commandline/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-arguments-commandline/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-arguments/pom.xml similarity index 68% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-arguments/pom.xml index 34ca2c03862e..84563c8b9748 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-arguments/pom.xml @@ -16,20 +16,12 @@ @project.groupId@ @project.artifactId@ @project.version@ - - - package - - run - - - - --management.endpoints.web.exposure.include=prometheus,info - --spring.profiles.active=foo,bar - - - - + + + --management.endpoints.web.exposure.include=prometheus,info + --spring.profiles.active=foo,bar + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-arguments/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-arguments/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-devtools/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-devtools/pom.xml new file mode 100644 index 000000000000..4f6bcd76fabd --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-devtools/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + org.springframework.boot.maven.it + run-devtools + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + false + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-devtools/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-devtools/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-devtools/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-devtools/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-disable-fork/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-disable-fork/pom.xml new file mode 100644 index 000000000000..fa5832c24ef0 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-disable-fork/pom.xml @@ -0,0 +1,31 @@ + + + 4.0.0 + org.springframework.boot.maven.it + run-disable-fork + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + false + -Dfoo=bar + ${project.build.sourceDirectory} + + value1 + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-disable-fork/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-disable-fork/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-disable-fork/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-disable-fork/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-envargs/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-envargs/pom.xml similarity index 70% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-envargs/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-envargs/pom.xml index 5d40d970c37e..836037851747 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-envargs/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-envargs/pom.xml @@ -16,22 +16,14 @@ @project.groupId@ @project.artifactId@ @project.version@ - - - package - - run - - - - 5000 - Some Text - - - - - - + + + 5000 + Some Text + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-envargs/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-envargs/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-envargs/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-envargs/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-exclude/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-exclude/pom.xml similarity index 75% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-exclude/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-exclude/pom.xml index 2f02afbabd21..f92c9521153b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-exclude/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-exclude/pom.xml @@ -16,23 +16,15 @@ @project.groupId@ @project.artifactId@ @project.version@ - - - package - - run - - - - - org.apache.logging.log4j - log4j-api - - - jakarta.servlet,javax.servlet - - - + + + + org.apache.logging.log4j + log4j-api + + + jakarta.servlet,javax.servlet + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-exclude/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-exclude/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-exclude/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-exclude/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-fork/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-fork/pom.xml similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-fork/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-fork/pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-fork/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-fork/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-fork/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-fork/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-jvm-system-props/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-jvm-system-props/pom.xml new file mode 100644 index 000000000000..6e76f7526b66 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-jvm-system-props/pom.xml @@ -0,0 +1,31 @@ + + + 4.0.0 + org.springframework.boot.maven.it + run-jvmargs + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + -Dfoo="value 1" -Dbar=value2 + + value1 + + ${project.artifactId} + should-be-ignored + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvm-system-props/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-jvm-system-props/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvm-system-props/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-jvm-system-props/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-jvmargs/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-jvmargs/pom.xml new file mode 100644 index 000000000000..849ed35c67bf --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-jvmargs/pom.xml @@ -0,0 +1,25 @@ + + + 4.0.0 + org.springframework.boot.maven.it + run-jvmargs + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + -Dfoo="value 1" -Dbar=value2 + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvmargs/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-jvmargs/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvmargs/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-jvmargs/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles-fork/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-profiles-fork-disabled/pom.xml similarity index 74% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles-fork/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-profiles-fork-disabled/pom.xml index 05049787147f..1a222c88974e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles-fork/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-profiles-fork-disabled/pom.xml @@ -16,20 +16,13 @@ @project.groupId@ @project.artifactId@ @project.version@ - - - package - - run - - - - foo - bar - - - - + + false + + foo + bar + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles-fork/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-profiles-fork-disabled/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles-fork/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-profiles-fork-disabled/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-profiles/pom.xml similarity index 74% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-profiles/pom.xml index 05049787147f..b46f8996088e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-profiles/pom.xml @@ -16,20 +16,12 @@ @project.groupId@ @project.artifactId@ @project.version@ - - - package - - run - - - - foo - bar - - - - + + + foo + bar + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-profiles/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-profiles/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-toolchains/jdkHome/bin/java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-toolchains/jdkHome/bin/java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-toolchains/jdkHome/bin/java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-toolchains/jdkHome/bin/java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-toolchains/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-toolchains/pom.xml similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-toolchains/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-toolchains/pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-toolchains/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-toolchains/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-toolchains/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-toolchains/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-toolchains/toolchains.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-toolchains/toolchains.xml similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-toolchains/toolchains.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-toolchains/toolchains.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-use-test-classpath/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-use-test-classpath/pom.xml similarity index 81% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-use-test-classpath/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-use-test-classpath/pom.xml index 419080b62dbb..a652f2ca53e0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-use-test-classpath/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-use-test-classpath/pom.xml @@ -16,17 +16,9 @@ @project.groupId@ @project.artifactId@ @project.version@ - - - package - - run - - - true - - - + + true + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-use-test-classpath/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-use-test-classpath/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-use-test-classpath/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-use-test-classpath/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-working-directory/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-working-directory/pom.xml new file mode 100644 index 000000000000..1dd1d52817f3 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-working-directory/pom.xml @@ -0,0 +1,25 @@ + + + 4.0.0 + org.springframework.boot.maven.it + run-working-directory + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + ${project.build.sourceDirectory} + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-working-directory/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-working-directory/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-working-directory/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-working-directory/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run/pom.xml new file mode 100644 index 000000000000..5202b61be3df --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + org.springframework.boot.maven.it + run + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/settings.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/settings.xml new file mode 100644 index 000000000000..73ac7d28415d --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/settings.xml @@ -0,0 +1,76 @@ + + + @localRepositoryPath@ + + + it-repo + + true + + + + local.central + @localCentralUrl@ + + true + + + true + + + + spring-snapshot + https://repo.spring.io/snapshot + + false + + + true + + + + spring-milestone + https://repo.spring.io/milestone + + true + + + false + + + + + + local.central + @localCentralUrl@ + + true + + + true + + + + spring-snapshot + https://repo.spring.io/snapshot + + false + + + true + + + + spring-milestone + https://repo.spring.io/milestone + + true + + + false + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop-fork-disabled/pom.xml similarity index 94% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop-fork-disabled/pom.xml index c0791845470d..8a1a8ad6714c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop-fork-disabled/pom.xml @@ -30,9 +30,6 @@ - - false - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop-fork-disabled/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop-fork-disabled/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-skip/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop-skip/pom.xml similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-skip/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop-skip/pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-skip/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop-skip/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-skip/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop-skip/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop/pom.xml similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop/pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/jar/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-reactor/jar/pom.xml similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/jar/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-reactor/jar/pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-reactor/pom.xml similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-reactor/pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/war/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-reactor/war/pom.xml similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/war/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-reactor/war/pom.xml diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-with-unpack/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-reactor/war/src/main/java/com/example/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-with-unpack/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-reactor/war/src/main/java/com/example/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/war/src/main/webapp/index.html b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-reactor/war/src/main/webapp/index.html similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/war/src/main/webapp/index.html rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-reactor/war/src/main/webapp/index.html diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-with-unpack/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-with-unpack/pom.xml similarity index 97% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-with-unpack/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-with-unpack/pom.xml index 9238324238c5..bb13ba1acde7 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-with-unpack/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-with-unpack/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.boot.maven.it - war + war-with-unpack 0.0.1.BUILD-SNAPSHOT war diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-with-unpack/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-with-unpack/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-with-unpack/src/main/webapp/index.html b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-with-unpack/src/main/webapp/index.html similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-with-unpack/src/main/webapp/index.html rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-with-unpack/src/main/webapp/index.html diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war/pom.xml similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war/pom.xml rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war/pom.xml diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/custom/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war/src/main/java/org/test/SampleApplication.java similarity index 100% rename from spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/custom/src/main/java/org/test/SampleApplication.java rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war/src/main/java/org/test/SampleApplication.java diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war/src/main/webapp/index.html b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war/src/main/webapp/index.html similarity index 100% rename from spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war/src/main/webapp/index.html rename to spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war/src/main/webapp/index.html diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-additional-properties/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-additional-properties/verify.groovy deleted file mode 100644 index 10f6bfa4f77f..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-additional-properties/verify.groovy +++ /dev/null @@ -1,13 +0,0 @@ -import org.springframework.boot.maven.Verify - -import static org.junit.Assert.assertEquals -import static org.junit.Assert.assertTrue - -def file = new File(basedir, "target/classes/META-INF/build-info.properties") -Properties properties = Verify.verifyBuildInfo(file, - 'org.springframework.boot.maven.it', 'build-info-additional-properties', - 'Generate build info', '0.0.1.BUILD-SNAPSHOT') -assertTrue properties.containsKey('build.time') -assertEquals 'bar', properties.get('build.foo') -assertEquals 'UTF-8', properties.get('build.encoding') -assertEquals '1.8', properties.get('build.java.source') \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-build-time/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-build-time/pom.xml deleted file mode 100644 index bfa9a51de3cc..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-build-time/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - build-info-custom-build-time - 0.0.1.BUILD-SNAPSHOT - Generate build info with custom build time - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - - - - build-info - - - - - - - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-build-time/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-build-time/verify.groovy deleted file mode 100644 index e6ec4d3e1dab..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-build-time/verify.groovy +++ /dev/null @@ -1,9 +0,0 @@ -import org.springframework.boot.maven.Verify - -import static org.junit.Assert.assertEquals - -def file = new File(basedir, "target/classes/META-INF/build-info.properties") -Properties properties = Verify.verifyBuildInfo(file, - 'org.springframework.boot.maven.it', 'build-info-custom-build-time', - 'Generate build info with custom build time', '0.0.1.BUILD-SNAPSHOT') -assertEquals(properties.get('build.time'), '2019-07-08T08:00:00Z') diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-file/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-file/verify.groovy deleted file mode 100644 index eecd9e10d89b..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-file/verify.groovy +++ /dev/null @@ -1,9 +0,0 @@ -import org.springframework.boot.maven.Verify - -import static org.junit.Assert.assertTrue - -def file = new File(basedir, "target/build.info") -Properties properties = Verify.verifyBuildInfo(file, - 'org.springframework.boot.maven.it', 'build-info-custom-file', - 'Generate custom build info', '0.0.1.BUILD-SNAPSHOT') -assertTrue properties.containsKey('build.time') \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-disable-build-time/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-disable-build-time/verify.groovy deleted file mode 100644 index 7b5971224bb5..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-disable-build-time/verify.groovy +++ /dev/null @@ -1,9 +0,0 @@ -import org.springframework.boot.maven.Verify - -import static org.junit.Assert.assertFalse - -def file = new File(basedir, "target/classes/META-INF/build-info.properties") -Properties properties = Verify.verifyBuildInfo(file, - 'org.springframework.boot.maven.it', 'build-info-disable-build-time', - 'Generate build info with disabled build time', '0.0.1.BUILD-SNAPSHOT') -assertFalse 'build time must not be present', properties.containsKey('build.time') diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info/verify.groovy deleted file mode 100644 index e266446a8ad2..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info/verify.groovy +++ /dev/null @@ -1,9 +0,0 @@ -import org.springframework.boot.maven.Verify - -import static org.junit.Assert.assertTrue - -def file = new File(basedir, "target/classes/META-INF/build-info.properties") -Properties properties = Verify.verifyBuildInfo(file, - 'org.springframework.boot.maven.it', 'build-info', - 'Generate build info', '0.0.1.BUILD-SNAPSHOT') -assertTrue properties.containsKey('build.time') \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-attach-disabled/invoker.properties b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-attach-disabled/invoker.properties deleted file mode 100644 index c0c3f7cc079e..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-attach-disabled/invoker.properties +++ /dev/null @@ -1 +0,0 @@ -invoker.goals=clean install \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-attach-disabled/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-attach-disabled/pom.xml deleted file mode 100644 index 5c8f7f2ef19e..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-attach-disabled/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-attach-disabled - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - false - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - some.random.Main - - - Foo - - - - - - - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-attach-disabled/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-attach-disabled/verify.groovy deleted file mode 100644 index 7cfb59170592..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-attach-disabled/verify.groovy +++ /dev/null @@ -1,18 +0,0 @@ -import org.springframework.boot.maven.* - -import static org.junit.Assert.assertTrue -import static org.junit.Assert.assertFalse - -File main = new File(basedir, "target/jar-attach-disabled-0.0.1.BUILD-SNAPSHOT.jar") -File backup = new File(basedir, "target/jar-attach-disabled-0.0.1.BUILD-SNAPSHOT.jar.original") -Verify.verifyJar(main, "some.random.Main") -assertTrue 'backup file should exist', backup.exists() - -def file = new File(basedir, "build.log") -assertTrue 'main artifact should have been updated', - file.text.contains("Updating main artifact " + main + " to " + backup) -assertTrue 'main artifact should have been installed', - file.text.contains ("Installing " + backup + " to") -assertFalse 'repackaged artifact should not have been installed', - file.text.contains ("Installing " + main + "to") - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main-attach-disabled/invoker.properties b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main-attach-disabled/invoker.properties deleted file mode 100644 index c0c3f7cc079e..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main-attach-disabled/invoker.properties +++ /dev/null @@ -1 +0,0 @@ -invoker.goals=clean install \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main-attach-disabled/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main-attach-disabled/pom.xml deleted file mode 100644 index ba65f7d5ece9..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main-attach-disabled/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-classifier-main-attach-disabled - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - test - false - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - Foo - - - - - - - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main-attach-disabled/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main-attach-disabled/verify.groovy deleted file mode 100644 index 8a40399d7e2e..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main-attach-disabled/verify.groovy +++ /dev/null @@ -1,24 +0,0 @@ -import org.springframework.boot.maven.* - -import static org.junit.Assert.assertTrue -import static org.junit.Assert.assertFalse - -File repackaged = new File(basedir, "target/jar-classifier-main-attach-disabled-0.0.1.BUILD-SNAPSHOT-test.jar") -File main = new File(basedir, "target/jar-classifier-main-attach-disabled-0.0.1.BUILD-SNAPSHOT.jar") -File backup = new File(basedir, "target/jar-classifier-main-attach-disabled-0.0.1.BUILD-SNAPSHOT.jar.original") - -new Verify.JarArchiveVerification(repackaged, Verify.SAMPLE_APP).verify(); -assertTrue 'main artifact should exist', main.exists() -assertFalse 'backup artifact should not exist', backup.exists() - -def file = new File(basedir, "build.log") -assertFalse 'repackaged artifact should not have been attached', - file.text.contains("Attaching repackaged archive " + repackaged + " with classifier test") -assertTrue 'repackaged artifact should have been created', - file.text.contains("Creating repackaged archive " + repackaged + " with classifier test") -assertTrue 'main artifact should have been installed', - file.text.contains ("Installing " + main + " to") -assertFalse 'repackaged artifact should not have been installed', - file.text.contains ("Installing " + repackaged + " to") -assertFalse 'backup artifact should not have been installed', - file.text.contains ("Installing " + backup + "to") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main/invoker.properties b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main/invoker.properties deleted file mode 100644 index c0c3f7cc079e..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main/invoker.properties +++ /dev/null @@ -1 +0,0 @@ -invoker.goals=clean install \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main/pom.xml deleted file mode 100644 index b754ff6d29d9..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-classifier-main - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - Foo - - - - - - - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main/verify.groovy deleted file mode 100644 index a575beda0a6c..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-main/verify.groovy +++ /dev/null @@ -1,22 +0,0 @@ -import org.springframework.boot.maven.* - -import static org.junit.Assert.assertTrue -import static org.junit.Assert.assertFalse - -File repackaged = new File(basedir, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT-test.jar") -File main = new File(basedir, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT.jar") -File backup = new File(basedir, "target/jar-classifier-main-0.0.1.BUILD-SNAPSHOT.jar.original") - -new Verify.JarArchiveVerification(repackaged, Verify.SAMPLE_APP).verify(); -assertTrue 'main artifact should exist', main.exists() -assertFalse 'backup artifact should not exist', backup.exists() - -def file = new File(basedir, "build.log") -assertTrue 'repackaged artifact should have been attached', - file.text.contains("Attaching repackaged archive " + repackaged + " with classifier test") -assertFalse 'repackaged artifact should have been created', - file.text.contains("Creating repackaged archive " + repackaged + " with classifier test") -assertTrue 'main artifact should have been installed', - file.text.contains ("Installing " + main + " to") -assertTrue 'repackaged artifact should have been installed', - file.text.contains ("Installing " + repackaged + " to") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/invoker.properties b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/invoker.properties deleted file mode 100644 index c0c3f7cc079e..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/invoker.properties +++ /dev/null @@ -1 +0,0 @@ -invoker.goals=clean install \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/verify.groovy deleted file mode 100644 index dae20efad32e..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/verify.groovy +++ /dev/null @@ -1,20 +0,0 @@ -import org.springframework.boot.maven.* - -import static org.junit.Assert.assertTrue -import static org.junit.Assert.assertFalse - -File main = new File(basedir, "target/jar-classifier-source-attach-disabled-0.0.1.BUILD-SNAPSHOT-test.jar") -File backup = new File(basedir, "target/jar-classifier-source-attach-disabled-0.0.1.BUILD-SNAPSHOT-test.jar.original") - -new Verify.JarArchiveVerification(main, Verify.SAMPLE_APP).verify(); -assertTrue 'backup artifact should exist', backup.exists() - -def file = new File(basedir, "build.log") -assertFalse 'repackaged artifact should not have been attached', - file.text.contains("Attaching repackaged archive " + main + " with classifier test") -assertTrue 'test artifact should have been updated', - file.text.contains("Updating artifact with classifier test " + main + " to " + backup) -assertTrue 'backup artifact should have been installed', - file.text.contains ("Installing " + backup + " to") -assertFalse 'repackaged artifact should not have been installed', - file.text.contains ("Installing " + main + " to") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/invoker.properties b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/invoker.properties deleted file mode 100644 index c0c3f7cc079e..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/invoker.properties +++ /dev/null @@ -1 +0,0 @@ -invoker.goals=clean install \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/verify.groovy deleted file mode 100644 index d85fe4126222..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/verify.groovy +++ /dev/null @@ -1,16 +0,0 @@ -import org.springframework.boot.maven.* - -import static org.junit.Assert.assertFalse -import static org.junit.Assert.assertTrue - -File repackaged = new File(basedir, "target/jar-classifier-source-0.0.1.BUILD-SNAPSHOT-test.jar") -File backup = new File(basedir, "target/jar-classifier-source-0.0.1.BUILD-SNAPSHOT-test.jar.original") - -new Verify.JarArchiveVerification(repackaged, Verify.SAMPLE_APP).verify(); -assertTrue 'backup artifact should exist', backup.exists() - -def file = new File(basedir, "build.log") -assertTrue 'repackaged artifact should have been replaced', - file.text.contains("Replacing artifact with classifier test with repackaged archive") -assertFalse 'backup artifact should not have been installed', file.text.contains ("Installing "+backup) -assertTrue 'repackaged artifact should have been installed', file.text.contains ("Installing "+repackaged) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-create-dir/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-create-dir/pom.xml deleted file mode 100644 index 33e076fcfb32..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-create-dir/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-create-dir - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - ${project.build.directory}/foo - foo - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - some.random.Main - - - Foo - - - - - - - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-create-dir/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-create-dir/verify.groovy deleted file mode 100644 index 9a3e44547440..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-create-dir/verify.groovy +++ /dev/null @@ -1,6 +0,0 @@ -import java.io.*; -import org.springframework.boot.maven.*; - -Verify.verifyJar( - new File(basedir, "target/foo/jar-create-dir-0.0.1.BUILD-SNAPSHOT-foo.jar"), "some.random.Main" -) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-dir/invoker.properties b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-dir/invoker.properties deleted file mode 100644 index c0c3f7cc079e..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-dir/invoker.properties +++ /dev/null @@ -1 +0,0 @@ -invoker.goals=clean install \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-dir/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-dir/pom.xml deleted file mode 100644 index fa75c04236ae..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-dir/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-custom-dir - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - ${project.build.directory}/foo - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - some.random.Main - - - Foo - - - - - - - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-dir/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-dir/verify.groovy deleted file mode 100644 index 0960d4ee3e62..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-dir/verify.groovy +++ /dev/null @@ -1,10 +0,0 @@ -import java.io.*; -import org.springframework.boot.maven.*; - -Verify.verifyJar( - new File(basedir, "target/foo/jar-custom-dir-0.0.1.BUILD-SNAPSHOT.jar"), "some.random.Main" -) - -Verify.verifyJar( - new File(localRepositoryPath, "org/springframework/boot/maven/it/jar-custom-dir/0.0.1.BUILD-SNAPSHOT/jar-custom-dir-0.0.1.BUILD-SNAPSHOT.jar"), "some.random.Main" -) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-launcher/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-launcher/pom.xml deleted file mode 100644 index f91261e24565..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-launcher/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - ${basedir}/src/launcher/custom.script - - world - - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - some.random.Main - - - Foo - - - - - - - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-launcher/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-launcher/verify.groovy deleted file mode 100644 index 738a8ad14273..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-custom-launcher/verify.groovy +++ /dev/null @@ -1,6 +0,0 @@ -import java.io.*; -import org.springframework.boot.maven.*; - -Verify.verifyJar( - new File(basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar"), "some.random.Main", "Hello world" -) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/pom.xml deleted file mode 100644 index ba0c43d46315..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-exclude-entry - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - - - javax.servlet - servlet-api - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - Foo - - - - - - - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - - javax.servlet - servlet-api - 2.5 - provided - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/verify.groovy deleted file mode 100644 index 61011b7aa505..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/verify.groovy +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.*; -import org.springframework.boot.maven.*; - -File f = new File(basedir, "target/jar-exclude-entry-0.0.1.BUILD-SNAPSHOT.jar") -new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { - @Override - protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { - super.verifyZipEntries(verifier) - verifier.assertHasNoEntryNameStartingWith("BOOT-INF/lib/servlet-api-2.5.jar") - } -}.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/verify.groovy deleted file mode 100644 index bf712e6801f3..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/verify.groovy +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.*; -import org.springframework.boot.maven.*; - -File f = new File(basedir, "target/jar-exclude-group-0.0.1.BUILD-SNAPSHOT.jar") -new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { - @Override - protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { - super.verifyZipEntries(verifier) - verifier.assertHasNoEntryNameStartingWith("BOOT-INF/lib/log4j-api-2.4.1.jar") - } -}.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-executable/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-executable/verify.groovy deleted file mode 100644 index 8c2522ba6845..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-executable/verify.groovy +++ /dev/null @@ -1,7 +0,0 @@ -import java.io.*; -import org.springframework.boot.maven.*; - -Verify.verifyJar( - new File(basedir, "target/jar-executable-0.0.1.BUILD-SNAPSHOT.jar"), - "some.random.Main", "Spring Boot Startup Script", "MyFullyExecutableJarName", - "MyFullyExecutableJarDesc") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/verify.groovy deleted file mode 100644 index 1294e4aeb7e9..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/verify.groovy +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2012-2016 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.*; -import org.springframework.boot.maven.*; - -File f = new File(basedir, "test-project/target/test-project-0.0.1.BUILD-SNAPSHOT.jar") -new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { - @Override - protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { - super.verifyZipEntries(verifier) - verifier.assertHasEntryNameStartingWith("BOOT-INF/lib/org.springframework.boot.maven.it-acme-lib-0.0.1.BUILD-SNAPSHOT.jar") - verifier.assertHasEntryNameStartingWith("BOOT-INF/lib/org.springframework.boot.maven.it.another-acme-lib-0.0.1.BUILD-SNAPSHOT.jar") - } -}.verify(); - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-non-executable/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-non-executable/pom.xml deleted file mode 100644 index 587f8a8695af..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-non-executable/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - false - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - some.random.Main - - - Foo - - - - - - - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-non-executable/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-non-executable/verify.groovy deleted file mode 100644 index 5d0f840e1732..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-non-executable/verify.groovy +++ /dev/null @@ -1,6 +0,0 @@ -import java.io.*; -import org.springframework.boot.maven.*; - -Verify.verifyJar( - new File(basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar"), "some.random.Main", false -) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-skip/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-skip/verify.groovy deleted file mode 100644 index cff568c8cbc9..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-skip/verify.groovy +++ /dev/null @@ -1,7 +0,0 @@ -import static org.junit.Assert.assertTrue -import static org.junit.Assert.assertFalse - -File f = new File(basedir, "target/jar-skip-0.0.1.BUILD-SNAPSHOT.jar") -assertTrue 'output file should have been generated', f.exists() -File shouldNotExist = new File(basedir, "target/jar-skip-0.0.1.BUILD-SNAPSHOT.jar.original") -assertFalse 'repackage goal should not have run. .original should not exist', shouldNotExist.exists() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope-default/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope-default/pom.xml deleted file mode 100644 index 15c4b16a57b3..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope-default/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-system-scope-default - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - Foo - - - - - - - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - - com.example - sample - 1.0.0 - system - ${project.basedir}/sample-1.0.0.jar - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope-default/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope-default/verify.groovy deleted file mode 100644 index 0a1ef4fc8f50..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope-default/verify.groovy +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2012-2014 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.*; -import org.springframework.boot.maven.*; - -File f = new File(basedir, "target/jar-system-scope-default-0.0.1.BUILD-SNAPSHOT.jar") -new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { - @Override - protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { - super.verifyZipEntries(verifier) - verifier.assertHasNoEntryNameStartingWith("BOOT-INF/lib/sample-1.0.0.jar") - } -}.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope/pom.xml deleted file mode 100644 index 22c2be938762..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-system-scope - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - true - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - Foo - - - - - - - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - - com.example - sample - 1.0.0 - system - ${project.basedir}/sample-1.0.0.jar - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope/verify.groovy deleted file mode 100644 index 20097b2b78b1..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-system-scope/verify.groovy +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2012-2014 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.*; -import org.springframework.boot.maven.*; - -File f = new File(basedir, "target/jar-system-scope-0.0.1.BUILD-SNAPSHOT.jar") -new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { - @Override - protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { - super.verifyZipEntries(verifier) - verifier.assertHasEntryNameStartingWith("BOOT-INF/lib/sample-1.0.0.jar") - } -}.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/pom.xml deleted file mode 100644 index 11985a8b8ae9..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-test-scope - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - servlet-api - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - Foo - - - - - - - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - - org.apache.logging.log4j - log4j-api - @log4j2.version@ - test - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/verify.groovy deleted file mode 100644 index 24a032bfc2c4..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/verify.groovy +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.*; -import org.springframework.boot.maven.*; - -File f = new File(basedir, "target/jar-test-scope-0.0.1.BUILD-SNAPSHOT.jar") -new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { - @Override - protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { - super.verifyZipEntries(verifier) - verifier.assertHasNoEntryNameStartingWith("BOOT-INF/lib/log4j-api-2.4.1.jar") - } -}.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/verify.groovy deleted file mode 100644 index 6000b59e5c87..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/verify.groovy +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.*; -import org.springframework.boot.maven.*; - -File f = new File(basedir, "target/jar-with-kotlin-module-0.0.1.BUILD-SNAPSHOT.jar") -new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { - @Override - protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { - super.verifyZipEntries(verifier) - verifier.assertHasEntryNameStartingWith("BOOT-INF/classes/META-INF/jar-with-kotlin-module.kotlin_module") - verifier.assertHasUnpackEntry("BOOT-INF/lib/kotlin-compiler-") - verifier.assertHasNonUnpackEntry("BOOT-INF/lib/kotlin-stdlib-") - verifier.assertHasNonUnpackEntry("BOOT-INF/lib/kotlin-reflect-") - } -}.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-layout-property/invoker.properties b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-layout-property/invoker.properties deleted file mode 100644 index 034be1275494..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-layout-property/invoker.properties +++ /dev/null @@ -1 +0,0 @@ -invoker.goals=package -Dspring-boot.repackage.layout=ZIP \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-layout-property/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-layout-property/verify.groovy deleted file mode 100644 index 74a5ff22db55..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-layout-property/verify.groovy +++ /dev/null @@ -1,4 +0,0 @@ -import static org.junit.Assert.assertTrue - -def file = new File(basedir, "build.log") -assertTrue file.text.contains("Layout: ZIP") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/verify.groovy deleted file mode 100644 index ea7eee6d1285..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/verify.groovy +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2012-2016 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.*; -import org.springframework.boot.maven.*; - -File f = new File(basedir, "target/jar-with-unpack-0.0.1.BUILD-SNAPSHOT.jar") -new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { - @Override - protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { - super.verifyZipEntries(verifier) - verifier.assertHasUnpackEntry("BOOT-INF/lib/spring-core-") - verifier.assertHasNonUnpackEntry("BOOT-INF/lib/spring-context-") - } -}.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar/invoker.properties b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar/invoker.properties deleted file mode 100644 index c0c3f7cc079e..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar/invoker.properties +++ /dev/null @@ -1 +0,0 @@ -invoker.goals=clean install \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar/verify.groovy deleted file mode 100644 index 248bf1acf3b6..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar/verify.groovy +++ /dev/null @@ -1,19 +0,0 @@ -import org.springframework.boot.maven.* - -import static org.junit.Assert.assertTrue -import static org.junit.Assert.assertFalse - -File main = new File(basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar") -File backup = new File(basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar.original") -Verify.verifyJar(main, "some.random.Main") -assertTrue 'backup file should exist', backup.exists() - -def file = new File(basedir, "build.log") -assertTrue 'main artifact should have been replaced by repackaged archive', - file.text.contains("Replacing main artifact with repackaged archive") -assertTrue 'main artifact should have been installed', - file.text.contains ("Installing " + main + " to") -assertFalse 'backup artifact should not have been installed', - file.text.contains ("Installing " + backup + "to") -assertFalse file.text.contains("Layout:") - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/prop/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/prop/pom.xml deleted file mode 100644 index 572465bd44f1..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/prop/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - ZIP - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - Foo - - - - - - - - - org.springframework - spring-context - @spring-framework.version@ - - - jakarta.servlet - jakarta.servlet-api - @jakarta-servlet.version@ - provided - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/prop/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/prop/verify.groovy deleted file mode 100644 index 39e9cd8496db..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/prop/verify.groovy +++ /dev/null @@ -1,6 +0,0 @@ -import java.io.*; -import org.springframework.boot.maven.*; - -Verify.verifyZip( - new File(basedir, "target/jar-0.0.1.BUILD-SNAPSHOT.jar") -) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments-commandline/invoker.properties b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments-commandline/invoker.properties deleted file mode 100644 index 9225c36f9e14..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments-commandline/invoker.properties +++ /dev/null @@ -1 +0,0 @@ -invoker.systemPropertiesFile=test.properties diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments-commandline/test.properties b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments-commandline/test.properties deleted file mode 100644 index 4de2d29f21f2..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments-commandline/test.properties +++ /dev/null @@ -1 +0,0 @@ -spring-boot.run.arguments=--management.endpoints.web.exposure.include=prometheus,info,health,metrics --spring.profiles.active=foo,bar diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments-commandline/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments-commandline/verify.groovy deleted file mode 100644 index 9963e64c2e2d..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments-commandline/verify.groovy +++ /dev/null @@ -1,2 +0,0 @@ -def file = new File(basedir, "build.log") -return file.text.contains("I haz been run with profile(s) 'foo,bar' and endpoint(s) 'prometheus,info,health,metrics'") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments/verify.groovy deleted file mode 100644 index 2a7cc17ab524..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments/verify.groovy +++ /dev/null @@ -1,2 +0,0 @@ -def file = new File(basedir, "build.log") -return file.text.contains("I haz been run with profile(s) 'foo,bar' and endpoint(s) 'prometheus,info'") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-devtools/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-devtools/verify.groovy deleted file mode 100644 index ac9957acf2d4..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-devtools/verify.groovy +++ /dev/null @@ -1,6 +0,0 @@ -import static org.junit.Assert.assertTrue - -def file = new File(basedir, "build.log") -assertTrue 'Devtools should have been detected', file.text.contains('Fork mode disabled, devtools will be disabled') -assertTrue 'Application should have run', file.text.contains("I haz been run") - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-disable-fork/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-disable-fork/verify.groovy deleted file mode 100644 index 752e0988f003..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-disable-fork/verify.groovy +++ /dev/null @@ -1,7 +0,0 @@ -import static org.junit.Assert.assertTrue - -def file = new File(basedir, "build.log") -assertTrue file.text.contains("I haz been run") -assertTrue file.text.contains("Fork mode disabled, ignoring JVM argument(s) [-Dproperty1=value1 -Dproperty2 -Dfoo=bar]") -assertTrue file.text.contains("Fork mode disabled, ignoring working directory configuration") - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-envargs/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-envargs/verify.groovy deleted file mode 100644 index 841c4a97de58..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-envargs/verify.groovy +++ /dev/null @@ -1,3 +0,0 @@ -def file = new File(basedir, "build.log") -return file.text.contains("I haz been run") - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-exclude/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-exclude/verify.groovy deleted file mode 100644 index 841c4a97de58..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-exclude/verify.groovy +++ /dev/null @@ -1,3 +0,0 @@ -def file = new File(basedir, "build.log") -return file.text.contains("I haz been run") - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-fork/invoker.properties b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-fork/invoker.properties deleted file mode 100644 index 8056f772dae6..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-fork/invoker.properties +++ /dev/null @@ -1 +0,0 @@ -invoker.goals=clean verify -X \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-fork/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-fork/verify.groovy deleted file mode 100644 index f675a4fa6121..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-fork/verify.groovy +++ /dev/null @@ -1,21 +0,0 @@ -import java.lang.reflect.Method; - -import static org.junit.Assert.assertTrue - -def boolean isJava13OrLater() { - for (Method method : String.class.getMethods()) { - if (method.getName().equals("stripIndent")) { - return true; - } - } - return false; -} - -def file = new File(basedir, "build.log") -assertTrue file.text.contains("I haz been run from '$basedir'") -if (isJava13OrLater()) { - assertTrue file.text.contains("JVM argument(s): -XX:TieredStopAtLevel=1") -} -else { - assertTrue file.text.contains("JVM argument(s): -Xverify:none -XX:TieredStopAtLevel=1") -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvm-system-props/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvm-system-props/pom.xml deleted file mode 100644 index 4828ceec96c6..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvm-system-props/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - run-jvmargs - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - package - - run - - - -Dfoo="value 1" -Dbar=value2 - - value1 - - ${project.artifactId} - should-be-ignored - - - - - - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvm-system-props/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvm-system-props/verify.groovy deleted file mode 100644 index 841c4a97de58..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvm-system-props/verify.groovy +++ /dev/null @@ -1,3 +0,0 @@ -def file = new File(basedir, "build.log") -return file.text.contains("I haz been run") - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvmargs/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvmargs/verify.groovy deleted file mode 100644 index 841c4a97de58..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvmargs/verify.groovy +++ /dev/null @@ -1,3 +0,0 @@ -def file = new File(basedir, "build.log") -return file.text.contains("I haz been run") - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles-fork/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles-fork/verify.groovy deleted file mode 100644 index c9cb44bb059f..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles-fork/verify.groovy +++ /dev/null @@ -1,2 +0,0 @@ -def file = new File(basedir, "build.log") -return file.text.contains("I haz been run with profile(s) 'foo,bar'") \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles/verify.groovy deleted file mode 100644 index c9cb44bb059f..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles/verify.groovy +++ /dev/null @@ -1,2 +0,0 @@ -def file = new File(basedir, "build.log") -return file.text.contains("I haz been run with profile(s) 'foo,bar'") \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-toolchains/invoker.properties b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-toolchains/invoker.properties deleted file mode 100644 index 12b66a0fa599..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-toolchains/invoker.properties +++ /dev/null @@ -1,2 +0,0 @@ -invoker.goals=clean verify -t toolchains.xml -invoker.os.family=!windows diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-toolchains/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-toolchains/verify.groovy deleted file mode 100644 index 7140f782d88e..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-toolchains/verify.groovy +++ /dev/null @@ -1,2 +0,0 @@ -def file = new File(basedir, "build.log") -return file.text.contains("The Maven Toolchains is awesome!") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-use-test-classpath/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-use-test-classpath/verify.groovy deleted file mode 100644 index 841c4a97de58..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-use-test-classpath/verify.groovy +++ /dev/null @@ -1,3 +0,0 @@ -def file = new File(basedir, "build.log") -return file.text.contains("I haz been run") - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-working-directory/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-working-directory/verify.groovy deleted file mode 100644 index 4f1b8234fc59..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-working-directory/verify.groovy +++ /dev/null @@ -1,6 +0,0 @@ -import static org.junit.Assert.assertTrue - -def file = new File(basedir, "build.log") -def workDir = new File(basedir, "src/main/java").getAbsolutePath() -assertTrue file.text.contains("I haz been run from ${workDir}") - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run/verify.groovy deleted file mode 100644 index 841c4a97de58..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run/verify.groovy +++ /dev/null @@ -1,3 +0,0 @@ -def file = new File(basedir, "build.log") -return file.text.contains("I haz been run") - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/settings.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/settings.xml deleted file mode 100644 index e1e0ace341b9..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/settings.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - it-repo - - true - - - - local.central - @localRepositoryUrl@ - - true - - - true - - - - - - local.central - @localRepositoryUrl@ - - true - - - true - - - - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/invoker.properties b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/invoker.properties deleted file mode 100644 index 793d89fcd371..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/invoker.properties +++ /dev/null @@ -1 +0,0 @@ -invoker.goals=clean verify \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/verify.groovy deleted file mode 100644 index 5aa87af6830b..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-fork/verify.groovy +++ /dev/null @@ -1,5 +0,0 @@ -import static org.junit.Assert.assertTrue - -def file = new File(basedir, "build.log") -assertTrue 'Start should have waited for application to be ready', file.text.contains("isReady: true") -assertTrue 'Shutdown should have been invoked', file.text.contains("Shutdown requested") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-skip/invoker.properties b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-skip/invoker.properties deleted file mode 100644 index 793d89fcd371..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-skip/invoker.properties +++ /dev/null @@ -1 +0,0 @@ -invoker.goals=clean verify \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-skip/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-skip/verify.groovy deleted file mode 100644 index 0d3ec538c9ce..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop-skip/verify.groovy +++ /dev/null @@ -1,5 +0,0 @@ -import static org.junit.Assert.assertFalse - -def file = new File(basedir, "build.log") -assertFalse 'Application should not have run', file.text.contains("Ooops, I haz been run") -assertFalse 'Should not attempt to stop the app', file.text.contains('Stopping application') diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/invoker.properties b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/invoker.properties deleted file mode 100644 index 793d89fcd371..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/invoker.properties +++ /dev/null @@ -1 +0,0 @@ -invoker.goals=clean verify \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/verify.groovy deleted file mode 100644 index 5aa87af6830b..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/verify.groovy +++ /dev/null @@ -1,5 +0,0 @@ -import static org.junit.Assert.assertTrue - -def file = new File(basedir, "build.log") -assertTrue 'Start should have waited for application to be ready', file.text.contains("isReady: true") -assertTrue 'Shutdown should have been invoked', file.text.contains("Shutdown requested") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/verify.groovy deleted file mode 100644 index 48d805aaac69..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-reactor/verify.groovy +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2012-2015 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.*; -import org.springframework.boot.maven.*; - -File f = new File(basedir, "war/target/war-0.0.1.BUILD-SNAPSHOT.war") -new Verify.WarArchiveVerification(f) { - @Override - protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { - super.verifyZipEntries(verifier) - verifier.assertHasEntryNameStartingWith("WEB-INF/lib/jar-0.0.1.BUILD-SNAPSHOT.jar") - verifier.assertHasNoEntryNameStartingWith("WEB-INF/lib/jar.jar") - } -}.verify() - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-with-unpack/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-with-unpack/verify.groovy deleted file mode 100644 index d1c8e547fb65..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-with-unpack/verify.groovy +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2012-2015 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import java.io.*; -import org.springframework.boot.maven.*; - -File f = new File(basedir, "target/war-0.0.1.BUILD-SNAPSHOT.war") -new Verify.WarArchiveVerification(f) { - @Override - protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { - super.verifyZipEntries(verifier) - verifier.assertHasUnpackEntry("WEB-INF/lib/spring-core-") - verifier.assertHasNonUnpackEntry("WEB-INF/lib/spring-context-") - } -}.verify() - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war/verify.groovy deleted file mode 100644 index e0c145c834c4..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war/verify.groovy +++ /dev/null @@ -1,7 +0,0 @@ -import java.io.*; -import org.springframework.boot.maven.*; - -Verify.verifyWar( - new File(basedir, "target/war-0.0.1.BUILD-SNAPSHOT.war") -) - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/maven/resources/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/maven/resources/pom.xml new file mode 100644 index 000000000000..9a7c8e0cde58 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/maven/resources/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + org.springframework.boot + spring-boot-maven-plugin + {{version}} + maven-plugin + Spring Boot Maven Plugin + https://projects.spring.io/spring-boot/# + + UTF-8 + + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0 + + + + https://github.com/spring-projects/spring-boot + scm:git:git://github.com/spring-projects/spring-boot.git + scm:git:ssh://git@github.com/spring-projects/spring-boot.git + + + GitHub + https://github.com/spring-projects/spring-boot/issues + + + Pivotal Software, Inc. + https://spring.io + + + + + org.apache.maven.plugins + maven-plugin-plugin + 3.6.0 + + org.springframework.boot.maven + + + + + \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/Verify.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/Verify.java deleted file mode 100644 index c69a060bb434..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/Verify.java +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.maven; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; -import java.util.jar.Manifest; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - -import org.springframework.core.io.FileSystemResource; -import org.springframework.core.io.support.PropertiesLoaderUtils; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.contentOf; - -/** - * Verification utility for use with maven-invoker-plugin verification scripts. - * - * @author Phillip Webb - * @author Andy Wilkinson - * @author Stephane Nicoll - */ -public final class Verify { - - public static final String SAMPLE_APP = "org.test.SampleApplication"; - - private Verify() { - } - - public static void verifyJar(File file) throws Exception { - new JarArchiveVerification(file, SAMPLE_APP).verify(); - } - - public static void verifyJar(File file, String main, String... scriptContents) throws Exception { - verifyJar(file, main, true, scriptContents); - } - - public static void verifyJar(File file, String main, boolean executable, String... scriptContents) - throws Exception { - new JarArchiveVerification(file, main).verify(executable, scriptContents); - } - - public static void verifyWar(File file) throws Exception { - new WarArchiveVerification(file).verify(); - } - - public static void verifyZip(File file) throws Exception { - new ZipArchiveVerification(file).verify(); - } - - public static void verifyModule(File file) throws Exception { - new ModuleArchiveVerification(file).verify(); - } - - public static Properties verifyBuildInfo(File file, String group, String artifact, String name, String version) - throws IOException { - FileSystemResource resource = new FileSystemResource(file); - Properties properties = PropertiesLoaderUtils.loadProperties(resource); - assertThat(properties.get("build.group")).isEqualTo(group); - assertThat(properties.get("build.artifact")).isEqualTo(artifact); - assertThat(properties.get("build.name")).isEqualTo(name); - assertThat(properties.get("build.version")).isEqualTo(version); - return properties; - } - - public static class ArchiveVerifier { - - private final ZipFile zipFile; - - private final Map content; - - public ArchiveVerifier(ZipFile zipFile) { - this.zipFile = zipFile; - Enumeration entries = zipFile.entries(); - this.content = new HashMap<>(); - while (entries.hasMoreElements()) { - ZipEntry zipEntry = entries.nextElement(); - this.content.put(zipEntry.getName(), zipEntry); - } - } - - public void assertHasEntryNameStartingWith(String entry) { - for (String name : this.content.keySet()) { - if (name.startsWith(entry)) { - return; - } - } - throw new IllegalStateException("Expected entry starting with " + entry); - } - - public void assertHasNoEntryNameStartingWith(String entry) { - for (String name : this.content.keySet()) { - if (name.startsWith(entry)) { - throw new IllegalStateException("Entry starting with " + entry + " should not have been found"); - } - } - } - - public void assertHasNonUnpackEntry(String entryName) { - assertThat(hasNonUnpackEntry(entryName)).as("Entry starting with " + entryName + " was an UNPACK entry") - .isTrue(); - } - - public void assertHasUnpackEntry(String entryName) { - assertThat(hasUnpackEntry(entryName)).as("Entry starting with " + entryName + " was not an UNPACK entry") - .isTrue(); - } - - private boolean hasNonUnpackEntry(String entryName) { - return !hasUnpackEntry(entryName); - } - - private boolean hasUnpackEntry(String entryName) { - String comment = getEntryStartingWith(entryName).getComment(); - return comment != null && comment.startsWith("UNPACK:"); - } - - private ZipEntry getEntryStartingWith(String entryName) { - return this.content.entrySet().stream().filter((entry) -> entry.getKey().startsWith(entryName)) - .map(Map.Entry::getValue).findFirst() - .orElseThrow(() -> new IllegalStateException("Unable to find entry starting with " + entryName)); - } - - public boolean hasEntry(String entry) { - return this.content.containsKey(entry); - } - - public ZipEntry getEntry(String entry) { - return this.content.get(entry); - } - - public InputStream getEntryContent(String entry) throws IOException { - ZipEntry zipEntry = getEntry(entry); - if (zipEntry == null) { - throw new IllegalArgumentException("No entry with name [" + entry + "]"); - } - return this.zipFile.getInputStream(zipEntry); - } - - } - - public abstract static class AbstractArchiveVerification { - - private final File file; - - AbstractArchiveVerification(File file) { - this.file = file; - } - - public void verify() throws Exception { - verify(true); - } - - public void verify(boolean executable, String... scriptContents) throws Exception { - assertThat(this.file).exists().isFile(); - - if (scriptContents.length > 0 && executable) { - String contents = contentOf(this.file); - contents = contents.substring(0, contents.indexOf(new String(new byte[] { 0x50, 0x4b, 0x03, 0x04 }))); - for (String content : scriptContents) { - assertThat(contents).contains(content); - } - } - - if (!executable) { - String contents = contentOf(this.file); - assertThat(contents).as("Is executable").startsWith(new String(new byte[] { 0x50, 0x4b, 0x03, 0x04 })); - } - - try (ZipFile zipFile = new ZipFile(this.file)) { - ArchiveVerifier verifier = new ArchiveVerifier(zipFile); - verifyZipEntries(verifier); - } - } - - protected void verifyZipEntries(ArchiveVerifier verifier) throws Exception { - verifyManifest(verifier); - } - - private void verifyManifest(ArchiveVerifier verifier) throws Exception { - Manifest manifest = new Manifest(verifier.getEntryContent("META-INF/MANIFEST.MF")); - verifyManifest(manifest); - } - - protected abstract void verifyManifest(Manifest manifest) throws Exception; - - } - - public static class JarArchiveVerification extends AbstractArchiveVerification { - - private final String main; - - public JarArchiveVerification(File file, String main) { - super(file); - this.main = main; - } - - @Override - protected void verifyZipEntries(ArchiveVerifier verifier) throws Exception { - super.verifyZipEntries(verifier); - verifier.assertHasEntryNameStartingWith("BOOT-INF/lib/spring-context"); - verifier.assertHasEntryNameStartingWith("BOOT-INF/lib/spring-core"); - verifier.assertHasEntryNameStartingWith("BOOT-INF/lib/jakarta.servlet-api-4"); - assertThat(verifier.hasEntry("org/springframework/boot/loader/JarLauncher.class")) - .as("Unpacked launcher classes").isTrue(); - assertThat(verifier.hasEntry("BOOT-INF/classes/org/test/SampleApplication.class")).as("Own classes") - .isTrue(); - } - - @Override - protected void verifyManifest(Manifest manifest) throws Exception { - assertThat(manifest.getMainAttributes().getValue("Main-Class")) - .isEqualTo("org.springframework.boot.loader.JarLauncher"); - assertThat(manifest.getMainAttributes().getValue("Start-Class")).isEqualTo(this.main); - assertThat(manifest.getMainAttributes().getValue("Not-Used")).isEqualTo("Foo"); - } - - } - - public static class WarArchiveVerification extends AbstractArchiveVerification { - - public WarArchiveVerification(File file) { - super(file); - } - - @Override - protected void verifyZipEntries(ArchiveVerifier verifier) throws Exception { - super.verifyZipEntries(verifier); - verifier.assertHasEntryNameStartingWith("WEB-INF/lib/spring-context"); - verifier.assertHasEntryNameStartingWith("WEB-INF/lib/spring-core"); - verifier.assertHasEntryNameStartingWith("WEB-INF/lib-provided/jakarta.servlet-api-4"); - assertThat(verifier.hasEntry("org/springframework/boot/loader/JarLauncher.class")) - .as("Unpacked launcher classes").isTrue(); - assertThat(verifier.hasEntry("WEB-INF/classes/org/test/SampleApplication.class")).as("Own classes") - .isTrue(); - assertThat(verifier.hasEntry("index.html")).as("Web content").isTrue(); - } - - @Override - protected void verifyManifest(Manifest manifest) throws Exception { - assertThat(manifest.getMainAttributes().getValue("Main-Class")) - .isEqualTo("org.springframework.boot.loader.WarLauncher"); - assertThat(manifest.getMainAttributes().getValue("Start-Class")).isEqualTo("org.test.SampleApplication"); - assertThat(manifest.getMainAttributes().getValue("Not-Used")).isEqualTo("Foo"); - } - - } - - private static class ZipArchiveVerification extends AbstractArchiveVerification { - - ZipArchiveVerification(File file) { - super(file); - } - - @Override - protected void verifyManifest(Manifest manifest) throws Exception { - assertThat(manifest.getMainAttributes().getValue("Main-Class")) - .isEqualTo("org.springframework.boot.loader.PropertiesLauncher"); - assertThat(manifest.getMainAttributes().getValue("Start-Class")).isEqualTo("org.test.SampleApplication"); - assertThat(manifest.getMainAttributes().getValue("Not-Used")).isEqualTo("Foo"); - } - - } - - private static class ModuleArchiveVerification extends AbstractArchiveVerification { - - ModuleArchiveVerification(File file) { - super(file); - } - - @Override - protected void verifyZipEntries(ArchiveVerifier verifier) throws Exception { - super.verifyZipEntries(verifier); - verifier.assertHasEntryNameStartingWith("lib/spring-context"); - verifier.assertHasEntryNameStartingWith("lib/spring-core"); - verifier.assertHasNoEntryNameStartingWith("lib/jakarta.servlet-api"); - assertThat(verifier.hasEntry("org/springframework/boot/loader/JarLauncher.class")) - .as("Unpacked launcher classes").isFalse(); - assertThat(verifier.hasEntry("org/test/SampleModule.class")).as("Own classes").isTrue(); - } - - @Override - protected void verifyManifest(Manifest manifest) throws Exception { - } - - } - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-test-support/build.gradle new file mode 100644 index 000000000000..b4b18cc55cee --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/build.gradle @@ -0,0 +1,37 @@ +plugins { + id 'java-library' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Testing Support' + +dependencies { + compileOnly "com.datastax.cassandra:cassandra-driver-core" + compileOnly "javax.servlet:javax.servlet-api" + compileOnly "junit:junit" + compileOnly "org.junit.jupiter:junit-jupiter" + compileOnly "org.junit.platform:junit-platform-engine" + compileOnly "org.mockito:mockito-core" + compileOnly "org.neo4j:neo4j-ogm-core" + compileOnly "org.springframework:spring-context" + compileOnly "org.springframework.data:spring-data-redis" + compileOnly "org.testcontainers:testcontainers" + + implementation enforcedPlatform(project(path: ":spring-boot-project:spring-boot-parent")) + implementation "org.apache.maven.resolver:maven-resolver-connector-basic" + implementation "org.apache.maven.resolver:maven-resolver-impl" + implementation "org.apache.maven:maven-resolver-provider" + implementation("org.apache.maven.resolver:maven-resolver-transport-http") { + exclude group: 'org.slf4j', module: 'jcl-over-slf4j' + } + implementation "org.assertj:assertj-core" + implementation "org.hamcrest:hamcrest-core" + implementation "org.hamcrest:hamcrest-library" + implementation "org.springframework:spring-core" + + testImplementation "org.junit.jupiter:junit-jupiter" + testImplementation "org.springframework:spring-context" + + testRuntimeOnly 'org.hibernate.validator:hibernate-validator' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-test-support/pom.xml deleted file mode 100644 index 580c05156d1b..000000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/pom.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-tools - ${revision} - - spring-boot-test-support - Spring Boot Testing Support - Spring Boot Testing Support - - ${basedir}/../../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - org.apache.maven.resolver - maven-resolver-connector-basic - - - org.apache.maven.resolver - maven-resolver-impl - - - org.apache.maven - maven-resolver-provider - - - com.google.guava - guava - - - - - org.apache.maven.resolver - maven-resolver-transport-http - - - jcl-over-slf4j - org.slf4j - - - - - org.springframework - spring-core - - - org.assertj - assertj-core - - - - com.datastax.cassandra - cassandra-driver-core - true - - - jakarta.servlet - jakarta.servlet-api - true - - - org.mockito - mockito-core - true - - - org.neo4j - neo4j-ogm-core - true - - - org.springframework.data - spring-data-redis - true - - - org.springframework - spring-context - true - - - org.testcontainers - testcontainers - true - - - javax.activation - javax.activation-api - - - javax.annotation - javax.annotation-api - - - javax.xml.bind - jaxb-api - - - - - org.testcontainers - junit-jupiter - true - - - - junit - junit - provided - - - org.hamcrest - hamcrest-core - - - - - org.junit.jupiter - junit-jupiter - provided - - - - org.hibernate.validator - hibernate-validator - test - - - javax.validation - validation-api - - - - - jakarta.validation - jakarta.validation-api - test - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/BuildOutput.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/BuildOutput.java index a0e1c3bd5b6e..41d055f396ef 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/BuildOutput.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/BuildOutput.java @@ -40,7 +40,9 @@ public BuildOutput(Class testClass) { public File getTestClassesLocation() { try { File location = new File(this.testClass.getProtectionDomain().getCodeSource().getLocation().toURI()); - if (location.getPath().endsWith(path("target", "test-classes"))) { + if (location.getPath().endsWith(path("bin", "test")) || location.getPath().endsWith(path("bin", "intTest")) + || location.getPath().endsWith(path("build", "classes", "java", "test")) + || location.getPath().endsWith(path("build", "classes", "java", "intTest"))) { return location; } throw new IllegalStateException("Unexpected test classes location '" + location + "'"); @@ -56,9 +58,16 @@ public File getTestClassesLocation() { */ public File getTestResourcesLocation() { File testClassesLocation = getTestClassesLocation(); - if (testClassesLocation.getPath().endsWith(path("target", "test-classes"))) { + if (testClassesLocation.getPath().endsWith(path("bin", "test")) + || testClassesLocation.getPath().endsWith(path("bin", "intTest"))) { return testClassesLocation; } + if (testClassesLocation.getPath().endsWith(path("build", "classes", "java", "test"))) { + return new File(testClassesLocation.getParentFile().getParentFile().getParentFile(), "resources/test"); + } + if (testClassesLocation.getPath().endsWith(path("build", "classes", "java", "intTest"))) { + return new File(testClassesLocation.getParentFile().getParentFile().getParentFile(), "resources/intTest"); + } throw new IllegalStateException( "Cannot determine test resources location from classes location '" + testClassesLocation + "'"); } @@ -68,7 +77,7 @@ public File getTestResourcesLocation() { * @return root location */ public File getRootLocation() { - return getTestClassesLocation().getParentFile(); + return new File("build"); } private String path(String... components) { diff --git a/spring-boot-project/spring-boot/build.gradle b/spring-boot-project/spring-boot/build.gradle new file mode 100644 index 000000000000..60a897770f90 --- /dev/null +++ b/spring-boot-project/spring-boot/build.gradle @@ -0,0 +1,127 @@ +plugins { + id 'java-library' + id 'org.jetbrains.kotlin.jvm' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.configuration-properties' + id 'org.springframework.boot.deployed' + id 'org.springframework.boot.optional-dependencies' +} + +description = 'Spring Boot' + +dependencies { + annotationProcessor enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + annotationProcessor 'org.apache.logging.log4j:log4j-core' + + api 'org.springframework:spring-core' + api 'org.springframework:spring-context' + + implementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + + optional enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + optional 'ch.qos.logback:logback-classic' + optional 'com.atomikos:transactions-jdbc' + optional 'com.atomikos:transactions-jms' + optional 'com.atomikos:transactions-jta' + optional 'com.fasterxml.jackson.core:jackson-databind' + optional 'com.google.code.gson:gson' + optional 'com.samskivert:jmustache' + optional 'com.sendgrid:sendgrid-java' + optional 'com.zaxxer:HikariCP' + optional 'io.netty:netty-tcnative-boringssl-static' + optional 'io.projectreactor:reactor-tools' + optional 'io.projectreactor.netty:reactor-netty' + optional 'io.rsocket:rsocket-core' + optional 'io.rsocket:rsocket-transport-netty' + optional ('io.undertow:undertow-servlet') { + exclude group: 'org.jboss.spec.javax.annotation', module: 'jboss-annotations-api_1.2_spec' + exclude group: 'org.jboss.spec.javax.servlet', module: 'jboss-servlet-api_4.0_spec' + } + optional 'javax.jms:javax.jms-api' + optional 'javax.servlet:javax.servlet-api' + optional 'junit:junit' + optional 'org.apache.commons:commons-dbcp2' + optional 'org.apache.httpcomponents:httpclient' + optional 'org.apache.logging.log4j:log4j-api' + optional 'org.apache.logging.log4j:log4j-core' + optional 'org.apache.tomcat.embed:tomcat-embed-core' + optional 'org.apache.tomcat.embed:tomcat-embed-jasper' + optional 'org.apache.tomcat:tomcat-jdbc' + optional 'org.assertj:assertj-core' + optional 'org.codehaus.btm:btm' + optional 'org.codehaus.groovy:groovy' + optional 'org.codehaus.groovy:groovy-xml' + optional 'org.eclipse.jetty:jetty-servlets' + optional 'org.eclipse.jetty:jetty-util' + optional 'org.eclipse.jetty:jetty-webapp' + optional 'org.eclipse.jetty:jetty-alpn-conscrypt-server' + optional 'org.eclipse.jetty.http2:http2-server' + optional 'org.hamcrest:hamcrest-library' + optional 'org.hibernate:hibernate-core' + optional 'org.hibernate.validator:hibernate-validator' + optional 'org.jboss:jboss-transaction-spi' + optional 'org.liquibase:liquibase-core' + optional 'org.neo4j:neo4j-ogm-core' + optional 'org.slf4j:jul-to-slf4j' + optional 'org.slf4j:slf4j-api' + optional 'org.springframework:spring-messaging' + optional 'org.springframework:spring-orm' + optional 'org.springframework:spring-oxm' + optional 'org.springframework:spring-test' + optional 'org.springframework:spring-web' + optional 'org.springframework:spring-webflux' + optional 'org.springframework:spring-webmvc' + optional 'org.springframework.security:spring-security-web' + optional 'org.springframework.ws:spring-ws-core' + optional 'org.yaml:snakeyaml' + optional 'org.jetbrains.kotlin:kotlin-reflect' + optional 'org.jetbrains.kotlin:kotlin-stdlib' + + testImplementation project(':spring-boot-project:spring-boot-tools:spring-boot-test-support') + testImplementation 'com.google.appengine:appengine-api-1.0-sdk' + testImplementation 'com.h2database:h2' + testImplementation 'com.ibm.db2:jcc' + testImplementation 'com.jayway.jsonpath:json-path' + testImplementation 'com.microsoft.sqlserver:mssql-jdbc' + testImplementation 'com.oracle.ojdbc:ojdbc8' + testImplementation 'com.squareup.okhttp3:okhttp' + testImplementation 'com.sun.xml.messaging.saaj:saaj-impl' + testImplementation 'io.projectreactor:reactor-test' + testImplementation 'javax.xml.ws:jaxws-api' + testImplementation 'mysql:mysql-connector-java' + testImplementation 'net.sourceforge.jtds:jtds' + testImplementation 'org.apache.derby:derby' + testImplementation 'org.apache.httpcomponents:httpasyncclient' + testImplementation 'org.awaitility:awaitility' + testImplementation 'org.firebirdsql.jdbc:jaybird-jdk18' + testImplementation 'org.hsqldb:hsqldb' + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.mariadb.jdbc:mariadb-java-client' + testImplementation 'org.mockito:mockito-core' + testImplementation 'org.postgresql:postgresql' + testImplementation 'org.springframework:spring-context-support' + testImplementation 'org.springframework.data:spring-data-redis' + testImplementation 'org.xerial:sqlite-jdbc' + + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' + testRuntimeOnly('org.testcontainers:jdbc') { + exclude group: 'javax.annotation', module: 'javax.annotation-api' + exclude group: 'javax.xml.bind', module: 'jaxb-api' + } +} + +compileKotlin { + kotlinOptions { + jvmTarget = 1.8 + } +} + +compileTestKotlin { + kotlinOptions { + jvmTarget = 1.8 + } +} + +compileJava { + doLast new org.springframework.boot.build.log4j2.ReproducibleLog4j2PluginsDatAction() +} diff --git a/spring-boot-project/spring-boot/pom.xml b/spring-boot-project/spring-boot/pom.xml deleted file mode 100644 index e42cf6267224..000000000000 --- a/spring-boot-project/spring-boot/pom.xml +++ /dev/null @@ -1,560 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-parent - ${revision} - ../spring-boot-parent - - spring-boot - Spring Boot - Spring Boot - - ${basedir}/../.. - - - ${git.url} - ${git.connection} - ${git.developerConnection} - - - - - org.springframework - spring-core - - - org.springframework - spring-context - - - - ch.qos.logback - logback-classic - true - - - com.atomikos - transactions-jdbc - true - - - com.atomikos - transactions-jms - true - - - com.atomikos - transactions-jta - true - - - com.fasterxml.jackson.core - jackson-databind - true - - - com.google.code.gson - gson - true - - - com.oracle.ojdbc - ojdbc8 - true - - - com.samskivert - jmustache - true - - - com.sendgrid - sendgrid-java - true - - - com.zaxxer - HikariCP - true - - - io.projectreactor.netty - reactor-netty - true - - - io.netty - netty-tcnative-boringssl-static - true - - - io.rsocket - rsocket-core - true - - - io.rsocket - rsocket-transport-netty - true - - - io.undertow - undertow-servlet - true - - - jakarta.jms - jakarta.jms-api - true - - - jakarta.servlet - jakarta.servlet-api - true - - - jakarta.validation - jakarta.validation-api - true - - - junit - junit - true - - - org.hamcrest - hamcrest-core - - - - - org.apache.commons - commons-dbcp2 - true - - - org.apache.httpcomponents - httpclient - true - - - org.apache.logging.log4j - log4j-api - true - - - org.apache.logging.log4j - log4j-core - true - - - org.apache.tomcat.embed - tomcat-embed-core - true - - - org.apache.tomcat.embed - tomcat-embed-jasper - true - - - org.apache.tomcat - tomcat-jdbc - true - - - org.assertj - assertj-core - true - - - org.codehaus.btm - btm - true - - - javax.transaction - jta - - - - - org.codehaus.groovy - groovy - true - - - org.codehaus.groovy - groovy-xml - true - - - org.eclipse.jetty - jetty-servlets - true - - - org.eclipse.jetty - jetty-util - true - - - org.eclipse.jetty - jetty-webapp - true - - - org.eclipse.jetty - jetty-alpn-conscrypt-server - true - - - org.eclipse.jetty.http2 - http2-server - true - - - javax.servlet - javax.servlet-api - - - - - org.hamcrest - hamcrest - true - - - org.hibernate - hibernate-core - true - - - javax.activation - javax.activation-api - - - javax.persistence - javax.persistence-api - - - javax.xml.bind - jaxb-api - - - - - org.hibernate.validator - hibernate-validator - true - - - javax.validation - validation-api - - - - - org.jboss - jboss-transaction-spi - true - - - org.liquibase - liquibase-core - true - - - org.neo4j - neo4j-ogm-core - true - - - org.slf4j - jul-to-slf4j - true - - - org.slf4j - slf4j-api - true - - - org.springframework - spring-messaging - true - - - org.springframework - spring-orm - true - - - org.springframework - spring-oxm - true - - - org.springframework - spring-test - true - - - org.springframework - spring-web - true - - - org.springframework - spring-webflux - true - - - org.springframework - spring-webmvc - true - - - org.springframework.security - spring-security-web - true - - - org.springframework.ws - spring-ws-core - true - - - org.yaml - snakeyaml - true - - - org.jetbrains.kotlin - kotlin-reflect - true - - - org.jetbrains.kotlin - kotlin-stdlib - true - - - - org.springframework.boot - spring-boot-configuration-processor - true - - - - org.springframework.boot - spring-boot-test-support - test - - - com.google.appengine - appengine-api-1.0-sdk - test - - - com.h2database - h2 - test - - - com.ibm.db2 - jcc - test - - - com.jayway.jsonpath - json-path - test - - - com.microsoft.sqlserver - mssql-jdbc - test - - - com.squareup.okhttp3 - okhttp - test - - - com.sun.xml.messaging.saaj - saaj-impl - test - - - io.projectreactor - reactor-test - test - - - jakarta.persistence - jakarta.persistence-api - test - - - jakarta.xml.ws - jakarta.xml.ws-api - test - - - mysql - mysql-connector-java - test - - - net.sourceforge.jtds - jtds - test - - - org.apache.derby - derby - test - - - org.apache.httpcomponents - httpasyncclient - test - - - org.awaitility - awaitility - test - - - org.firebirdsql.jdbc - jaybird-jdk18 - test - - - javax.resource - connector-api - - - - - org.hsqldb - hsqldb - test - - - org.mariadb.jdbc - mariadb-java-client - test - - - org.mockito - mockito-core - test - - - org.postgresql - postgresql - test - - - org.springframework - spring-context-support - test - - - org.springframework.data - spring-data-redis - test - - - org.testcontainers - jdbc - test - - - javax.annotation - javax.annotation-api - - - javax.xml.bind - jaxb-api - - - - - org.xerial - sqlite-jdbc - test - - - - - - org.jetbrains.kotlin - kotlin-maven-plugin - - - compile - compile - - compile - - - - ${project.basedir}/src/main/kotlin - ${project.basedir}/src/main/java - - - - - test-compile - test-compile - - test-compile - - - - ${project.basedir}/src/test/kotlin - ${project.basedir}/src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - default-compile - none - - - default-testCompile - none - - - java-compile - compile - - compile - - - - java-test-compile - test-compile - - testCompile - - - - - - - diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java index a90c97f64f52..fdde9a62d616 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java @@ -747,7 +747,7 @@ void loadSources() { @Test void wildcardSources() { TestSpringApplication application = new TestSpringApplication(); - application.getSources().add("classpath:org/springframework/boot/sample-${sample.app.test.prop}.xml"); + application.getSources().add("classpath*:org/springframework/boot/sample-${sample.app.test.prop}.xml"); application.setWebApplicationType(WebApplicationType.NONE); this.context = application.run(); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystemTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystemTests.java index e5a957e5545e..2a92a97bfcb5 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystemTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystemTests.java @@ -23,6 +23,7 @@ import java.util.Collections; import java.util.EnumSet; import java.util.List; +import java.util.logging.Level; import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.logging.log4j.LogManager; @@ -32,6 +33,7 @@ import org.apache.logging.log4j.core.config.Reconfigurable; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -187,10 +189,12 @@ void setLevelOfUnconfiguredLoggerDoesNotAffectRootConfiguration(CapturedOutput o } @Test + @Disabled("Uses Logback unintentionally") void loggingThatUsesJulIsCaptured(CapturedOutput output) { this.loggingSystem.beforeInitialize(); this.loggingSystem.initialize(null, null, null); java.util.logging.Logger julLogger = java.util.logging.Logger.getLogger(getClass().getName()); + julLogger.setLevel(Level.INFO); julLogger.severe("Hello world"); assertThat(output).contains("Hello world"); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java index 7b69ffb6b72b..dbf98c89b0ed 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java @@ -47,6 +47,7 @@ import java.util.concurrent.Callable; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; import java.util.zip.GZIPInputStream; import javax.net.ssl.SSLContext; @@ -73,8 +74,10 @@ import org.apache.http.client.protocol.HttpClientContext; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.conn.ssl.TrustSelfSignedStrategy; +import org.apache.http.impl.client.DefaultHttpRequestRetryHandler; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.client.StandardHttpRequestRetryHandler; import org.apache.http.protocol.HttpContext; import org.apache.http.ssl.SSLContextBuilder; import org.apache.http.ssl.TrustStrategy; @@ -149,6 +152,25 @@ public abstract class AbstractServletWebServerFactoryTests { private final HttpClientContext httpClientContext = HttpClientContext.create(); + private final Supplier httpClientBuilder = () -> HttpClients.custom() + .setRetryHandler(new StandardHttpRequestRetryHandler(10, false) { + + @Override + public boolean retryRequest(IOException exception, int executionCount, HttpContext context) { + boolean retry = super.retryRequest(exception, executionCount, context); + if (retry) { + try { + Thread.sleep(200); + } + catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + } + } + return retry; + } + + }); + @AfterEach void tearDown() { if (this.webServer != null) { @@ -159,6 +181,11 @@ void tearDown() { // Ignore } } + if (ClassUtils.isPresent("org.apache.catalina.webresources.TomcatURLStreamHandlerFactory", + getClass().getClassLoader())) { + ReflectionTestUtils.setField(TomcatURLStreamHandlerFactory.class, "instance", null); + } + ReflectionTestUtils.setField(URL.class, "factory", null); } @AfterEach @@ -429,7 +456,7 @@ void serverHeaderIsDisabledByDefaultWhenUsingSsl() throws Exception { this.webServer.start(); SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory( new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy()).build()); - HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory).build(); + HttpClient httpClient = this.httpClientBuilder.get().setSSLSocketFactory(socketFactory).build(); ClientHttpResponse response = getClientResponse(getLocalUrl("https", "/hello"), HttpMethod.GET, new HttpComponentsClientHttpRequestFactory(httpClient)); assertThat(response.getHeaders().get("Server")).isNullOrEmpty(); @@ -444,7 +471,8 @@ void serverHeaderCanBeCustomizedWhenUsingSsl() throws Exception { this.webServer.start(); SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory( new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy()).build()); - HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory).build(); + HttpClient httpClient = this.httpClientBuilder.get().setSSLSocketFactory(socketFactory) + .setRetryHandler(new DefaultHttpRequestRetryHandler(10, false)).build(); ClientHttpResponse response = getClientResponse(getLocalUrl("https", "/hello"), HttpMethod.GET, new HttpComponentsClientHttpRequestFactory(httpClient)); assertThat(response.getHeaders().get("Server")).containsExactly("MyServer"); @@ -458,7 +486,7 @@ protected final void testBasicSslWithKeyStore(String keyStore) throws Exception this.webServer.start(); SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory( new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy()).build()); - HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory).build(); + HttpClient httpClient = this.httpClientBuilder.get().setSSLSocketFactory(socketFactory).build(); HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient); assertThat(getResponse(getLocalUrl("https", "/test.txt"), requestFactory)).isEqualTo("test"); } @@ -475,7 +503,7 @@ void pkcs12KeyStoreAndTrustStore() throws Exception { SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory( new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy()) .loadKeyMaterial(keyStore, "secret".toCharArray()).build()); - HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory).build(); + HttpClient httpClient = this.httpClientBuilder.get().setSSLSocketFactory(socketFactory).build(); HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient); assertThat(getResponse(getLocalUrl("https", "/test.txt"), requestFactory)).isEqualTo("test"); } @@ -492,7 +520,7 @@ void sslNeedsClientAuthenticationSucceedsWithClientCertificate() throws Exceptio SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory( new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy()) .loadKeyMaterial(keyStore, "password".toCharArray()).build()); - HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory).build(); + HttpClient httpClient = this.httpClientBuilder.get().setSSLSocketFactory(socketFactory).build(); HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient); assertThat(getResponse(getLocalUrl("https", "/test.txt"), requestFactory)).isEqualTo("test"); } @@ -506,7 +534,7 @@ void sslNeedsClientAuthenticationFailsWithoutClientCertificate() throws Exceptio this.webServer.start(); SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory( new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy()).build()); - HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory).build(); + HttpClient httpClient = this.httpClientBuilder.get().setSSLSocketFactory(socketFactory).build(); HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient); String localUrl = getLocalUrl("https", "/test.txt"); assertThatIOException().isThrownBy(() -> getResponse(localUrl, requestFactory)); @@ -525,7 +553,7 @@ void sslWantsClientAuthenticationSucceedsWithClientCertificate() throws Exceptio SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory( new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy()) .loadKeyMaterial(keyStore, "password".toCharArray()).build()); - HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory).build(); + HttpClient httpClient = this.httpClientBuilder.get().setSSLSocketFactory(socketFactory).build(); HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient); assertThat(getResponse(getLocalUrl("https", "/test.txt"), requestFactory)).isEqualTo("test"); } @@ -539,7 +567,7 @@ void sslWantsClientAuthenticationSucceedsWithoutClientCertificate() throws Excep this.webServer.start(); SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory( new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy()).build()); - HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory).build(); + HttpClient httpClient = this.httpClientBuilder.get().setSSLSocketFactory(socketFactory).build(); HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient); assertThat(getResponse(getLocalUrl("https", "/test.txt"), requestFactory)).isEqualTo("test"); } @@ -563,7 +591,7 @@ void sslWithCustomSslStoreProvider() throws Exception { SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory( new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy()) .loadKeyMaterial(keyStore, "password".toCharArray()).build()); - HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory).build(); + HttpClient httpClient = this.httpClientBuilder.get().setSSLSocketFactory(socketFactory).build(); HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient); assertThat(getResponse(getLocalUrl("https", "/test.txt"), requestFactory)).isEqualTo("test"); verify(sslStoreProvider, atLeastOnce()).getKeyStore(); @@ -637,7 +665,7 @@ protected void testRestrictedSSLProtocolsAndCipherSuites(String[] protocols, Str this.webServer.start(); SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory( new SSLContextBuilder().loadTrustMaterial(null, new TrustSelfSignedStrategy()).build()); - HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory).build(); + HttpClient httpClient = this.httpClientBuilder.get().setSSLSocketFactory(socketFactory).build(); HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient); assertThat(getResponse(getLocalUrl("https", "/hello"), requestFactory)).contains("scheme=https"); } @@ -784,7 +812,7 @@ void compressionWithoutContentSizeHeader() throws Exception { TestGzipInputStreamFactory inputStreamFactory = new TestGzipInputStreamFactory(); Map contentDecoderMap = Collections.singletonMap("gzip", inputStreamFactory); getResponse(getLocalUrl("/hello"), new HttpComponentsClientHttpRequestFactory( - HttpClientBuilder.create().setContentDecoderRegistry(contentDecoderMap).build())); + this.httpClientBuilder.get().setContentDecoderRegistry(contentDecoderMap).build())); assertThat(inputStreamFactory.wasCompressionUsed()).isTrue(); } @@ -1078,14 +1106,15 @@ protected ClientHttpResponse getClientResponse(String url, String... headers) protected ClientHttpResponse getClientResponse(String url, HttpMethod method, String... headers) throws IOException, URISyntaxException { - return getClientResponse(url, method, new HttpComponentsClientHttpRequestFactory() { + return getClientResponse(url, method, + new HttpComponentsClientHttpRequestFactory(this.httpClientBuilder.get().build()) { - @Override - protected HttpContext createHttpContext(HttpMethod httpMethod, URI uri) { - return AbstractServletWebServerFactoryTests.this.httpClientContext; - } + @Override + protected HttpContext createHttpContext(HttpMethod httpMethod, URI uri) { + return AbstractServletWebServerFactoryTests.this.httpClientContext; + } - }, headers); + }, headers); } protected ClientHttpResponse getClientResponse(String url, HttpMethod method, diff --git a/spring-boot-tests/pom.xml b/spring-boot-tests/pom.xml deleted file mode 100644 index fc79c4ae8298..000000000000 --- a/spring-boot-tests/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-parent - ${revision} - ../spring-boot-project/spring-boot-parent - - spring-boot-tests - pom - Spring Boot Tests - Spring Boot Test - - ${basedir}/.. - - - - spring-boot-smoke-tests-invoker - spring-boot-integration-tests - - - - - m2e - - - m2e.version - - - - spring-boot-smoke-tests - spring-boot-smoke-tests-invoker - spring-boot-integration-tests - spring-boot-deployment-tests - - - - - - - org.apache.maven.plugins - maven-install-plugin - - true - - - - org.apache.maven.plugins - maven-javadoc-plugin - - true - - true - - - - diff --git a/spring-boot-tests/spring-boot-deployment-tests/build.gradle b/spring-boot-tests/spring-boot-deployment-tests/build.gradle new file mode 100644 index 000000000000..942627d5fafc --- /dev/null +++ b/spring-boot-tests/spring-boot-deployment-tests/build.gradle @@ -0,0 +1,28 @@ +plugins { + id 'war' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.integration-test' +} + +description = "Spring Boot Deployment Tests" + +dependencies { + implementation(project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web')) { + exclude group: 'org.hibernate.validator' + } + + intTestImplementation enforcedPlatform(project(path: ":spring-boot-project:spring-boot-parent")) + intTestImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + intTestImplementation 'org.apache.httpcomponents:httpasyncclient' + intTestImplementation 'org.awaitility:awaitility' + intTestImplementation 'org.testcontainers:testcontainers' + intTestImplementation 'org.springframework:spring-web' + + providedRuntime project(':spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat') + + runtimeOnly project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') +} + +intTest { + dependsOn war +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-deployment-tests/pom.xml b/spring-boot-tests/spring-boot-deployment-tests/pom.xml deleted file mode 100644 index 75d26a05f202..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/pom.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-tests - ${revision} - - spring-boot-deployment-tests - pom - Spring Boot Deployment Tests - Spring Boot Deployment Tests - - ${basedir}/../.. - 1.8 - 1200000 - ${settings.localRepository}/.cache/cargo/installs - - - spring-boot-deployment-test-glassfish - spring-boot-deployment-test-tomee - spring-boot-deployment-test-tomcat - spring-boot-deployment-test-wildfly - spring-boot-deployment-test-wlp - - - - - - org.codehaus.cargo - cargo-maven2-plugin - - - ${cargo.container.id} - ${cargo.timeout} - - ${cargo.container.url} - ${cargo.container.download-dir} - - - true - true - - - - - - /bootapp - - http://localhost:${appserver.port}/bootapp - 60000 - - - - - - start-cargo - pre-integration-test - - start - - - - stop-cargo - post-integration-test - - stop - - - - - - - - - org.apache.maven.plugins - maven-install-plugin - - true - - - - - diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/pom.xml b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/pom.xml deleted file mode 100644 index 3d2fad57a296..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/pom.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-deployment-tests - ${revision} - - spring-boot-deployment-test-glassfish - war - Spring Boot Glassfish Deployment Test - Spring Boot Glassfish Deployment Test - - ${basedir}/../../.. - 4.1.1 - glassfish4x - https://download.oracle.com/glassfish/${glassfish.version}/release/glassfish-${glassfish.version}.zip - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - org.hibernate.validator - hibernate-validator - - - - - org.springframework.boot - spring-boot-starter-actuator - - - jakarta.servlet - jakarta.servlet-api - provided - - - org.springframework.boot - spring-boot-starter-test - test - - - - - jdk8 - - 1.8 - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - reserve-network-port - - reserve-network-port - - process-resources - - - appserver.port - appserver.admin.port - appserver.jms.port - appserver.iiop.port - appserver.https.port - appserver.iiops.port - appserver.iiopmutualauth.port - appserver.jmx.port - appserver.osgishell.port - appserver.debugger.port - - - - - - - org.codehaus.cargo - cargo-maven2-plugin - - - - ${appserver.port} - ${appserver.admin.port} - ${appserver.jmx.port} - ${appserver.https.port} - ${appserver.debugger.port} - ${appserver.jms.port} - ${appserver.iiop.port} - ${appserver.iiopmutualauth.port} - ${appserver.iiops.port} - ${appserver.osgishell.port} - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - ${appserver.port} - - - - - - - - diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/main/java/sample/SampleGlassfishDeployApplication.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/main/java/sample/SampleGlassfishDeployApplication.java deleted file mode 100644 index b37ed0d48eb5..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/main/java/sample/SampleGlassfishDeployApplication.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package sample; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; - -@SpringBootApplication -public class SampleGlassfishDeployApplication extends SpringBootServletInitializer { - -} diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/main/webapp/WEB-INF/glassfish-web.xml b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/main/webapp/WEB-INF/glassfish-web.xml deleted file mode 100644 index 4ff13ba3c202..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/main/webapp/WEB-INF/glassfish-web.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/test/java/sample/SampleGlassfishDeployApplicationIT.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/test/java/sample/SampleGlassfishDeployApplicationIT.java deleted file mode 100644 index 491b5d505aa0..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/test/java/sample/SampleGlassfishDeployApplicationIT.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package sample; - -import org.junit.jupiter.api.Test; - -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Integration Tests for {@link SampleGlassfishDeployApplication}. - */ -public class SampleGlassfishDeployApplicationIT { - - private int port = Integer.valueOf(System.getProperty("port")); - - @Test - void testHome() throws Exception { - String url = "http://localhost:" + this.port + "/bootapp/"; - System.out.println(url); - ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); - assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); - assertThat(entity.getBody()).isEqualTo("Hello World"); - } - - @Test - void testHealth() throws Exception { - String url = "http://localhost:" + this.port + "/bootapp/actuator/health"; - System.out.println(url); - ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); - assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); - assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}"); - } - -} diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/pom.xml b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/pom.xml deleted file mode 100644 index 2039e27f02a6..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/pom.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-deployment-tests - ${revision} - - spring-boot-deployment-test-tomcat - war - Spring Boot Tomcat Deployment Test - Spring Boot Tomcat Deployment Test - - ${basedir}/../../.. - tomcat9x - - https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat/${tomcat.version}/tomcat-${tomcat.version}.zip - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - org.springframework.boot - spring-boot-starter-actuator - - - jakarta.servlet - jakarta.servlet-api - provided - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - reserve-network-port - - reserve-network-port - - process-resources - - - appserver.port - appserver.ajp.port - - - - - - - org.codehaus.cargo - cargo-maven2-plugin - - - - ${appserver.port} - ${appserver.ajp.port} - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - ${appserver.port} - - - - - - diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/src/main/java/sample/SampleController.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/src/main/java/sample/SampleController.java deleted file mode 100644 index 7023f3b9900f..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/src/main/java/sample/SampleController.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package sample; - -import java.io.IOException; - -import javax.servlet.http.HttpServletResponse; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class SampleController { - - @RequestMapping("/") - public String hello() { - return "Hello World"; - } - - @RequestMapping("/send-error") - public void sendError(HttpServletResponse response) throws IOException { - response.sendError(500); - } - - @RequestMapping("/exception") - public void exception() { - throw new RuntimeException(); - } - -} diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/src/main/java/sample/SampleTomcatDeployApplication.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/src/main/java/sample/SampleTomcatDeployApplication.java deleted file mode 100644 index 42a0fc03b859..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/src/main/java/sample/SampleTomcatDeployApplication.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package sample; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; - -@SpringBootApplication -public class SampleTomcatDeployApplication extends SpringBootServletInitializer { - -} diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/src/test/java/sample/SampleTomcatDeployApplicationIT.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/src/test/java/sample/SampleTomcatDeployApplicationIT.java deleted file mode 100644 index a4c9f1441053..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/src/test/java/sample/SampleTomcatDeployApplicationIT.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package sample; - -import java.net.URI; - -import org.junit.jupiter.api.Test; - -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.RequestEntity; -import org.springframework.http.ResponseEntity; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Integration Tests for {@link SampleTomcatDeployApplication}. - */ -public class SampleTomcatDeployApplicationIT { - - private final TestRestTemplate rest = new TestRestTemplate(); - - private int port = Integer.valueOf(System.getProperty("port")); - - @Test - void testHome() throws Exception { - String url = "http://localhost:" + this.port + "/bootapp/"; - ResponseEntity entity = this.rest.getForEntity(url, String.class); - assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); - assertThat(entity.getBody()).isEqualTo("Hello World"); - } - - @Test - void testHealth() throws Exception { - String url = "http://localhost:" + this.port + "/bootapp/actuator/health"; - System.out.println(url); - ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); - assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); - assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}"); - } - - @Test - void errorFromExceptionForRequestAcceptingAnythingProducesAJsonResponse() throws Exception { - assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.ALL, MediaType.APPLICATION_JSON); - } - - @Test - void errorFromExceptionForRequestAcceptingJsonProducesAJsonResponse() throws Exception { - assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.APPLICATION_JSON, - MediaType.APPLICATION_JSON); - } - - @Test - void errorFromExceptionForRequestAcceptingHtmlProducesAnHtmlResponse() throws Exception { - assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.TEXT_HTML, MediaType.TEXT_HTML); - } - - @Test - void sendErrorForRequestAcceptingAnythingProducesAJsonResponse() throws Exception { - assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.ALL, MediaType.APPLICATION_JSON); - } - - @Test - void sendErrorForRequestAcceptingJsonProducesAJsonResponse() throws Exception { - assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.APPLICATION_JSON, - MediaType.APPLICATION_JSON); - } - - @Test - void sendErrorForRequestAcceptingHtmlProducesAnHtmlResponse() throws Exception { - assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.TEXT_HTML, MediaType.TEXT_HTML); - } - - private void assertThatPathProducesExpectedResponse(String path, MediaType accept, MediaType contentType) { - RequestEntity request = RequestEntity.get(URI.create("http://localhost:" + this.port + path)) - .accept(accept).build(); - ResponseEntity response = this.rest.exchange(request, String.class); - assertThat(response.getStatusCode()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR); - assertThat(contentType.isCompatibleWith(response.getHeaders().getContentType())) - .as("%s is compatible with %s", contentType, response.getHeaders().getContentType()).isTrue(); - } - -} diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/pom.xml b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/pom.xml deleted file mode 100644 index f06085fd1c66..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/pom.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-deployment-tests - ${revision} - - spring-boot-deployment-test-tomee - war - Spring Boot TomEE Deployment Test - Spring Boot TomEE Deployment Test - - ${basedir}/../../.. - 8.0.0 - tomee1x - - https://archive.apache.org/dist/tomee/tomee-${tomee.version}/apache-tomee-${tomee.version}-webprofile.zip - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - org.hibernate.validator - hibernate-validator - - - - - org.springframework.boot - spring-boot-starter-actuator - - - jakarta.servlet - jakarta.servlet-api - provided - - - org.springframework.boot - spring-boot-starter-test - test - - - - - jdk8 - - 1.8 - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - reserve-network-port - - reserve-network-port - - process-resources - - - appserver.port - appserver.ajp.port - - - - - - - org.codehaus.cargo - cargo-maven2-plugin - - - - ${appserver.port} - ${appserver.ajp.port} - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - ${appserver.port} - - - - - - - - diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/src/main/java/sample/SampleController.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/src/main/java/sample/SampleController.java deleted file mode 100644 index 819f68150b4b..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/src/main/java/sample/SampleController.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package sample; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class SampleController { - - @GetMapping("/") - public String hello() { - return "Hello World"; - } - -} diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/src/main/java/sample/SampleTomEEDeployApplication.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/src/main/java/sample/SampleTomEEDeployApplication.java deleted file mode 100644 index d9aee11660db..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/src/main/java/sample/SampleTomEEDeployApplication.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package sample; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; - -@SpringBootApplication -public class SampleTomEEDeployApplication extends SpringBootServletInitializer { - - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { - return application.sources(SampleTomEEDeployApplication.class); - } - -} diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/src/test/java/sample/SampleTomEEDeployApplicationIT.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/src/test/java/sample/SampleTomEEDeployApplicationIT.java deleted file mode 100644 index cb9acd56c6e8..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/src/test/java/sample/SampleTomEEDeployApplicationIT.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package sample; - -import org.junit.jupiter.api.Test; - -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Integration Tests for {@link SampleTomEEDeployApplication}. - */ -public class SampleTomEEDeployApplicationIT { - - private int port = Integer.valueOf(System.getProperty("port")); - - @Test - void testHome() throws Exception { - String url = "http://localhost:" + this.port + "/bootapp/"; - ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); - assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); - assertThat(entity.getBody()).isEqualTo("Hello World"); - } - - @Test - void testHealth() throws Exception { - String url = "http://localhost:" + this.port + "/bootapp/actuator/health"; - System.out.println(url); - ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); - assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); - assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}"); - } - -} diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/pom.xml b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/pom.xml deleted file mode 100644 index cb572e6c5ca0..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/pom.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-deployment-tests - ${revision} - - spring-boot-deployment-test-wildfly - war - Spring Boot WildFly Deployment Test - Spring Boot WildFly Deployment Test - - ${basedir}/../../.. - 12.0.0.Final - wildfly12x - https://download.jboss.org/wildfly/${wildfly.version}/wildfly-${wildfly.version}.zip - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - org.springframework.boot - spring-boot-starter-actuator - - - jakarta.servlet - jakarta.servlet-api - provided - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - reserve-network-port - - reserve-network-port - - process-resources - - - appserver.port - appserver.ajp.port - appserver.transaction.port - - - - - - - org.codehaus.cargo - cargo-maven2-plugin - - - - ${appserver.port} - ${appserver.ajp.port} - - ${appserver.transaction.port} - - standalone-full - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - ${appserver.port} - - - - - - diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/main/java/sample/SampleWildFlyDeployApplication.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/main/java/sample/SampleWildFlyDeployApplication.java deleted file mode 100644 index 3385e2d34893..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/main/java/sample/SampleWildFlyDeployApplication.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package sample; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; - -@SpringBootApplication -public class SampleWildFlyDeployApplication extends SpringBootServletInitializer { - -} diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/main/webapp/WEB-INF/jboss-deployment-structure.xml deleted file mode 100644 index 5e5bd73881c2..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/test/java/sample/SampleWildFlyDeployApplicationIT.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/test/java/sample/SampleWildFlyDeployApplicationIT.java deleted file mode 100644 index 001ffe6f5bbf..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/test/java/sample/SampleWildFlyDeployApplicationIT.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package sample; - -import org.junit.jupiter.api.Test; - -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Integration Tests for {@link SampleWildFlyDeployApplication}. - */ -public class SampleWildFlyDeployApplicationIT { - - private int port = Integer.valueOf(System.getProperty("port")); - - @Test - void testHome() throws Exception { - String url = "http://localhost:" + this.port + "/bootapp/"; - ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); - assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); - assertThat(entity.getBody()).isEqualTo("Hello World"); - } - - @Test - void testHealth() throws Exception { - String url = "http://localhost:" + this.port + "/bootapp/actuator/health"; - System.out.println(url); - ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); - assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); - assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}"); - } - -} diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/pom.xml b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/pom.xml deleted file mode 100644 index b8b7ca8706ab..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/pom.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-deployment-tests - ${revision} - - spring-boot-deployment-test-wlp - war - Spring Boot WebSphere Liberty Profile Deployment Test - Spring Boot WebSphere Liberty Profile Deployment Test - - ${basedir}/../../.. - 18.0.0.1 - liberty - https://repo.maven.apache.org/maven2/com/ibm/websphere/appserver/runtime/wlp-webProfile7/${wlp.version}/wlp-webProfile7-${wlp.version}.zip - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - org.springframework.boot - spring-boot-starter-actuator - - - jakarta.servlet - jakarta.servlet-api - provided - - - org.springframework.boot - spring-boot-starter-test - test - - - - - jdk8 - - 1.8 - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - reserve-network-port - - reserve-network-port - - process-resources - - - appserver.port - - - - - - - org.codehaus.cargo - cargo-maven2-plugin - - - - ${appserver.port} - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - ${appserver.port} - - - - - - - - diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/main/java/sample/SampleController.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/main/java/sample/SampleController.java deleted file mode 100644 index 819f68150b4b..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/main/java/sample/SampleController.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package sample; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class SampleController { - - @GetMapping("/") - public String hello() { - return "Hello World"; - } - -} diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/test/java/sample/SampleWlpDeployApplicationIT.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/test/java/sample/SampleWlpDeployApplicationIT.java deleted file mode 100644 index 64b2ca48476a..000000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/test/java/sample/SampleWlpDeployApplicationIT.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package sample; - -import org.junit.jupiter.api.Test; - -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Integration Tests for {@link SampleWlpDeployApplication}. - */ -public class SampleWlpDeployApplicationIT { - - private int port = Integer.valueOf(System.getProperty("port")); - - @Test - void testHome() throws Exception { - String url = "http://localhost:" + this.port + "/bootapp/"; - ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); - assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); - assertThat(entity.getBody()).isEqualTo("Hello World"); - } - - @Test - void testHealth() throws Exception { - String url = "http://localhost:" + this.port + "/bootapp/actuator/health"; - System.out.println(url); - ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); - assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); - assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}"); - } - -} diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/DeploymentIntegrationTests.java b/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/DeploymentIntegrationTests.java new file mode 100644 index 000000000000..3e892569f44d --- /dev/null +++ b/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/DeploymentIntegrationTests.java @@ -0,0 +1,139 @@ +/* + * Copyright 2012-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package sample; + +import java.io.File; +import java.time.Duration; +import java.util.Arrays; +import java.util.List; +import java.util.function.Consumer; + +import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.client.StandardHttpRequestRetryHandler; +import org.awaitility.Awaitility; +import org.awaitility.core.ConditionTimeoutException; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.images.builder.ImageFromDockerfile; + +import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Deployment integration tests. + */ +class DeploymentIntegrationTests { + + @ParameterizedTest + @MethodSource("deployedApplications") + void home(DeployedApplication app) throws Exception { + app.test((rest) -> { + ResponseEntity response = rest.getForEntity("/", String.class); + assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK); + assertThat(response.getBody()).isEqualTo("Hello World"); + }); + } + + @ParameterizedTest + @MethodSource("deployedApplications") + void health(DeployedApplication application) throws Exception { + application.test((rest) -> { + ResponseEntity response = rest.getForEntity("/actuator/health", String.class); + assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK); + assertThat(response.getBody()).isEqualTo("{\"status\":\"UP\"}"); + }); + } + + static List deployedApplications() { + return Arrays.asList(new DeployedApplication("open-liberty:19.0.0.9-webProfile8", "/config/dropins", 9080), + new DeployedApplication("tomcat:9.0.29-jdk8-openjdk", "/usr/local/tomcat/webapps", 8080), + new DeployedApplication("tomee:11-jre-8.0.0-M3-webprofile", "/usr/local/tomee/webapps", 8080), + new DeployedApplication("jboss/wildfly:18.0.1.Final", "/opt/jboss/wildfly/standalone/deployments/", + 8080)); + } + + public static final class DeployedApplication { + + private final String baseImage; + + private final String deploymentLocation; + + private final int port; + + private DeployedApplication(String baseImage, String deploymentLocation, int port) { + this.baseImage = baseImage; + this.deploymentLocation = deploymentLocation; + this.port = port; + } + + private void test(Consumer consumer) { + try (WarDeploymentContainer container = new WarDeploymentContainer(this.baseImage, this.deploymentLocation, + this.port)) { + container.start(); + TestRestTemplate rest = new TestRestTemplate(new RestTemplateBuilder() + .rootUri("http://" + container.getContainerIpAddress() + ":" + + container.getMappedPort(this.port) + "/spring-boot") + .requestFactory(() -> new HttpComponentsClientHttpRequestFactory(HttpClients.custom() + .setRetryHandler(new StandardHttpRequestRetryHandler(10, false)).build()))); + try { + Awaitility.await().atMost(Duration.ofMinutes(10)).until(() -> { + try { + consumer.accept(rest); + return true; + } + catch (Throwable ex) { + return false; + } + }); + } + catch (ConditionTimeoutException ex) { + System.out.println(container.getLogs()); + throw ex; + } + } + } + + public String toString() { + return this.baseImage; + } + + } + + private static final class WarDeploymentContainer extends GenericContainer { + + private WarDeploymentContainer(String baseImage, String deploymentLocation, int port) { + super(new ImageFromDockerfile().withFileFromFile("spring-boot.war", findWarToDeploy()) + .withDockerfileFromBuilder((builder) -> builder.from(baseImage) + .add("spring-boot.war", deploymentLocation + "/spring-boot.war").build())); + withExposedPorts(port).withStartupTimeout(Duration.ofMinutes(10)); + } + + private static File findWarToDeploy() { + File[] candidates = new File("build/libs").listFiles(); + assertThat(candidates).hasSize(1); + return candidates[0]; + } + + } + +} diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/main/java/sample/SampleWlpDeployApplication.java b/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/DeploymentTestApplication.java similarity index 91% rename from spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/main/java/sample/SampleWlpDeployApplication.java rename to spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/DeploymentTestApplication.java index e1cda220c3b1..38c310428b9e 100644 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/main/java/sample/SampleWlpDeployApplication.java +++ b/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/DeploymentTestApplication.java @@ -20,6 +20,6 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; @SpringBootApplication -public class SampleWlpDeployApplication extends SpringBootServletInitializer { +public class DeploymentTestApplication extends SpringBootServletInitializer { } diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/main/java/sample/SampleController.java b/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/SampleController.java similarity index 100% rename from spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/main/java/sample/SampleController.java rename to spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/SampleController.java diff --git a/spring-boot-tests/spring-boot-integration-tests/pom.xml b/spring-boot-tests/spring-boot-integration-tests/pom.xml deleted file mode 100644 index 16c814635a76..000000000000 --- a/spring-boot-tests/spring-boot-integration-tests/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-tests - ${revision} - - spring-boot-integration-tests - pom - Spring Boot Integration Tests - Spring Boot Integration Tests - - ${basedir}/../.. - 1.8 - - - spring-boot-configuration-processor-tests - spring-boot-devtools-tests - spring-boot-server-tests - spring-boot-launch-script-tests - - - - - org.apache.maven.plugins - maven-install-plugin - - true - - - - - diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-configuration-processor-tests/build.gradle b/spring-boot-tests/spring-boot-integration-tests/spring-boot-configuration-processor-tests/build.gradle new file mode 100644 index 000000000000..92038132c0e1 --- /dev/null +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-configuration-processor-tests/build.gradle @@ -0,0 +1,17 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = "Spring Boot Configuration Processor Tests" + +dependencies { + annotationProcessor project(':spring-boot-project:spring-boot-tools:spring-boot-configuration-processor') + + implementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + implementation project(':spring-boot-project:spring-boot') + implementation 'jakarta.validation:jakarta.validation-api' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation project(':spring-boot-project:spring-boot-tools:spring-boot-configuration-metadata') +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-configuration-processor-tests/pom.xml b/spring-boot-tests/spring-boot-integration-tests/spring-boot-configuration-processor-tests/pom.xml deleted file mode 100644 index 8b8d7363d26d..000000000000 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-configuration-processor-tests/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-integration-tests - ${revision} - - spring-boot-configuration-processor-tests - Spring Boot Configuration Processor Tests - ${project.name} - - ${basedir}/../../.. - - - - org.springframework.boot - spring-boot - - - org.springframework.boot - spring-boot-configuration-metadata - - - jakarta.validation - jakarta.validation-api - - - org.springframework.boot - spring-boot-configuration-processor - true - - - org.springframework.boot - spring-boot-starter-test - test - - - diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/pom.xml b/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/pom.xml deleted file mode 100644 index 1eae491ae059..000000000000 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-integration-tests - ${revision} - - spring-boot-devtools-tests - Spring Boot DevTools Tests - ${project.name} - - ${basedir}/../../.. - - - - org.springframework.boot - spring-boot-devtools - - - org.springframework.boot - spring-boot-starter-web - - - net.bytebuddy - byte-buddy - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-test-support - test - - - org.awaitility - awaitility - test - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-dependencies - process-test-resources - - copy-dependencies - - - runtime - ${project.build.directory}/dependencies - true - true - - - - - - - diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/build.gradle b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/build.gradle new file mode 100644 index 000000000000..4ae4cbceb4e6 --- /dev/null +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/build.gradle @@ -0,0 +1,21 @@ +plugins { + id 'java' + id 'org.springframework.boot' +} + +apply plugin: 'io.spring.dependency-management' + +repositories { + maven { url "file:$rootDir/../int-test-maven-repository"} + mavenCentral() + maven { url 'https://repo.spring.io/snapshot' } + maven { url 'https://repo.spring.io/milestone' } +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-web' +} + +bootJar { + launchScript() +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/settings.gradle b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/settings.gradle new file mode 100644 index 000000000000..85bf6bdb43e5 --- /dev/null +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/settings.gradle @@ -0,0 +1,15 @@ +pluginManagement { + repositories { + maven { url "file:$rootDir/../int-test-maven-repository"} + mavenCentral() + maven { url 'https://repo.spring.io/snapshot' } + maven { url 'https://repo.spring.io/milestone' } + } + resolutionStrategy { + eachPlugin { + if (requested.id.id == 'org.springframework.boot') { + useModule "org.springframework.boot:spring-boot-gradle-plugin:${requested.version}" + } + } + } +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/main/java/org/springframework/boot/launchscript/LaunchScriptTestApplication.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/src/main/java/org/springframework/boot/launchscript/LaunchScriptTestApplication.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/main/java/org/springframework/boot/launchscript/LaunchScriptTestApplication.java rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/src/main/java/org/springframework/boot/launchscript/LaunchScriptTestApplication.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/main/java/org/springframework/boot/launchscript/LaunchVerificationController.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/src/main/java/org/springframework/boot/launchscript/LaunchVerificationController.java similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/main/java/org/springframework/boot/launchscript/LaunchVerificationController.java rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/app/src/main/java/org/springframework/boot/launchscript/LaunchVerificationController.java diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/build.gradle b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/build.gradle new file mode 100644 index 000000000000..5d7f20909b83 --- /dev/null +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/build.gradle @@ -0,0 +1,45 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' + id 'org.springframework.boot.integration-test' +} + +description = "Spring Boot Launch Script Integration Tests" + +configurations { + app +} + +dependencies { + app project(path: ':spring-boot-project:spring-boot-tools:spring-boot-gradle-plugin', configuration: 'mavenRepository') + app project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter-web', configuration: 'mavenRepository') + + intTestImplementation enforcedPlatform(project(':spring-boot-project:spring-boot-parent')) + intTestImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + intTestImplementation 'org.testcontainers:testcontainers' +} + +task syncMavenRepository(type: Sync) { + from configurations.app + into "$buildDir/int-test-maven-repository" +} + +task syncAppSource(type: Sync) { + from 'app' + into "$buildDir/app" + filter { line -> + line.replace("id 'org.springframework.boot'", "id 'org.springframework.boot' version '${project.version}'") + } +} + +task buildApp(type: GradleBuild) { + dependsOn syncAppSource, syncMavenRepository + dir = "$buildDir/app" + startParameter.buildCacheEnabled = false + tasks = ['build'] +} + +intTest { + dependsOn buildApp + enabled = !JavaVersion.current().java9Compatible +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/pom.xml b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/pom.xml deleted file mode 100644 index f74e08f87bd9..000000000000 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/pom.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-integration-tests - ${revision} - - spring-boot-launch-script-tests - jar - Spring Boot Launch Script Integration Tests - Spring Boot Launch Script Integration Tests - - ${basedir}/../../.. - 2.27 - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - org.springframework.boot - spring-boot-starter-undertow - - - org.springframework.boot - spring-boot-starter-test - test - - - org.slf4j - jcl-over-slf4j - - - javax.ws.rs - javax.ws.rs-api - - - javax.annotation - javax.annotation-api - - - - - jakarta.ws.rs - jakarta.ws.rs-api - - - org.testcontainers - testcontainers - test - - - javax.annotation - javax.annotation-api - - - javax.xml.bind - jaxb-api - - - org.hamcrest - hamcrest-core - - - - - - - docker - - - - org.springframework.boot - spring-boot-maven-plugin - - true - - - - - repackage - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - - integration-test - verify - - - - - - - - - diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIT.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIntegrationTests.java similarity index 94% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIT.java rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIntegrationTests.java index a4014dcb4705..2f1f4ea3d015 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIT.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIntegrationTests.java @@ -42,7 +42,7 @@ * @author Andy Wilkinson * @author Ali Shahbour */ -class SysVinitLaunchScriptIT { +class SysVinitLaunchScriptIntegrationTests { private static final char ESC = 27; @@ -279,7 +279,7 @@ void whenLaunchedUsingNonRootUserWithRunAsUserSpecifiedLaunchFailsWithInsufficie static List parameters() { List parameters = new ArrayList<>(); - for (File os : new File("src/test/resources/conf").listFiles()) { + for (File os : new File("src/intTest/resources/conf").listFiles()) { for (File version : os.listFiles()) { parameters.add(new Object[] { os.getName(), version.getName() }); } @@ -333,25 +333,22 @@ private static final class LaunchScriptTestContainer extends GenericContainer /dev/null do now=$(date +%s) diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/build.gradle b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/build.gradle new file mode 100644 index 000000000000..b7c4cd5a04ea --- /dev/null +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/build.gradle @@ -0,0 +1,51 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = "Spring Boot Server Tests" + +configurations { + testRepository +} + +dependencies { + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation project(':spring-boot-project:spring-boot-tools:spring-boot-test-support') + + testImplementation 'com.samskivert:jmustache' + testImplementation 'jakarta.servlet:jakarta.servlet-api' + testImplementation 'org.apache.httpcomponents:httpasyncclient' + testImplementation 'org.apache.maven.shared:maven-invoker:3.0.0' + testImplementation 'org.awaitility:awaitility' + testImplementation('org.eclipse.jetty:jetty-webapp') { + exclude group: 'javax.servlet', module: 'javax-servlet-api' + } + testImplementation 'org.springframework:spring-web' + + testRepository project(path: ':spring-boot-project:spring-boot-dependencies', configuration: 'mavenRepository') + testRepository project(path: ':spring-boot-project:spring-boot-tools:spring-boot-maven-plugin', configuration: 'mavenRepository') + testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter', configuration: 'mavenRepository') + testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter-jetty', configuration: 'mavenRepository') + testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter-parent', configuration: 'mavenRepository') + testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat', configuration: 'mavenRepository') + testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter-undertow', configuration: 'mavenRepository') + + testRuntimeOnly project(':spring-boot-project:spring-boot-starters:spring-boot-starter-logging') +} + +task prepareMavenBinaries(type: org.springframework.boot.build.mavenplugin.PrepareMavenBinaries) { + outputDir = file("$buildDir/maven-binaries") + versions '3.6.2' +} + +task syncTestRepository(type: Sync) { + destinationDir = file("${buildDir}/test-repository") + from { + configurations.testRepository + } +} + +test { + dependsOn prepareMavenBinaries, syncTestRepository +} diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/pom.xml b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/pom.xml deleted file mode 100644 index 95ddd77d9c59..000000000000 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-integration-tests - ${revision} - - spring-boot-server-tests - jar - Spring Boot Server Tests - - ${basedir}/../../.. - - - - org.springframework.boot - spring-boot-starter-logging - test - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-test-support - test - - - com.samskivert - jmustache - test - - - jakarta.servlet - jakarta.servlet-api - test - - - org.apache.maven.shared - maven-invoker - 3.0.0 - test - - - org.awaitility - awaitility - test - - - org.eclipse.jetty - jetty-webapp - test - - - javax.servlet - javax.servlet-api - - - - - org.springframework - spring-web - test - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - ${maven.home} - ${repository} - - - - - - diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/AbstractApplicationLauncher.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/AbstractApplicationLauncher.java index 42caaae4d623..d22fa9c8805a 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/AbstractApplicationLauncher.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/AbstractApplicationLauncher.java @@ -95,7 +95,7 @@ private Process startApplication() throws Exception { } private int awaitServerPort(Process process, File serverPortFile) throws Exception { - Awaitility.waitAtMost(Duration.ofSeconds(30)).until(serverPortFile::length, (length) -> { + Awaitility.waitAtMost(Duration.ofSeconds(180)).until(serverPortFile::length, (length) -> { if (!process.isAlive()) { throw new IllegalStateException("Application failed to start"); } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java index 198c8ec420a1..2b0284354642 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java @@ -36,13 +36,11 @@ import org.apache.maven.shared.invoker.MavenInvocationException; import org.springframework.util.FileCopyUtils; -import org.springframework.util.StringUtils; import static org.assertj.core.api.Assertions.assertThat; /** - * Builds a Spring Boot application using Maven. To use this class, the {@code maven.home} - * system property must be set. + * Builds a Spring Boot application using Maven. * * @author Andy Wilkinson */ @@ -121,12 +119,9 @@ private void writePom(File appFolder, File resourcesJar) throws IOException { } private File writeSettingsXml(File appFolder) throws IOException { - String repository = System.getProperty("repository"); - if (!StringUtils.hasText(repository)) { - return null; - } Map context = new HashMap<>(); - context.put("repository", repository); + context.put("repository", new File("build/test-repository").toURI().toURL()); + context.put("localRepository", new File("build/local-m2-repository").getAbsolutePath()); File settingsXml = new File(appFolder, "settings.xml"); try (FileWriter out = new FileWriter(settingsXml); FileReader templateReader = new FileReader("src/test/resources/settings-template.xml")) { @@ -160,7 +155,9 @@ private void packageApplication(File appFolder, File settingsXml) throws MavenIn if (settingsXml != null) { invocation.setUserSettingsFile(settingsXml); } - InvocationResult execute = new DefaultInvoker().execute(invocation); + DefaultInvoker invoker = new DefaultInvoker(); + invoker.setMavenHome(new File("build/maven-binaries/apache-maven-3.6.2")); + InvocationResult execute = invoker.execute(invocation); assertThat(execute.getExitCode()).isEqualTo(0); } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServerContainerInvocationContextProvider.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServerContainerInvocationContextProvider.java index cf09b7fb0495..083d0ad3b7cd 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServerContainerInvocationContextProvider.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServerContainerInvocationContextProvider.java @@ -27,6 +27,8 @@ import java.util.Set; import java.util.stream.Stream; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.client.StandardHttpRequestRetryHandler; import org.junit.jupiter.api.extension.AfterAllCallback; import org.junit.jupiter.api.extension.Extension; import org.junit.jupiter.api.extension.ExtensionContext; @@ -39,6 +41,7 @@ import org.springframework.boot.testsupport.BuildOutput; import org.springframework.http.client.ClientHttpResponse; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.util.FileSystemUtils; import org.springframework.util.StringUtils; import org.springframework.web.client.ResponseErrorHandler; @@ -154,7 +157,8 @@ public boolean supportsParameter(ParameterContext parameterContext, ExtensionCon @Override public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException { - RestTemplate rest = new RestTemplate(); + RestTemplate rest = new RestTemplate(new HttpComponentsClientHttpRequestFactory( + HttpClients.custom().setRetryHandler(new StandardHttpRequestRetryHandler(10, false)).build())); rest.setErrorHandler(new ResponseErrorHandler() { @Override diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ExplodedApplicationLauncher.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ExplodedApplicationLauncher.java index 2370caa7d112..5e9be691a2da 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ExplodedApplicationLauncher.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ExplodedApplicationLauncher.java @@ -80,6 +80,7 @@ private void explodeArchive(File archive) throws IOException { extracted.mkdirs(); } else { + extracted.getParentFile().mkdirs(); FileOutputStream extractedOutputStream = new FileOutputStream(extracted); StreamUtils.copy(jarFile.getInputStream(jarEntry), extractedOutputStream); extractedOutputStream.close(); diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/Versions.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/Versions.java index 5d7a5fbc0214..4028cd0255c0 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/Versions.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/Versions.java @@ -16,43 +16,28 @@ package org.springframework.boot.context.embedded; -import java.io.File; -import java.io.FileReader; - -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathFactory; - -import org.xml.sax.InputSource; - -import org.springframework.util.StringUtils; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.Properties; /** - * Provides access to dependency versions by querying the project's pom. + * Provides access to the current Boot version by referring to {@code gradle.properties}. * * @author Andy Wilkinson */ final class Versions { - private static final String PROPERTIES = "/*[local-name()='project']/*[local-name()='properties']"; - private Versions() { } static String getBootVersion() { - String baseDir = StringUtils.cleanPath(new File(".").getAbsolutePath()); - String mainBaseDir = evaluateExpression("pom.xml", PROPERTIES + "/*[local-name()='main.basedir']/text()"); - mainBaseDir = mainBaseDir.replace("${basedir}", baseDir); - return evaluateExpression(mainBaseDir + "/pom.xml", PROPERTIES + "/*[local-name()='revision']/text()"); - } - - private static String evaluateExpression(String file, String expression) { - try { - InputSource source = new InputSource(new FileReader(file)); - XPath xpath = XPathFactory.newInstance().newXPath(); - return xpath.compile(expression).evaluate(source); + Properties gradleProperties = new Properties(); + try (FileInputStream input = new FileInputStream("../../../gradle.properties")) { + gradleProperties.load(input); + return gradleProperties.getProperty("version"); } - catch (Exception ex) { - throw new IllegalStateException("Failed to evaluate expression", ex); + catch (IOException ex) { + throw new RuntimeException(ex); } } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/resources/settings-template.xml b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/resources/settings-template.xml index 5cf9a073f986..8f5030fac964 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/resources/settings-template.xml +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/resources/settings-template.xml @@ -1,6 +1,7 @@ + {{localRepository}} repository diff --git a/spring-boot-tests/spring-boot-smoke-tests-invoker/pom.xml b/spring-boot-tests/spring-boot-smoke-tests-invoker/pom.xml deleted file mode 100644 index 9dc633c60c3f..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests-invoker/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-parent - ${revision} - ../../spring-boot-project/spring-boot-parent - - spring-boot-smoke-tests-invoker - pom - Spring Boot Smoke Tests Invoker - Spring Boot Smoke Tests Invoker - - ${basedir}/../.. - - - - - - org.apache.maven.plugins - maven-invoker-plugin - false - - ${main.basedir}/spring-boot-tests/spring-boot-smoke-tests - ${skipTests} - true - - pom.xml - - - - - integration-test - install - - run - - - - - - org.apache.maven.plugins - maven-antrun-plugin - false - - - clean-smoke-tests - clean - - run - - - - - - - - - - - - - org.apache.maven.plugins - maven-clean-plugin - false - - - clean-smoke-tests - clean - - clean - - - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/pom.xml deleted file mode 100644 index 10de667638fd..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/pom.xml +++ /dev/null @@ -1,206 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - ${revision} - ../../spring-boot-project/spring-boot-starters/spring-boot-starter-parent - - spring-boot-smoke-tests - pom - Spring Boot Smoke Tests - Spring Boot Smoke Tests - - ${basedir}/../.. - 1.8 - false - - - spring-boot-smoke-test-ant - spring-boot-smoke-test-activemq - spring-boot-smoke-test-actuator - spring-boot-smoke-test-actuator-log4j2 - spring-boot-smoke-test-actuator-noweb - spring-boot-smoke-test-actuator-ui - spring-boot-smoke-test-actuator-custom-security - spring-boot-smoke-test-amqp - spring-boot-smoke-test-animated-banner - spring-boot-smoke-test-aop - spring-boot-smoke-test-atmosphere - spring-boot-smoke-test-batch - spring-boot-smoke-test-cache - spring-boot-smoke-test-custom-layout - spring-boot-smoke-test-data-cassandra - spring-boot-smoke-test-data-couchbase - spring-boot-smoke-test-data-elasticsearch - spring-boot-smoke-test-data-jdbc - spring-boot-smoke-test-data-jpa - spring-boot-smoke-test-data-ldap - spring-boot-smoke-test-data-mongodb - spring-boot-smoke-test-data-neo4j - spring-boot-smoke-test-data-redis - spring-boot-smoke-test-data-rest - spring-boot-smoke-test-data-solr - spring-boot-smoke-test-devtools - spring-boot-smoke-test-flyway - spring-boot-smoke-test-hateoas - spring-boot-smoke-test-hibernate52 - spring-boot-smoke-test-integration - spring-boot-smoke-test-jersey - spring-boot-smoke-test-jetty - spring-boot-smoke-test-jetty-jsp - spring-boot-smoke-test-jetty-ssl - spring-boot-smoke-test-jooq - spring-boot-smoke-test-jpa - spring-boot-smoke-test-jta-atomikos - spring-boot-smoke-test-jta-bitronix - spring-boot-smoke-test-jta-jndi - spring-boot-smoke-test-junit-jupiter - spring-boot-smoke-test-junit-vintage - spring-boot-smoke-test-kafka - spring-boot-smoke-test-liquibase - spring-boot-smoke-test-logback - spring-boot-smoke-test-oauth2-client - spring-boot-smoke-test-oauth2-resource-server - spring-boot-smoke-test-parent-context - spring-boot-smoke-test-profile - spring-boot-smoke-test-property-validation - spring-boot-smoke-test-quartz - spring-boot-smoke-test-reactive-oauth2-client - spring-boot-smoke-test-reactive-oauth2-resource-server - spring-boot-smoke-test-rsocket - spring-boot-smoke-test-saml2-service-provider - spring-boot-smoke-test-secure - spring-boot-smoke-test-secure-jersey - spring-boot-smoke-test-secure-webflux - spring-boot-smoke-test-servlet - spring-boot-smoke-test-session - spring-boot-smoke-test-session-webflux - spring-boot-smoke-test-simple - spring-boot-smoke-test-test - spring-boot-smoke-test-test-nomockito - spring-boot-smoke-test-testng - spring-boot-smoke-test-tomcat - spring-boot-smoke-test-tomcat-jsp - spring-boot-smoke-test-tomcat-ssl - spring-boot-smoke-test-tomcat-multi-connectors - spring-boot-smoke-test-traditional - spring-boot-smoke-test-undertow - spring-boot-smoke-test-undertow-ssl - spring-boot-smoke-test-war - spring-boot-smoke-test-web-freemarker - spring-boot-smoke-test-web-groovy-templates - spring-boot-smoke-test-web-jsp - spring-boot-smoke-test-web-method-security - spring-boot-smoke-test-web-mustache - spring-boot-smoke-test-web-secure - spring-boot-smoke-test-web-secure-custom - spring-boot-smoke-test-web-secure-jdbc - spring-boot-smoke-test-web-static - spring-boot-smoke-test-web-ui - spring-boot-smoke-test-webflux - spring-boot-smoke-test-webflux-coroutines - spring-boot-smoke-test-websocket-jetty - spring-boot-smoke-test-websocket-tomcat - spring-boot-smoke-test-websocket-undertow - spring-boot-smoke-test-webservices - spring-boot-smoke-test-xml - - - - - - - org.codehaus.mojo - flatten-maven-plugin - true - - - flatten - process-resources - - flatten - - - true - oss - - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*Tests.java - - - **/Abstract*.java - - - file:/dev/./urandom - true - - - - - org.apache.maven.plugins - maven-enforcer-plugin - - - enforce-rules - - enforce - - - - - - commons-logging:*:* - - true - - - true - - - - - - org.apache.maven.plugins - maven-install-plugin - - true - - - - org.apache.maven.plugins - maven-javadoc-plugin - - true - - true - - - - - - fast - - - fast - - - - true - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-activemq/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-activemq/build.gradle new file mode 100644 index 000000000000..b1de23afa167 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-activemq/build.gradle @@ -0,0 +1,11 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Actuator ActiveMQ smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-activemq') + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-activemq/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-activemq/pom.xml deleted file mode 100644 index 94d0db4ada25..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-activemq/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-activemq - Spring Boot ActiveMQ Smoke Test - Spring Boot ActiveMQ Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-activemq - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/build.gradle new file mode 100644 index 000000000000..02c2597511a4 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/build.gradle @@ -0,0 +1,17 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Actuator custom security smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-freemarker') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-security') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + runtimeOnly 'org.jolokia:jolokia-core' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testRuntimeOnly 'org.apache.httpcomponents:httpclient' +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/pom.xml deleted file mode 100644 index de0f0b25f876..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-actuator-custom-security - Spring Boot Actuator Custom Security Smoke Test - Spring Boot Actuator Custom Security Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-freemarker - - - org.springframework.boot - spring-boot-starter-security - - - org.jolokia - jolokia-core - - - - org.apache.httpcomponents - httpclient - runtime - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-log4j2/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-log4j2/build.gradle new file mode 100644 index 000000000000..25f853b42888 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-log4j2/build.gradle @@ -0,0 +1,20 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Actuator Log4j 2 smoke test' + +configurations.all { + exclude module: 'spring-boot-starter-logging' +} + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-log4j2') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-security') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-log4j2/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-log4j2/pom.xml deleted file mode 100644 index a697d566f9d7..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-log4j2/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-actuator-log4j2 - Spring Boot Actuator Log4j 2 Smoke Test - Spring Boot Actuator Log4j 2 Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-logging - - - - - org.springframework.boot - spring-boot-starter-log4j2 - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-security - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-noweb/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-noweb/build.gradle new file mode 100644 index 000000000000..c031508fc06e --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-noweb/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Actuator non-web smoke test' + +dependencies { + annotationProcessor project(':spring-boot-project:spring-boot-tools:spring-boot-configuration-processor') + + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-noweb/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-noweb/pom.xml deleted file mode 100644 index 863864bd5774..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-noweb/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-actuator-noweb - Spring Boot Actuator Non-Web Smoke Test - Spring Boot Actuator Non-Web Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-actuator - - - - org.springframework.boot - spring-boot-configuration-processor - true - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-ui/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-ui/build.gradle new file mode 100644 index 000000000000..65379711f042 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-ui/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Actuator UI smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-freemarker') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-security') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-ui/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-ui/pom.xml deleted file mode 100644 index d53df3d9018f..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-ui/pom.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-actuator-ui - Spring Boot Actuator UI Smoke Test - Spring Boot Actuator UI Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-freemarker - - - org.springframework.boot - spring-boot-starter-security - - - org.jolokia - jolokia-core - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/build.gradle new file mode 100644 index 000000000000..6626aa97dc45 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/build.gradle @@ -0,0 +1,17 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Actuator smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jdbc') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-security') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + runtimeOnly 'com.h2database:h2' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testRuntimeOnly 'org.apache.httpcomponents:httpclient' +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/pom.xml deleted file mode 100644 index 4093b2cb40ce..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/pom.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-actuator - Spring Boot Actuator Smoke Test - Spring Boot Actuator Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-jdbc - - - - org.apache.httpcomponents - httpclient - runtime - - - com.h2database - h2 - runtime - - - - org.springframework.boot - spring-boot-configuration-processor - true - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - true - - - - generate build info - - build-info - - - - ${project.build.sourceEncoding} - ${project.reporting.outputEncoding} - ${maven.compiler.source} - ${maven.compiler.target} - - - - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/src/main/resources/META-INF/build-info.properties b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/src/main/resources/META-INF/build-info.properties new file mode 100644 index 000000000000..1ca9f928048e --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/src/main/resources/META-INF/build-info.properties @@ -0,0 +1,5 @@ +build.artifact=spring-boot-smoke-test-actuator +build.encoding.source=UTF-8 +build.encoding.reporting=UTF-8 +build.java.source=1.8 +build.java.target=1.8 \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-amqp/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-amqp/build.gradle new file mode 100644 index 000000000000..0d4dbfb422e3 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-amqp/build.gradle @@ -0,0 +1,10 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot AMQP smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-amqp') +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-amqp/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-amqp/pom.xml deleted file mode 100644 index 66e0dd896ca2..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-amqp/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-amqp - Spring Boot AMQP Smoke Test - Spring Boot AMQP Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-amqp - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-animated-banner/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-animated-banner/build.gradle new file mode 100644 index 000000000000..2b04032ab97c --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-animated-banner/build.gradle @@ -0,0 +1,10 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot animated banner smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter') +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-animated-banner/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-animated-banner/pom.xml deleted file mode 100644 index b62aff037605..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-animated-banner/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-animated-banner - Spring Boot Animated Banner Smoke Test - Spring Boot Animated Banner Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.gradle new file mode 100644 index 000000000000..9b26aae89d85 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.gradle @@ -0,0 +1,69 @@ +plugins { + id 'org.springframework.boot.conventions' + id 'java-base' +} + +description = 'Spring Boot Ant smoke test' + +configurations { + antDependencies + testRepository +} + +sourceSets { + test +} + +plugins.withType(EclipsePlugin) { + eclipse { + classpath { + plusConfigurations = [configurations.testRuntimeClasspath] + } + } +} + +dependencies { + antDependencies 'org.apache.ivy:ivy:2.4.0' + antDependencies project(path: ':spring-boot-project:spring-boot-tools:spring-boot-antlib') + + testRepository project(path: ':spring-boot-project:spring-boot-tools:spring-boot-loader', configuration: 'mavenRepository') + testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter', configuration: 'mavenRepository') + + testImplementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + testImplementation project(path: ':spring-boot-project:spring-boot-tools:spring-boot-loader-tools') + testImplementation 'org.assertj:assertj-core' + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.springframework:spring-core' +} + +task syncTestRepository(type: Sync) { + destinationDir = file("${buildDir}/test-repository") + from configurations.testRepository + rename { + it.replaceAll('-[0-9]+\\.[0-9]+-[0-9]+\\.', '-SNAPSHOT.') + } +} + +ant.importBuild('build.xml') { + 'ant' + it +} +ant.properties['ant-spring-boot.version'] = project.version +ant.properties['projectDir'] = project.layout.projectDirectory + +antresolve { + dependsOn syncTestRepository, configurations.antDependencies + doFirst { + ClassLoader antClassLoader = org.apache.tools.ant.Project.class.classLoader + configurations.antDependencies.each { antClassLoader.addURL it.toURI().toURL() } + } +} + +task test(type: Test) { + dependsOn antbuild + testClassesDirs = sourceSets.test.output.classesDirs + classpath = sourceSets.test.runtimeClasspath +} + +check { + dependsOn test +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.xml index 31e501819599..1cc4fcae3474 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.xml +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.xml @@ -11,7 +11,6 @@ actual jars). Run with '$ java -jar target/*.jar'. - @@ -26,11 +25,11 @@ - + - + @@ -38,7 +37,7 @@ - + @@ -48,7 +47,7 @@ - + diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/ivysettings.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/ivysettings.xml index a96e5a5c7fb6..37ccec0280f9 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/ivysettings.xml +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/ivysettings.xml @@ -4,8 +4,8 @@ - - + + diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/pom.xml deleted file mode 100644 index cf2a8c967546..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/pom.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-ant - Spring Boot Ant Smoke Test - Spring Boot Ant Smoke Test - - ${basedir}/../../.. - 1.9.3 - - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-loader - - - org.springframework.boot - spring-boot-starter-test - - - org.springframework.boot - spring-boot-antlib - ${project.version} - - - - org.springframework.boot - spring-boot-loader-tools - test - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - default-compile - none - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - antbuild - package - - - - - - - - run - - - - - - org.apache.ant - ant - ${ant.version} - - - org.apache.ivy - ivy - 2.4.0 - - - org.springframework.boot - spring-boot-antlib - ${revision} - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - - integration-test - verify - - - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/src/test/java/smoketest/ant/SampleAntApplicationIT.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/src/test/java/smoketest/ant/SampleAntApplicationIT.java index 51e870bff401..9d0f7cde7b18 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/src/test/java/smoketest/ant/SampleAntApplicationIT.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/src/test/java/smoketest/ant/SampleAntApplicationIT.java @@ -38,7 +38,7 @@ public class SampleAntApplicationIT { @Test void runJar() throws Exception { - File target = new File("target"); + File target = new File("build/ant/libs"); File[] jarFiles = target.listFiles(new FileFilter() { @Override diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-aop/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-aop/build.gradle new file mode 100644 index 000000000000..7c7c7fa9d33a --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-aop/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot AOP smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-aop') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-aop/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-aop/pom.xml deleted file mode 100644 index 8a47c6a21a7a..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-aop/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-aop - Spring Boot AOP Smoke Test - Spring Boot AOP Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-aop - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-atmosphere/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-atmosphere/build.gradle new file mode 100644 index 000000000000..75edfaedf15e --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-atmosphere/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Atmosphere smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + implementation 'org.atmosphere:atmosphere-runtime:2.4.14' + runtimeOnly 'org.webjars:atmosphere-javascript:2.3.4' + + testImplementation enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'org.springframework:spring-websocket' +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-atmosphere/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-atmosphere/pom.xml deleted file mode 100644 index d3b7058a5c71..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-atmosphere/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-atmosphere - Spring Boot Atmosphere Smoke Test - Spring Boot Atmosphere Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-web - - - javax.inject - javax.inject - 1 - - - org.atmosphere - atmosphere-runtime - 2.4.14 - - - org.webjars - atmosphere-javascript - 2.3.4 - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework - spring-websocket - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-batch/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-batch/build.gradle new file mode 100644 index 000000000000..2af7bc92de89 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-batch/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Batch smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-batch') + runtimeOnly 'org.hsqldb:hsqldb' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-batch/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-batch/pom.xml deleted file mode 100644 index 3249ad312ee0..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-batch/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-batch - Spring Boot Batch Smoke Test - Spring Boot Batch Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-batch - - - - org.hsqldb - hsqldb - runtime - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle new file mode 100644 index 000000000000..3f1c40743605 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle @@ -0,0 +1,46 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot cache smoke test' + +def caches = [ + 'caffeine': [ + 'com.github.ben-manes.caffeine:caffeine' + ], + 'couchbase': [ + 'com.couchbase.client:java-client', + 'com.couchbase.client:couchbase-spring-cache' + ], + 'ehcache': [ + 'javax.cache:cache-api', + 'org.ehcache:ehcache' + ], + 'ehcache2': [ + 'net.sf.ehcache:ehcache' + ], + 'hazelcast': [ + 'com.hazelcast:hazelcast', + 'com.hazelcast:hazelcast-spring' + ], + 'infinispan': [ + 'org.infinispan:infinispan-jcache', + 'org.infinispan:infinispan-spring5-embedded' + ], + 'redis': [ + project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-redis') + ] +] + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-cache') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + if (project.hasProperty('cache')) { + caches[project.getProperty('cache')].each { runtimeOnly it } + } + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/pom.xml deleted file mode 100644 index 79e99e6b2f9f..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-cache - Spring Boot Cache Smoke Test - Spring Boot Cache Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-cache - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-actuator - - - - javax.cache - cache-api - - - org.ehcache - ehcache - runtime - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/pom.xml deleted file mode 100644 index a87f8d0575b4..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/pom.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-custom-layout - Spring Boot Custom Layout Smoke Test - Spring Boot Custom Layout Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-loader-tools - - - - - - org.apache.maven.plugins - maven-invoker-plugin - - ${project.build.directory}/local-repo - - - - prepare-integration-test - pre-integration-test - - install - - - - integration-test - integration-test - - run - - - ${project.build.directory}/it - src/it/settings.xml - verify - true - ${skipTests} - true - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - cleanup-local-integration-repo - pre-integration-test - - run - - - - - - - - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/custom/verify.groovy b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/custom/verify.groovy deleted file mode 100644 index 7da68e56a2e4..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/custom/verify.groovy +++ /dev/null @@ -1,6 +0,0 @@ -import java.io.*; -import smoketest.layout.*; - -Verify.verify( - new File(basedir, "target/custom-0.0.1.BUILD-SNAPSHOT.jar"), "custom" -) diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/default/src/main/java/org/test/SampleApplication.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/default/src/main/java/org/test/SampleApplication.java deleted file mode 100644 index 672d96a2a604..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/default/src/main/java/org/test/SampleApplication.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.test; - -public class SampleApplication { - - public static void main(String[] args) { - } - -} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/default/verify.groovy b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/default/verify.groovy deleted file mode 100644 index aca02ce428a1..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/default/verify.groovy +++ /dev/null @@ -1,6 +0,0 @@ -import java.io.*; -import smoketest.layout.*; - -Verify.verify( - new File(basedir, "target/default-0.0.1.BUILD-SNAPSHOT.jar"), "sample" -) diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/settings.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/settings.xml deleted file mode 100644 index e1e0ace341b9..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/settings.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - it-repo - - true - - - - local.central - @localRepositoryUrl@ - - true - - - true - - - - - - local.central - @localRepositoryUrl@ - - true - - - true - - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/test/java/smoketest/layout/Verify.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/test/java/smoketest/layout/Verify.java deleted file mode 100644 index f7d5c924e864..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/test/java/smoketest/layout/Verify.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package smoketest.layout; - -import java.io.File; -import java.util.Enumeration; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - -public final class Verify { - - private Verify() { - } - - public static void verify(File file, String entry) throws Exception { - try (ZipFile zipFile = new ZipFile(file)) { - Enumeration entries = zipFile.entries(); - while (entries.hasMoreElements()) { - if (entries.nextElement().getName().equals(entry)) { - return; - } - } - throw new AssertionError("No entry " + entry); - } - } - -} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-cassandra/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-cassandra/build.gradle new file mode 100644 index 000000000000..34c0983d74e9 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-cassandra/build.gradle @@ -0,0 +1,40 @@ +buildscript { + dependencies { + classpath 'org.springframework:spring-core:5.2.2.RELEASE' + } +} + +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Data Cassandra smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-cassandra') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation('org.cassandraunit:cassandra-unit-spring:3.5.0.1') { + exclude group: 'org.slf4j', module: 'jcl-over-slf4j' + } +} + +test { + jvmArgumentProviders.add new CassandraPortsProvider() + enabled = !JavaVersion.current().java9Compatible +} + +class CassandraPortsProvider implements CommandLineArgumentProvider { + + @Override + Iterable asArguments() { + def ports = org.springframework.util.SocketUtils.findAvailableTcpPorts(2) + return [ + "-Dspring.data.cassandra.port=${ports[0]}", + "-Dcassandra.native_transport_port=${ports[0]}", + "-Dcassandra.port.storage=${ports[1]}" + ] + } + +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-cassandra/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-cassandra/pom.xml deleted file mode 100644 index 607cc194ee5e..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-cassandra/pom.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-data-cassandra - Spring Boot Data Cassandra Smoke Test - Spring Boot Data Cassandra Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-data-cassandra - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.cassandraunit - cassandra-unit-spring - 3.5.0.1 - test - - - org.slf4j - jcl-over-slf4j - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - reserve-cassandra-port - - reserve-network-port - - process-resources - - - cassandra.port.native-transport - cassandra.port.storage - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - ${cassandra.port.native-transport} - ${cassandra.port.native-transport} - ${cassandra.port.storage} - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - java9+ - - [9,) - - - - - org.apache.maven.plugins - maven-surefire-plugin - - true - - - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-couchbase/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-couchbase/build.gradle new file mode 100644 index 000000000000..8480164a8eb4 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-couchbase/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Data Couchbase smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-couchbase') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-couchbase/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-couchbase/pom.xml deleted file mode 100644 index 58a8b51d99be..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-couchbase/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - - spring-boot-smoke-tests - org.springframework.boot - ${revision} - - spring-boot-smoke-test-data-couchbase - Spring Boot Data Couchbase Smoke Test - Spring Boot Data Couchbase Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-data-couchbase - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/build.gradle new file mode 100644 index 000000000000..fa4759b3108d --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Data Elasticsearch smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-elasticsearch') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/pom.xml deleted file mode 100644 index a7e1a3936929..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/pom.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-data-elasticsearch - Spring Boot Data Elasticsearch Smoke Test - Spring Boot Data Elasticsearch Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-data-elasticsearch - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jdbc/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jdbc/build.gradle new file mode 100644 index 000000000000..b91d1d72fb29 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jdbc/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Data JDBC smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-jdbc') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + runtimeOnly 'com.h2database:h2' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jdbc/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jdbc/pom.xml deleted file mode 100755 index d631952f9159..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jdbc/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-data-jdbc - Spring Boot Data JDBC Smoke Test - Spring Boot Data JDBC Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-data-jdbc - - - org.springframework.boot - spring-boot-starter-web - - - - com.h2database - h2 - runtime - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/build.gradle new file mode 100644 index 000000000000..01abdb2150be --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Data JPA smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-jpa') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + runtimeOnly 'com.h2database:h2' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/pom.xml deleted file mode 100755 index 6a616898b381..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jpa/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-data-jpa - Spring Boot Data JPA Smoke Test - Spring Boot Data JPA Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-web - - - - com.h2database - h2 - runtime - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-ldap/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-ldap/build.gradle new file mode 100644 index 000000000000..abcf5208e949 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-ldap/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Data LDAP smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-ldap') + runtimeOnly 'com.unboundid:unboundid-ldapsdk' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-ldap/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-ldap/pom.xml deleted file mode 100644 index 5dd86ff90bfe..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-ldap/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-data-ldap - Spring Boot Data LDAP Smoke Test - Spring Boot Data LDAP Smoke Test - - ${basedir}/../../.. - - - - - com.unboundid - unboundid-ldapsdk - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-data-ldap - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-mongodb/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-mongodb/build.gradle new file mode 100644 index 000000000000..9d31618775a3 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-mongodb/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Data MongoDB smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-mongodb') + runtimeOnly 'de.flapdoodle.embed:de.flapdoodle.embed.mongo' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-mongodb/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-mongodb/pom.xml deleted file mode 100644 index 5b6c9509c0d8..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-mongodb/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-data-mongodb - Spring Boot Data MongoDB Smoke Test - Spring Boot Data MongoDB Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-data-mongodb - - - de.flapdoodle.embed - de.flapdoodle.embed.mongo - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-neo4j/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-neo4j/build.gradle new file mode 100644 index 000000000000..0a5d557bdde9 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-neo4j/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Data Neo4j smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-neo4j') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-neo4j/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-neo4j/pom.xml deleted file mode 100644 index 071ef9961959..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-neo4j/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-data-neo4j - Spring Boot Data Neo4j Smoke Test - Spring Boot Data Neo4j Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-data-neo4j - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-redis/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-redis/build.gradle new file mode 100644 index 000000000000..9fb809100867 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-redis/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Data Redis smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-redis') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-redis/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-redis/pom.xml deleted file mode 100644 index f354ac153eef..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-redis/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-data-redis - Spring Boot Data Redis Smoke Test - Spring Boot Data Redis Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-data-redis - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - production - - - - commons-pool - commons-pool - pom.lastUpdated - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-rest/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-rest/build.gradle new file mode 100644 index 000000000000..5eb485731870 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-rest/build.gradle @@ -0,0 +1,19 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Data REST smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-jpa') + implementation(project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-rest')) { + exclude module: 'spring-boot-starter-tomcat' + } + implementation 'com.h2database:h2' + + runtimeOnly project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jetty') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testRuntimeOnly 'com.jayway.jsonpath:json-path' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-rest/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-rest/pom.xml deleted file mode 100644 index 8268687c67a8..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-rest/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-data-rest - Spring Boot Data REST Smoke Test - Spring Boot Data REST Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - org.springframework.boot - spring-boot-starter-jetty - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-data-rest - - - - com.h2database - h2 - runtime - - - - org.springframework.boot - spring-boot-starter-test - test - - - com.jayway.jsonpath - json-path - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - java9+ - - [9,) - - - - jakarta.xml.bind - jakarta.xml.bind-api - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-solr/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-solr/build.gradle new file mode 100644 index 000000000000..9575c1022e7d --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-solr/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Data Solr smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-solr') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-solr/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-solr/pom.xml deleted file mode 100644 index 69ba3dfcead2..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-solr/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-data-solr - Spring Boot Data Solr Smoke Test - Spring Boot Data Solr Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-data-solr - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-devtools/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-devtools/build.gradle new file mode 100644 index 000000000000..f451df2412a5 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-devtools/build.gradle @@ -0,0 +1,20 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot DevTools smoke test' + +configurations { + developmentOnly + runtimeClasspath.extendsFrom developmentOnly +} + +dependencies { + developmentOnly project(':spring-boot-project:spring-boot-devtools') + + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-thymeleaf') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-devtools/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-devtools/pom.xml deleted file mode 100644 index bdab3466c043..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-devtools/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-devtools - Spring Boot Developer Tools Smoke Test - Spring Boot Developer Tools Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.boot - spring-boot-devtools - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-flyway/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-flyway/build.gradle new file mode 100644 index 000000000000..408d0ff3eaf3 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-flyway/build.gradle @@ -0,0 +1,17 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Flyway smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-jpa') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + runtimeOnly 'com.h2database:h2' + runtimeOnly 'org.flywaydb:flyway-core' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-flyway/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-flyway/pom.xml deleted file mode 100644 index 8bf6446af770..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-flyway/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-flyway - Spring Boot Flyway Smoke Test - Spring Boot Flyway Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-actuator - - - org.flywaydb - flyway-core - - - - com.h2database - h2 - runtime - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - java9+ - - [9,) - - - - jakarta.xml.bind - jakarta.xml.bind-api - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-hateoas/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-hateoas/build.gradle new file mode 100644 index 000000000000..8b8163d15085 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-hateoas/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot HATEOAS smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-hateoas') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-hateoas/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-hateoas/pom.xml deleted file mode 100644 index b1249779340e..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-hateoas/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-hateoas - Spring Boot Hateoas Smoke Test - Spring Boot Hateoas Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-hateoas - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-hibernate52/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-hibernate52/build.gradle new file mode 100644 index 000000000000..25972c05c177 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-hibernate52/build.gradle @@ -0,0 +1,22 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Hibernate 5.2 smoke test' + +configurations.all { + resolutionStrategy { + force 'org.hibernate:hibernate-core:5.2.17.Final' + } +} + +dependencies { + implementation(project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-jpa')) { + exclude group: 'org.hibernate.javax.persistence', module: 'hibernate-jpa-2.1-api' + } + + runtimeOnly 'com.h2database:h2' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-hibernate52/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-hibernate52/pom.xml deleted file mode 100755 index 526fd2f360c6..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-hibernate52/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-hibernate52 - Spring Boot Hibernate 5.2 Smoke Tests - ${project.name} - - ${basedir}/../../.. - 5.2.17.Final - - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - - com.h2database - h2 - runtime - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-integration/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-integration/build.gradle new file mode 100644 index 000000000000..960f09ca564f --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-integration/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Integration smoke test' + +dependencies { + annotationProcessor project(':spring-boot-project:spring-boot-tools:spring-boot-configuration-processor') + + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-integration') + implementation 'org.springframework.integration:spring-integration-file' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'org.awaitility:awaitility' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-integration/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-integration/pom.xml deleted file mode 100644 index 9c2026d12b62..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-integration/pom.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-integration - Spring Boot Integration Smoke Test - Spring Boot Integration Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-integration - - - org.springframework.integration - spring-integration-file - - - - org.springframework.boot - spring-boot-configuration-processor - true - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.awaitility - awaitility - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jersey/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jersey/build.gradle new file mode 100644 index 000000000000..7a3b3c2a2e2a --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jersey/build.gradle @@ -0,0 +1,18 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Jersey smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jersey') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat') + + if (JavaVersion.current().java9Compatible) { + runtimeOnly 'jakarta.xml.bind:jakarta.xml.bind-api' + } + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jersey/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jersey/pom.xml deleted file mode 100644 index d2d2b2164a66..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jersey/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-jersey - Spring Boot Jersey Smoke Test - Spring Boot Jersey Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-jersey - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-tomcat - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - generate build info - - build-info - - - - - - - - - java9+ - - [9,) - - - - jakarta.xml.bind - jakarta.xml.bind-api - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/build.gradle new file mode 100644 index 000000000000..75490b6c9c3d --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/build.gradle @@ -0,0 +1,25 @@ +plugins { + id 'war' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Jetty JSP smoke test' + +dependencies { + compileOnly 'jakarta.servlet:jakarta.servlet-api' + compileOnly project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jetty') + + implementation(project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web')) { + exclude module: 'spring-boot-starter-tomcat' + } + + providedRuntime enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + providedRuntime('org.eclipse.jetty:apache-jsp') { + exclude group: 'javax.annotation', module: 'javax.annotation-api' + } + + runtimeOnly 'javax.servlet:jstl' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jetty') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/pom.xml deleted file mode 100644 index 795f4ddc70d9..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-jsp/pom.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-jetty-jsp - war - Spring Boot Jetty JSP Smoke Test - Spring Boot Jetty JSP Smoke Test - - ${basedir}/../../.. - / - 3.1.0 - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - javax.servlet - jstl - - - - org.springframework.boot - spring-boot-starter-jetty - provided - - - jakarta.servlet - jakarta.servlet-api - - - - - org.eclipse.jetty - apache-jsp - provided - - - javax.annotation - javax.annotation-api - - - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - true - - - - org.apache.maven.plugins - maven-enforcer-plugin - - - enforce-rules - - enforce - - - - - - javax.servlet:javax.servlet-api:* - - true - - - true - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - false - - - - - - - java9+ - - [9,) - - - - - org.apache.maven.plugins - maven-surefire-plugin - - true - - - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-ssl/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-ssl/build.gradle new file mode 100644 index 000000000000..5c52b3e364b5 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-ssl/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Jetty SSL smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jetty') + implementation(project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web')) { + exclude module: 'spring-boot-starter-tomcat' + } + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testRuntimeOnly 'org.apache.httpcomponents:httpclient' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-ssl/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-ssl/pom.xml deleted file mode 100644 index fffed290700a..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty-ssl/pom.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-jetty-ssl - Spring Boot Jetty SSL Smoke Test - Spring Boot Jetty SSL Smoke Test - - ${basedir}/../../.. - 3.1.0 - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - org.springframework.boot - spring-boot-starter-jetty - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.apache.httpcomponents - httpclient - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty/build.gradle new file mode 100644 index 000000000000..ae3b1c1f49d4 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Jetty smoke test' + +dependencies { + implementation(project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web')) { + exclude module: 'spring-boot-starter-tomcat' + } + + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jetty') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty/pom.xml deleted file mode 100644 index d36c7dbe1b3c..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jetty/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-jetty - Spring Boot Jetty Smoke Test - Spring Boot Jetty Smoke Test - - ${basedir}/../../.. - 3.1.0 - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - org.springframework.boot - spring-boot-starter-jetty - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jooq/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jooq/build.gradle new file mode 100644 index 000000000000..790d9fd6a272 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jooq/build.gradle @@ -0,0 +1,43 @@ +// plugins { +// id 'java' +// id 'nu.studer.jooq' version '3.0.3' +// id 'org.springframework.boot.conventions' +// } +// +// description = 'Spring Boot JOOQ smoke test' +// +// dependencies { +// implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jooq') +// jooqRuntime enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) +// jooqRuntime 'com.h2database:h2' +// runtimeOnly 'com.h2database:h2' +// +// testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +// } +// +// jooq { +// version = '3.12.3' +// smokeTest(sourceSets.main) { +// jdbc { +// driver = 'org.h2.Driver' +// url = 'jdbc:h2:~/springbootjooq' +// } +// generator { +// name = 'org.jooq.codegen.DefaultGenerator' +// database { +// name = 'org.jooq.meta.h2.H2Database' +// includes = '.*' +// inputSchema = 'PUBLIC' +// } +// strategy { +// // name = 'smoketest.jooq.util.TangleFreeGeneratorStrategy' +// } +// target { +// packageName = 'smoketest.jooq.domain' +// } +// generate { +// records = false +// } +// } +// } +// } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jooq/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jooq/pom.xml deleted file mode 100644 index e6e5c10cac47..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jooq/pom.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-jooq - Spring Boot jOOQ Smoke Test - Spring Boot jOOQ Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-jooq - - - - com.h2database - h2 - runtime - - - - org.jooq - jooq-codegen - provided - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - generate-sources - - add-source - - - - gensrc/main/java - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - generate - - - - maven-compiler-plugin - - - generate-jooq-utils - generate-sources - - compile - - false - - - smoketest/jooq/util/** - - - - - - - org.codehaus.mojo - sql-maven-plugin - 1.5 - - - generate-sources - - execute - - - - - - com.h2database - h2 - ${h2.version} - - - - org.h2.Driver - jdbc:h2:~/springbootjooq - - ${basedir}/src/main/resources/reset.sql - ${basedir}/src/main/resources/schema.sql - - - - - org.jooq - jooq-codegen-maven - - - - generate - - - - - - com.h2database - h2 - ${h2.version} - - - - - org.h2.Driver - jdbc:h2:~/springbootjooq - - - org.jooq.util.DefaultGenerator - - org.jooq.util.h2.H2Database - .* - - PUBLIC - - - smoketest.jooq.util.TangleFreeGeneratorStrategy - - - smoketest.jooq.domain - ${basedir}/gensrc/main/java - - - false - - - - - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/build.gradle new file mode 100644 index 000000000000..b6e319a8a834 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/build.gradle @@ -0,0 +1,25 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot JPA smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-freemarker') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + implementation 'jakarta.persistence:jakarta.persistence-api' + if (JavaVersion.current().java9Compatible) { + implementation 'jakarta.xml.bind:jakarta.xml.bind-api' + } + implementation('org.hibernate:hibernate-core') { + exclude group: 'javax.activation', module: 'javax.activation-api' + exclude group: 'javax.persistence', module: 'javax.persistence-api' + exclude group: 'javax.xml.bind', module: 'jaxb-api' + } + implementation 'org.springframework:spring-orm' + + runtimeOnly 'com.h2database:h2' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/pom.xml deleted file mode 100644 index 3a718411f58d..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jpa/pom.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-jpa - Spring Boot JPA Smoke Test - Spring Boot JPA Smoke Test - - ${basedir}/../../.. - - - - - jakarta.persistence - jakarta.persistence-api - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-freemarker - - - org.springframework - spring-orm - - - org.hibernate - hibernate-core - - - javax.xml.bind - jaxb-api - - - javax.persistence - javax.persistence-api - - - javax.activation - javax.activation-api - - - - - - com.h2database - h2 - runtime - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - java9+ - - [9,) - - - - jakarta.xml.bind - jakarta.xml.bind-api - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-atomikos/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-atomikos/build.gradle new file mode 100644 index 000000000000..46979b6018c4 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-atomikos/build.gradle @@ -0,0 +1,23 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Atomikos JTA smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-artemis') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-jpa') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jta-atomikos') + if (JavaVersion.current().java9Compatible) { + implementation 'jakarta.xml.bind:jakarta.xml.bind-api' + } + implementation 'org.springframework:spring-jms' + + runtimeOnly 'com.h2database:h2' + runtimeOnly('org.apache.activemq:artemis-jms-server') { + exclude group: 'org.apache.geronimo.specs', module: 'geronimo-jms_2.0_spec' + } + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-atomikos/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-atomikos/pom.xml deleted file mode 100644 index b117c9ec0a66..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-atomikos/pom.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-jta-atomikos - Spring Boot Atomikos JTA Smoke Test - Spring Boot Atomikos JTA Smoke Test - - ${basedir}/../../.. - - - - - org.springframework - spring-jms - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-jta-atomikos - - - org.springframework.boot - spring-boot-starter-artemis - - - org.apache.activemq - artemis-jms-server - - - geronimo-jms_2.0_spec - org.apache.geronimo.specs - - - - - com.h2database - h2 - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - java9+ - - [9,) - - - - jakarta.xml.bind - jakarta.xml.bind-api - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-bitronix/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-bitronix/build.gradle new file mode 100644 index 000000000000..c30bea68d424 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-bitronix/build.gradle @@ -0,0 +1,23 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Bitronix JTA smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-artemis') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-jpa') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jta-bitronix') + if (JavaVersion.current().java9Compatible) { + implementation 'jakarta.xml.bind:jakarta.xml.bind-api' + } + implementation 'org.springframework:spring-jms' + + runtimeOnly 'com.h2database:h2' + runtimeOnly('org.apache.activemq:artemis-jms-server') { + exclude group: 'org.apache.geronimo.specs', module: 'geronimo-jms_2.0_spec' + } + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-bitronix/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-bitronix/pom.xml deleted file mode 100644 index fbc875808f9c..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-bitronix/pom.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-jta-bitronix - Spring Boot Bitronix JTA Smoke Test - Spring Boot Bitronix JTA Smoke Test - - ${basedir}/../../.. - - - - - org.springframework - spring-jms - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-jta-bitronix - - - org.springframework.boot - spring-boot-starter-artemis - - - org.apache.activemq - artemis-jms-server - - - geronimo-jms_2.0_spec - org.apache.geronimo.specs - - - - - com.h2database - h2 - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - java9+ - - [9,) - - - - jakarta.xml.bind - jakarta.xml.bind-api - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/pom.xml deleted file mode 100644 index d69a7e7d7f7f..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-jta-jndi - Spring Boot JNDI JTA Smoke Test - war - Spring Boot JNDI JTA Smoke Test - - ${basedir}/../../.. - - - - - org.springframework - spring-jms - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - - jakarta.servlet - jakarta.servlet-api - provided - - - jakarta.jms - jakarta.jms-api - provided - - - - org.springframework.boot - spring-boot-starter-test - test - - - - spring-boot-smoke-test-jta-jndi - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-junit-jupiter/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-junit-jupiter/build.gradle new file mode 100644 index 000000000000..d48beca8ba38 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-junit-jupiter/build.gradle @@ -0,0 +1,26 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot JUnit Jupiter smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + testImplementation(project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test')) { + exclude group: 'org.junit.vintage' + } +} + +test { + testLogging { + afterSuite { description, result -> + if (!description.parent) { + if (!result.testCount) { + throw new GradleException('No tests were executed') + } + } + } + } +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-junit-jupiter/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-junit-jupiter/pom.xml deleted file mode 100644 index 1c661d1f349d..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-junit-jupiter/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-junit-jupiter - Spring Boot JUnit Jupiter Smoke Test - Spring Boot JUnit Jupiter Smoke Test - - ${basedir}/../../.. - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.vintage - junit-vintage-engine - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-junit-vintage/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-junit-vintage/build.gradle new file mode 100644 index 000000000000..2ae43e941a18 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-junit-vintage/build.gradle @@ -0,0 +1,24 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot JUnit Vintage smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + testImplementation(project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test')) +} + +test { + testLogging { + afterSuite { description, result -> + if (!description.parent) { + if (!result.testCount) { + throw new GradleException('No tests were executed') + } + } + } + } +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-junit-vintage/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-junit-vintage/pom.xml deleted file mode 100644 index 6452cb757f72..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-junit-vintage/pom.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-junit-vintage - Spring Boot JUnit Vintage Smoke Test - Spring Boot JUnit Vintage Smoke Test - - ${basedir}/../../.. - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-test - test - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/build.gradle new file mode 100644 index 000000000000..2abfa04180e4 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Kafka smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-json') + implementation 'org.springframework.kafka:spring-kafka' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'org.awaitility:awaitility' + testImplementation 'org.springframework.kafka:spring-kafka-test' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/pom.xml deleted file mode 100644 index 2b0b0fd109a8..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-kafka/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-kafka - Spring Boot Kafka Smoke Test - Spring Boot Kafka Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-json - - - org.springframework.kafka - spring-kafka - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.awaitility - awaitility - test - - - org.springframework.kafka - spring-kafka-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-liquibase/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-liquibase/build.gradle new file mode 100644 index 000000000000..9ca130e1eeae --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-liquibase/build.gradle @@ -0,0 +1,17 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Liquibase smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jdbc') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + implementation 'org.liquibase:liquibase-core' + + runtimeOnly 'com.h2database:h2' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-liquibase/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-liquibase/pom.xml deleted file mode 100644 index 04541350985e..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-liquibase/pom.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-liquibase - Spring Boot Liquibase Smoke Test - Spring Boot Liquibase Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-jdbc - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-actuator - - - org.liquibase - liquibase-core - - - - com.h2database - h2 - runtime - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-logback/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-logback/build.gradle new file mode 100644 index 000000000000..98895564996d --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-logback/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Logback smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-logback/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-logback/pom.xml deleted file mode 100644 index fe1daa14a106..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-logback/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-logback - Spring Boot Logback Smoke Test - Spring Boot Logback Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-oauth2-client/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-oauth2-client/build.gradle new file mode 100644 index 000000000000..3d14d0b45b00 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-oauth2-client/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot OAuth2 Client smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-oauth2-client') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'org.apache.httpcomponents:httpclient' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-oauth2-client/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-oauth2-client/pom.xml deleted file mode 100644 index 4682992ad359..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-oauth2-client/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-oauth2-client - Spring Boot OAuth2 Client Smoke Test - Spring Boot OAuth2 Client Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-oauth2-client - - - org.springframework.boot - spring-boot-starter-web - - - - org.apache.httpcomponents - httpclient - test - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-oauth2-resource-server/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-oauth2-resource-server/build.gradle new file mode 100644 index 000000000000..ff995cdfe210 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-oauth2-resource-server/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot OAuth2 Resource Server smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-oauth2-resource-server') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'com.squareup.okhttp3:mockwebserver:3.9.0' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-oauth2-resource-server/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-oauth2-resource-server/pom.xml deleted file mode 100644 index 08064623a6c7..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-oauth2-resource-server/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-oauth2-resource-server - Spring Boot OAuth2 Resource Server Smoke Test - Spring Boot OAuth2 Resource Server Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-oauth2-resource-server - - - org.springframework.boot - spring-boot-starter-web - - - - com.squareup.okhttp3 - mockwebserver - 3.9.0 - test - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-parent-context/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-parent-context/build.gradle new file mode 100644 index 000000000000..4596ddac2b01 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-parent-context/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot parent context smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-integration') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + implementation 'org.springframework.integration:spring-integration-file' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'org.awaitility:awaitility' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-parent-context/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-parent-context/pom.xml deleted file mode 100644 index 970261a078c8..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-parent-context/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-parent-context - Spring Boot Parent Context Smoke Test - Spring Boot Parent Context Smoke Test - - smoketest.parent.SampleParentContextApplication - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-integration - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.integration - spring-integration-file - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.awaitility - awaitility - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-profile/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-profile/build.gradle new file mode 100644 index 000000000000..70937058ffa0 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-profile/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot profile smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-profile/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-profile/pom.xml deleted file mode 100644 index c450b9540ab8..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-profile/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-profile - Spring Boot Profile Smoke Test - Spring Boot Profile Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-property-validation/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-property-validation/build.gradle new file mode 100644 index 000000000000..e430ee65d903 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-property-validation/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot property validation smoke test' + +dependencies { + annotationProcessor project(':spring-boot-project:spring-boot-tools:spring-boot-configuration-processor') + + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-property-validation/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-property-validation/pom.xml deleted file mode 100644 index 772aac45c5f1..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-property-validation/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-property-validation - Spring Boot Property Validation Smoke Test - Spring Boot Property Validation Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter - - - - org.springframework.boot - spring-boot-configuration-processor - true - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-quartz/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-quartz/build.gradle new file mode 100644 index 000000000000..792ce334e832 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-quartz/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Quartz smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jdbc') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-quartz') + + runtimeOnly 'com.h2database:h2' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'org.awaitility:awaitility' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-quartz/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-quartz/pom.xml deleted file mode 100644 index a31b639a0356..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-quartz/pom.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-quartz - Spring Boot Quartz Smoke Test - Spring Boot Quartz Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-jdbc - - - org.springframework.boot - spring-boot-starter-quartz - - - - com.h2database - h2 - runtime - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.awaitility - awaitility - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-reactive-oauth2-client/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-reactive-oauth2-client/build.gradle new file mode 100644 index 000000000000..7415212766f5 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-reactive-oauth2-client/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot reactive OAuth 2 client smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-oauth2-client') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-webflux') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'org.apache.httpcomponents:httpclient' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-reactive-oauth2-client/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-reactive-oauth2-client/pom.xml deleted file mode 100644 index 4ea448e9d63c..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-reactive-oauth2-client/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-reactive-oauth2-client - Spring Boot Reactive OAuth2 Client Smoke Test - Spring Boot Reactive OAuth2 Client Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-oauth2-client - - - org.springframework.boot - spring-boot-starter-webflux - - - - org.apache.httpcomponents - httpclient - test - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-reactive-oauth2-resource-server/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-reactive-oauth2-resource-server/build.gradle new file mode 100644 index 000000000000..0aee1a03c486 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-reactive-oauth2-resource-server/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot reactive OAuth 2 resource server smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-oauth2-resource-server') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-webflux') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'com.squareup.okhttp3:mockwebserver:3.9.0' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-reactive-oauth2-resource-server/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-reactive-oauth2-resource-server/pom.xml deleted file mode 100644 index 89056132a73d..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-reactive-oauth2-resource-server/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-reactive-oauth2-resource-server - Spring Boot Reactive OAuth2 Resource Server Smoke Test - Spring Boot OAuth2 Reactive Resource Server Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-oauth2-resource-server - - - org.springframework.boot - spring-boot-starter-webflux - - - - com.squareup.okhttp3 - mockwebserver - 3.9.0 - test - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-rsocket/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-rsocket/build.gradle new file mode 100644 index 000000000000..6176f9e03a0c --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-rsocket/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot RSocket smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-rsocket') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-security') + implementation 'org.springframework.security:spring-security-rsocket' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'io.projectreactor:reactor-test' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-rsocket/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-rsocket/pom.xml deleted file mode 100644 index 99bfae491f97..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-rsocket/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-rsocket - Spring Boot RSocket Smoke Test - Spring Boot RSocket Smoke Test - - ${basedir}/../../.. - / - - - - - org.springframework.boot - spring-boot-starter-rsocket - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.security - spring-security-rsocket - - - - org.springframework.boot - spring-boot-starter-test - test - - - io.projectreactor - reactor-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-saml2-service-provider/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-saml2-service-provider/build.gradle new file mode 100644 index 000000000000..9cf22b2ea34e --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-saml2-service-provider/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot SAML 2 service provider smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + implementation 'org.springframework.security:spring-security-config' + implementation 'org.springframework.security:spring-security-saml2-service-provider' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-saml2-service-provider/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-saml2-service-provider/pom.xml deleted file mode 100644 index a09b044368b9..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-saml2-service-provider/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-saml2-service-provider - Spring Boot SAML2 Service Provider Smoke Test - Spring Boot SAML2 Service Provider Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.security - spring-security-config - - - org.springframework.security - spring-security-saml2-service-provider - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-jersey/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-jersey/build.gradle new file mode 100644 index 000000000000..c8d2548a58b7 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-jersey/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot secure Jersey smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jersey') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-security') + implementation 'org.jolokia:jolokia-core' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-jersey/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-jersey/pom.xml deleted file mode 100644 index 5ad8da0f5d69..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-jersey/pom.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-secure-jersey - jar - Spring Boot Secure Jersey Smoke Test - Spring Boot Secure Jersey Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-jersey - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-security - - - org.jolokia - jolokia-core - - - - org.springframework.boot - spring-boot-starter-tomcat - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - generate build info - - build-info - - - - - - - - - java9+ - - [9,) - - - - javax.xml.bind - jaxb-api - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-webflux/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-webflux/build.gradle new file mode 100644 index 000000000000..66f73aedce85 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-webflux/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot secure WebFlux smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-security') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-webflux') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'io.projectreactor:reactor-test' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-webflux/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-webflux/pom.xml deleted file mode 100644 index c92dcf50529d..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-webflux/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-secure-webflux - Spring Boot Secure WebFlux Smoke Test - Spring Boot Secure WebFlux Smoke Test - - ${basedir}/../../.. - / - - - - - org.springframework.boot - spring-boot-starter-webflux - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-security - - - - org.springframework.boot - spring-boot-starter-test - test - - - io.projectreactor - reactor-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - generate build info - - build-info - - - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure/build.gradle new file mode 100644 index 000000000000..e4bd622b0be7 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Security smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-security') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure/pom.xml deleted file mode 100644 index 8e3eec4a94b0..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-secure - Spring Boot Security Smoke Test - Spring Boot Security Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-security - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-servlet/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-servlet/build.gradle new file mode 100644 index 000000000000..3cd180ab4304 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-servlet/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'war' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Servlet smoke test' + +dependencies { + compileOnly project(':spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-security') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testRuntimeOnly project(':spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-servlet/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-servlet/pom.xml deleted file mode 100644 index e40be5a1b080..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-servlet/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-servlet - war - Spring Boot Servlet Smoke Test - Spring Boot Servlet Smoke Test - - ${basedir}/../../.. - / - - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-security - - - - org.springframework.boot - spring-boot-starter-tomcat - provided - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-webflux/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-webflux/build.gradle new file mode 100644 index 000000000000..4fee4d429f0d --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-webflux/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Session WebFlux smoke test' + +def sessionStores = [ + 'mongodb': [ + project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-mongodb-reactive'), + 'de.flapdoodle.embed:de.flapdoodle.embed.mongo', + 'org.springframework.session:spring-session-data-mongodb' + ], + 'redis': [ + project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-redis-reactive'), + 'org.springframework.session:spring-session-data-redis' + ] +] + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-security') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-webflux') + + sessionStores[project.findProperty('sessionStore') ?: 'mongodb'].each { runtimeOnly it } + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-webflux/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-webflux/pom.xml deleted file mode 100644 index 4028c68679b4..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-webflux/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-session-webflux - Spring Boot Session WebFlux Smoke Test - Spring Boot Session WebFlux Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-webflux - - - org.springframework.boot - spring-boot-starter-security - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - redis - - - org.springframework.session - spring-session-data-redis - - - org.springframework.boot - spring-boot-starter-data-redis-reactive - - - - - mongodb - - true - - - - org.springframework.session - spring-session-data-mongodb - - - org.springframework.boot - spring-boot-starter-data-mongodb-reactive - - - de.flapdoodle.embed - de.flapdoodle.embed.mongo - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session/build.gradle new file mode 100644 index 000000000000..46cc84d54a89 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session/build.gradle @@ -0,0 +1,36 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Session smoke test' + +def sessionStores = [ + 'hazelcast': [ + 'com.hazelcast:hazelcast', + 'org.springframework.session:spring-session-hazelcast' + ], + 'jdbc': [ + project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jdbc'), + 'org.springframework.session:spring-session-jdbc' , + 'com.h2database:h2' + ], + 'mongodb': [ + project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-mongodb'), + 'org.springframework.session:spring-session-data-mongodb' + ], + 'redis': [ + project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-redis'), + 'org.springframework.session:spring-session-data-redis' + ] +] + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-security') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + sessionStores[project.findProperty('sessionStore') ?: 'jdbc'].each { runtimeOnly it } + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session/pom.xml deleted file mode 100644 index a806f3a00653..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session/pom.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-session - Spring Boot Session Smoke Test - Spring Boot Session Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-actuator - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - redis - - - org.springframework.session - spring-session-data-redis - - - org.springframework.boot - spring-boot-starter-data-redis - - - - - jdbc - - true - - - - org.springframework.session - spring-session-jdbc - - - org.springframework.boot - spring-boot-starter-jdbc - - - com.h2database - h2 - - - - - hazelcast - - - org.springframework.session - spring-session-hazelcast - - - com.hazelcast - hazelcast - - - - - mongodb - - - org.springframework.session - spring-session-data-mongodb - - - org.springframework.boot - spring-boot-starter-data-mongodb - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-simple/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-simple/build.gradle new file mode 100644 index 000000000000..c038dfeb9a60 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-simple/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Simple smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + implementation 'jakarta.validation:jakarta.validation-api' + implementation('org.hibernate.validator:hibernate-validator') { + exclude group: 'javax.validation' + } + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-simple/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-simple/pom.xml deleted file mode 100644 index 7fca8bb43a13..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-simple/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-simple - Spring Boot Simple Smoke Test - Spring Boot Simple Smoke Test - - ${basedir}/../../.. - - - - - jakarta.validation - jakarta.validation-api - - - org.springframework.boot - spring-boot-starter - - - org.hibernate.validator - hibernate-validator - - - javax.validation - validation-api - - - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test-nomockito/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test-nomockito/build.gradle new file mode 100644 index 000000000000..88d23d3fa89d --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test-nomockito/build.gradle @@ -0,0 +1,18 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Test no Mockito smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + runtimeOnly 'com.h2database:h2' + + testImplementation project(':spring-boot-project:spring-boot-test') + testImplementation 'org.assertj:assertj-core' + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.springframework:spring-test' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test-nomockito/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test-nomockito/pom.xml deleted file mode 100644 index 6f239374fdf9..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test-nomockito/pom.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-test-nomockito - Spring Boot Test No Mockito Smoke Test - Spring Boot Test No Mockito Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter - - - - org.springframework.boot - spring-boot-test - test - - - org.assertj - assertj-core - test - - - org.junit.jupiter - junit-jupiter-engine - test - - - org.springframework - spring-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/build.gradle new file mode 100644 index 000000000000..b4470ce1263a --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/build.gradle @@ -0,0 +1,18 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Test smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-data-jpa') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + runtimeOnly 'com.h2database:h2' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'org.seleniumhq.selenium:selenium-api' + testImplementation 'org.seleniumhq.selenium:htmlunit-driver' + testImplementation 'net.sourceforge.htmlunit:htmlunit' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/pom.xml deleted file mode 100644 index fc6c5a58d8e7..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-test/pom.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-test - Spring Boot Test Smoke Test - Spring Boot Test Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.seleniumhq.selenium - selenium-api - - - com.h2database - h2 - - - mysql - mysql-connector-java - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.seleniumhq.selenium - htmlunit-driver - test - - - net.sourceforge.htmlunit - htmlunit - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - java9+ - - [9,) - - - - jakarta.xml.bind - jakarta.xml.bind-api - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-testng/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-testng/build.gradle new file mode 100644 index 000000000000..0bfa9d67c6c8 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-testng/build.gradle @@ -0,0 +1,21 @@ +plugins { + id 'java' +// id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot TestNG smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat') + implementation 'org.springframework:spring-webmvc' + + testImplementation project(':spring-boot-project:spring-boot-test') + testImplementation 'org.assertj:assertj-core' + testImplementation 'org.springframework:spring-test' + testImplementation 'org.testng:testng:6.8.13' +} + +test { + useTestNG() +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-testng/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-testng/pom.xml deleted file mode 100644 index 28c4100b31b7..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-testng/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-testng - Spring Boot TestNG Smoke Test - Spring Boot TestNG Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-tomcat - - - org.springframework - spring-webmvc - - - - org.springframework - spring-test - test - - - org.springframework.boot - spring-boot-test - test - - - org.testng - testng - 6.8.13 - test - - - org.assertj - assertj-core - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-testng/src/test/java/smoketest/testng/SampleTestNGApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-testng/src/test/java/smoketest/testng/SampleTestNGApplicationTests.java index 84cf1b164bb4..0d382dbc0885 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-testng/src/test/java/smoketest/testng/SampleTestNGApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-testng/src/test/java/smoketest/testng/SampleTestNGApplicationTests.java @@ -34,13 +34,13 @@ * @author Phillip Webb */ @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) -class SampleTestNGApplicationTests extends AbstractTestNGSpringContextTests { +public class SampleTestNGApplicationTests extends AbstractTestNGSpringContextTests { @Autowired private TestRestTemplate restTemplate; @Test - void testHome() { + public void testHome() { ResponseEntity entity = this.restTemplate.getForEntity("/", String.class); assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(entity.getBody()).isEqualTo("Hello World"); diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-jsp/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-jsp/build.gradle new file mode 100644 index 000000000000..e7b096cfccba --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-jsp/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'war' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Tomcat JSP smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + providedRuntime project(':spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat') + providedRuntime 'javax.servlet:jstl' + providedRuntime 'org.apache.tomcat.embed:tomcat-embed-jasper' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-jsp/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-jsp/pom.xml deleted file mode 100644 index 09a70d9579cc..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-jsp/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-tomcat-jsp - war - Spring Boot Tomcat JSP Smoke Test - Spring Boot Tomcat JSP Smoke Test - - ${basedir}/../../.. - / - - - - - org.springframework.boot - spring-boot-starter-web - - - javax.servlet - jstl - - - - org.apache.tomcat.embed - tomcat-embed-jasper - provided - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - false - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/build.gradle new file mode 100644 index 000000000000..5079c8f8a016 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Tomcat multi-connectors smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'org.apache.httpcomponents:httpclient' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/pom.xml deleted file mode 100644 index 7aef1489a83e..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-multi-connectors/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-tomcat-multi-connectors - Spring Boot Multi-Connector Tomcat Smoke Test - Spring Boot Multi-Connector Tomcat Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.apache.httpcomponents - httpclient - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-ssl/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-ssl/build.gradle new file mode 100644 index 000000000000..08d55bdb6cf1 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-ssl/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Tomcat SSL smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'org.apache.httpcomponents:httpclient' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-ssl/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-ssl/pom.xml deleted file mode 100644 index 4b9acb73d449..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat-ssl/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-tomcat-ssl - Spring Boot Tomcat SSL Smoke Test - Spring Boot Tomcat SSL Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.apache.httpcomponents - httpclient - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/build.gradle new file mode 100644 index 000000000000..befc755c958b --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Tomcat smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat') + implementation 'org.springframework:spring-webmvc' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/pom.xml deleted file mode 100644 index 1be0cce0f228..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-tomcat/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-tomcat - Spring Boot Tomcat Smoke Test - Spring Boot Tomcat Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-tomcat - - - org.springframework - spring-webmvc - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-traditional/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-traditional/build.gradle new file mode 100644 index 000000000000..a52687531480 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-traditional/build.gradle @@ -0,0 +1,17 @@ +plugins { + id 'war' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot traditional deployment smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + implementation 'org.springframework:spring-webmvc' + + providedRuntime project(':spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat') + providedRuntime 'org.apache.tomcat.embed:tomcat-embed-jasper' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'org.apache.httpcomponents:httpclient' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-traditional/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-traditional/pom.xml deleted file mode 100644 index be279b47f7b2..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-traditional/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-traditional - war - Spring Boot Traditional Smoke Test - Spring Boot Traditional Smoke Test - - ${basedir}/../../.. - / - - - - - org.springframework.boot - spring-boot-starter - - - org.springframework - spring-webmvc - - - - org.springframework.boot - spring-boot-starter-tomcat - provided - - - org.apache.tomcat.embed - tomcat-embed-jasper - provided - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-undertow-ssl/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-undertow-ssl/build.gradle new file mode 100644 index 000000000000..0af2b289b4cc --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-undertow-ssl/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Undertow SSL smoke test' + +dependencies { + implementation(project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web')) { + exclude module: 'spring-boot-starter-tomcat' + } + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-undertow') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'org.apache.httpcomponents:httpclient' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-undertow-ssl/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-undertow-ssl/pom.xml deleted file mode 100644 index bf42c115058e..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-undertow-ssl/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-undertow-ssl - Spring Boot Undertow SSL Smoke Test - Spring Boot Undertow SSL Smoke Test - - ${basedir}/../../.. - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - org.springframework.boot - spring-boot-starter-undertow - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.apache.httpcomponents - httpclient - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-undertow/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-undertow/build.gradle new file mode 100644 index 000000000000..1296d950eb63 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-undertow/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Undertow smoke test' + +dependencies { + implementation(project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web')) { + exclude module: 'spring-boot-starter-tomcat' + } + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-undertow') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-undertow/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-undertow/pom.xml deleted file mode 100644 index 6596725af76d..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-undertow/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-undertow - Spring Boot Undertow Smoke Test - Spring Boot Undertow Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - org.springframework.boot - spring-boot-starter-undertow - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-war/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-war/build.gradle new file mode 100644 index 000000000000..dc133506d389 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-war/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'war' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot war smoke test' + +dependencies { + implementation(project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web')) { + exclude module: 'spring-boot-starter-tomcat' + } + providedCompile enforcedPlatform(project(':spring-boot-project:spring-boot-dependencies')) + providedCompile 'jakarta.servlet:jakarta.servlet-api' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-war/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-war/pom.xml deleted file mode 100644 index 4c3dcf6e747c..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-war/pom.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-war - war - Spring Boot War Smoke Test - Spring Boot War Smoke Test - - ${basedir}/../../.. - / - - - - - org.springframework.boot - spring-boot-starter - - - - jakarta.servlet - jakarta.servlet-api - provided - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - - org.springframework.boot - spring-boot-devtools - provided - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - tomcat - - - org.springframework.boot - spring-boot-starter-tomcat - provided - - - - - jetty - - - org.springframework.boot - spring-boot-starter-jetty - provided - - - - - undertow - - - org.springframework.boot - spring-boot-starter-undertow - provided - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-freemarker/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-freemarker/build.gradle new file mode 100644 index 000000000000..5a509586ca30 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-freemarker/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot web FreeMarker smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-freemarker') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-freemarker/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-freemarker/pom.xml deleted file mode 100644 index 290e34877aa5..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-freemarker/pom.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-web-freemarker - Spring Boot Web FreeMarker Smoke Test - Spring Boot Web FreeMarker Smoke Test - - ${basedir}/../../.. - / - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-freemarker - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - true - - - - org.apache.maven.plugins - maven-surefire-plugin - - false - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/build.gradle new file mode 100644 index 000000000000..5079cdb18e9b --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot web Groovy Templates smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-groovy-templates') + if (JavaVersion.current().java9Compatible) { + implementation 'jakarta.xml.bind:jakarta.xml.bind-api' + } + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/pom.xml deleted file mode 100755 index b383378db9bb..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-groovy-templates/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-web-groovy-templates - Spring Boot Web Groovy Templates Smoke Test - Spring Boot Web Groovy Templates Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-groovy-templates - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - java9+ - - [9,) - - - - jakarta.xml.bind - jakarta.xml.bind-api - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-jsp/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-jsp/build.gradle new file mode 100644 index 000000000000..259deb0cdd61 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-jsp/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'war' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot web JSP smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + providedRuntime project(':spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat') + providedRuntime 'javax.servlet:jstl' + providedRuntime 'org.apache.tomcat.embed:tomcat-embed-jasper' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-jsp/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-jsp/pom.xml deleted file mode 100644 index 1d98da248070..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-jsp/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-web-jsp - war - Spring Boot Web JSP Smoke Test - Spring Boot Web JSP Smoke Test - - ${basedir}/../../.. - / - - - - - org.springframework.boot - spring-boot-starter-web - - - javax.servlet - jstl - - - - org.springframework.boot - spring-boot-starter-tomcat - provided - - - org.apache.tomcat.embed - tomcat-embed-jasper - provided - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - false - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-method-security/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-method-security/build.gradle new file mode 100644 index 000000000000..4aaafa2627ed --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-method-security/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot web method security smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-security') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-thymeleaf') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-method-security/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-method-security/pom.xml deleted file mode 100644 index acaceaa0523f..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-method-security/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-web-method-security - Spring Boot Web Method Security Smoke Test - Spring Boot Web Method Security Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-mustache/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-mustache/build.gradle new file mode 100644 index 000000000000..6153f7d14817 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-mustache/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot web Mustache smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-mustache') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-mustache/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-mustache/pom.xml deleted file mode 100644 index 4e37f23b7d07..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-mustache/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-web-mustache - Spring Boot Web Mustache Smoke Test - Spring Boot Web Mustache Smoke Test - - ${basedir}/../../.. - / - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-mustache - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - false - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure-custom/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure-custom/build.gradle new file mode 100644 index 000000000000..00bb73374d3a --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure-custom/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot web secure custom smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-security') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-thymeleaf') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'org.apache.httpcomponents:httpclient' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure-custom/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure-custom/pom.xml deleted file mode 100644 index 14b8eed03b81..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure-custom/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-web-secure-custom - Spring Boot Web Secure Custom Smoke Test - Spring Boot Web Secure Custom Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - - org.apache.httpcomponents - httpclient - test - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure-jdbc/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure-jdbc/build.gradle new file mode 100644 index 000000000000..38a45ceeaecf --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure-jdbc/build.gradle @@ -0,0 +1,18 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot web secure JDBC smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jdbc') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-security') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-thymeleaf') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + runtimeOnly 'com.h2database:h2' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'org.apache.httpcomponents:httpclient' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure-jdbc/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure-jdbc/pom.xml deleted file mode 100644 index 2cdd189e060d..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure-jdbc/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-web-secure-jdbc - Spring Boot Web Secure JDBC Smoke Test - Spring Boot Web Secure JDBC Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.boot - spring-boot-starter-jdbc - - - com.h2database - h2 - - - - org.apache.httpcomponents - httpclient - test - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure/build.gradle new file mode 100644 index 000000000000..6c37b1940c5b --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure/build.gradle @@ -0,0 +1,16 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot web secure smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-security') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-thymeleaf') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'org.apache.httpcomponents:httpclient' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure/pom.xml deleted file mode 100644 index 23c5128793d3..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-secure/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-web-secure - Spring Boot Web Secure Smoke Test - Spring Boot Web Secure Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - - org.apache.httpcomponents - httpclient - test - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-static/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-static/build.gradle new file mode 100644 index 000000000000..36752d7f4b22 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-static/build.gradle @@ -0,0 +1,17 @@ +plugins { + id 'war' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot web static smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + providedRuntime project(':spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat') + + runtimeOnly 'org.webjars:bootstrap:3.0.3' + runtimeOnly 'org.webjars:jquery:2.0.3-1' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-static/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-static/pom.xml deleted file mode 100644 index 026ed3c5d115..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-static/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-web-static - war - Spring Boot Web Static Smoke Test - Spring Boot Web Static Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-web - - - org.webjars - bootstrap - 3.0.3 - - - org.webjars - jquery - 2.0.3-1 - - - - org.springframework.boot - spring-boot-starter-tomcat - provided - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-ui/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-ui/build.gradle new file mode 100644 index 000000000000..bececbfb5d16 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-ui/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot web UI smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-thymeleaf') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-ui/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-ui/pom.xml deleted file mode 100755 index e7eb24620568..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-web-ui/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-web-ui - Spring Boot Web UI Smoke Test - Spring Boot Web UI Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.boot - spring-boot-devtools - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/build.gradle new file mode 100644 index 000000000000..c9303314ef07 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'org.jetbrains.kotlin.jvm' + id 'org.jetbrains.kotlin.plugin.spring' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot WebFlux coroutines smoke test' + +compileKotlin { + kotlinOptions { + jvmTarget = '1.8' + } +} + +compileTestKotlin { + kotlinOptions { + jvmTarget = '1.8' + } +} + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-webflux') + implementation 'com.fasterxml.jackson.module:jackson-module-kotlin' + implementation 'org.jetbrains.kotlin:kotlin-reflect' + implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-reactor' + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'io.projectreactor:reactor-test' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/pom.xml deleted file mode 100644 index a7396bfd16e8..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/pom.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-webflux-coroutines - Spring Boot WebFlux Coroutines Smoke Test - Spring Boot WebFlux Coroutines Smoke Test - - ${basedir}/../../.. - / - - - - - org.springframework.boot - spring-boot-starter-webflux - - - - org.jetbrains.kotlin - kotlin-reflect - - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - - - org.jetbrains.kotlinx - kotlinx-coroutines-reactor - - - - com.fasterxml.jackson.module - jackson-module-kotlin - - - - org.springframework.boot - spring-boot-starter-test - test - - - - ${project.basedir}/src/main/kotlin - ${project.basedir}/src/test/kotlin - - - org.springframework.boot - spring-boot-maven-plugin - - - org.jetbrains.kotlin - kotlin-maven-plugin - - - -Xjsr305=strict - - - spring - - - - - org.jetbrains.kotlin - kotlin-maven-allopen - ${kotlin.version} - - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux/build.gradle new file mode 100644 index 000000000000..75a3810821b0 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot WebFlux smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-actuator') + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-webflux') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') + testImplementation 'io.projectreactor:reactor-test' +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux/pom.xml deleted file mode 100644 index 92f01fbcefd2..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux/pom.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-webflux - Spring Boot WebFlux Smoke Test - Spring Boot WebFlux Smoke Test - - ${basedir}/../../.. - / - - - - - org.springframework.boot - spring-boot-starter-webflux - - - org.springframework.boot - spring-boot-starter-actuator - - - - org.springframework.boot - spring-boot-starter-test - test - - - io.projectreactor - reactor-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - generate build info - - build-info - - - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webservices/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webservices/build.gradle new file mode 100644 index 000000000000..3de88c8ed974 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webservices/build.gradle @@ -0,0 +1,21 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot Web Services smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-web-services') + implementation 'org.jdom:jdom2' + + runtimeOnly 'jaxen:jaxen' + runtimeOnly 'wsdl4j:wsdl4j' + + if (JavaVersion.current().java11Compatible) { + runtimeOnly 'jakarta.activation:jakarta.activation-api' + runtimeOnly 'org.glassfish.jaxb:jaxb-runtime' + } + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webservices/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webservices/pom.xml deleted file mode 100644 index ca75ff62fed1..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webservices/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-webservices - Spring Boot Web Services Smoke Test - Spring Boot Web Services Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-web-services - - - jaxen - jaxen - - - org.jdom - jdom2 - - - wsdl4j - wsdl4j - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - java11+ - - [11,) - - - - jakarta.activation - jakarta.activation-api - - - org.glassfish.jaxb - jaxb-runtime - - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/build.gradle new file mode 100644 index 000000000000..1adb130385d3 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot WebSocket Jetty smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-jetty') + implementation(project(':spring-boot-project:spring-boot-starters:spring-boot-starter-websocket')) { + exclude module: 'spring-boot-starter-tomcat' + } + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/pom.xml deleted file mode 100755 index 1c03905144a4..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-websocket-jetty - Spring Boot WebSocket Jetty Smoke Test - Spring Boot WebSocket Jetty Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-websocket - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - org.springframework.boot - spring-boot-starter-jetty - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/build.gradle new file mode 100644 index 000000000000..36f289fc4661 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot WebSocket Tomcat smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-websocket') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/pom.xml deleted file mode 100755 index fed614e0c89b..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-websocket-tomcat - Spring Boot WebSocket Tomcat Smoke Test - Spring Boot WebSocket Tomcat Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-websocket - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/build.gradle new file mode 100644 index 000000000000..4d6e98bd4a26 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/build.gradle @@ -0,0 +1,15 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot WebSocket Undertow smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-undertow') + implementation(project(':spring-boot-project:spring-boot-starters:spring-boot-starter-websocket')) { + exclude module: 'spring-boot-starter-tomcat' + } + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/pom.xml deleted file mode 100755 index cf44c04ed72c..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-websocket-undertow - Spring Boot WebSocket Undertow Smoke Test - Spring Boot WebSocket Undertow Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter-websocket - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - org.springframework.boot - spring-boot-starter-undertow - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-xml/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-xml/build.gradle new file mode 100644 index 000000000000..86c2cc77cb78 --- /dev/null +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-xml/build.gradle @@ -0,0 +1,12 @@ +plugins { + id 'java' + id 'org.springframework.boot.conventions' +} + +description = 'Spring Boot XML smoke test' + +dependencies { + implementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter') + + testImplementation project(':spring-boot-project:spring-boot-starters:spring-boot-starter-test') +} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-xml/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-xml/pom.xml deleted file mode 100644 index d4a9abb4d9d0..000000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-xml/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-smoke-tests - ${revision} - - spring-boot-smoke-test-xml - Spring Boot XML Smoke Test - Spring Boot XML Smoke Test - - ${basedir}/../../.. - - - - - org.springframework.boot - spring-boot-starter - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/src/checkstyle/checkstyle-suppressions.xml b/src/checkstyle/checkstyle-suppressions.xml index 1f7a85c54744..8361ff02ee19 100644 --- a/src/checkstyle/checkstyle-suppressions.xml +++ b/src/checkstyle/checkstyle-suppressions.xml @@ -42,4 +42,6 @@ + + diff --git a/src/checkstyle/checkstyle.xml b/src/checkstyle/checkstyle.xml index 22449bf75401..e759f663af0e 100644 --- a/src/checkstyle/checkstyle.xml +++ b/src/checkstyle/checkstyle.xml @@ -3,8 +3,11 @@ "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd"> + + + - + @@ -20,7 +23,7 @@ + value="${config_loc}/import-control.xml" />