diff --git a/.bomr/bomr.yaml b/.bomr/bomr.yaml deleted file mode 100644 index a9ac945f30..0000000000 --- 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 4dbf2657a9..d37eb49a80 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 f432c96022..0000000000 --- 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 e89f07c229..0000000000 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 a84b7ef2d6..0000000000 --- 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 6c3c7c551b..04a4ef94b7 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 0000000000..bc35a69d00 --- /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 0000000000..44c7bc7f43 --- /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 0000000000..b0587d4d33 --- /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 0000000000..ce6d3a43da --- /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 0000000000..132940f685 --- /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 0000000000..30aa02b726 --- /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 0000000000..30dc9d3db1 --- /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 0000000000..d7fcbfdcbc --- /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 0000000000..c4664062b4 --- /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 0000000000..7c2c77b4d2 --- /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 0000000000..6302342dd7 --- /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 0000000000..e524749a0d --- /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 0000000000..9b08ede52d --- /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 0000000000..cde5d53513 --- /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 0000000000..e28447838c --- /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 0000000000..831d3b4f85 --- /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 0000000000..b216e9e382 --- /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 0000000000..d29f6b0759 --- /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 0000000000..e0457fe8f4 --- /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 0000000000..7da198a5f1 --- /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/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeResolver.java b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeResolver.java new file mode 100644 index 0000000000..ed1805eca0 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/UpgradeResolver.java @@ -0,0 +1,38 @@ +/* + * 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.Collection; +import java.util.List; + +import org.springframework.boot.build.bom.Library; + +/** + * Resolves upgrades for the libraries in a bom. + * + * @author Andy Wilkinson + */ +interface UpgradeResolver { + + /** + * 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 0000000000..70b1c9298c --- /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 0000000000..879caec26e --- /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 0000000000..3c49ba56d5 --- /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 0000000000..f50dd28c48 --- /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 0000000000..5be432a0ac --- /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 0000000000..6eced35271 --- /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 0000000000..0192c64f6f --- /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 0000000000..8ff9408ef9 --- /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 0000000000..8a910d6b60 --- /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 0000000000..a344a5c0e6 --- /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 0000000000..5514b8b652 --- /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 0000000000..363def7d80 --- /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 0000000000..b3626d1984 --- /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 0000000000..02822beaec --- /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 0000000000..b5096ed115 --- /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 0000000000..301304deb7 --- /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 0000000000..f0592979d3 --- /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/buildSrc/src/main/java/org/springframework/boot/build/cli/HomebrewFormula.java b/buildSrc/src/main/java/org/springframework/boot/build/cli/HomebrewFormula.java new file mode 100644 index 0000000000..5592d30617 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/cli/HomebrewFormula.java @@ -0,0 +1,35 @@ +/* + * 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.cli; + +import java.util.Collections; + +import org.gradle.api.tasks.TaskAction; + +/** + * 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/buildSrc/src/main/java/org/springframework/boot/build/cli/ScoopManifest.java b/buildSrc/src/main/java/org/springframework/boot/build/cli/ScoopManifest.java new file mode 100644 index 0000000000..de671c8da1 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/cli/ScoopManifest.java @@ -0,0 +1,36 @@ +/* + * 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.cli; + +import java.util.Collections; + +import org.gradle.api.tasks.TaskAction; + +/** + * A {@Task} for creating a Scoop manifest. + * + * @author Andy Wilkinson + */ +public class ScoopManifest extends AbstractPackageManagerDefinitionTask { + + @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 0000000000..101039e9fd --- /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 0000000000..3151560b7f --- /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/buildSrc/src/main/java/org/springframework/boot/build/context/properties/AsciidocBuilder.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/AsciidocBuilder.java new file mode 100644 index 0000000000..305da3abcf --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/AsciidocBuilder.java @@ -0,0 +1,59 @@ +/* + * 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; + +/** + * Simple builder to help construct Asciidoc markup. + * + * @author Phillip Webb + */ +class AsciidocBuilder { + + private final StringBuilder content; + + AsciidocBuilder() { + this.content = new StringBuilder(); + } + + AsciidocBuilder appendKey(Object... items) { + for (Object item : items) { + appendln("`+", item, "+` +"); + } + return this; + } + + AsciidocBuilder newLine() { + return append(System.lineSeparator()); + } + + AsciidocBuilder appendln(Object... items) { + return append(items).newLine(); + } + + AsciidocBuilder append(Object... items) { + for (Object item : items) { + this.content.append(item); + } + return this; + } + + @Override + public String toString() { + return this.content.toString(); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/context/properties/CompoundConfigurationTableEntry.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/CompoundConfigurationTableEntry.java new file mode 100644 index 0000000000..f045b5d730 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/CompoundConfigurationTableEntry.java @@ -0,0 +1,51 @@ +/* + * 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.util.Set; +import java.util.TreeSet; +import java.util.stream.Stream; + +/** + * Table entry regrouping a list of configuration properties sharing the same description. + * + * @author Brian Clozel + */ +class CompoundConfigurationTableEntry extends ConfigurationTableEntry { + + private Set configurationKeys; + + private String description; + + CompoundConfigurationTableEntry(String key, String description) { + this.key = key; + this.description = description; + this.configurationKeys = new TreeSet<>(); + } + + void addConfigurationKeys(ConfigurationProperty... properties) { + Stream.of(properties).map(ConfigurationProperty::getName).forEach(this.configurationKeys::add); + } + + @Override + void write(AsciidocBuilder builder) { + builder.append("|"); + this.configurationKeys.forEach(builder::appendKey); + builder.newLine().appendln("|").appendln("|+++", this.description, "+++"); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationMetadataDocumentWriter.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationMetadataDocumentWriter.java new file mode 100644 index 0000000000..f566107322 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationMetadataDocumentWriter.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.context.properties; + +import java.io.IOException; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.gradle.api.file.FileCollection; + +/** + * Write Asciidoc documents with configuration properties listings. + * + * @author Brian Clozel + * @since 2.0.0 + */ +public class ConfigurationMetadataDocumentWriter { + + public void writeDocument(Path outputDirectory, DocumentOptions options, FileCollection metadataFiles) + throws IOException { + assertValidOutputDirectory(outputDirectory); + if (!Files.exists(outputDirectory)) { + Files.createDirectory(outputDirectory); + } + List tables = createConfigTables(ConfigurationProperties.fromFiles(metadataFiles), options); + for (ConfigurationTable table : tables) { + writeConfigurationTable(table, outputDirectory); + } + } + + private void assertValidOutputDirectory(Path outputDirPath) { + if (outputDirPath == null) { + throw new IllegalArgumentException("output path should not be null"); + } + if (Files.exists(outputDirPath) && !Files.isDirectory(outputDirPath)) { + throw new IllegalArgumentException("output path already exists and is not a directory"); + } + } + + private List createConfigTables(Map metadataProperties, + DocumentOptions options) { + List tables = new ArrayList<>(); + List unmappedKeys = metadataProperties.values().stream().filter((property) -> !property.isDeprecated()) + .map(ConfigurationProperty::getName).collect(Collectors.toList()); + Map overrides = getOverrides(metadataProperties, unmappedKeys, + options); + options.getMetadataSections().forEach((id, keyPrefixes) -> tables + .add(createConfigTable(metadataProperties, unmappedKeys, overrides, id, keyPrefixes))); + if (!unmappedKeys.isEmpty()) { + throw new IllegalStateException( + "The following keys were not written to the documentation: " + String.join(", ", unmappedKeys)); + } + if (!overrides.isEmpty()) { + throw new IllegalStateException("The following keys were not written to the documentation: " + + String.join(", ", overrides.keySet())); + } + return tables; + } + + private Map getOverrides( + Map metadataProperties, List unmappedKeys, DocumentOptions options) { + Map overrides = new HashMap<>(); + options.getOverrides().forEach((keyPrefix, description) -> { + CompoundConfigurationTableEntry entry = new CompoundConfigurationTableEntry(keyPrefix, description); + List matchingKeys = unmappedKeys.stream().filter((key) -> key.startsWith(keyPrefix)) + .collect(Collectors.toList()); + for (String matchingKey : matchingKeys) { + entry.addConfigurationKeys(metadataProperties.get(matchingKey)); + } + overrides.put(keyPrefix, entry); + unmappedKeys.removeAll(matchingKeys); + }); + return overrides; + } + + private ConfigurationTable createConfigTable(Map metadataProperties, + List unmappedKeys, Map overrides, String id, + List keyPrefixes) { + ConfigurationTable table = new ConfigurationTable(id); + for (String keyPrefix : keyPrefixes) { + List matchingOverrides = overrides.keySet().stream() + .filter((overrideKey) -> overrideKey.startsWith(keyPrefix)).collect(Collectors.toList()); + matchingOverrides.forEach((match) -> table.addEntry(overrides.remove(match))); + } + List matchingKeys = unmappedKeys.stream() + .filter((key) -> keyPrefixes.stream().anyMatch(key::startsWith)).collect(Collectors.toList()); + for (String matchingKey : matchingKeys) { + ConfigurationProperty property = metadataProperties.get(matchingKey); + table.addEntry(new SingleConfigurationTableEntry(property)); + } + unmappedKeys.removeAll(matchingKeys); + return table; + } + + private void writeConfigurationTable(ConfigurationTable table, Path outputDirectory) throws IOException { + Path outputFilePath = outputDirectory.resolve(table.getId() + ".adoc"); + Files.deleteIfExists(outputFilePath); + Files.createFile(outputFilePath); + try (OutputStream outputStream = Files.newOutputStream(outputFilePath)) { + outputStream.write(table.toAsciidocTable().getBytes(StandardCharsets.UTF_8)); + } + } + +} 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 0000000000..5fa43adee1 --- /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 0000000000..81f51281fb --- /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 0000000000..e66c236f47 --- /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/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationTable.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationTable.java new file mode 100644 index 0000000000..533c0b8365 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationTable.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.context.properties; + +import java.util.Arrays; +import java.util.Set; +import java.util.TreeSet; + +/** + * Asciidoctor table listing configuration properties sharing to a common theme. + * + * @author Brian Clozel + */ +class ConfigurationTable { + + private final String id; + + private final Set entries; + + ConfigurationTable(String id) { + this.id = id; + this.entries = new TreeSet<>(); + } + + String getId() { + return this.id; + } + + void addEntry(ConfigurationTableEntry... entries) { + this.entries.addAll(Arrays.asList(entries)); + } + + String toAsciidocTable() { + AsciidocBuilder builder = new AsciidocBuilder(); + builder.appendln("[cols=\"1,1,2\", options=\"header\"]"); + builder.appendln("|==="); + builder.appendln("|Key|Default Value|Description"); + builder.appendln(); + this.entries.forEach((entry) -> { + entry.write(builder); + builder.appendln(); + }); + return builder.appendln("|===").toString(); + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationTableEntry.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationTableEntry.java new file mode 100644 index 0000000000..a0ebc3361b --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationTableEntry.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.context.properties; + +/** + * Abstract class for entries in {@link ConfigurationTable}. + * + * @author Brian Clozel + */ +abstract class ConfigurationTableEntry implements Comparable { + + protected String key; + + String getKey() { + return this.key; + } + + abstract void write(AsciidocBuilder builder); + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + ConfigurationTableEntry other = (ConfigurationTableEntry) obj; + return this.key.equals(other.key); + } + + @Override + public int hashCode() { + return this.key.hashCode(); + } + + @Override + public int compareTo(ConfigurationTableEntry other) { + return this.key.compareTo(other.getKey()); + } + +} 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 0000000000..bb38138e2c --- /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/buildSrc/src/main/java/org/springframework/boot/build/context/properties/DocumentOptions.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/DocumentOptions.java new file mode 100644 index 0000000000..53fc4adec3 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/DocumentOptions.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.context.properties; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Options for generating documentation for configuration properties. + * + * @author Brian Clozel + * @since 2.0.0 + */ +public final class DocumentOptions { + + private final Map> metadataSections; + + private final Map overrides; + + private DocumentOptions(Map> metadataSections, Map overrides) { + this.metadataSections = metadataSections; + this.overrides = overrides; + } + + Map> getMetadataSections() { + return this.metadataSections; + } + + Map getOverrides() { + return this.overrides; + } + + static Builder builder() { + return new Builder(); + } + + /** + * Builder for DocumentOptions. + */ + public static class Builder { + + Map> metadataSections = new HashMap<>(); + + Map overrides = new HashMap<>(); + + SectionSpec addSection(String name) { + return new SectionSpec(this, name); + } + + Builder addOverride(String keyPrefix, String description) { + this.overrides.put(keyPrefix, description); + return this; + } + + DocumentOptions build() { + return new DocumentOptions(this.metadataSections, this.overrides); + } + + } + + /** + * Configuration for a documentation section listing properties for a specific theme. + */ + public static class SectionSpec { + + private final String name; + + private final Builder builder; + + SectionSpec(Builder builder, String name) { + this.builder = builder; + this.name = name; + } + + Builder withKeyPrefixes(String... keyPrefixes) { + this.builder.metadataSections.put(this.name, Arrays.asList(keyPrefixes)); + return this.builder; + } + + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/context/properties/SingleConfigurationTableEntry.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/SingleConfigurationTableEntry.java new file mode 100644 index 0000000000..a269281843 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/SingleConfigurationTableEntry.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.context.properties; + +import java.util.Arrays; +import java.util.stream.Collectors; + +/** + * Table entry containing a single configuration property. + * + * @author Brian Clozel + */ +class SingleConfigurationTableEntry extends ConfigurationTableEntry { + + private final String description; + + private final String defaultValue; + + SingleConfigurationTableEntry(ConfigurationProperty property) { + this.key = property.getName(); + if (property.getType() != null && property.getType().startsWith("java.util.Map")) { + this.key += ".*"; + } + this.description = property.getDescription(); + this.defaultValue = getDefaultValue(property.getDefaultValue()); + } + + private String getDefaultValue(Object defaultValue) { + if (defaultValue == null) { + return null; + } + if (defaultValue.getClass().isArray()) { + return Arrays.stream((Object[]) defaultValue).map(Object::toString) + .collect(Collectors.joining("," + System.lineSeparator())); + } + return defaultValue.toString(); + } + + @Override + void write(AsciidocBuilder builder) { + builder.appendln("|`+", this.key, "+`"); + writeDefaultValue(builder); + writeDescription(builder); + builder.appendln(); + } + + private void writeDefaultValue(AsciidocBuilder builder) { + String defaultValue = (this.defaultValue != null) ? this.defaultValue : ""; + if (defaultValue.isEmpty()) { + builder.appendln("|"); + } + else { + defaultValue = defaultValue.replace("\\", "\\\\").replace("|", "\\|"); + builder.appendln("|`+", defaultValue, "+`"); + } + } + + private void writeDescription(AsciidocBuilder builder) { + if (this.description == null || this.description.isEmpty()) { + builder.append("|"); + } + else { + String cleanedDescription = this.description.replace("|", "\\|"); + builder.append("|+++", cleanedDescription, "+++"); + } + } + +} 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 0000000000..0414fb1cbb --- /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 0000000000..2a16072dbb --- /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 0000000000..17694f11d1 --- /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 0000000000..08874b11aa --- /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 0000000000..6269923df2 --- /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 0000000000..e4f18ece6b --- /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 0000000000..0f622fcee8 --- /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 0000000000..a5cdf124d4 --- /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 0000000000..75e09c1273 --- /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 0000000000..3ad6a3f714 --- /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 0000000000..58ac2fb33f --- /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 0000000000..6643b9fcf1 --- /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 0000000000..1a1c5ab9de --- /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 0000000000..d67307453c --- /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 0000000000..452fafaf6f --- /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 0000000000..3bd1c2bb4a --- /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 0000000000..643baa2219 --- /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 0000000000..2e0b16d7f0 --- /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 0000000000..5e58d3a99c --- /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 0000000000..6010bfd075 --- /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/buildSrc/src/test/java/org/springframework/boot/build/context/properties/CompoundConfigurationTableEntryTests.java b/buildSrc/src/test/java/org/springframework/boot/build/context/properties/CompoundConfigurationTableEntryTests.java new file mode 100644 index 0000000000..2f229b93b7 --- /dev/null +++ b/buildSrc/src/test/java/org/springframework/boot/build/context/properties/CompoundConfigurationTableEntryTests.java @@ -0,0 +1,47 @@ +/* + * 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 org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link CompoundConfigurationTableEntry}. + * + * @author Brian Clozel + */ +public class CompoundConfigurationTableEntryTests { + + private static String NEWLINE = System.lineSeparator(); + + @Test + void simpleProperty() { + 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); + AsciidocBuilder builder = new AsciidocBuilder(); + entry.write(builder); + assertThat(builder.toString()).isEqualTo( + "|`+spring.test.first+` +" + NEWLINE + "`+spring.test.second+` +" + NEWLINE + "`+spring.test.third+` +" + + NEWLINE + NEWLINE + "|" + NEWLINE + "|+++This is a description.+++" + NEWLINE); + } + +} diff --git a/buildSrc/src/test/java/org/springframework/boot/build/context/properties/ConfigurationTableTests.java b/buildSrc/src/test/java/org/springframework/boot/build/context/properties/ConfigurationTableTests.java new file mode 100644 index 0000000000..c757c73f16 --- /dev/null +++ b/buildSrc/src/test/java/org/springframework/boot/build/context/properties/ConfigurationTableTests.java @@ -0,0 +1,48 @@ +/* + * 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 org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link ConfigurationTable}. + * + * @author Brian Clozel + */ +public class ConfigurationTableTests { + + private static String NEWLINE = System.lineSeparator(); + + @Test + void simpleTable() { + ConfigurationTable table = new ConfigurationTable("test"); + 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 + "|===" + + NEWLINE + "|Key|Default Value|Description" + NEWLINE + NEWLINE + "|`+spring.test.other+`" + NEWLINE + + "|`+other value+`" + NEWLINE + "|+++This is another description.+++" + NEWLINE + NEWLINE + + "|`+spring.test.prop+`" + NEWLINE + "|`+something+`" + NEWLINE + "|+++This is a description.+++" + + NEWLINE + NEWLINE + "|===" + NEWLINE); + } + +} diff --git a/buildSrc/src/test/java/org/springframework/boot/build/context/properties/SingleConfigurationTableEntryTests.java b/buildSrc/src/test/java/org/springframework/boot/build/context/properties/SingleConfigurationTableEntryTests.java new file mode 100644 index 0000000000..615cdca6ae --- /dev/null +++ b/buildSrc/src/test/java/org/springframework/boot/build/context/properties/SingleConfigurationTableEntryTests.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.context.properties; + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link SingleConfigurationTableEntry}. + * + * @author Brian Clozel + */ +public class SingleConfigurationTableEntryTests { + + private static String NEWLINE = System.lineSeparator(); + + @Test + void simpleProperty() { + 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); + assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+something+`" + NEWLINE + + "|+++This is a description.+++" + NEWLINE); + } + + @Test + void noDefaultValue() { + 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); + assertThat(builder.toString()).isEqualTo( + "|`+spring.test.prop+`" + NEWLINE + "|" + NEWLINE + "|+++This is a description.+++" + NEWLINE); + } + + @Test + void defaultValueWithPipes() { + 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); + assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+first\\|second+`" + NEWLINE + + "|+++This is a description.+++" + NEWLINE); + } + + @Test + void defaultValueWithBackslash() { + 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); + assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+first\\\\second+`" + NEWLINE + + "|+++This is a description.+++" + NEWLINE); + } + + @Test + void descriptionWithPipe() { + 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); + assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|" + NEWLINE + + "|+++This is a description with a \\| pipe.+++" + NEWLINE); + } + + @Test + void mapProperty() { + 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); + assertThat(builder.toString()).isEqualTo( + "|`+spring.test.prop.*+`" + NEWLINE + "|" + NEWLINE + "|+++This is a description.+++" + NEWLINE); + } + + @Test + void listProperty() { + String[] defaultValue = new String[] { "first", "second", "third" }; + 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); + assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+first," + NEWLINE + "second," + + NEWLINE + "third+`" + NEWLINE + "|+++This is a description.+++" + NEWLINE); + } + +} 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 0000000000..f482f5353e --- /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/buildSrc/src/test/java/org/springframework/boot/build/mavenplugin/PluginXmlParserTests.java b/buildSrc/src/test/java/org/springframework/boot/build/mavenplugin/PluginXmlParserTests.java new file mode 100644 index 0000000000..b5a4f83820 --- /dev/null +++ b/buildSrc/src/test/java/org/springframework/boot/build/mavenplugin/PluginXmlParserTests.java @@ -0,0 +1,40 @@ +/* + * 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 org.junit.jupiter.api.Test; + +import org.springframework.boot.build.mavenplugin.PluginXmlParser.Plugin; + +/** + * Tests for {@link PluginXmlParser}. + * + * @author Andy Wilkinson + */ +public class PluginXmlParserTests { + + private final PluginXmlParser parser = new PluginXmlParser(); + + @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 0000000000..d5585ee9e6 --- /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 0000000000..f9464b5a5d --- /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 73131464ca..e2aeb3871f 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 c93fd09008..0000000000 --- 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 953eaebb1c..0000000000 --- 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 efade5d1ac..aa8b62e1ab 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 da3c44e472..767884cbc9 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 cfb839c0ef..0000000000 --- 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 2ff3a71bb3..79aa2d5846 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 e45a4c2a30..0000000000 --- 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 bc96aa6cef..0000000000 --- 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 b4576a4849..c3dbfc8c05 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 50e222c7d2..a22b6f5d9d 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 a38dfb2ef9..0000000000 --- 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 f486313ae9..dd21db74f8 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 79100f5284..2048d3b1bd 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 0000000000..cc4fdc293d Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..94920145f3 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 0000000000..2fe81a7d95 --- /dev/null +++ b/gradlew @@ -0,0 +1,183 @@ +#!/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 +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +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='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# 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"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + 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" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +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" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000000..9618d8d960 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,100 @@ +@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 +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +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="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/pom.xml b/pom.xml deleted file mode 100644 index dd169ece2b..0000000000 --- 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 0000000000..43d7fd1cfb --- /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 2e893ff281..0000000000 --- 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 0000000000..5c7076e9ef --- /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 aa824b2ae1..0000000000 --- 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/docs/asciidoc/endpoints/auditevents.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/auditevents.adoc new file mode 100644 index 0000000000..9c6358f20b --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/auditevents.adoc @@ -0,0 +1,40 @@ +[[audit-events]] += Audit Events (`auditevents`) + +The `auditevents` endpoint provides information about the application's audit events. + + + +[[audit-events-retrieving]] +== Retrieving Audit Events + +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[] + +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[] + + + +[[audit-events-retrieving-query-parameters]] +=== Query Parameters + +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[] + + + +[[audit-events-retrieving-response-structure]] +=== Response Structure + +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[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/beans.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/beans.adoc new file mode 100644 index 0000000000..e3307538ba --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/beans.adoc @@ -0,0 +1,28 @@ +[[beans]] += Beans (`beans`) + +The `beans` endpoint provides information about the application's beans. + + + +[[beans-retrieving]] +== Retrieving the 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[] + +The resulting response is similar to the following: + +include::{snippets}/beans/http-response.adoc[] + + + +[[beans-retrieving-response-structure]] +=== Response Structure + +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[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/caches.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/caches.adoc new file mode 100644 index 0000000000..f6057a656d --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/caches.adoc @@ -0,0 +1,89 @@ +[[caches]] += Caches (`caches`) + +The `caches` endpoint provides access to the application's caches. + + + +[[caches-all]] +== 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[] + +The resulting response is similar to the following: + +include::{snippets}/caches/all/http-response.adoc[] + + + +[[caches-all-response-structure]] +=== Response Structure +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[] + + + +[[caches-named]] +== 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[] + +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[] + + + +[[caches-named-query-parameters]] +=== Query Parameters +If the requested name is specific enough to identify a single cache, no extra parameter is required. +Otherwise, the `cacheManager` must be specified. +The following table shows the supported query parameters: + +[cols="2,4"] +include::{snippets}/caches/named/request-parameters.adoc[] + + + +[[caches-named-response-structure]] +=== Response Structure +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[] + + + +[[caches-evict-all]] +== 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[] + + + +[[caches-evict-named]] +== 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[] + +NOTE: As there are two caches named `countries`, the `cacheManager` has to be provided to specify which `Cache` should be cleared. + + + +[[caches-evict-named-request-structure]] +=== Request Structure +If the requested name is specific enough to identify a single cache, no extra parameter is required. +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[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/conditions.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/conditions.adoc new file mode 100644 index 0000000000..2477015d83 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/conditions.adoc @@ -0,0 +1,28 @@ +[[conditions]] += Conditions Evaluation Report (`conditions`) + +The `conditions` endpoint provides information about the evaluation of conditions on configuration and auto-configuration classes. + + + +[[conditions-retrieving]] +== Retrieving the Report + +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[] + +The resulting response is similar to the following: + +include::{snippets}/conditions/http-response.adoc[] + + + +[[conditions-retrieving-response-structure]] +=== Response Structure + +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[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/configprops.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/configprops.adoc new file mode 100644 index 0000000000..1f251b9c2e --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/configprops.adoc @@ -0,0 +1,28 @@ +[[configprops]] += Configuration Properties (`configprops`) + +The `configprops` endpoint provides information about the application's `@ConfigurationProperties` beans. + + + +[[configprops-retrieving]] +== Retrieving the `@ConfigurationProperties` Bean + +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[] + +The resulting response is similar to the following: + +include::{snippets}/configprops/http-response.adoc[] + + + +[[configprops-retrieving-response-structure]] +=== Response Structure + +The response contains details of the application's `@ConfigurationProperties` beans. +The following table describes the structure of the response: + +[cols="2,1,3"] +include::{snippets}/configprops/response-fields.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/env.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/env.adoc new file mode 100644 index 0000000000..4b624946db --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/env.adoc @@ -0,0 +1,53 @@ +[[env]] += Environment (`env`) + +The `env` endpoint provides information about the application's `Environment`. + + + +[[env-entire]] +== Retrieving the Entire 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[] + +The resulting response is similar to the following: + +include::{snippets}/env/all/http-response.adoc[] + + + +[[env-entire-response-structure]] +=== Response Structure + +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[] + + + +[[env-single-property]] +== Retrieving a Single Property + +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[] + +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[] + + + +[[env-single-response-structure]] +=== Response Structure + +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[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/flyway.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/flyway.adoc new file mode 100644 index 0000000000..d70b0e6a56 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/flyway.adoc @@ -0,0 +1,28 @@ +[[flyway]] += Flyway (`flyway`) + +The `flyway` endpoint provides information about database migrations performed by Flyway. + + + +[[flyway-retrieving]] +== Retrieving the Migrations + +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[] + +The resulting response is similar to the following: + +include::{snippets}/flyway/http-response.adoc[] + + + +[[flyway-retrieving-response-structure]] +=== Response Structure + +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[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/health.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/health.adoc new file mode 100644 index 0000000000..6cbaf51771 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/health.adoc @@ -0,0 +1,75 @@ +[[health]] += Health (`health`) +The `health` endpoint provides detailed information about the health of the application. + + + +[[health-retrieving]] +== 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[] + +The resulting response is similar to the following: + +include::{snippets}/health/http-response.adoc[] + + + +[[health-retrieving-response-structure]] +=== Response Structure +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[] + +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` + + + +[[health-retrieving-component]] +== 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[] + +The resulting response is similar to the following: + +include::{snippets}/health/component/http-response.adoc[] + + + +[[health-retrieving-component-response-structure]] +=== Response Structure +The response contains details of the health of a particular component of the application's health. +The following table describes the structure of the response: + +[cols="2,1,3"] +include::{snippets}/health/component/response-fields.adoc[] + + + +[[health-retrieving-component-nested]] +== 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[] + +The resulting response is similar to the following: + +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. + + + +[[health-retrieving-component-instance-response-structure]] +=== Response Structure +The response contains details of the health of an instance of a particular component of the application. +The following table describes the structure of the response: + +[cols="2,1,3"] +include::{snippets}/health/instance/response-fields.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/heapdump.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/heapdump.adoc new file mode 100644 index 0000000000..57488cb017 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/heapdump.adoc @@ -0,0 +1,18 @@ +[[heapdump]] += Heap Dump (`heapdump`) + +The `heapdump` endpoint provides a heap dump from the application's JVM. + + + +[[heapdump-retrieving]] +== Retrieving the Heap Dump + +To retrieve the heap dump, make a `GET` request to `/actuator/heapdump`. +The response is binary data in https://docs.oracle.com/javase/8/docs/technotes/samples/hprof.html[HPROF] format and can be large. +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[] + +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/docs/asciidoc/endpoints/httptrace.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/httptrace.adoc new file mode 100644 index 0000000000..b7937e57a2 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/httptrace.adoc @@ -0,0 +1,28 @@ +[[http-trace]] += HTTP Trace (`httptrace`) + +The `httptrace` endpoint provides information about HTTP request-response exchanges. + + + +[[http-trace-retrieving]] +== Retrieving the Traces + +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[] + +The resulting response is similar to the following: + +include::{snippets}/httptrace/http-response.adoc[] + + + +[[http-trace-retrieving-response-structure]] +=== Response Structure + +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[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/info.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/info.adoc new file mode 100644 index 0000000000..91f884face --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/info.adoc @@ -0,0 +1,46 @@ +[[info]] += Info (`info`) + +The `info` endpoint provides general information about the application. + + + +[[info-retrieving]] +== Retrieving the Info + +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[] + +The resulting response is similar to the following: + +include::{snippets}/info/http-response.adoc[] + + + +[[info-retrieving-response-structure]] +=== Response Structure + +The response contains general information about the application. +Each section of the response is contributed by an `InfoContributor`. +Spring Boot provides `build` and `git` contributions. + + + +[[info-retrieving-response-structure-build]] +==== `build` Response Structure + +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[] + + + +[[info-retrieving-response-structure-git]] +==== `git` Response Structure + +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[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/integrationgraph.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/integrationgraph.adoc new file mode 100644 index 0000000000..5a2b28a63a --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/integrationgraph.adoc @@ -0,0 +1,35 @@ +[[integrationgraph]] += Spring Integration graph (`integrationgraph`) + +The `integrationgraph` endpoint exposes a graph containing all Spring Integration components. + + + +[[integrationgraph-retrieving]] +== 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[] + +The resulting response is similar to the following: + +include::{snippets}/integrationgraph/graph/http-response.adoc[] + + + +[[integrationgraph-retrieving-response-structure]] +=== Response Structure +The response contains all Spring Integration components used within the application, as well as the links between them. +More information about the structure can be found in the https://docs.spring.io/spring-integration/reference/html/#integration-graph[reference documentation]. + + + +[[integrationgraph-rebuilding]] +== 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[] + +This will result in a `204 - No Content` response: + +include::{snippets}/integrationgraph/rebuild/http-response.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/liquibase.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/liquibase.adoc new file mode 100644 index 0000000000..a517d85cce --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/liquibase.adoc @@ -0,0 +1,28 @@ +[[liquibase]] += Liquibase (`liquibase`) + +The `liquibase` endpoint provides information about database change sets applied by Liquibase. + + + +[[liquibase-retrieving]] +== Retrieving the Changes + +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[] + +The resulting response is similar to the following: + +include::{snippets}/liquibase/http-response.adoc[] + + + +[[liquibase-retrieving-response-structure]] +=== Response Structure + +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[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/logfile.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/logfile.adoc new file mode 100644 index 0000000000..9fd1dc8658 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/logfile.adoc @@ -0,0 +1,33 @@ +[[log-file]] += Log File (`logfile`) + +The `logfile` endpoint provides access to the contents of the application's log file. + + + +[[logfile-retrieving]] +== Retrieving the Log File + +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[] + +The resulting response is similar to the following: + +include::{snippets}/logfile/entire/http-response.adoc[] + + + +[[logfile-retrieving-part]] +== Retrieving Part of the Log File + +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[] + +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[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/loggers.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/loggers.adoc new file mode 100644 index 0000000000..5e88b104e4 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/loggers.adoc @@ -0,0 +1,134 @@ +[[loggers]] += Loggers (`loggers`) + +The `loggers` endpoint provides access to the application's loggers and the configuration of their levels. + + + +[[loggers-all]] +== Retrieving All Loggers + +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[] + +The resulting response is similar to the following: + +include::{snippets}/loggers/all/http-response.adoc[] + + + +[[loggers-all-response-structure]] +=== Response Structure + +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[] + + + +[[loggers-single]] +== Retrieving a Single Logger + +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[] + +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[] + + + +[[loggers-single-response-structure]] +=== Response Structure + +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[] + + + +[[loggers-group]] +== Retrieving a Single Group + +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[] + +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[] + + + +[[loggers-group-response-structure]] +=== Response Structure + +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[] + + + +[[loggers-setting-level]] +== Setting a Log Level + +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[] + +The preceding example sets the `configuredLevel` of the `com.example` logger to `DEBUG`. + + + +[[loggers-setting-level-request-structure]] +=== Request Structure + +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[] + + + +[[loggers-group-setting-level]] +== Setting a Log Level for a Group + +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[] + +The preceding example sets the `configuredLevel` of the `test` logger group to `DEBUG`. + + + +[[loggers-group-setting-level-request-structure]] +=== Request Structure + +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[] + + + +[[loggers-clearing-level]] +== Clearing a Log Level + +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[] + +The preceding example clears the configured level of the `com.example` logger. diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/mappings.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/mappings.adoc new file mode 100644 index 0000000000..20ac03e0f7 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/mappings.adoc @@ -0,0 +1,74 @@ +[[mappings]] += Mappings (`mappings`) + +The `mappings` endpoint provides information about the application's request mappings. + + + +[[mappings-retrieving]] +== Retrieving the Mappings + +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[] + +The resulting response is similar to the following: + +include::{snippets}/mappings/http-response.adoc[] + + + +[[mappings-retrieving-response-structure]] +=== Response Structure + +The response contains details of the application's mappings. +The items found in the response depend on the type of web application (reactive or Servlet-based). +The following table describes the structure of the common elements of the response: + +[cols="2,1,3"] +include::{snippets}/mappings/response-fields.adoc[] + +The entries that may be found in `contexts.*.mappings` are described in the following sections. + + +[[mappings-retrieving-response-structure-dispatcher-servlets]] +=== Dispatcher Servlets Response Structure + +When using Spring MVC, the response contains details of any `DispatcherServlet` request mappings beneath `contexts.*.mappings.dispatcherServlets`. +The following table describes the structure of this section of the response: + +[cols="4,1,2"] +include::{snippets}/mappings/response-fields-dispatcher-servlets.adoc[] + + + +[[mappings-retrieving-response-structure-servlets]] +=== Servlets Response Structure + +When using the Servlet stack, the response contains details of any `Servlet` mappings beneath `contexts.*.mappings.servlets`. +The following table describes the structure of this section of the response: + +[cols="2,1,3"] +include::{snippets}/mappings/response-fields-servlets.adoc[] + + + +[[mappings-retrieving-response-structure-servlet-filters]] +=== Servlet Filters Response Structure + +When using the Servlet stack, the response contains details of any `Filter` mappings beneath `contexts.*.mappings.servletFilters`. +The following table describes the structure of this section of the response: + +[cols="2,1,3"] +include::{snippets}/mappings/response-fields-servlet-filters.adoc[] + + + +[[mappings-retrieving-response-structure-dispatcher-handlers]] +=== Dispatcher Handlers Response Structure + +When using Spring WebFlux, the response contains details of any `DispatcherHandler` request mappings beneath `contexts.*.mappings.dispatcherHandlers`. +The following table describes the structure of this section of the response: + +[cols="4,1,2"] +include::{snippets}/mappings/response-fields-dispatcher-handlers.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/metrics.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/metrics.adoc new file mode 100644 index 0000000000..ac5430abe8 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/metrics.adoc @@ -0,0 +1,76 @@ +[[metrics]] += Metrics (`metrics`) + +The `metrics` endpoint provides access to application metrics. + + + +[[metrics-retrieving-names]] +== Retrieving Metric Names + +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[] + +The resulting response is similar to the following: + +include::{snippets}/metrics/names/http-response.adoc[] + + + +[[metrics-retrieving-names-response-structure]] +=== Response Structure + +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[] + + + +[[metrics-retrieving-metric]] +== Retrieving a Metric + +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[] + +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[] + + + +[[metrics-retrieving-metric-query-parameters]] +=== Query Parameters + +The endpoint uses query parameters to <> into a metric by using its tags. +The following table shows the single supported query parameter: + +[cols="2,4"] +include::{snippets}/metrics/metric-with-tags/request-parameters.adoc[] + + + +[[metrics-retrieving-metric-response-structure]] +=== Response structure + +The response contains details of the metric. +The following table describes the structure of the response: + +include::{snippets}/metrics/metric/response-fields.adoc[] + + +[[metrics-drilling-down]] +== Drilling Down + +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[] + +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[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/prometheus.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/prometheus.adoc new file mode 100644 index 0000000000..16d2205ba4 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/prometheus.adoc @@ -0,0 +1,17 @@ +[[prometheus]] += Prometheus (`prometheus`) + +The `prometheus` endpoint provides Spring Boot application's metrics in the format required for scraping by a Prometheus server. + + + +[[prometheus-retrieving]] +== Retrieving the Metrics + +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[] + +The resulting response is similar to the following: + +include::{snippets}/prometheus/http-response.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/scheduledtasks.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/scheduledtasks.adoc new file mode 100644 index 0000000000..1e69e6046a --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/scheduledtasks.adoc @@ -0,0 +1,28 @@ +[[scheduled-tasks]] += Scheduled Tasks (`scheduledtasks`) + +The `scheduledtasks` endpoint provides information about the application's scheduled tasks. + + + +[[scheduled-tasks-retrieving]] +== Retrieving the Scheduled Tasks + +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[] + +The resulting response is similar to the following: + +include::{snippets}/scheduled-tasks/http-response.adoc[] + + + +[[scheduled-tasks-retrieving-response-structure]] +=== Response Structure + +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[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/sessions.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/sessions.adoc new file mode 100644 index 0000000000..01f2d8a842 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/sessions.adoc @@ -0,0 +1,76 @@ +[[sessions]] += Sessions (`sessions`) + +The `sessions` endpoint provides information about the application's HTTP sessions that are managed by Spring Session. + + + +[[sessions-retrieving]] +== Retrieving Sessions + +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[] + +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[] + + + +[[sessions-retrieving-query-parameters]] +=== Query Parameters + +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[] + + + +[[sessions-retrieving-response-structure]] +=== Response Structure + +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[] + + + +[[sessions-retrieving-id]] +== Retrieving a Single Session + +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[] + +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[] + + + +[[sessions-retrieving-id-response-structure]] +=== Response Structure + +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[] + + + +[[sessions-deleting]] +== Deleting a Session + +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[] + +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/docs/asciidoc/endpoints/shutdown.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/shutdown.adoc new file mode 100644 index 0000000000..2231904f67 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/shutdown.adoc @@ -0,0 +1,28 @@ +[[shutdown]] += Shutdown (`shutdown`) + +The `shutdown` endpoint is used to shut down the application. + + + +[[shutdown-shutting-down]] +== Shutting 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[] + +A response similar to the following is produced: + +include::{snippets}/shutdown/http-response.adoc[] + + + +[[shutdown-shutting-down-response-structure]] +=== Response Structure + +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[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/threaddump.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/threaddump.adoc new file mode 100644 index 0000000000..e141296d70 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/docs/asciidoc/endpoints/threaddump.adoc @@ -0,0 +1,42 @@ +[[threaddump]] += Thread Dump (`threaddump`) + +The `threaddump` endpoint provides a thread dump from the application's JVM. + + + +[[threaddump-retrieving-json]] +== Retrieving the Thread Dump as JSON + +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[] + +The resulting response is similar to the following: + +include::{snippets}/threaddump/json/http-response.adoc[] + + + +[[threaddump-retrieving-json-response-structure]] +=== Response Structure + +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[] + + + +[[threaddump-retrieving-text]] +== Retrieving the Thread Dump as Text + +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[] + +The resulting response is similar to the following: + +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-autoconfigure/src/main/asciidoc/endpoints/auditevents.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/auditevents.adoc deleted file mode 100644 index 91dac834d5..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/auditevents.adoc +++ /dev/null @@ -1,40 +0,0 @@ -[[audit-events]] -= Audit Events (`auditevents`) - -The `auditevents` endpoint provides information about the application's audit events. - - - -[[audit-events-retrieving]] -== Retrieving Audit Events - -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[] - -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[] - - - -[[audit-events-retrieving-query-parameters]] -=== Query Parameters - -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[] - - - -[[audit-events-retrieving-response-structure]] -=== Response Structure - -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[] 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/main/asciidoc/endpoints/beans.adoc deleted file mode 100644 index 5417a90601..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/beans.adoc +++ /dev/null @@ -1,28 +0,0 @@ -[[beans]] -= Beans (`beans`) - -The `beans` endpoint provides information about the application's beans. - - - -[[beans-retrieving]] -== Retrieving the 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[] - -The resulting response is similar to the following: - -include::{snippets}beans/http-response.adoc[] - - - -[[beans-retrieving-response-structure]] -=== Response Structure - -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[] 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/main/asciidoc/endpoints/caches.adoc deleted file mode 100644 index 3f2156a4b9..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/caches.adoc +++ /dev/null @@ -1,89 +0,0 @@ -[[caches]] -= Caches (`caches`) - -The `caches` endpoint provides access to the application's caches. - - - -[[caches-all]] -== 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[] - -The resulting response is similar to the following: - -include::{snippets}caches/all/http-response.adoc[] - - - -[[caches-all-response-structure]] -=== Response Structure -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[] - - - -[[caches-named]] -== 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[] - -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[] - - - -[[caches-named-query-parameters]] -=== Query Parameters -If the requested name is specific enough to identify a single cache, no extra parameter is required. -Otherwise, the `cacheManager` must be specified. -The following table shows the supported query parameters: - -[cols="2,4"] -include::{snippets}caches/named/request-parameters.adoc[] - - - -[[caches-named-response-structure]] -=== Response Structure -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[] - - - -[[caches-evict-all]] -== 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[] - - - -[[caches-evict-named]] -== 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[] - -NOTE: As there are two caches named `countries`, the `cacheManager` has to be provided to specify which `Cache` should be cleared. - - - -[[caches-evict-named-request-structure]] -=== Request Structure -If the requested name is specific enough to identify a single cache, no extra parameter is required. -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[] 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/main/asciidoc/endpoints/conditions.adoc deleted file mode 100644 index 26dace0267..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/conditions.adoc +++ /dev/null @@ -1,28 +0,0 @@ -[[conditions]] -= Conditions Evaluation Report (`conditions`) - -The `conditions` endpoint provides information about the evaluation of conditions on configuration and auto-configuration classes. - - - -[[conditions-retrieving]] -== Retrieving the Report - -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[] - -The resulting response is similar to the following: - -include::{snippets}conditions/http-response.adoc[] - - - -[[conditions-retrieving-response-structure]] -=== Response Structure - -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[] 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/main/asciidoc/endpoints/configprops.adoc deleted file mode 100644 index 651b0ec512..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/configprops.adoc +++ /dev/null @@ -1,28 +0,0 @@ -[[configprops]] -= Configuration Properties (`configprops`) - -The `configprops` endpoint provides information about the application's `@ConfigurationProperties` beans. - - - -[[configprops-retrieving]] -== Retrieving the `@ConfigurationProperties` Bean - -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[] - -The resulting response is similar to the following: - -include::{snippets}configprops/http-response.adoc[] - - - -[[configprops-retrieving-response-structure]] -=== Response Structure - -The response contains details of the application's `@ConfigurationProperties` beans. -The following table describes the structure of the response: - -[cols="2,1,3"] -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/main/asciidoc/endpoints/env.adoc deleted file mode 100644 index d7b917ca16..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/env.adoc +++ /dev/null @@ -1,53 +0,0 @@ -[[env]] -= Environment (`env`) - -The `env` endpoint provides information about the application's `Environment`. - - - -[[env-entire]] -== Retrieving the Entire 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[] - -The resulting response is similar to the following: - -include::{snippets}env/all/http-response.adoc[] - - - -[[env-entire-response-structure]] -=== Response Structure - -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[] - - - -[[env-single-property]] -== Retrieving a Single Property - -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[] - -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[] - - - -[[env-single-response-structure]] -=== Response Structure - -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[] 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/main/asciidoc/endpoints/flyway.adoc deleted file mode 100644 index 8fe81d6295..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/flyway.adoc +++ /dev/null @@ -1,28 +0,0 @@ -[[flyway]] -= Flyway (`flyway`) - -The `flyway` endpoint provides information about database migrations performed by Flyway. - - - -[[flyway-retrieving]] -== Retrieving the Migrations - -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[] - -The resulting response is similar to the following: - -include::{snippets}flyway/http-response.adoc[] - - - -[[flyway-retrieving-response-structure]] -=== Response Structure - -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[] 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/main/asciidoc/endpoints/health.adoc deleted file mode 100644 index a7c1998dde..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/health.adoc +++ /dev/null @@ -1,75 +0,0 @@ -[[health]] -= Health (`health`) -The `health` endpoint provides detailed information about the health of the application. - - - -[[health-retrieving]] -== 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[] - -The resulting response is similar to the following: - -include::{snippets}health/http-response.adoc[] - - - -[[health-retrieving-response-structure]] -=== Response Structure -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[] - -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` - - - -[[health-retrieving-component]] -== 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[] - -The resulting response is similar to the following: - -include::{snippets}health/component/http-response.adoc[] - - - -[[health-retrieving-component-response-structure]] -=== Response Structure -The response contains details of the health of a particular component of the application's health. -The following table describes the structure of the response: - -[cols="2,1,3"] -include::{snippets}health/component/response-fields.adoc[] - - - -[[health-retrieving-component-nested]] -== 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[] - -The resulting response is similar to the following: - -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. - - - -[[health-retrieving-component-instance-response-structure]] -=== Response Structure -The response contains details of the health of an instance of a particular component of the application. -The following table describes the structure of the response: - -[cols="2,1,3"] -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/main/asciidoc/endpoints/heapdump.adoc deleted file mode 100644 index ebbba69207..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/heapdump.adoc +++ /dev/null @@ -1,18 +0,0 @@ -[[heapdump]] -= Heap Dump (`heapdump`) - -The `heapdump` endpoint provides a heap dump from the application's JVM. - - - -[[heapdump-retrieving]] -== Retrieving the Heap Dump - -To retrieve the heap dump, make a `GET` request to `/actuator/heapdump`. -The response is binary data in https://docs.oracle.com/javase/8/docs/technotes/samples/hprof.html[HPROF] format and can be large. -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[] - -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/main/asciidoc/endpoints/httptrace.adoc deleted file mode 100644 index ea1149f9ef..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/httptrace.adoc +++ /dev/null @@ -1,28 +0,0 @@ -[[http-trace]] -= HTTP Trace (`httptrace`) - -The `httptrace` endpoint provides information about HTTP request-response exchanges. - - - -[[http-trace-retrieving]] -== Retrieving the Traces - -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[] - -The resulting response is similar to the following: - -include::{snippets}httptrace/http-response.adoc[] - - - -[[http-trace-retrieving-response-structure]] -=== Response Structure - -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[] 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/main/asciidoc/endpoints/info.adoc deleted file mode 100644 index f431c3a8d8..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/info.adoc +++ /dev/null @@ -1,46 +0,0 @@ -[[info]] -= Info (`info`) - -The `info` endpoint provides general information about the application. - - - -[[info-retrieving]] -== Retrieving the Info - -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[] - -The resulting response is similar to the following: - -include::{snippets}info/http-response.adoc[] - - - -[[info-retrieving-response-structure]] -=== Response Structure - -The response contains general information about the application. -Each section of the response is contributed by an `InfoContributor`. -Spring Boot provides `build` and `git` contributions. - - - -[[info-retrieving-response-structure-build]] -==== `build` Response Structure - -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[] - - - -[[info-retrieving-response-structure-git]] -==== `git` Response Structure - -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[] 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/main/asciidoc/endpoints/integrationgraph.adoc deleted file mode 100644 index e2d3274729..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/integrationgraph.adoc +++ /dev/null @@ -1,35 +0,0 @@ -[[integrationgraph]] -= Spring Integration graph (`integrationgraph`) - -The `integrationgraph` endpoint exposes a graph containing all Spring Integration components. - - - -[[integrationgraph-retrieving]] -== 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[] - -The resulting response is similar to the following: - -include::{snippets}integrationgraph/graph/http-response.adoc[] - - - -[[integrationgraph-retrieving-response-structure]] -=== Response Structure -The response contains all Spring Integration components used within the application, as well as the links between them. -More information about the structure can be found in the https://docs.spring.io/spring-integration/reference/html/#integration-graph[reference documentation]. - - - -[[integrationgraph-rebuilding]] -== 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[] - -This will result in a `204 - No Content` response: - -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/main/asciidoc/endpoints/liquibase.adoc deleted file mode 100644 index 1e84c8efac..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/liquibase.adoc +++ /dev/null @@ -1,28 +0,0 @@ -[[liquibase]] -= Liquibase (`liquibase`) - -The `liquibase` endpoint provides information about database change sets applied by Liquibase. - - - -[[liquibase-retrieving]] -== Retrieving the Changes - -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[] - -The resulting response is similar to the following: - -include::{snippets}liquibase/http-response.adoc[] - - - -[[liquibase-retrieving-response-structure]] -=== Response Structure - -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[] 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/main/asciidoc/endpoints/logfile.adoc deleted file mode 100644 index 99121fc673..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/logfile.adoc +++ /dev/null @@ -1,33 +0,0 @@ -[[log-file]] -= Log File (`logfile`) - -The `logfile` endpoint provides access to the contents of the application's log file. - - - -[[logfile-retrieving]] -== Retrieving the Log File - -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[] - -The resulting response is similar to the following: - -include::{snippets}logfile/entire/http-response.adoc[] - - - -[[logfile-retrieving-part]] -== Retrieving Part of the Log File - -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[] - -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[] 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/main/asciidoc/endpoints/loggers.adoc deleted file mode 100644 index e4609c73e7..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/loggers.adoc +++ /dev/null @@ -1,134 +0,0 @@ -[[loggers]] -= Loggers (`loggers`) - -The `loggers` endpoint provides access to the application's loggers and the configuration of their levels. - - - -[[loggers-all]] -== Retrieving All Loggers - -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[] - -The resulting response is similar to the following: - -include::{snippets}loggers/all/http-response.adoc[] - - - -[[loggers-all-response-structure]] -=== Response Structure - -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[] - - - -[[loggers-single]] -== Retrieving a Single Logger - -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[] - -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[] - - - -[[loggers-single-response-structure]] -=== Response Structure - -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[] - - - -[[loggers-group]] -== Retrieving a Single Group - -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[] - -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[] - - - -[[loggers-group-response-structure]] -=== Response Structure - -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[] - - - -[[loggers-setting-level]] -== Setting a Log Level - -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[] - -The preceding example sets the `configuredLevel` of the `com.example` logger to `DEBUG`. - - - -[[loggers-setting-level-request-structure]] -=== Request Structure - -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[] - - - -[[loggers-group-setting-level]] -== Setting a Log Level for a Group - -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[] - -The preceding example sets the `configuredLevel` of the `test` logger group to `DEBUG`. - - - -[[loggers-group-setting-level-request-structure]] -=== Request Structure - -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[] - - - -[[loggers-clearing-level]] -== Clearing a Log Level - -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[] - -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/main/asciidoc/endpoints/mappings.adoc deleted file mode 100644 index 1d7371d9e2..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/mappings.adoc +++ /dev/null @@ -1,74 +0,0 @@ -[[mappings]] -= Mappings (`mappings`) - -The `mappings` endpoint provides information about the application's request mappings. - - - -[[mappings-retrieving]] -== Retrieving the Mappings - -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[] - -The resulting response is similar to the following: - -include::{snippets}mappings/http-response.adoc[] - - - -[[mappings-retrieving-response-structure]] -=== Response Structure - -The response contains details of the application's mappings. -The items found in the response depend on the type of web application (reactive or Servlet-based). -The following table describes the structure of the common elements of the response: - -[cols="2,1,3"] -include::{snippets}mappings/response-fields.adoc[] - -The entries that may be found in `contexts.*.mappings` are described in the following sections. - - -[[mappings-retrieving-response-structure-dispatcher-servlets]] -=== Dispatcher Servlets Response Structure - -When using Spring MVC, the response contains details of any `DispatcherServlet` request mappings beneath `contexts.*.mappings.dispatcherServlets`. -The following table describes the structure of this section of the response: - -[cols="4,1,2"] -include::{snippets}mappings/response-fields-dispatcher-servlets.adoc[] - - - -[[mappings-retrieving-response-structure-servlets]] -=== Servlets Response Structure - -When using the Servlet stack, the response contains details of any `Servlet` mappings beneath `contexts.*.mappings.servlets`. -The following table describes the structure of this section of the response: - -[cols="2,1,3"] -include::{snippets}mappings/response-fields-servlets.adoc[] - - - -[[mappings-retrieving-response-structure-servlet-filters]] -=== Servlet Filters Response Structure - -When using the Servlet stack, the response contains details of any `Filter` mappings beneath `contexts.*.mappings.servletFilters`. -The following table describes the structure of this section of the response: - -[cols="2,1,3"] -include::{snippets}mappings/response-fields-servlet-filters.adoc[] - - - -[[mappings-retrieving-response-structure-dispatcher-handlers]] -=== Dispatcher Handlers Response Structure - -When using Spring WebFlux, the response contains details of any `DispatcherHandler` request mappings beneath `contexts.*.mappings.dispatcherHandlers`. -The following table describes the structure of this section of the response: - -[cols="4,1,2"] -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/main/asciidoc/endpoints/metrics.adoc deleted file mode 100644 index db26c3fd95..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/metrics.adoc +++ /dev/null @@ -1,76 +0,0 @@ -[[metrics]] -= Metrics (`metrics`) - -The `metrics` endpoint provides access to application metrics. - - - -[[metrics-retrieving-names]] -== Retrieving Metric Names - -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[] - -The resulting response is similar to the following: - -include::{snippets}metrics/names/http-response.adoc[] - - - -[[metrics-retrieving-names-response-structure]] -=== Response Structure - -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[] - - - -[[metrics-retrieving-metric]] -== Retrieving a Metric - -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[] - -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[] - - - -[[metrics-retrieving-metric-query-parameters]] -=== Query Parameters - -The endpoint uses query parameters to <> into a metric by using its tags. -The following table shows the single supported query parameter: - -[cols="2,4"] -include::{snippets}metrics/metric-with-tags/request-parameters.adoc[] - - - -[[metrics-retrieving-metric-response-structure]] -=== Response structure - -The response contains details of the metric. -The following table describes the structure of the response: - -include::{snippets}metrics/metric/response-fields.adoc[] - - -[[metrics-drilling-down]] -== Drilling Down - -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[] - -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[] 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/main/asciidoc/endpoints/prometheus.adoc deleted file mode 100644 index 1d1006bc37..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/prometheus.adoc +++ /dev/null @@ -1,17 +0,0 @@ -[[prometheus]] -= Prometheus (`prometheus`) - -The `prometheus` endpoint provides Spring Boot application's metrics in the format required for scraping by a Prometheus server. - - - -[[prometheus-retrieving]] -== Retrieving the Metrics - -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[] - -The resulting response is similar to the following: - -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/main/asciidoc/endpoints/scheduledtasks.adoc deleted file mode 100644 index a3a4f3a9a4..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/scheduledtasks.adoc +++ /dev/null @@ -1,28 +0,0 @@ -[[scheduled-tasks]] -= Scheduled Tasks (`scheduledtasks`) - -The `scheduledtasks` endpoint provides information about the application's scheduled tasks. - - - -[[scheduled-tasks-retrieving]] -== Retrieving the Scheduled Tasks - -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[] - -The resulting response is similar to the following: - -include::{snippets}scheduled-tasks/http-response.adoc[] - - - -[[scheduled-tasks-retrieving-response-structure]] -=== Response Structure - -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[] 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/main/asciidoc/endpoints/sessions.adoc deleted file mode 100644 index 8cc3508d9e..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/sessions.adoc +++ /dev/null @@ -1,76 +0,0 @@ -[[sessions]] -= Sessions (`sessions`) - -The `sessions` endpoint provides information about the application's HTTP sessions that are managed by Spring Session. - - - -[[sessions-retrieving]] -== Retrieving Sessions - -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[] - -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[] - - - -[[sessions-retrieving-query-parameters]] -=== Query Parameters - -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[] - - - -[[sessions-retrieving-response-structure]] -=== Response Structure - -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[] - - - -[[sessions-retrieving-id]] -== Retrieving a Single Session - -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[] - -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[] - - - -[[sessions-retrieving-id-response-structure]] -=== Response Structure - -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[] - - - -[[sessions-deleting]] -== Deleting a Session - -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[] - -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/main/asciidoc/endpoints/shutdown.adoc deleted file mode 100644 index 00aec5b1bf..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/shutdown.adoc +++ /dev/null @@ -1,28 +0,0 @@ -[[shutdown]] -= Shutdown (`shutdown`) - -The `shutdown` endpoint is used to shut down the application. - - - -[[shutdown-shutting-down]] -== Shutting 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[] - -A response similar to the following is produced: - -include::{snippets}shutdown/http-response.adoc[] - - - -[[shutdown-shutting-down-response-structure]] -=== Response Structure - -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[] 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/main/asciidoc/endpoints/threaddump.adoc deleted file mode 100644 index fa61f6df0c..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/threaddump.adoc +++ /dev/null @@ -1,42 +0,0 @@ -[[threaddump]] -= Thread Dump (`threaddump`) - -The `threaddump` endpoint provides a thread dump from the application's JVM. - - - -[[threaddump-retrieving-json]] -== Retrieving the Thread Dump as JSON - -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[] - -The resulting response is similar to the following: - -include::{snippets}threaddump/json/http-response.adoc[] - - - -[[threaddump-retrieving-json-response-structure]] -=== Response Structure - -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[] - - - -[[threaddump-retrieving-text]] -== Retrieving the Thread Dump as Text - -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[] - -The resulting response is similar to the following: - -include::{snippets}threaddump/text/http-response.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 0000000000..73dddb1880 --- /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 cedc88716c..0000000000 --- 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 41bf39c07f..c1669f4545 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.Bean; 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 @@ class WebEndpointTestInvocationContextProvider implements TestTemplateInvocation 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 0000000000..ff509e7425 --- /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 a187161806..0000000000 --- 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 8ccaf257f9..614c598ae7 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 @@ public class ReactiveRestClientAutoConfigurationTests { @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 ba889f9762..2461c1eaa9 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 @@ class TransactionAutoConfigurationTests { 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 0000000000..db7ee46c8d --- /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 a349767d00..0000000000 --- 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/intTest/java/org/springframework/boot/cli/CommandLineIT.java b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/CommandLineIT.java new file mode 100644 index 0000000000..1ee7939855 --- /dev/null +++ b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/CommandLineIT.java @@ -0,0 +1,86 @@ +/* + * 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.cli; + +import java.io.File; +import java.io.IOException; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import org.springframework.boot.cli.infrastructure.CommandLineInvoker; +import org.springframework.boot.cli.infrastructure.CommandLineInvoker.Invocation; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Integration Tests for the command line application. + * + * @author Andy Wilkinson + * @author Phillip Webb + */ +class CommandLineIT { + + private CommandLineInvoker cli; + + @BeforeEach + void setup(@TempDir File tempDir) { + this.cli = new CommandLineInvoker(tempDir); + } + + @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 { + 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 { + 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.getStandardOutput()).isEmpty(); + } + + @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 { + Invocation cli = this.cli.invoke("help"); + assertThat(cli.await()).isEqualTo(1); + assertThat(cli.getErrorOutput()).isEmpty(); + assertThat(cli.getStandardOutput()).startsWith("usage:"); + } + +} diff --git a/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/JarCommandIT.java b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/JarCommandIT.java new file mode 100644 index 0000000000..cafb01739d --- /dev/null +++ b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/JarCommandIT.java @@ -0,0 +1,150 @@ +/* + * 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.cli; + +import java.io.File; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import org.springframework.boot.cli.command.archive.JarCommand; +import org.springframework.boot.cli.infrastructure.CommandLineInvoker; +import org.springframework.boot.cli.infrastructure.CommandLineInvoker.Invocation; +import org.springframework.boot.loader.tools.JavaExecutable; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Integration test for {@link JarCommand}. + * + * @author Andy Wilkinson + * @author Stephane Nicoll + */ +class JarCommandIT { + + private static final boolean JAVA_9_OR_LATER = isClassPresent("java.security.cert.URICertStoreParameters"); + + private CommandLineInvoker cli; + + private File tempDir; + + @BeforeEach + void setup(@TempDir File tempDir) { + this.cli = new CommandLineInvoker(new File("src/intTest/resources/jar-command"), tempDir); + this.tempDir = tempDir; + } + + @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"); + } + + @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"); + } + + @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.await(); + if (!JAVA_9_OR_LATER) { + assertThat(invocation.getErrorOutput()).isEqualTo(""); + } + invocation = this.cli.invoke("jar", jar.getAbsolutePath(), "bad.groovy"); + invocation.await(); + if (!JAVA_9_OR_LATER) { + assertThat(invocation.getErrorOutput()).isEmpty(); + } + assertThat(jar).exists(); + + Process process = new JavaExecutable().processBuilder("-jar", jar.getAbsolutePath()).start(); + invocation = new Invocation(process); + invocation.await(); + + if (!JAVA_9_OR_LATER) { + assertThat(invocation.getErrorOutput()).isEqualTo(""); + } + } + + @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.await(); + if (!JAVA_9_OR_LATER) { + assertThat(invocation.getErrorOutput()).isEmpty(); + } + assertThat(jar).exists(); + + 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!") + .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 { + File jar = new File(this.tempDir, "test-app.jar"); + 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(); + 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") + .doesNotContain("/resources/resource.txt").contains("/static/static.txt") + .contains("/templates/template.txt").contains("Goodbye Mama"); + } + + private static boolean isClassPresent(String name) { + try { + Class.forName(name); + return true; + } + catch (Exception ex) { + return false; + } + } + +} diff --git a/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/WarCommandIT.java b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/WarCommandIT.java new file mode 100644 index 0000000000..4ea3ffa4b5 --- /dev/null +++ b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/WarCommandIT.java @@ -0,0 +1,66 @@ +/* + * 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.cli; + +import java.io.File; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import org.springframework.boot.cli.command.archive.WarCommand; +import org.springframework.boot.cli.infrastructure.CommandLineInvoker; +import org.springframework.boot.cli.infrastructure.CommandLineInvoker.Invocation; +import org.springframework.boot.loader.tools.JavaExecutable; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Integration test for {@link WarCommand}. + * + * @author Andrey Stolyarov + * @author Henri Kerola + */ +class WarCommandIT { + + private CommandLineInvoker cli; + + private File tempDir; + + @BeforeEach + void setup(@TempDir File tempDir) { + this.cli = new CommandLineInvoker(new File("src/intTest/resources/war-command"), tempDir); + this.tempDir = tempDir; + } + + @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.await(); + assertThat(war.exists()).isTrue(); + 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/classes!/root.properties"); + process.destroy(); + } + +} diff --git a/spring-boot-project/spring-boot-cli/src/intTest/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 new file mode 100644 index 0000000000..4792b8ebad --- /dev/null +++ b/spring-boot-project/spring-boot-cli/src/intTest/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java @@ -0,0 +1,217 @@ +/* + * 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.cli.infrastructure; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +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; +import java.util.stream.Collectors; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +import org.springframework.boot.testsupport.BuildOutput; +import org.springframework.util.Assert; +import org.springframework.util.StreamUtils; + +/** + * Utility to invoke the command line in the same way as a user would, i.e. via the shell + * script in the package's bin directory. + * + * @author Andy Wilkinson + * @author Phillip Webb + */ +public final class CommandLineInvoker { + + private final File workingDirectory; + + private final File temp; + + public CommandLineInvoker(File temp) { + this(new File("."), temp); + } + + public CommandLineInvoker(File workingDirectory, File temp) { + this.workingDirectory = workingDirectory; + this.temp = temp; + } + + public Invocation invoke(String... args) throws IOException { + return new Invocation(runCliProcess(args)); + } + + 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().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 File(new BuildOutput(getClass()).getRootLocation(), "distributions") + .listFiles((pathname) -> pathname.getName().endsWith("-bin.zip"))[0]; + try (ZipInputStream input = new ZipInputStream(new FileInputStream(zip))) { + ZipEntry entry; + while ((entry = input.getNextEntry()) != null) { + File file = new File(unpacked, entry.getName()); + if (entry.isDirectory()) { + file.mkdirs(); + } + else { + file.getParentFile().mkdirs(); + try (FileOutputStream output = new FileOutputStream(file)) { + StreamUtils.copy(input, output); + if (entry.getName().endsWith("/bin/spring")) { + file.setExecutable(true); + } + } + } + } + } + } + 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()); + return launchScript; + } + + private boolean isWindows() { + return File.separatorChar == '\\'; + } + + /** + * An ongoing Process invocation. + */ + public static final class Invocation { + + private final StringBuffer err = new StringBuffer(); + + private final StringBuffer out = new StringBuffer(); + + private final StringBuffer combined = new StringBuffer(); + + private final Process process; + + private final List streamReaders = new ArrayList<>(); + + 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))); + for (Thread streamReader : this.streamReaders) { + streamReader.start(); + } + } + + public String getOutput() { + return postProcessLines(getLines(this.combined)); + } + + public String getErrorOutput() { + return postProcessLines(getLines(this.err)); + } + + public String getStandardOutput() { + return postProcessLines(getStandardOutputLines()); + } + + public List getStandardOutputLines() { + return getLines(this.out); + } + + private String postProcessLines(List lines) { + StringWriter out = new StringWriter(); + PrintWriter printOut = new PrintWriter(out); + for (String line : lines) { + if (!line.startsWith("Maven settings decryption failed")) { + printOut.println(line); + } + } + return out.toString(); + } + + 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()); + } + + public int await() throws InterruptedException { + for (Thread streamReader : this.streamReaders) { + streamReader.join(); + } + return this.process.waitFor(); + } + + /** + * {@link Runnable} to copy stream output. + */ + private final class StreamReadingRunnable implements Runnable { + + private final InputStream stream; + + private final StringBuffer[] outputs; + + private final byte[] buffer = new byte[4096]; + + private StreamReadingRunnable(InputStream stream, StringBuffer... outputs) { + this.stream = stream; + this.outputs = outputs; + } + + @Override + public void run() { + int read; + try { + while ((read = this.stream.read(this.buffer)) > 0) { + for (StringBuffer output : this.outputs) { + output.append(new String(this.buffer, 0, read)); + } + } + } + catch (IOException ex) { + // Allow thread to die + } + } + + } + + } + +} 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 0000000000..bbe1ac0ed3 --- /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/it/java/org/springframework/boot/cli/CommandLineIT.java b/spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/CommandLineIT.java deleted file mode 100644 index c98970b269..0000000000 --- a/spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/CommandLineIT.java +++ /dev/null @@ -1,85 +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.cli; - -import java.io.File; -import java.io.IOException; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - -import org.springframework.boot.cli.infrastructure.CommandLineInvoker; -import org.springframework.boot.cli.infrastructure.CommandLineInvoker.Invocation; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Integration Tests for the command line application. - * - * @author Andy Wilkinson - * @author Phillip Webb - */ -class CommandLineIT { - - private CommandLineInvoker cli; - - @BeforeEach - void setup(@TempDir File tempDir) { - this.cli = new CommandLineInvoker(tempDir); - } - - @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 { - 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 { - 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.getStandardOutput()).isEmpty(); - } - - @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 { - Invocation cli = this.cli.invoke("help"); - assertThat(cli.await()).isEqualTo(1); - assertThat(cli.getErrorOutput()).isEmpty(); - assertThat(cli.getStandardOutput()).startsWith("usage:"); - } - -} 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/it/java/org/springframework/boot/cli/JarCommandIT.java deleted file mode 100644 index 255b91d5de..0000000000 --- a/spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/JarCommandIT.java +++ /dev/null @@ -1,155 +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.cli; - -import java.io.File; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - -import org.springframework.boot.cli.command.archive.JarCommand; -import org.springframework.boot.cli.infrastructure.CommandLineInvoker; -import org.springframework.boot.cli.infrastructure.CommandLineInvoker.Invocation; -import org.springframework.boot.loader.tools.JavaExecutable; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Integration test for {@link JarCommand}. - * - * @author Andy Wilkinson - * @author Stephane Nicoll - */ -class JarCommandIT { - - private static final boolean JAVA_9_OR_LATER = isClassPresent( - "java.security.cert.URICertStoreParameters"); - - private CommandLineInvoker cli; - - private File tempDir; - - @BeforeEach - void setup(@TempDir File tempDir) { - this.cli = new CommandLineInvoker(new File("src/it/resources/jar-command"), - tempDir); - this.tempDir = tempDir; - } - - @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"); - } - - @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"); - } - - @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.await(); - if (!JAVA_9_OR_LATER) { - assertThat(invocation.getErrorOutput()).isEqualTo(""); - } - invocation = this.cli.invoke("jar", jar.getAbsolutePath(), "bad.groovy"); - invocation.await(); - if (!JAVA_9_OR_LATER) { - assertThat(invocation.getErrorOutput()).isEmpty(); - } - assertThat(jar).exists(); - - Process process = new JavaExecutable() - .processBuilder("-jar", jar.getAbsolutePath()).start(); - invocation = new Invocation(process); - invocation.await(); - - if (!JAVA_9_OR_LATER) { - assertThat(invocation.getErrorOutput()).isEqualTo(""); - } - } - - @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.await(); - if (!JAVA_9_OR_LATER) { - assertThat(invocation.getErrorOutput()).isEmpty(); - } - assertThat(jar).exists(); - - 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!") - .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 { - File jar = new File(this.tempDir, "test-app.jar"); - 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(); - 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") - .doesNotContain("/resources/resource.txt").contains("/static/static.txt") - .contains("/templates/template.txt").contains("Goodbye Mama"); - } - - private static boolean isClassPresent(String name) { - try { - Class.forName(name); - return true; - } - catch (Exception ex) { - return false; - } - } - -} 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/it/java/org/springframework/boot/cli/WarCommandIT.java deleted file mode 100644 index 0554fff7d9..0000000000 --- a/spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/WarCommandIT.java +++ /dev/null @@ -1,69 +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.cli; - -import java.io.File; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - -import org.springframework.boot.cli.command.archive.WarCommand; -import org.springframework.boot.cli.infrastructure.CommandLineInvoker; -import org.springframework.boot.cli.infrastructure.CommandLineInvoker.Invocation; -import org.springframework.boot.loader.tools.JavaExecutable; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Integration test for {@link WarCommand}. - * - * @author Andrey Stolyarov - * @author Henri Kerola - */ -class WarCommandIT { - - private CommandLineInvoker cli; - - private File tempDir; - - @BeforeEach - void setup(@TempDir File tempDir) { - this.cli = new CommandLineInvoker(new File("src/it/resources/war-command"), - tempDir); - this.tempDir = tempDir; - } - - @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.await(); - assertThat(war.exists()).isTrue(); - 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/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/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java deleted file mode 100644 index b1e1c0cd78..0000000000 --- a/spring-boot-project/spring-boot-cli/src/it/java/org/springframework/boot/cli/infrastructure/CommandLineInvoker.java +++ /dev/null @@ -1,213 +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.cli.infrastructure; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.PrintWriter; -import java.io.StringReader; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; - -import org.springframework.boot.testsupport.BuildOutput; -import org.springframework.util.Assert; -import org.springframework.util.StreamUtils; - -/** - * Utility to invoke the command line in the same way as a user would, i.e. via the shell - * script in the package's bin directory. - * - * @author Andy Wilkinson - * @author Phillip Webb - */ -public final class CommandLineInvoker { - - private final File workingDirectory; - - private final File temp; - - public CommandLineInvoker(File temp) { - this(new File("."), temp); - } - - public CommandLineInvoker(File workingDirectory, File temp) { - this.workingDirectory = workingDirectory; - this.temp = temp; - } - - public Invocation invoke(String... args) throws IOException { - return new Invocation(runCliProcess(args)); - } - - private Process runCliProcess(String... args) throws IOException { - 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"); - 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() - .listFiles((pathname) -> pathname.getName().endsWith("-bin.zip"))[0]; - try (ZipInputStream input = new ZipInputStream(new FileInputStream(zip))) { - ZipEntry entry; - while ((entry = input.getNextEntry()) != null) { - File file = new File(unpacked, entry.getName()); - if (entry.isDirectory()) { - file.mkdirs(); - } - else { - file.getParentFile().mkdirs(); - try (FileOutputStream output = new FileOutputStream(file)) { - StreamUtils.copy(input, output); - if (entry.getName().endsWith("/bin/spring")) { - file.setExecutable(true); - } - } - } - } - } - } - 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()); - return launchScript; - } - - private boolean isWindows() { - return File.separatorChar == '\\'; - } - - /** - * An ongoing Process invocation. - */ - public static final class Invocation { - - private final StringBuffer err = new StringBuffer(); - - private final StringBuffer out = new StringBuffer(); - - private final StringBuffer combined = new StringBuffer(); - - private final Process process; - - private final List streamReaders = new ArrayList<>(); - - 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))); - for (Thread streamReader : this.streamReaders) { - streamReader.start(); - } - } - - public String getOutput() { - return postProcessLines(getLines(this.combined)); - } - - public String getErrorOutput() { - return postProcessLines(getLines(this.err)); - } - - public String getStandardOutput() { - return postProcessLines(getStandardOutputLines()); - } - - public List getStandardOutputLines() { - return getLines(this.out); - } - - private String postProcessLines(List lines) { - StringWriter out = new StringWriter(); - PrintWriter printOut = new PrintWriter(out); - for (String line : lines) { - if (!line.startsWith("Maven settings decryption failed")) { - printOut.println(line); - } - } - return out.toString(); - } - - 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()); - } - - public int await() throws InterruptedException { - for (Thread streamReader : this.streamReaders) { - streamReader.join(); - } - return this.process.waitFor(); - } - - /** - * {@link Runnable} to copy stream output. - */ - private final class StreamReadingRunnable implements Runnable { - - private final InputStream stream; - - private final StringBuffer[] outputs; - - private final byte[] buffer = new byte[4096]; - - private StreamReadingRunnable(InputStream stream, StringBuffer... outputs) { - this.stream = stream; - this.outputs = outputs; - } - - @Override - public void run() { - int read; - try { - while ((read = this.stream.read(this.buffer)) > 0) { - for (StringBuffer output : this.outputs) { - output.append(new String(this.buffer, 0, read)); - } - } - } - catch (IOException ex) { - // Allow thread to die - } - } - - } - - } - -} 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 4c9d0e7590..5f338dcceb 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 694c278542..7f79b5c08a 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 @@ public class SpringBootDependenciesDependencyManagement extends MavenModelDepend 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 10a8e7b02a..c1ae15b6d5 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 @@ public class MavenSettingsReader { } 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 b8b3ad73f2..dbfe2308cc 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 f9015b196f..0586e792af 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 class CliTester implements BeforeEachCallback, AfterEachCallback { 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 @@ public class CliTester implements BeforeEachCallback, AfterEachCallback { "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 @@ public class CliTester implements BeforeEachCallback, AfterEachCallback { 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 8790f3f314..fec42a0efc 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 @@ class GrabCommandIntegrationTests { @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 d16fa45684..28c5991d5b 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 abf868f0f7..b6677248c5 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 @@ package org.springframework.boot.cli.compiler.dependencies; 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 @@ class SpringBootDependenciesDependencyManagementTests { @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 95377e122b..2c1d15329c 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 @@ class AetherGrapeEngineTests { @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 @@ class AetherGrapeEngineTests { 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 @@ class AetherGrapeEngineTests { 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 8ae764f39d..7aff364114 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-cli/src/test/resources/cli-tester/.m2/settings.xml b/spring-boot-project/spring-boot-cli/src/test/resources/cli-tester/.m2/settings.xml new file mode 100644 index 0000000000..504eb80a05 --- /dev/null +++ b/spring-boot-project/spring-boot-cli/src/test/resources/cli-tester/.m2/settings.xml @@ -0,0 +1,44 @@ + + + build/local-m2-repository + + + cli-test-repo + + true + + + + local.central + file:build/test-repository + + 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-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 0000000000..32640370e1 --- /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 0000000000..f3d7d7ec17 --- /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 ce2763d9eb..0000000000 --- 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 0000000000..4120f22aea --- /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 9af7e352ad..0000000000 --- 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-project/spring-boot-devtools/src/intTest/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 new file mode 100644 index 0000000000..e8773240a6 --- /dev/null +++ b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java @@ -0,0 +1,113 @@ +/* + * 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.devtools.tests; + +import java.io.File; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; + +import net.bytebuddy.ByteBuddy; +import net.bytebuddy.description.annotation.AnnotationDescription; +import net.bytebuddy.description.modifier.Visibility; +import net.bytebuddy.dynamic.DynamicType; +import net.bytebuddy.implementation.FixedValue; +import org.awaitility.Awaitility; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.io.TempDir; + +import org.springframework.boot.testsupport.BuildOutput; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Base class for DevTools integration tests. + * + * @author Andy Wilkinson + */ +abstract class AbstractDevToolsIntegrationTests { + + protected static final BuildOutput buildOutput = new BuildOutput(AbstractDevToolsIntegrationTests.class); + + protected final File serverPortFile = new File(buildOutput.getRootLocation(), "server.port"); + + @RegisterExtension + protected final JvmLauncher javaLauncher = new JvmLauncher(); + + @TempDir + protected static File temp; + + protected LaunchedApplication launchedApplication; + + protected void launchApplication(ApplicationLauncher applicationLauncher, String... args) throws Exception { + this.serverPortFile.delete(); + this.launchedApplication = applicationLauncher.launchApplication(this.javaLauncher, this.serverPortFile, args); + } + + @AfterEach + void stopApplication() throws InterruptedException { + this.launchedApplication.stop(); + } + + protected int awaitServerPort() throws Exception { + int port = Awaitility.waitAtMost(Duration.ofSeconds(30)) + .until(() -> new ApplicationState(this.serverPortFile, this.launchedApplication), + ApplicationState::hasServerPort) + .getServerPort(); + this.serverPortFile.delete(); + this.launchedApplication.restartRemote(port); + Thread.sleep(1000); + return port; + } + + protected ControllerBuilder controller(String name) { + return new ControllerBuilder(name, this.launchedApplication.getClassesDirectory()); + } + + protected static final class ControllerBuilder { + + private final List mappings = new ArrayList<>(); + + private final String name; + + private final File classesDirectory; + + protected ControllerBuilder(String name, File classesDirectory) { + this.name = name; + this.classesDirectory = classesDirectory; + } + + protected ControllerBuilder withRequestMapping(String mapping) { + this.mappings.add(mapping); + return this; + } + + protected void build() throws Exception { + DynamicType.Builder builder = new ByteBuddy().subclass(Object.class).name(this.name) + .annotateType(AnnotationDescription.Builder.ofType(RestController.class).build()); + for (String mapping : this.mappings) { + builder = builder.defineMethod(mapping, String.class, Visibility.PUBLIC) + .intercept(FixedValue.value(mapping)).annotateMethod(AnnotationDescription.Builder + .ofType(RequestMapping.class).defineArray("value", mapping).build()); + } + builder.make().saveIn(this.classesDirectory); + } + + } + +} 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-project/spring-boot-devtools/src/intTest/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 new file mode 100644 index 0000000000..91d5290783 --- /dev/null +++ b/spring-boot-project/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java @@ -0,0 +1,163 @@ +/* + * 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.devtools.tests; + +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; + +/** + * Integration tests for DevTools. + * + * @author Andy Wilkinson + */ +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); + String urlBase = "http://localhost:" + awaitServerPort(); + 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(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); + String urlBase = "http://localhost:" + awaitServerPort(); + assertThat(this.template.getForObject(urlBase + "/one", String.class)).isEqualTo("one"); + controller("com.example.ControllerOne").build(); + urlBase = "http://localhost:" + awaitServerPort(); + assertThat(this.template.getForEntity(urlBase + "/one", String.class).getStatusCode()) + .isEqualTo(HttpStatus.NOT_FOUND); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("parameters") + void createAController(ApplicationLauncher applicationLauncher) throws Exception { + launchApplication(applicationLauncher); + String urlBase = "http://localhost:" + awaitServerPort(); + 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(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 createAControllerAndThenAddARequestMapping(ApplicationLauncher applicationLauncher) throws Exception { + launchApplication(applicationLauncher); + String urlBase = "http://localhost:" + awaitServerPort(); + 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(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(this.template.getForObject(urlBase + "/three", String.class)).isEqualTo("three"); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("parameters") + void createAControllerAndThenAddARequestMappingToAnExistingController(ApplicationLauncher applicationLauncher) + throws Exception { + launchApplication(applicationLauncher); + String urlBase = "http://localhost:" + awaitServerPort(); + 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(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(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); + String urlBase = "http://localhost:" + awaitServerPort(); + 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(this.template.getForEntity(urlBase + "/one", String.class).getStatusCode()) + .isEqualTo(HttpStatus.NOT_FOUND); + + } + + @ParameterizedTest(name = "{0}") + @MethodSource("parameters") + void createAControllerAndThenDeleteIt(ApplicationLauncher applicationLauncher) throws Exception { + launchApplication(applicationLauncher); + String urlBase = "http://localhost:" + awaitServerPort(); + 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(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(this.template.getForEntity(urlBase + "/two", String.class).getStatusCode()) + .isEqualTo(HttpStatus.NOT_FOUND); + } + + static Object[] parameters() throws IOException { + Directories directories = new Directories(buildOutput, temp); + return new Object[] { new Object[] { new LocalApplicationLauncher(directories) }, + new Object[] { new ExplodedRemoteApplicationLauncher(directories) }, + new Object[] { new JarFileRemoteApplicationLauncher(directories) } }; + } + +} 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 9810d8d63e..88ee28a8f8 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 f698822000..e82daac477 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 @@ class FileSystemWatcherTests { } @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 85567ef2c5..f51b34b422 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 @@ class ChangeableUrlsTests { 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 9602bfc0c4..4b1edbbdac 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 @@ class DefaultRestartInitializerTests { } @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 590536d4c8..5f0ca38094 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 @@ class DevToolsSettingsTests { 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 0000000000..69fb5da90c --- /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 1ff020f128..0000000000 --- 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/docs/asciidoc/appendix-application-properties.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-application-properties.adoc new file mode 100644 index 0000000000..723b3f609e --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-application-properties.adoc @@ -0,0 +1,78 @@ +:numbered!: +[appendix] +[[common-application-properties]] += Common Application properties +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. + +TIP: Spring Boot provides various conversion mechanism with advanced value formatting, make sure to review <>. + +NOTE: Property contributions can come from additional jar files on your classpath, so you should not consider this an exhaustive list. +Also, you can define your own properties. + + +== Core properties + +include::config-docs/core.adoc[] + +== Cache properties + +include::config-docs/cache.adoc[] + +== Mail properties + +include::config-docs/mail.adoc[] + +== JSON properties + +include::config-docs/json.adoc[] + +== Data properties + +include::config-docs/data.adoc[] + +== Transaction properties + +include::config-docs/transaction.adoc[] + +== Data migration properties + +include::config-docs/data-migration.adoc[] + +== Integration properties + +include::config-docs/integration.adoc[] + +== Web properties + +include::config-docs/web.adoc[] + +== Templating properties + +include::config-docs/templating.adoc[] + +== Server properties + +include::config-docs/server.adoc[] + +== Security properties + +include::config-docs/security.adoc[] + +== RSocket properties + +include::config-docs/rsocket.adoc[] + +== Actuator properties + +include::config-docs/actuator.adoc[] + +== Devtools properties + +include::config-docs/devtools.adoc[] + +== Testing properties + +include::config-docs/testing.adoc[] diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-auto-configuration-classes.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-auto-configuration-classes.adoc new file mode 100644 index 0000000000..a098131bea --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-auto-configuration-classes.adoc @@ -0,0 +1,24 @@ +[appendix] +[[auto-configuration-classes]] += Auto-configuration Classes +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. +(To do so, start the app with `--debug` or `-Ddebug` or, in an Actuator application, use the `conditions` endpoint). + + + +[[auto-configuration-classes-from-autoconfigure-module]] +== `spring-boot-autoconfigure` +The following auto-configuration classes are from the `spring-boot-autoconfigure` module: + +include::auto-configuration-classes/spring-boot-autoconfigure.adoc[] + + + +[[auto-configuration-classes-from-actuator]] +== `spring-boot-actuator-autoconfigure` +The following auto-configuration classes are from the `spring-boot-actuator-autoconfigure` module: + +include::auto-configuration-classes/spring-boot-actuator-autoconfigure.adoc[] diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-configuration-metadata.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-configuration-metadata.adoc new file mode 100644 index 0000000000..899c323cc7 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-configuration-metadata.adoc @@ -0,0 +1,860 @@ +[appendix] +[[configuration-metadata]] += Configuration Metadata +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. + +The majority of the metadata file is generated automatically at compile time by processing all items annotated with `@ConfigurationProperties`. +However, it is possible to <> for corner cases or more advanced use cases. + + + +[[configuration-metadata-format]] +== Metadata Format +Configuration metadata files are located inside jars under `META-INF/spring-configuration-metadata.json`. +They use a simple JSON format with items categorized under either "`groups`" or "`properties`" and additional values hints categorized under "hints", as shown in the following example: + +[source,json,indent=0] +---- + {"groups": [ + { + "name": "server", + "type": "org.springframework.boot.autoconfigure.web.ServerProperties", + "sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties" + }, + { + "name": "spring.jpa.hibernate", + "type": "org.springframework.boot.autoconfigure.orm.jpa.JpaProperties$Hibernate", + "sourceType": "org.springframework.boot.autoconfigure.orm.jpa.JpaProperties", + "sourceMethod": "getHibernate()" + } + ... + ],"properties": [ + { + "name": "server.port", + "type": "java.lang.Integer", + "sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties" + }, + { + "name": "server.address", + "type": "java.net.InetAddress", + "sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties" + }, + { + "name": "spring.jpa.hibernate.ddl-auto", + "type": "java.lang.String", + "description": "DDL mode. This is actually a shortcut for the \"hibernate.hbm2ddl.auto\" property.", + "sourceType": "org.springframework.boot.autoconfigure.orm.jpa.JpaProperties$Hibernate" + } + ... + ],"hints": [ + { + "name": "spring.jpa.hibernate.ddl-auto", + "values": [ + { + "value": "none", + "description": "Disable DDL handling." + }, + { + "value": "validate", + "description": "Validate the schema, make no changes to the database." + }, + { + "value": "update", + "description": "Update the schema if necessary." + }, + { + "value": "create", + "description": "Create the schema and destroy previous data." + }, + { + "value": "create-drop", + "description": "Create and then destroy the schema at the end of the session." + } + ] + } + ]} +---- + +Each "`property`" is a configuration item that the user specifies with a given value. +For example, `server.port` and `server.address` might be specified in `application.properties`, as follows: + +[source,properties,indent=0,configprops] +---- + server.port=9090 + server.address=127.0.0.1 +---- + +The "`groups`" are higher level items that do not themselves specify a value but instead provide a contextual grouping for properties. +For example, the `server.port` and `server.address` properties are part of the `server` group. + +NOTE: It is not required that every "`property`" has a "`group`". +Some properties might exist in their own right. + +Finally, "`hints`" are additional information used to assist the user in configuring a given property. +For example, when a developer is configuring the configprop:spring.jpa.hibernate.ddl-auto[] property, a tool can use the hints to offer some auto-completion help for the `none`, `validate`, `update`, `create`, and `create-drop` values. + + + +[[configuration-metadata-group-attributes]] +=== Group Attributes +The JSON object contained in the `groups` array can contain the attributes shown in the following table: + +[cols="1,1,4"] +|=== +| Name | Type | Purpose + +| `name` +| String +| The full name of the group. + This attribute is mandatory. + +| `type` +| String +| The class name of the data type of the group. + For example, if the group were based on a class annotated with `@ConfigurationProperties`, the attribute would contain the fully qualified name of that class. + If it were based on a `@Bean` method, it would be the return type of that method. + If the type is not known, the attribute may be omitted. + +| `description` +| String +| A short description of the group that can be displayed to users. + If no description is available, it may be omitted. + It is recommended that descriptions be short paragraphs, with the first line providing a concise summary. + The last line in the description should end with a period (`.`). + +| `sourceType` +| String +| The class name of the source that contributed this group. + For example, if the group were based on a `@Bean` method annotated with `@ConfigurationProperties`, this attribute would contain the fully qualified name of the `@Configuration` class that contains the method. + If the source type is not known, the attribute may be omitted. + +| `sourceMethod` +| String +| The full name of the method (include parenthesis and argument types) that contributed this group (for example, the name of a `@ConfigurationProperties` annotated `@Bean` method). + If the source method is not known, it may be omitted. +|=== + + + +[[configuration-metadata-property-attributes]] +=== Property Attributes +The JSON object contained in the `properties` array can contain the attributes described in the following table: + +[cols="1,1,4"] +|=== +| Name | Type | Purpose + +| `name` +| String +| The full name of the property. + Names are in lower-case period-separated form (for example, `server.address`). + This attribute is mandatory. + +| `type` +| String +| The full signature of the data type of the property (for example, `java.lang.String`) but also a full generic type (such as `java.util.Map`). + You can use this attribute to guide the user as to the types of values that they can enter. + For consistency, the type of a primitive is specified by using its wrapper counterpart (for example, `boolean` becomes `java.lang.Boolean`). + Note that this class may be a complex type that gets converted from a `String` as values are bound. + If the type is not known, it may be omitted. + +| `description` +| String +| A short description of the property that can be displayed to users. + If no description is available, it may be omitted. + It is recommended that descriptions be short paragraphs, with the first line providing a concise summary. + The last line in the description should end with a period (`.`). + +| `sourceType` +| String +| The class name of the source that contributed this property. + For example, if the property were from a class annotated with `@ConfigurationProperties`, this attribute would contain the fully qualified name of that class. + If the source type is unknown, it may be omitted. + +| `defaultValue` +| Object +| The default value, which is used if the property is not specified. + If the type of the property is an array, it can be an array of value(s). + If the default value is unknown, it may be omitted. + +| `deprecation` +| Deprecation +| Specify whether the property is deprecated. + If the field is not deprecated or if that information is not known, it may be omitted. + The next table offers more detail about the `deprecation` attribute. +|=== + +The JSON object contained in the `deprecation` attribute of each `properties` element can contain the following attributes: + +[cols="1,1,4"] +|=== +| Name | Type | Purpose + +| `level` +| String +| The level of deprecation, which can be either `warning` (the default) or `error`. + When a property has a `warning` deprecation level, it should still be bound in the environment. + However, when it has an `error` deprecation level, the property is no longer managed and is not bound. + +| `reason` +| String +| A short description of the reason why the property was deprecated. + If no reason is available, it may be omitted. + It is recommended that descriptions be short paragraphs, with the first line providing a concise summary. + The last line in the description should end with a period (`.`). + +| `replacement` +| String +| The full name of the property that _replaces_ this deprecated property. + If there is no replacement for this property, it may be omitted. +|=== + +NOTE: Prior to Spring Boot 1.3, a single `deprecated` boolean attribute can be used instead of the `deprecation` element. +This is still supported in a deprecated fashion and should no longer be used. +If no reason and replacement are available, an empty `deprecation` object should be set. + +Deprecation can also be specified declaratively in code by adding the `@DeprecatedConfigurationProperty` annotation to the getter exposing the deprecated property. +For instance, assume that the `app.acme.target` property was confusing and was renamed to `app.acme.name`. +The following example shows how to handle that situation: + +[source,java,indent=0] +---- + @ConfigurationProperties("app.acme") + public class AcmeProperties { + + private String name; + + public String getName() { ... } + + public void setName(String name) { ... } + + @DeprecatedConfigurationProperty(replacement = "app.acme.name") + @Deprecated + public String getTarget() { + return getName(); + } + + @Deprecated + public void setTarget(String target) { + setName(target); + } + } +---- + +NOTE: There is no way to set a `level`. +`warning` is always assumed, since code is still handling the property. + +The preceding code makes sure that the deprecated property still works (delegating to the `name` property behind the scenes). +Once the `getTarget` and `setTarget` methods can be removed from your public API, the automatic deprecation hint in the metadata goes away as well. +If you want to keep a hint, adding manual metadata with an `error` deprecation level ensures that users are still informed about that property. +Doing so is particularly useful when a `replacement` is provided. + + + +[[configuration-metadata-hints-attributes]] +=== Hint Attributes +The JSON object contained in the `hints` array can contain the attributes shown in the following table: + +[cols="1,1,4"] +|=== +| Name | Type | Purpose + +| `name` +| String +| The full name of the property to which this hint refers. + Names are in lower-case period-separated form (such as `spring.mvc.servlet.path`). + If the property refers to a map (such as `system.contexts`), the hint either applies to the _keys_ of the map (`system.contexts.keys`) or the _values_ (`system.contexts.values`) of the map. + This attribute is mandatory. + +| `values` +| ValueHint[] +| A list of valid values as defined by the `ValueHint` object (described in the next table). + Each entry defines the value and may have a description. + +| `providers` +| ValueProvider[] +| A list of providers as defined by the `ValueProvider` object (described later in this document). + Each entry defines the name of the provider and its parameters, if any. +|=== + +The JSON object contained in the `values` attribute of each `hint` element can contain the attributes described in the following table: + +[cols="1,1,4"] +|=== +| Name | Type | Purpose + +| `value` +| Object +| A valid value for the element to which the hint refers. + If the type of the property is an array, it can also be an array of value(s). + This attribute is mandatory. + +| `description` +| String +| A short description of the value that can be displayed to users. + If no description is available, it may be omitted. + It is recommended that descriptions be short paragraphs, with the first line providing a concise summary. + The last line in the description should end with a period (`.`). +|=== + +The JSON object contained in the `providers` attribute of each `hint` element can contain the attributes described in the following table: + +[cols="1,1,4"] +|=== +|Name | Type |Purpose + +| `name` +| String +| The name of the provider to use to offer additional content assistance for the element to which the hint refers. + +| `parameters` +| JSON object +| Any additional parameter that the provider supports (check the documentation of the provider for more details). +|=== + + + +[[configuration-metadata-repeated-items]] +=== Repeated Metadata Items +Objects with the same "`property`" and "`group`" name can appear multiple times within a metadata file. +For example, you could bind two separate classes to the same prefix, with each having potentially overlapping property names. +While the same names appearing in the metadata multiple times should not be common, consumers of metadata should take care to ensure that they support it. + + + +[[configuration-metadata-providing-manual-hints]] +== Providing Manual Hints +To improve the user experience and further assist the user in configuring a given property, you can provide additional metadata that: + +* Describes the list of potential values for a property. +* Associates a provider, to attach a well defined semantic to a property, so that a tool can discover the list of potential values based on the project's context. + + +=== Value Hint +The `name` attribute of each hint refers to the `name` of a property. +In the <>, we provide five values for the `spring.jpa.hibernate.ddl-auto` property: `none`, `validate`, `update`, `create`, and `create-drop`. +Each value may have a description as well. + +If your property is of type `Map`, you can provide hints for both the keys and the values (but not for the map itself). +The special `.keys` and `.values` suffixes must refer to the keys and the values, respectively. + +Assume a `sample.contexts` maps magic `String` values to an integer, as shown in the following example: + +[source,java,indent=0] +---- + @ConfigurationProperties("sample") + public class SampleProperties { + + private Map contexts; + // getters and setters + } +---- + +The magic values are (in this example) are `sample1` and `sample2`. +In order to offer additional content assistance for the keys, you could add the following JSON to <>: + +[source,json,indent=0] +---- + {"hints": [ + { + "name": "sample.contexts.keys", + "values": [ + { + "value": "sample1" + }, + { + "value": "sample2" + } + ] + } + ]} +---- + +TIP: We recommend that you use an `Enum` for those two values instead. +If your IDE supports it, this is by far the most effective approach to auto-completion. + + + +=== Value Providers +Providers are a powerful way to attach semantics to a property. +In this section, we define the official providers that you can use for your own hints. +However, your favorite IDE may implement some of these or none of them. +Also, it could eventually provide its own. + +NOTE: As this is a new feature, IDE vendors must catch up with how it works. +Adoption times naturally vary. + +The following table summarizes the list of supported providers: + +[cols="2,4"] +|=== +| Name | Description + +| `any` +| Permits any additional value to be provided. + +| `class-reference` +| Auto-completes the classes available in the project. + Usually constrained by a base class that is specified by the `target` parameter. + +| `handle-as` +| Handles the property as if it were defined by the type defined by the mandatory `target` parameter. + +| `logger-name` +| Auto-completes valid logger names and <>. + Typically, package and class names available in the current project can be auto-completed as well as defined groups. + +| `spring-bean-reference` +| Auto-completes the available bean names in the current project. + Usually constrained by a base class that is specified by the `target` parameter. + +| `spring-profile-name` +| Auto-completes the available Spring profile names in the project. +|=== + +TIP: Only one provider can be active for a given property, but you can specify several providers if they can all manage the property _in some way_. +Make sure to place the most powerful provider first, as the IDE must use the first one in the JSON section that it can handle. +If no provider for a given property is supported, no special content assistance is provided, either. + + + +==== Any +The special **any** provider value permits any additional values to be provided. +Regular value validation based on the property type should be applied if this is supported. + +This provider is typically used if you have a list of values and any extra values should still be considered as valid. + +The following example offers `on` and `off` as auto-completion values for `system.state`: + +[source,json,indent=0] +---- + {"hints": [ + { + "name": "system.state", + "values": [ + { + "value": "on" + }, + { + "value": "off" + } + ], + "providers": [ + { + "name": "any" + } + ] + } + ]} +---- + +Note that, in the preceding example, any other value is also allowed. + +==== Class Reference +The **class-reference** provider auto-completes classes available in the project. +This provider supports the following parameters: + +[cols="1,1,2,4"] +|=== +| Parameter | Type | Default value | Description + +| `target` +| `String` (`Class`) +| _none_ +| The fully qualified name of the class that should be assignable to the chosen value. + Typically used to filter out-non candidate classes. + Note that this information can be provided by the type itself by exposing a class with the appropriate upper bound. + +| `concrete` +| `boolean` +| true +| Specify whether only concrete classes are to be considered as valid candidates. +|=== + + +The following metadata snippet corresponds to the standard `server.servlet.jsp.class-name` property that defines the `JspServlet` class name to use: + +[source,json,indent=0] +---- + {"hints": [ + { + "name": "server.servlet.jsp.class-name", + "providers": [ + { + "name": "class-reference", + "parameters": { + "target": "javax.servlet.http.HttpServlet" + } + } + ] + } + ]} +---- + + + +==== Handle As +The **handle-as** provider lets you substitute the type of the property to a more high-level type. +This typically happens when the property has a `java.lang.String` type, because you do not want your configuration classes to rely on classes that may not be on the classpath. +This provider supports the following parameters: + +[cols="1,1,2,4"] +|=== +| Parameter | Type | Default value | Description + +| **`target`** +| `String` (`Class`) +| _none_ +| The fully qualified name of the type to consider for the property. + This parameter is mandatory. +|=== + +The following types can be used: + +* Any `java.lang.Enum`: Lists the possible values for the property. + (We recommend defining the property with the `Enum` type, as no further hint should be required for the IDE to auto-complete the values) +* `java.nio.charset.Charset`: Supports auto-completion of charset/encoding values (such as `UTF-8`) +* `java.util.Locale`: auto-completion of locales (such as `en_US`) +* `org.springframework.util.MimeType`: Supports auto-completion of content type values (such as `text/plain`) +* `org.springframework.core.io.Resource`: Supports auto-completion of Spring’s Resource abstraction to refer to a file on the filesystem or on the classpath (such as `classpath:/sample.properties`) + +TIP: If multiple values can be provided, use a `Collection` or _Array_ type to teach the IDE about it. + +The following metadata snippet corresponds to the standard `spring.liquibase.change-log` property that defines the path to the changelog to use. +It is actually used internally as a `org.springframework.core.io.Resource` but cannot be exposed as such, because we need to keep the original String value to pass it to the Liquibase API. + +[source,json,indent=0] +---- + {"hints": [ + { + "name": "spring.liquibase.change-log", + "providers": [ + { + "name": "handle-as", + "parameters": { + "target": "org.springframework.core.io.Resource" + } + } + ] + } + ]} +---- + + + +==== Logger Name +The **logger-name** provider auto-completes valid logger names and <>. +Typically, package and class names available in the current project can be auto-completed. +If groups are enabled (default) and if a custom logger group is identified in the configuration, auto-completion for it should be provided. +Specific frameworks may have extra magic logger names that can be supported as well. + +This provider supports the following parameters: + +[cols="1,1,2,4"] +|=== +| Parameter | Type | Default value | Description + +| `group` +| `boolean` +| `true` +| Specify whether known groups should be considered. +|=== + +Since a logger name can be any arbitrary name, this provider should allow any value but could highlight valid package and class names that are not available in the project's classpath. + +The following metadata snippet corresponds to the standard `logging.level` property. +Keys are _logger names_, and values correspond to the standard log levels or any custom level. +As Spring Boot defines a few logger groups out-of-the-box, dedicated value hints have been added for those. + +[source,json,indent=0] +---- + {"hints": [ + { + "name": "logging.level.keys", + "values": [ + { + "value": "root", + "description": "Root logger used to assign the default logging level." + }, + { + "value": "sql", + "description": "SQL logging group including Hibernate SQL logger." + }, + { + "value": "web", + "description": "Web logging group including codecs." + } + ], + "providers": [ + { + "name": "logger-name" + } + ] + }, + { + "name": "logging.level.values", + "values": [ + { + "value": "trace" + }, + { + "value": "debug" + }, + { + "value": "info" + }, + { + "value": "warn" + }, + { + "value": "error" + }, + { + "value": "fatal" + }, + { + "value": "off" + } + + ], + "providers": [ + { + "name": "any" + } + ] + } + ]} +---- + + + +==== Spring Bean Reference +The **spring-bean-reference** provider auto-completes the beans that are defined in the configuration of the current project. +This provider supports the following parameters: + +[cols="1,1,2,4"] +|=== +| Parameter | Type | Default value | Description + +| `target` +| `String` (`Class`) +| _none_ +| The fully qualified name of the bean class that should be assignable to the candidate. + Typically used to filter out non-candidate beans. +|=== + +The following metadata snippet corresponds to the standard `spring.jmx.server` property that defines the name of the `MBeanServer` bean to use: + +[source,json,indent=0] +---- + {"hints": [ + { + "name": "spring.jmx.server", + "providers": [ + { + "name": "spring-bean-reference", + "parameters": { + "target": "javax.management.MBeanServer" + } + } + ] + } + ]} +---- + +NOTE: The binder is not aware of the metadata. +If you provide that hint, you still need to transform the bean name into an actual Bean reference using by the `ApplicationContext`. + + + +==== Spring Profile Name +The **spring-profile-name** provider auto-completes the Spring profiles that are defined in the configuration of the current project. + +The following metadata snippet corresponds to the standard `spring.profiles.active` property that defines the name of the Spring profile(s) to enable: + +[source,json,indent=0] +---- + {"hints": [ + { + "name": "spring.profiles.active", + "providers": [ + { + "name": "spring-profile-name" + } + ] + } + ]} +---- + + + +[[configuration-metadata-annotation-processor]] +== Generating Your Own Metadata by Using the Annotation Processor +You can easily generate your own configuration metadata file from items annotated with `@ConfigurationProperties` by using the `spring-boot-configuration-processor` jar. +The jar includes a Java annotation processor which is invoked as your project is compiled. +To use the processor, include a dependency on `spring-boot-configuration-processor`. + +With Maven the dependency should be declared as optional, as shown in the following example: + +[source,xml,indent=0,subs="verbatim,quotes,attributes"] +---- + + org.springframework.boot + spring-boot-configuration-processor + true + +---- + +With Gradle 4.5 and earlier, the dependency should be declared in the `compileOnly` configuration, as shown in the following example: + +[source,groovy,indent=0,subs="verbatim,quotes,attributes"] +---- + dependencies { + compileOnly "org.springframework.boot:spring-boot-configuration-processor" + } +---- + +With Gradle 4.6 and later, the dependency should be declared in the `annotationProcessor` configuration, as shown in the following example: + +[source,groovy,indent=0,subs="verbatim,quotes,attributes"] +---- + dependencies { + annotationProcessor "org.springframework.boot:spring-boot-configuration-processor" + } +---- + +If you are using an `additional-spring-configuration-metadata.json` file, the `compileJava` task should be configured to depend on the `processResources` task, as shown in the following example: + +[source,groovy,indent=0,subs="verbatim,quotes,attributes"] +---- + compileJava.dependsOn(processResources) +---- + +This dependency ensures that the additional metadata is available when the annotation processor runs during compilation. + +The processor picks up both classes and methods that are annotated with `@ConfigurationProperties`. +The Javadoc for field values within configuration classes is used to populate the `description` attribute. + +NOTE: You should only use simple text with `@ConfigurationProperties` field Javadoc, since they are not processed before being added to the JSON. + +If the class has a single constructor with at least one parameters, one property is created per constructor parameter. +Otherwise, properties are discovered through the presence of standard getters and setters with special handling for collection types (that is detected even if only a getter is present). + +The annotation processor also supports the use of the `@Data`, `@Getter`, and `@Setter` lombok annotations. + +The annotation processor cannot auto-detect default values for ``Enum``s and ``Collections``s. +In the cases where a `Collection` or `Enum` property has a non-empty default value, <> should be provided. + +Consider the following class: + +[source,java,indent=0,subs="verbatim,quotes,attributes"] +---- + @ConfigurationProperties(prefix = "acme.messaging") + public class MessagingProperties { + + private List addresses = new ArrayList<>(Arrays.asList("a", "b")); + + private ContainerType containerType = ContainerType.SIMPLE; + + // ... getter and setters + + public enum ContainerType { + + SIMPLE, + DIRECT + + } + + } +---- + +In order to document default values for properties in the class above, you could add the following content to <>: + +[source,json,indent=0] +---- + {"properties": [ + { + "name": "acme.messaging.addresses", + "defaultValue": ["a", "b"] + }, + { + "name": "acme.messaging.container-type", + "defaultValue": "simple" + } + ]} +---- + +Only the `name` of the property is required to document additional fields with manual metadata. + +[NOTE] +==== +If you are using AspectJ in your project, you need to make sure that the annotation processor runs only once. +There are several ways to do this. +With Maven, you can configure the `maven-apt-plugin` explicitly and add the dependency to the annotation processor only there. +You could also let the AspectJ plugin run all the processing and disable annotation processing in the `maven-compiler-plugin` configuration, as follows: + +[source,xml,indent=0,subs="verbatim,quotes,attributes"] +---- + + org.apache.maven.plugins + maven-compiler-plugin + + none + + +---- +==== + + + +[[configuration-metadata-nested-properties]] +=== Nested Properties +The annotation processor automatically considers inner classes as nested properties. +Consider the following class: + +[source,java,indent=0,subs="verbatim,quotes,attributes"] +---- + @ConfigurationProperties(prefix="server") + public class ServerProperties { + + private String name; + + private Host host; + + // ... getter and setters + + public static class Host { + + private String ip; + + private int port; + + // ... getter and setters + + } + + } +---- + +The preceding example produces metadata information for `server.name`, `server.host.ip`, and `server.host.port` properties. +You can use the `@NestedConfigurationProperty` annotation on a field to indicate that a regular (non-inner) class should be treated as if it were nested. + +TIP: This has no effect on collections and maps, as those types are automatically identified, and a single metadata property is generated for each of them. + + + +[[configuration-metadata-additional-metadata]] +=== Adding Additional Metadata +Spring Boot's configuration file handling is quite flexible, and it is often the case that properties may exist that are not bound to a `@ConfigurationProperties` bean. +You may also need to tune some attributes of an existing key. +To support such cases and let you provide custom "hints", the annotation processor automatically merges items from `META-INF/additional-spring-configuration-metadata.json` into the main metadata file. + +If you refer to a property that has been detected automatically, the description, default value, and deprecation information are overridden, if specified. +If the manual property declaration is not identified in the current module, it is added as a new property. + +The format of the `additional-spring-configuration-metadata.json` file is exactly the same as the regular `spring-configuration-metadata.json`. +The additional properties file is optional. +If you do not have any additional properties, do not add the file. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-dependency-versions.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-dependency-versions.adoc new file mode 100644 index 0000000000..e5049c86dc --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-dependency-versions.adoc @@ -0,0 +1,14 @@ +[appendix] +[[dependency-versions]] += Dependency versions +include::attributes.adoc[] + +This appendix provides details of the dependencies that are managed by Spring Boot. + +[[dependency-versions-coordinates]] +== Managed Dependency Coordinates + +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::dependency-versions.adoc[] diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-executable-jar-format.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-executable-jar-format.adoc new file mode 100644 index 0000000000..dda383d71e --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-executable-jar-format.adoc @@ -0,0 +1,281 @@ +[appendix] +[[executable-jar]] += The Executable Jar Format +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. + +If you need to create executable jars from a different build system or if you are just curious about the underlying technology, this appendix provides some background. + + + +[[executable-jar-nested-jars]] +== Nested JARs +Java does not provide any standard way to load nested jar files (that is, jar files that are themselves contained within a jar). +This can be problematic if you need to distribute a self-contained application that can be run from the command line without unpacking. + +To solve this problem, many developers use "`shaded`" jars. +A shaded jar packages all classes, from all jars, into a single "`uber jar`". +The problem with shaded jars is that it becomes hard to see which libraries are actually in your application. +It can also be problematic if the same filename is used (but with different content) in multiple jars. +Spring Boot takes a different approach and lets you actually nest jars directly. + + + +[[executable-jar-jar-file-structure]] +=== The Executable Jar File Structure +Spring Boot Loader-compatible jar files should be structured in the following way: + +[indent=0] +---- + example.jar + | + +-META-INF + | +-MANIFEST.MF + +-org + | +-springframework + | +-boot + | +-loader + | +- + +-BOOT-INF + +-classes + | +-mycompany + | +-project + | +-YourClasses.class + +-lib + +-dependency1.jar + +-dependency2.jar +---- + +Application classes should be placed in a nested `BOOT-INF/classes` directory. +Dependencies should be placed in a nested `BOOT-INF/lib` directory. + + + +[[executable-jar-war-file-structure]] +=== The Executable War File Structure +Spring Boot Loader-compatible war files should be structured in the following way: + +[indent=0] +---- + example.war + | + +-META-INF + | +-MANIFEST.MF + +-org + | +-springframework + | +-boot + | +-loader + | +- + +-WEB-INF + +-classes + | +-com + | +-mycompany + | +-project + | +-YourClasses.class + +-lib + | +-dependency1.jar + | +-dependency2.jar + +-lib-provided + +-servlet-api.jar + +-dependency3.jar +---- + +Dependencies should be placed in a nested `WEB-INF/lib` directory. +Any dependencies that are required when running embedded but are not required when deploying to a traditional web container should be placed in `WEB-INF/lib-provided`. + + + +[[executable-jar-jarfile]] +== Spring Boot's "`JarFile`" Class +The core class used to support loading nested jars is `org.springframework.boot.loader.jar.JarFile`. +It lets you load jar content from a standard jar file or from nested child jar data. +When first loaded, the location of each `JarEntry` is mapped to a physical file offset of the outer jar, as shown in the following example: + +[indent=0] +---- + myapp.jar + +-------------------+-------------------------+ + | /BOOT-INF/classes | /BOOT-INF/lib/mylib.jar | + |+-----------------+||+-----------+----------+| + || A.class ||| B.class | C.class || + |+-----------------+||+-----------+----------+| + +-------------------+-------------------------+ + ^ ^ ^ + 0063 3452 3980 +---- + +The preceding example shows how `A.class` can be found in `/BOOT-INF/classes` in `myapp.jar` at position `0063`. +`B.class` from the nested jar can actually be found in `myapp.jar` at position `3452`, and `C.class` is at position `3980`. + +Armed with this information, we can load specific nested entries by seeking to the appropriate part of the outer jar. +We do not need to unpack the archive, and we do not need to read all entry data into memory. + + + +[[executable-jar-jarfile-compatibility]] +=== Compatibility with the Standard Java "`JarFile`" +Spring Boot Loader strives to remain compatible with existing code and libraries. +`org.springframework.boot.loader.jar.JarFile` extends from `java.util.jar.JarFile` and should work as a drop-in replacement. +The `getURL()` method returns a `URL` that opens a connection compatible with `java.net.JarURLConnection` and can be used with Java's `URLClassLoader`. + + + +[[executable-jar-launching]] +== Launching Executable Jars +The `org.springframework.boot.loader.Launcher` class is a special bootstrap class that is used as an executable jar's main entry point. +It is the actual `Main-Class` in your jar file, and it is used to setup an appropriate `URLClassLoader` and ultimately call your `main()` method. + +There are three launcher subclasses (`JarLauncher`, `WarLauncher`, and `PropertiesLauncher`). +Their purpose is to load resources (`.class` files and so on) from nested jar files or war files in directories (as opposed to those explicitly on the classpath). +In the case of `JarLauncher` and `WarLauncher`, the nested paths are fixed. +`JarLauncher` looks in `BOOT-INF/lib/`, and `WarLauncher` looks in `WEB-INF/lib/` and `WEB-INF/lib-provided/`. +You can add extra jars in those locations if you want more. +The `PropertiesLauncher` looks in `BOOT-INF/lib/` in your application archive by default. +You can add additional locations by setting an environment variable called `LOADER_PATH` or `loader.path` in `loader.properties` (which is a comma-separated list of directories, archives, or directories within archives). + + + +[[executable-jar-launcher-manifest]] +=== Launcher Manifest +You need to specify an appropriate `Launcher` as the `Main-Class` attribute of `META-INF/MANIFEST.MF`. +The actual class that you want to launch (that is, the class that contains a `main` method) should be specified in the `Start-Class` attribute. + +The following example shows a typical `MANIFEST.MF` for an executable jar file: + +[indent=0] +---- + Main-Class: org.springframework.boot.loader.JarLauncher + Start-Class: com.mycompany.project.MyApplication +---- + +For a war file, it would be as follows: + +[indent=0] +---- + Main-Class: org.springframework.boot.loader.WarLauncher + Start-Class: com.mycompany.project.MyApplication +---- + +NOTE: You need not specify `Class-Path` entries in your manifest file. +The classpath is deduced from the nested jars. + + + +[[executable-jar-property-launcher-features]] +== `PropertiesLauncher` Features +`PropertiesLauncher` has a few special features that can be enabled with external properties (System properties, environment variables, manifest entries, or `loader.properties`). +The following table describes these properties: + +|=== +| Key | Purpose + +| `loader.path` +| Comma-separated Classpath, such as `lib,$\{HOME}/app/lib`. + Earlier entries take precedence, like a regular `-classpath` on the `javac` command line. + +| `loader.home` +| Used to resolve relative paths in `loader.path`. + For example, given `loader.path=lib`, then `${loader.home}/lib` is a classpath location (along with all jar files in that directory). + This property is also used to locate a `loader.properties` file, as in the following example `file:///opt/app` It defaults to `${user.dir}`. + +| `loader.args` +| Default arguments for the main method (space separated). + +| `loader.main` +| Name of main class to launch (for example, `com.app.Application`). + +| `loader.config.name` +| Name of properties file (for example, `launcher`). + It defaults to `loader`. + +| `loader.config.location` +| Path to properties file (for example, `classpath:loader.properties`). + It defaults to `loader.properties`. + +| `loader.system` +| Boolean flag to indicate that all properties should be added to System properties. + It defaults to `false`. +|=== + +When specified as environment variables or manifest entries, the following names should be used: + +|=== +| Key | Manifest entry | Environment variable + +| `loader.path` +| `Loader-Path` +| `LOADER_PATH` + +| `loader.home` +| `Loader-Home` +| `LOADER_HOME` + +| `loader.args` +| `Loader-Args` +| `LOADER_ARGS` + +| `loader.main` +| `Start-Class` +| `LOADER_MAIN` + +| `loader.config.location` +| `Loader-Config-Location` +| `LOADER_CONFIG_LOCATION` + +| `loader.system` +| `Loader-System` +| `LOADER_SYSTEM` +|=== + +TIP: Build plugins automatically move the `Main-Class` attribute to `Start-Class` when the fat jar is built. +If you use that, specify the name of the class to launch by using the `Main-Class` attribute and leaving out `Start-Class`. + +The following rules apply to working with `PropertiesLauncher`: + +* `loader.properties` is searched for in `loader.home`, then in the root of the classpath, and then in `classpath:/BOOT-INF/classes`. + The first location where a file with that name exists is used. +* `loader.home` is the directory location of an additional properties file (overriding the default) only when `loader.config.location` is not specified. +* `loader.path` can contain directories (which are scanned recursively for jar and zip files), archive paths, a directory within an archive that is scanned for jar files (for example, `dependencies.jar!/lib`), or wildcard patterns (for the default JVM behavior). + Archive paths can be relative to `loader.home` or anywhere in the file system with a `jar:file:` prefix. +* `loader.path` (if empty) defaults to `BOOT-INF/lib` (meaning a local directory or a nested one if running from an archive). + Because of this, `PropertiesLauncher` behaves the same as `JarLauncher` when no additional configuration is provided. +* `loader.path` can not be used to configure the location of `loader.properties` (the classpath used to search for the latter is the JVM classpath when `PropertiesLauncher` is launched). +* Placeholder replacement is done from System and environment variables plus the properties file itself on all values before use. +* The search order for properties (where it makes sense to look in more than one place) is environment variables, system properties, `loader.properties`, the exploded archive manifest, and the archive manifest. + + + +[[executable-jar-restrictions]] +== Executable Jar Restrictions +You need to consider the following restrictions when working with a Spring Boot Loader packaged application: + + + +[[executable-jar-zip-entry-compression]] +* Zip entry compression: +The `ZipEntry` for a nested jar must be saved by using the `ZipEntry.STORED` method. +This is required so that we can seek directly to individual content within the nested jar. +The content of the nested jar file itself can still be compressed, as can any other entries in the outer jar. + + + +[[executable-jar-system-classloader]] +* System classLoader: +Launched applications should use `Thread.getContextClassLoader()` when loading classes (most libraries and frameworks do so by default). +Trying to load nested jar classes with `ClassLoader.getSystemClassLoader()` fails. +`java.util.Logging` always uses the system classloader. +For this reason, you should consider a different logging implementation. + + + +[[executable-jar-alternatives]] +== Alternative Single Jar Solutions +If the preceding restrictions mean that you cannot use Spring Boot Loader, consider the following alternatives: + +* https://maven.apache.org/plugins/maven-shade-plugin/[Maven Shade Plugin] +* http://www.jdotsoft.com/JarClassLoader.php[JarClassLoader] +* https://sourceforge.net/projects/one-jar/[OneJar] +* https://imperceptiblethoughts.com/shadow/[Gradle Shadow Plugin] + diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-test-auto-configuration.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-test-auto-configuration.adoc new file mode 100644 index 0000000000..dc33154eae --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/appendix-test-auto-configuration.adoc @@ -0,0 +1,13 @@ +[appendix] +[[test-auto-configuration]] += Test Auto-configuration Annotations +include::attributes.adoc[] + +This appendix describes the `@…Test` auto-configuration annotations that Spring Boot provides to test slices of your application. + +[[test-auto-configuration-slices]] +== Test Slices + +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::test-slice-auto-configuration.adoc[] diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc new file mode 100644 index 0000000000..fb0f1f30ef --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc @@ -0,0 +1,108 @@ +:doctype: book +:idprefix: +:idseparator: - +:toc: left +:toclevels: 4 +:tabsize: 4 +:numbered: +:sectanchors: +:sectnums: +:icons: font +:hide-uri-scheme: +:docinfo: shared,private + +:spring-boot-artifactory-repo: snapshot +:github-tag: master +:spring-boot-version: current + +:github-repo: spring-projects/spring-boot +:github-raw: https://raw.githubusercontent.com/{github-repo}/{github-tag} +:github-issues: https://github.com/{github-repo}/issues/ +:github-wiki: https://github.com/{github-repo}/wiki + +: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/ +:spring-boot-docs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/reference +:spring-boot-master-code: https://github.com/{github-repo}/tree/master +:spring-boot-current-docs: https://docs.spring.io/spring-boot/docs/current/reference +:spring-boot-actuator-restapi: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/actuator-api/ +:spring-boot-maven-plugin-docs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/maven-plugin/html/ +:spring-boot-gradle-plugin-docs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/gradle-plugin/reference/html/ +:spring-boot-gradle-plugin-pdfdocs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/gradle-plugin/reference/pdf/spring-boot-gradle-plugin-reference.pdf +:spring-boot-gradle-plugin-api: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/gradle-plugin/reference/api/ + +:spring-boot-module-code: {spring-boot-code}/spring-boot-project/spring-boot/src/main/java/org/springframework/boot +:spring-boot-module-api: {spring-boot-api}/org/springframework/boot +:spring-boot-autoconfigure-module-code: {spring-boot-code}/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure +:spring-boot-autoconfigure-module-api: {spring-boot-api}/org/springframework/boot/autoconfigure +:spring-boot-actuator-module-code: {spring-boot-code}/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate +:spring-boot-actuator-module-api: {spring-boot-api}/org/springframework/boot/actuate +:spring-boot-actuator-autoconfigure-module-code: {spring-boot-code}/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure +:spring-boot-actuator-autoconfigure-module-api: : {spring-boot-api}/org/springframework/boot/actuate/autoconfigure +:spring-boot-cli-module-code: {spring-boot-code}/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli +:spring-boot-cli-module-api: {spring-boot-api}/org/springframework/boot/cli +:spring-boot-devtools-module-code: {spring-boot-code}/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools +:spring-boot-devtools-module-api: {spring-boot-api}/org/springframework/boot/devtools +:spring-boot-test-module-code: {spring-boot-code}/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test +:spring-boot-test-module-api: {spring-boot-api}/org/springframework/boot/test +:spring-boot-test-autoconfigure-module-code: {spring-boot-code}/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure +:spring-boot-test-autoconfigure-module-api: {spring-boot-api}/org/springframework/boot/test/autoconfigure + +:spring-amqp-api: https://docs.spring.io/spring-amqp/docs/{spring-amqp-version}/api/org/springframework/amqp +:spring-batch: https://spring.io/projects/spring-batch +:spring-batch-api: https://docs.spring.io/spring-batch/docs/{spring-batch-version}/api/org/springframework/batch +:spring-batch-docs: https://docs.spring.io/spring-batch/docs/{spring-batch-version}/reference/html/ +:spring-data: https://spring.io/projects/spring-data +:spring-data-cassandra: https://spring.io/projects/spring-data-cassandra +:spring-data-commons-api: https://docs.spring.io/spring-data/commons/docs/{spring-data-commons-version}/api/org/springframework/data +:spring-data-couchbase: https://spring.io/projects/spring-data-couchbase +:spring-data-couchbase-docs: https://docs.spring.io/spring-data/couchbase/docs/{spring-data-couchbase-version}/reference/html/ +:spring-data-elasticsearch: https://spring.io/projects/spring-data-elasticsearch +:spring-data-elasticsearch-docs: https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/ +:spring-data-gemfire: https://spring.io/projects/spring-data-gemfire +:spring-data-geode: https://spring.io/projects/spring-data-geode +:spring-data-jpa: https://spring.io/projects/spring-data-jpa +:spring-data-jpa-api: https://docs.spring.io/spring-data/jpa/docs/{spring-data-jpa-version}/api/org/springframework/data/jpa +:spring-data-jdbc-docs: https://docs.spring.io/spring-data/jdbc/docs/{spring-data-jdbc-version}/reference/html/ +:spring-data-ldap: https://spring.io/projects/spring-data-ldap +:spring-data-mongodb: https://spring.io/projects/spring-data-mongodb +:spring-data-mongodb-api: https://docs.spring.io/spring-data/mongodb/docs/{spring-data-mongodb-version}/api/org/springframework/data/mongodb +:spring-data-neo4j: https://spring.io/projects/spring-data-neo4j +:spring-data-neo4j-docs: https://docs.spring.io/spring-data/neo4j/docs/{spring-data-neo4j-version}/reference/html/ +:spring-data-redis: https://spring.io/projects/spring-data-redis +:spring-data-rest-api: https://docs.spring.io/spring-data/rest/docs/{spring-data-rest-version}/api/org/springframework/data/rest +:spring-data-solr: https://spring.io/projects/spring-data-solr +:spring-data-solr-docs: https://docs.spring.io/spring-data/solr/docs/{spring-data-solr-version}/reference/html/ +:spring-framework: https://spring.io/projects/spring-framework +:spring-framework-api: https://docs.spring.io/spring/docs/{spring-framework-version}/javadoc-api/org/springframework +:spring-framework-docs: https://docs.spring.io/spring/docs/{spring-framework-version}/spring-framework-reference/ +:spring-initializr-docs: https://docs.spring.io/initializr/docs/current/reference/html/ +:spring-integration: https://spring.io/projects/spring-integration +:spring-integration-docs: https://docs.spring.io/spring-integration/docs/{spring-integration-version}/reference/html/ +:spring-restdocs: https://spring.io/projects/spring-restdocs +:spring-security: https://spring.io/projects/spring-security +:spring-security-docs: https://docs.spring.io/spring-security/site/docs/{spring-security-version}/reference/htmlsingle/ +:spring-security-oauth2: https://spring.io/projects/spring-security-oauth +:spring-security-oauth2-docs: https://projects.spring.io/spring-security-oauth/docs/oauth2.html +:spring-session: https://spring.io/projects/spring-session +:spring-webservices-docs: https://docs.spring.io/spring-ws/docs/{spring-webservices-version}/reference/ + + + + +:ant-docs: https://ant.apache.org/manual +:dependency-management-plugin-code: https://github.com/spring-gradle-plugins/dependency-management-plugin +:gradle-docs: https://docs.gradle.org/current/userguide +:hibernate-docs: https://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html +:java-api: https://docs.oracle.com/javase/8/docs/api/ +:jetty-docs: https://www.eclipse.org/jetty/documentation/{jetty-version} +:jooq-docs: https://www.jooq.org/doc/{jooq-version}/manual-single-page +:junit5-docs: https://junit.org/junit5/docs/current/user-guide +:kotlin-docs: https://kotlinlang.org/docs/reference/ +:micrometer-docs: https://micrometer.io/docs +:micrometer-concepts-docs: {micrometer-docs}/concepts +:micrometer-registry-docs: {micrometer-docs}/registry +:tomcat-docs: https://tomcat.apache.org/tomcat-9.0-doc 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/docs/asciidoc/using-spring-boot.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using-spring-boot.adoc new file mode 100644 index 0000000000..04a6b817a9 --- /dev/null +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/using-spring-boot.adoc @@ -0,0 +1,1039 @@ +[[using-boot]] += Using Spring Boot +include::attributes.adoc[] + +This section goes into more detail about how you should use Spring Boot. +It covers topics such as build systems, auto-configuration, and how to run your applications. +We also cover some Spring Boot best practices. +Although there is nothing particularly special about Spring Boot (it is just another library that you can consume), there are a few recommendations that, when followed, make your development process a little easier. + +If you are starting out with Spring Boot, you should probably read the _<>_ guide before diving into this section. + + + +[[using-boot-build-systems]] +== Build Systems +It is strongly recommended that you choose a build system that supports <> and that can consume artifacts published to the "`Maven Central`" repository. +We would recommend that you choose Maven or Gradle. +It is possible to get Spring Boot to work with other build systems (Ant, for example), but they are not particularly well supported. + + + +[[using-boot-dependency-management]] +=== Dependency Management +Each release of Spring Boot provides a curated list of dependencies that it supports. +In practice, you do not need to provide a version for any of these dependencies in your build configuration, as Spring Boot manages that for you. +When you upgrade Spring Boot itself, these dependencies are upgraded as well in a consistent way. + +NOTE: You can still specify a version and override Spring Boot's recommendations if you need to do so. + +The curated list contains all the spring modules that you can use with Spring Boot as well as a refined list of third party libraries. +The list is available as a standard <> that can be used with both <> and <>. + +WARNING: Each release of Spring Boot is associated with a base version of the Spring Framework. +We **highly** recommend that you not specify its version. + + + +[[using-boot-maven]] +=== Maven +Maven users can inherit from the `spring-boot-starter-parent` project to obtain sensible defaults. +The parent project provides the following features: + +* Java 1.8 as the default compiler level. +* UTF-8 source encoding. +* A <>, inherited from the spring-boot-dependencies pom, that manages the versions of common dependencies. +This dependency management lets you omit tags for those dependencies when used in your own pom. +* An execution of the {spring-boot-maven-plugin-docs}/repackage-mojo.html[`repackage` goal] with a `repackage` execution id. +* Sensible https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html[resource filtering]. +* Sensible plugin configuration (https://www.mojohaus.org/exec-maven-plugin/[exec plugin], https://github.com/ktoso/maven-git-commit-id-plugin[Git commit ID], and https://maven.apache.org/plugins/maven-shade-plugin/[shade]). +* Sensible resource filtering for `application.properties` and `application.yml` including profile-specific files (for example, `application-dev.properties` and `application-dev.yml`) + +Note that, since the `application.properties` and `application.yml` files accept Spring style placeholders (`${...}`), the Maven filtering is changed to use `@..@` placeholders. +(You can override that by setting a Maven property called `resource.delimiter`.) + + + +[[using-boot-maven-parent-pom]] +==== Inheriting the Starter Parent +To configure your project to inherit from the `spring-boot-starter-parent`, set the `parent` as follows: + +[source,xml,indent=0,subs="verbatim,quotes,attributes"] +---- + + + org.springframework.boot + spring-boot-starter-parent + {spring-boot-version} + +---- + +NOTE: You should need to specify only the Spring Boot version number on this dependency. +If you import additional starters, you can safely omit the version number. + +With that setup, you can also override individual dependencies by overriding a property in your own project. +For instance, to upgrade to another Spring Data release train, you would add the following to your `pom.xml`: + +[source,xml,indent=0,subs="verbatim,quotes,attributes"] +---- + + Fowler-SR2 + +---- + +TIP: Check the {spring-boot-code}/spring-boot-project/spring-boot-dependencies/pom.xml[`spring-boot-dependencies` pom] for a list of supported properties. + + + +[[using-boot-maven-without-a-parent]] +==== Using Spring Boot without the Parent POM +Not everyone likes inheriting from the `spring-boot-starter-parent` POM. +You may have your own corporate standard parent that you need to use or you may prefer to explicitly declare all your Maven configuration. + +If you do not want to use the `spring-boot-starter-parent`, you can still keep the benefit of the dependency management (but not the plugin management) by using a `scope=import` dependency, as follows: + +[source,xml,indent=0,subs="verbatim,quotes,attributes"] +---- + + + + + org.springframework.boot + spring-boot-dependencies + {spring-boot-version} + pom + import + + + +---- + +The preceding sample setup does not let you override individual dependencies by using a property, as explained above. +To achieve the same result, you need to add an entry in the `dependencyManagement` of your project **before** the `spring-boot-dependencies` entry. +For instance, to upgrade to another Spring Data release train, you could add the following element to your `pom.xml`: + +[source,xml,indent=0,subs="verbatim,quotes,attributes"] +---- + + + + + org.springframework.data + spring-data-releasetrain + Fowler-SR2 + pom + import + + + org.springframework.boot + spring-boot-dependencies + {spring-boot-version} + pom + import + + + +---- + +NOTE: In the preceding example, we specify a _BOM_, but any dependency type can be overridden in the same way. + + + +[[using-boot-maven-plugin]] +==== Using the Spring Boot Maven Plugin +Spring Boot includes a <> that can package the project as an executable jar. +Add the plugin to your `` section if you want to use it, as shown in the following example: + +[source,xml,indent=0,subs="verbatim,quotes,attributes"] +---- + + + + org.springframework.boot + spring-boot-maven-plugin + + + +---- + +NOTE: If you use the Spring Boot starter parent pom, you need to add only the plugin. +There is no need to configure it unless you want to change the settings defined in the parent. + + + +[[using-boot-gradle]] +=== Gradle +To learn about using Spring Boot with Gradle, please refer to the documentation for Spring Boot's Gradle plugin: + +* Reference ({spring-boot-gradle-plugin-docs}[HTML] and {spring-boot-gradle-plugin-pdfdocs}[PDF]) +* {spring-boot-gradle-plugin-api}[API] + + + +[[using-boot-ant]] +=== Ant +It is possible to build a Spring Boot project using Apache Ant+Ivy. +The `spring-boot-antlib` "`AntLib`" module is also available to help Ant create executable jars. + +To declare dependencies, a typical `ivy.xml` file looks something like the following example: + +[source,xml,indent=0] +---- + + + + + + + + + + +---- + +A typical `build.xml` looks like the following example: + +[source,xml,indent=0,subs="verbatim,quotes,attributes"] +---- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +---- + +TIP: If you do not want to use the `spring-boot-antlib` module, see the _<>_ "`How-to`" . + + + +[[using-boot-starter]] +=== Starters +Starters are a set of convenient dependency descriptors that you can include in your application. +You get a one-stop shop for all the Spring and related technologies that you need without having to hunt through sample code and copy-paste loads of dependency descriptors. +For example, if you want to get started using Spring and JPA for database access, include the `spring-boot-starter-data-jpa` dependency in your project. + +The starters contain a lot of the dependencies that you need to get a project up and running quickly and with a consistent, supported set of managed transitive dependencies. + +.What's in a name +**** +All **official** starters follow a similar naming pattern; `+spring-boot-starter-*+`, where `+*+` is a particular type of application. +This naming structure is intended to help when you need to find a starter. +The Maven integration in many IDEs lets you search dependencies by name. +For example, with the appropriate Eclipse or STS plugin installed, you can press `ctrl-space` in the POM editor and type "`spring-boot-starter`" for a complete list. + +As explained in the "`<>`" section, third party starters should not start with `spring-boot`, as it is reserved for official Spring Boot artifacts. +Rather, a third-party starter typically starts with the name of the project. +For example, a third-party starter project called `thirdpartyproject` would typically be named `thirdpartyproject-spring-boot-starter`. +**** + +The following application starters are provided by Spring Boot under the `org.springframework.boot` group: + +.Spring Boot application starters +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::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::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. + + + +[[using-boot-structuring-your-code]] +== Structuring Your Code +Spring Boot does not require any specific code layout to work. +However, there are some best practices that help. + + + +[[using-boot-using-the-default-package]] +=== Using the "`default`" Package +When a class does not include a `package` declaration, it is considered to be in the "`default package`". +The use of the "`default package`" is generally discouraged and should be avoided. +It can cause particular problems for Spring Boot applications that use the `@ComponentScan`, `@ConfigurationPropertiesScan`, `@EntityScan`, or `@SpringBootApplication` annotations, since every class from every jar is read. + +TIP: We recommend that you follow Java's recommended package naming conventions and use a reversed domain name (for example, `com.example.project`). + + + +[[using-boot-locating-the-main-class]] +=== Locating the Main Application Class +We generally recommend that you locate your main application class in a root package above other classes. +The <> is often placed on your main class, and it implicitly defines a base "`search package`" for certain items. +For example, if you are writing a JPA application, the package of the `@SpringBootApplication` annotated class is used to search for `@Entity` items. +Using a root package also allows component scan to apply only on your project. + +TIP: If you don't want to use `@SpringBootApplication`, the `@EnableAutoConfiguration` and `@ComponentScan` annotations that it imports defines that behaviour so you can also use those instead. + +The following listing shows a typical layout: + +[indent=0] +---- + com + +- example + +- myapplication + +- Application.java + | + +- customer + | +- Customer.java + | +- CustomerController.java + | +- CustomerService.java + | +- CustomerRepository.java + | + +- order + +- Order.java + +- OrderController.java + +- OrderService.java + +- OrderRepository.java +---- + +The `Application.java` file would declare the `main` method, along with the basic `@SpringBootApplication`, as follows: + +[source,java,indent=0] +---- + package com.example.myapplication; + + import org.springframework.boot.SpringApplication; + import org.springframework.boot.autoconfigure.SpringBootApplication; + + @SpringBootApplication + public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + + } +---- + + + +[[using-boot-configuration-classes]] +== Configuration Classes +Spring Boot favors Java-based configuration. +Although it is possible to use `SpringApplication` with XML sources, we generally recommend that your primary source be a single `@Configuration` class. +Usually the class that defines the `main` method is a good candidate as the primary `@Configuration`. + +TIP: Many Spring configuration examples have been published on the Internet that use XML configuration. +If possible, always try to use the equivalent Java-based configuration. +Searching for `+Enable*+` annotations can be a good starting point. + + + +[[using-boot-importing-configuration]] +=== Importing Additional Configuration Classes +You need not put all your `@Configuration` into a single class. +The `@Import` annotation can be used to import additional configuration classes. +Alternatively, you can use `@ComponentScan` to automatically pick up all Spring components, including `@Configuration` classes. + + + +[[using-boot-importing-xml-configuration]] +=== Importing XML Configuration +If you absolutely must use XML based configuration, we recommend that you still start with a `@Configuration` class. +You can then use an `@ImportResource` annotation to load XML configuration files. + + + +[[using-boot-auto-configuration]] +== Auto-configuration +Spring Boot auto-configuration attempts to automatically configure your Spring application based on the jar dependencies that you have added. +For example, if `HSQLDB` is on your classpath, and you have not manually configured any database connection beans, then Spring Boot auto-configures an in-memory database. + +You need to opt-in to auto-configuration by adding the `@EnableAutoConfiguration` or `@SpringBootApplication` annotations to one of your `@Configuration` classes. + +TIP: You should only ever add one `@SpringBootApplication` or `@EnableAutoConfiguration` annotation. +We generally recommend that you add one or the other to your primary `@Configuration` class only. + + + +[[using-boot-replacing-auto-configuration]] +=== Gradually Replacing Auto-configuration +Auto-configuration is non-invasive. +At any point, you can start to define your own configuration to replace specific parts of the auto-configuration. +For example, if you add your own `DataSource` bean, the default embedded database support backs away. + +If you need to find out what auto-configuration is currently being applied, and why, start your application with the `--debug` switch. +Doing so enables debug logs for a selection of core loggers and logs a conditions report to the console. + + + +[[using-boot-disabling-specific-auto-configuration]] +=== Disabling Specific Auto-configuration Classes +If you find that specific auto-configuration classes that you do not want are being applied, you can use the exclude attribute of `@EnableAutoConfiguration` to disable them, as shown in the following example: + +[source,java,indent=0] +---- + import org.springframework.boot.autoconfigure.*; + import org.springframework.boot.autoconfigure.jdbc.*; + import org.springframework.context.annotation.*; + + @Configuration(proxyBeanMethods = false) + @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class}) + public class MyConfiguration { + } +---- + +If the class is not on the classpath, you can use the `excludeName` attribute of the annotation and specify the fully qualified name instead. +Finally, you can also control the list of auto-configuration classes to exclude by using the configprop:spring.autoconfigure.exclude[] property. + +TIP: You can define exclusions both at the annotation level and by using the property. + +NOTE: Even though auto-configuration classes are `public`, the only aspect of the class that is considered public API is the name of the class which can be used for disabling the auto-configuration. +The actual contents of those classes, such as nested configuration classes or bean methods are for internal use only and we do not recommend using those directly. + + + +[[using-boot-spring-beans-and-dependency-injection]] +== Spring Beans and Dependency Injection +You are free to use any of the standard Spring Framework techniques to define your beans and their injected dependencies. +For simplicity, we often find that using `@ComponentScan` (to find your beans) and using `@Autowired` (to do constructor injection) works well. + +If you structure your code as suggested above (locating your application class in a root package), you can add `@ComponentScan` without any arguments. +All of your application components (`@Component`, `@Service`, `@Repository`, `@Controller` etc.) are automatically registered as Spring Beans. + +The following example shows a `@Service` Bean that uses constructor injection to obtain a required `RiskAssessor` bean: + +[source,java,indent=0] +---- + package com.example.service; + + import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.stereotype.Service; + + @Service + public class DatabaseAccountService implements AccountService { + + private final RiskAssessor riskAssessor; + + @Autowired + public DatabaseAccountService(RiskAssessor riskAssessor) { + this.riskAssessor = riskAssessor; + } + + // ... + + } +---- + +If a bean has one constructor, you can omit the `@Autowired`, as shown in the following example: + +[source,java,indent=0] +---- + @Service + public class DatabaseAccountService implements AccountService { + + private final RiskAssessor riskAssessor; + + public DatabaseAccountService(RiskAssessor riskAssessor) { + this.riskAssessor = riskAssessor; + } + + // ... + + } +---- + +TIP: Notice how using constructor injection lets the `riskAssessor` field be marked as `final`, indicating that it cannot be subsequently changed. + + + +[[using-boot-using-springbootapplication-annotation]] +== Using the @SpringBootApplication Annotation +Many Spring Boot developers like their apps to use auto-configuration, component scan and be able to define extra configuration on their "application class". +A single `@SpringBootApplication` annotation can be used to enable those three features, that is: + +* `@EnableAutoConfiguration`: enable <> +* `@ComponentScan`: enable `@Component` scan on the package where the application is located (see <>) +* `@Configuration`: allow to register extra beans in the context or import additional configuration classes + +[source,java,indent=0] +---- + package com.example.myapplication; + + import org.springframework.boot.SpringApplication; + import org.springframework.boot.autoconfigure.SpringBootApplication; + + @SpringBootApplication // same as @Configuration @EnableAutoConfiguration @ComponentScan + public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + + } +---- + +NOTE: `@SpringBootApplication` also provides aliases to customize the attributes of `@EnableAutoConfiguration` and `@ComponentScan`. + +[NOTE] +==== +None of these features are mandatory and you may choose to replace this single annotation by any of the features that it enables. +For instance, you may not want to use component scan or configuration properties scan in your application: + +[source,java,indent=0] +---- + package com.example.myapplication; + + import org.springframework.boot.SpringApplication; + import org.springframework.context.annotation.ComponentScan + import org.springframework.context.annotation.Configuration; + import org.springframework.context.annotation.Import; + + @Configuration(proxyBeanMethods = false) + @EnableAutoConfiguration + @Import({ MyConfig.class, MyAnotherConfig.class }) + public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + + } +---- + +In this example, `Application` is just like any other Spring Boot application except that `@Component`-annotated classes and `@ConfigurationProperties`-annotated classes are not detected automatically and the user-defined beans are imported explicitly (see `@Import`). +==== + + + +[[using-boot-running-your-application]] +== Running Your Application +One of the biggest advantages of packaging your application as a jar and using an embedded HTTP server is that you can run your application as you would any other. +Debugging Spring Boot applications is also easy. +You do not need any special IDE plugins or extensions. + +NOTE: This section only covers jar based packaging. +If you choose to package your application as a war file, you should refer to your server and IDE documentation. + + + +[[using-boot-running-from-an-ide]] +=== Running from an IDE +You can run a Spring Boot application from your IDE as a simple Java application. +However, you first need to import your project. +Import steps vary depending on your IDE and build system. +Most IDEs can import Maven projects directly. +For example, Eclipse users can select `Import...` -> `Existing Maven Projects` from the `File` menu. + +If you cannot directly import your project into your IDE, you may be able to generate IDE metadata by using a build plugin. +Maven includes plugins for https://maven.apache.org/plugins/maven-eclipse-plugin/[Eclipse] and https://maven.apache.org/plugins/maven-idea-plugin/[IDEA]. +Gradle offers plugins for {gradle-docs}/userguide.html[various IDEs]. + +TIP: If you accidentally run a web application twice, you see a "`Port already in use`" error. +STS users can use the `Relaunch` button rather than the `Run` button to ensure that any existing instance is closed. + + + +[[using-boot-running-as-a-packaged-application]] +=== Running as a Packaged Application +If you use the Spring Boot Maven or Gradle plugins to create an executable jar, you can run your application using `java -jar`, as shown in the following example: + +[indent=0,subs="attributes"] +---- + $ java -jar target/myapplication-0.0.1-SNAPSHOT.jar +---- + +It is also possible to run a packaged application with remote debugging support enabled. +Doing so lets you attach a debugger to your packaged application, as shown in the following example: + +[indent=0,subs="attributes"] +---- + $ java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n \ + -jar target/myapplication-0.0.1-SNAPSHOT.jar +---- + + + +[[using-boot-running-with-the-maven-plugin]] +=== Using the Maven Plugin +The Spring Boot Maven plugin includes a `run` goal that can be used to quickly compile and run your application. +Applications run in an exploded form, as they do in your IDE. +The following example shows a typical Maven command to run a Spring Boot application: + +[indent=0,subs="attributes"] +---- + $ mvn spring-boot:run +---- + +You might also want to use the `MAVEN_OPTS` operating system environment variable, as shown in the following example: + +[indent=0,subs="attributes"] +---- + $ export MAVEN_OPTS=-Xmx1024m +---- + + + +[[using-boot-running-with-the-gradle-plugin]] +=== Using the Gradle Plugin +The Spring Boot Gradle plugin also includes a `bootRun` task that can be used to run your application in an exploded form. +The `bootRun` task is added whenever you apply the `org.springframework.boot` and `java` plugins and is shown in the following example: + +[indent=0,subs="attributes"] +---- + $ gradle bootRun +---- + +You might also want to use the `JAVA_OPTS` operating system environment variable, as shown in the following example: + +[indent=0,subs="attributes"] +---- + $ export JAVA_OPTS=-Xmx1024m +---- + + + +[[using-boot-hot-swapping]] +=== Hot Swapping +Since Spring Boot applications are just plain Java applications, JVM hot-swapping should work out of the box. +JVM hot swapping is somewhat limited with the bytecode that it can replace. +For a more complete solution, https://jrebel.com/software/jrebel/[JRebel] can be used. + +The `spring-boot-devtools` module also includes support for quick application restarts. +See the <> section later in this chapter and the <> for details. + + + +[[using-boot-devtools]] +== Developer Tools +Spring Boot includes an additional set of tools that can make the application development experience a little more pleasant. +The `spring-boot-devtools` module can be included in any project to provide additional development-time features. +To include devtools support, add the module dependency to your build, as shown in the following listings for Maven and Gradle: + +.Maven +[source,xml,indent=0,subs="verbatim,quotes,attributes"] +---- + + + org.springframework.boot + spring-boot-devtools + true + + +---- + +.Gradle +[source,groovy,indent=0,subs="attributes"] +---- + configurations { + developmentOnly + runtimeClasspath { + extendsFrom developmentOnly + } + } + dependencies { + developmentOnly("org.springframework.boot:spring-boot-devtools") + } +---- + +NOTE: Developer tools are automatically disabled when running a fully packaged application. +If your application is launched from `java -jar` or if it is started from a special classloader, then it is considered a "`production application`". +If that does not apply to you (i.e. if you run your application from a container), consider excluding devtools or set the `-Dspring.devtools.restart.enabled=false` system property. + +TIP: Flagging the dependency as optional in Maven or using a custom `developmentOnly` configuration in Gradle (as shown above) is a best practice that prevents devtools from being transitively applied to other modules that use your project. + +TIP: Repackaged archives do not contain devtools by default. +If you want to use a <>, you need to disable the `excludeDevtools` build property to include it. +The property is supported with both the Maven and Gradle plugins. + + + +[[using-boot-devtools-property-defaults]] +=== Property Defaults +Several of the libraries supported by Spring Boot use caches to improve performance. +For example, <> cache compiled templates to avoid repeatedly parsing template files. +Also, Spring MVC can add HTTP caching headers to responses when serving static resources. + +While caching is very beneficial in production, it can be counter-productive during development, preventing you from seeing the changes you just made in your application. +For this reason, spring-boot-devtools disables the caching options by default. + +Cache options are usually configured by settings in your `application.properties` file. +For example, Thymeleaf offers the configprop:spring.thymeleaf.cache[] property. +Rather than needing to set these properties manually, the `spring-boot-devtools` module automatically applies sensible development-time configuration. + +Because you need more information about web requests while developing Spring MVC and Spring WebFlux applications, developer tools will enable `DEBUG` logging for the `web` logging group. +This will give you information about the incoming request, which handler is processing it, the response outcome, etc. +If you wish to log all request details (including potentially sensitive information), you can turn on the configprop:spring.http.log-request-details[] configuration property. + +NOTE: If you don't want property defaults to be applied you can set configprop:spring.devtools.add-properties[] to `false` in your `application.properties`. + +TIP: For a complete list of the properties that are applied by the devtools, see {spring-boot-devtools-module-code}/env/DevToolsPropertyDefaultsPostProcessor.java[DevToolsPropertyDefaultsPostProcessor]. + + + +[[using-boot-devtools-restart]] +=== Automatic Restart +Applications that use `spring-boot-devtools` automatically restart whenever files on the classpath change. +This can be a useful feature when working in an IDE, as it gives a very fast feedback loop for code changes. +By default, any entry on the classpath that points to a folder is monitored for changes. +Note that certain resources, such as static assets and view templates, <>. + +.Triggering a restart +**** +As DevTools monitors classpath resources, the only way to trigger a restart is to update the classpath. +The way in which you cause the classpath to be updated depends on the IDE that you are using. +In Eclipse, saving a modified file causes the classpath to be updated and triggers a restart. +In IntelliJ IDEA, building the project (`Build +->+ Build Project`) has the same effect. +**** + +NOTE: As long as forking is enabled, you can also start your application by using the supported build plugins (Maven and Gradle), since DevTools needs an isolated application classloader to operate properly. +By default, the Gradle and Maven plugins fork the application process. + +TIP: Automatic restart works very well when used with LiveReload. +<> for details. +If you use JRebel, automatic restarts are disabled in favor of dynamic class reloading. +Other devtools features (such as LiveReload and property overrides) can still be used. + +NOTE: DevTools relies on the application context's shutdown hook to close it during a restart. +It does not work correctly if you have disabled the shutdown hook (`SpringApplication.setRegisterShutdownHook(false)`). + +NOTE: When deciding if an entry on the classpath should trigger a restart when it changes, DevTools automatically ignores projects named `spring-boot`, `spring-boot-devtools`, `spring-boot-autoconfigure`, `spring-boot-actuator`, and `spring-boot-starter`. + +NOTE: DevTools needs to customize the `ResourceLoader` used by the `ApplicationContext`. +If your application provides one already, it is going to be wrapped. +Direct override of the `getResource` method on the `ApplicationContext` is not supported. + +[[using-spring-boot-restart-vs-reload]] +.Restart vs Reload +**** +The restart technology provided by Spring Boot works by using two classloaders. +Classes that do not change (for example, those from third-party jars) are loaded into a _base_ classloader. +Classes that you are actively developing are loaded into a _restart_ classloader. +When the application is restarted, the _restart_ classloader is thrown away and a new one is created. +This approach means that application restarts are typically much faster than "`cold starts`", since the _base_ classloader is already available and populated. + +If you find that restarts are not quick enough for your applications or you encounter classloading issues, you could consider reloading technologies such as https://jrebel.com/software/jrebel/[JRebel] from ZeroTurnaround. +These work by rewriting classes as they are loaded to make them more amenable to reloading. +**** + + + +[[using-boot-devtools-restart-logging-condition-delta]] +==== Logging changes in condition evaluation +By default, each time your application restarts, a report showing the condition evaluation delta is logged. +The report shows the changes to your application's auto-configuration as you make changes such as adding or removing beans and setting configuration properties. + +To disable the logging of the report, set the following property: + +[indent=0] +---- + spring.devtools.restart.log-condition-evaluation-delta=false +---- + + +[[using-boot-devtools-restart-exclude]] +==== Excluding Resources +Certain resources do not necessarily need to trigger a restart when they are changed. +For example, Thymeleaf templates can be edited in-place. +By default, changing resources in `/META-INF/maven`, `/META-INF/resources`, `/resources`, `/static`, `/public`, or `/templates` does not trigger a restart but does trigger a <>. +If you want to customize these exclusions, you can use the configprop:spring.devtools.restart.exclude[] property. +For example, to exclude only `/static` and `/public` you would set the following property: + +[indent=0] +---- + spring.devtools.restart.exclude=static/**,public/** +---- + +TIP: If you want to keep those defaults and _add_ additional exclusions, use the configprop:spring.devtools.restart.additional-exclude[] property instead. + + + +[[using-boot-devtools-restart-additional-paths]] +==== Watching Additional Paths +You may want your application to be restarted or reloaded when you make changes to files that are not on the classpath. +To do so, use the configprop:spring.devtools.restart.additional-paths[] property to configure additional paths to watch for changes. +You can use the configprop:spring.devtools.restart.exclude[] property <> to control whether changes beneath the additional paths trigger a full restart or a <>. + + + +[[using-boot-devtools-restart-disable]] +==== Disabling Restart +If you do not want to use the restart feature, you can disable it by using the configprop:spring.devtools.restart.enabled[] property. +In most cases, you can set this property in your `application.properties` (doing so still initializes the restart classloader, but it does not watch for file changes). + +If you need to _completely_ disable restart support (for example, because it does not work with a specific library), you need to set the configprop:spring.devtools.restart.enabled[] `System` property to `false` before calling `SpringApplication.run(...)`, as shown in the following example: + +[source,java,indent=0] +---- + public static void main(String[] args) { + System.setProperty("spring.devtools.restart.enabled", "false"); + SpringApplication.run(MyApp.class, args); + } +---- + + + +[[using-boot-devtools-restart-triggerfile]] +==== Using a Trigger File +If you work with an IDE that continuously compiles changed files, you might prefer to trigger restarts only at specific times. +To do so, you can use a "`trigger file`", which is a special file that must be modified when you want to actually trigger a restart check. + +NOTE: Any update to the file will trigger a check, but restart only actually occurs if Devtools has detected it has something to do. + +To use a trigger file, set the configprop:spring.devtools.restart.trigger-file[] property to the name (excluding any path) of your trigger file. +The trigger file must appear somewhere on your classpath. + +For example, if you have a project with the following structure: + +[indent=0] +---- + src + +- main + +- resources + +- .reloadtrigger +---- + +Then your `trigger-file` property would be: + +[source,properties,indent=0,configprops] +---- + spring.devtools.restart.trigger-file=.reloadtrigger +---- + +Restarts will now only happen when the `src/main/resources/.reloadtrigger` is updated. + +TIP: You might want to set `spring.devtools.restart.trigger-file` as a <>, so that all your projects behave in the same way. + +Some IDEs have features that save you from needing to update your trigger file manually. +https://spring.io/tools[Spring Tools for Eclipse] and https://www.jetbrains.com/idea/[IntelliJ IDEA (Ultimate Edition)] both have such support. +With Spring Tools, you can use the "`reload`" button from the console view (as long as your `trigger-file` is named `.reloadtrigger`). +For IntelliJ, you can follow the https://www.jetbrains.com/help/idea/spring-boot.html#configure-application-update-policies-with-devtools[instructions in their documentation]. + + + +[[using-boot-devtools-customizing-classload]] +==== Customizing the Restart Classloader +As described earlier in the <> section, restart functionality is implemented by using two classloaders. +For most applications, this approach works well. +However, it can sometimes cause classloading issues. + +By default, any open project in your IDE is loaded with the "`restart`" classloader, and any regular `.jar` file is loaded with the "`base`" classloader. +If you work on a multi-module project, and not every module is imported into your IDE, you may need to customize things. +To do so, you can create a `META-INF/spring-devtools.properties` file. + +The `spring-devtools.properties` file can contain properties prefixed with `restart.exclude` and `restart.include`. +The `include` elements are items that should be pulled up into the "`restart`" classloader, and the `exclude` elements are items that should be pushed down into the "`base`" classloader. +The value of the property is a regex pattern that is applied to the classpath, as shown in the following example: + +[source,properties,indent=0] +---- + restart.exclude.companycommonlibs=/mycorp-common-[\\w\\d-\.]+\.jar + restart.include.projectcommon=/mycorp-myproj-[\\w\\d-\.]+\.jar +---- + +NOTE: All property keys must be unique. +As long as a property starts with `restart.include.` or `restart.exclude.` it is considered. + +TIP: All `META-INF/spring-devtools.properties` from the classpath are loaded. +You can package files inside your project, or in the libraries that the project consumes. + + + +[[using-boot-devtools-known-restart-limitations]] +==== Known Limitations +Restart functionality does not work well with objects that are deserialized by using a standard `ObjectInputStream`. +If you need to deserialize data, you may need to use Spring's `ConfigurableObjectInputStream` in combination with `Thread.currentThread().getContextClassLoader()`. + +Unfortunately, several third-party libraries deserialize without considering the context classloader. +If you find such a problem, you need to request a fix with the original authors. + + + +[[using-boot-devtools-livereload]] +=== LiveReload +The `spring-boot-devtools` module includes an embedded LiveReload server that can be used to trigger a browser refresh when a resource is changed. +LiveReload browser extensions are freely available for Chrome, Firefox and Safari from http://livereload.com/extensions/[livereload.com]. + +If you do not want to start the LiveReload server when your application runs, you can set the configprop:spring.devtools.livereload.enabled[] property to `false`. + +NOTE: You can only run one LiveReload server at a time. +Before starting your application, ensure that no other LiveReload servers are running. +If you start multiple applications from your IDE, only the first has LiveReload support. + + + +[[using-boot-devtools-globalsettings]] +=== Global Settings +You can configure global devtools settings by adding any of the following files to the `$HOME/.config/spring-boot` folder: + +. `spring-boot-devtools.properties` +. `spring-boot-devtools.yaml` +. `spring-boot-devtools.yml` + +Any properties added to these file apply to _all_ Spring Boot applications on your machine that use devtools. +For example, to configure restart to always use a <>, you would add the following property: + +.~/.config/spring-boot/spring-boot-devtools.properties +[source,properties,indent=0,configprops] +---- + spring.devtools.restart.trigger-file=.reloadtrigger +---- + +NOTE: If devtools configuration files are not found in `$HOME/.config/spring-boot`, the root of the `$HOME` folder is searched for the presence of a `.spring-boot-devtools.properties` file. +This allows you to share the devtools global configuration with applications that are on an older version of Spring Boot that does not support the `$HOME/.config/spring-boot` location. + +NOTE: Profiles activated in the above files will not affect the loading of <>. + + + +[[using-boot-devtools-remote]] +=== Remote Applications +The Spring Boot developer tools are not limited to local development. +You can also use several features when running applications remotely. +Remote support is opt-in as enabling it can be a security risk. +It should only be enabled when running on a trusted network or when secured with SSL. +If neither of these options is available to you, you should not use DevTools' remote support. +You should never enable support on a production deployment. + +To enable it, you need to make sure that `devtools` is included in the repackaged archive, as shown in the following listing: + +[source,xml,indent=0,subs="verbatim,quotes,attributes"] +---- + + + + org.springframework.boot + spring-boot-maven-plugin + + false + + + + +---- + +Then you need to set the configprop:spring.devtools.remote.secret[] property. +Like any important password or secret, the value should be unique and strong such that it cannot be guessed or brute-forced. + +Remote devtools support is provided in two parts: a server-side endpoint that accepts connections and a client application that you run in your IDE. +The server component is automatically enabled when the configprop:spring.devtools.remote.secret[] property is set. +The client component must be launched manually. + + + +==== Running the Remote Client Application +The remote client application is designed to be run from within your IDE. +You need to run `org.springframework.boot.devtools.RemoteSpringApplication` with the same classpath as the remote project that you connect to. +The application's single required argument is the remote URL to which it connects. + +For example, if you are using Eclipse or STS and you have a project named `my-app` that you have deployed to Cloud Foundry, you would do the following: + +* Select `Run Configurations...` from the `Run` menu. +* Create a new `Java Application` "`launch configuration`". +* Browse for the `my-app` project. +* Use `org.springframework.boot.devtools.RemoteSpringApplication` as the main class. +* Add `+++https://myapp.cfapps.io+++` to the `Program arguments` (or whatever your remote URL is). + +A running remote client might resemble the following listing: + +[indent=0,subs="attributes"] +---- + . ____ _ __ _ _ + /\\ / ___'_ __ _ _(_)_ __ __ _ ___ _ \ \ \ \ + ( ( )\___ | '_ | '_| | '_ \/ _` | | _ \___ _ __ ___| |_ ___ \ \ \ \ + \\/ ___)| |_)| | | | | || (_| []::::::[] / -_) ' \/ _ \ _/ -_) ) ) ) ) + ' |____| .__|_| |_|_| |_\__, | |_|_\___|_|_|_\___/\__\___|/ / / / + =========|_|==============|___/===================================/_/_/_/ + :: Spring Boot Remote :: {spring-boot-version} + + 2015-06-10 18:25:06.632 INFO 14938 --- [ main] o.s.b.devtools.RemoteSpringApplication : Starting RemoteSpringApplication on pwmbp with PID 14938 (/Users/pwebb/projects/spring-boot/code/spring-boot-project/spring-boot-devtools/target/classes started by pwebb in /Users/pwebb/projects/spring-boot/code) + 2015-06-10 18:25:06.671 INFO 14938 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2a17b7b6: startup date [Wed Jun 10 18:25:06 PDT 2015]; root of context hierarchy + 2015-06-10 18:25:07.043 WARN 14938 --- [ main] o.s.b.d.r.c.RemoteClientConfiguration : The connection to http://localhost:8080 is insecure. You should use a URL starting with 'https://'. + 2015-06-10 18:25:07.074 INFO 14938 --- [ main] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729 + 2015-06-10 18:25:07.130 INFO 14938 --- [ main] o.s.b.devtools.RemoteSpringApplication : Started RemoteSpringApplication in 0.74 seconds (JVM running for 1.105) +---- + +NOTE: Because the remote client is using the same classpath as the real application it can directly read application properties. +This is how the configprop:spring.devtools.remote.secret[] property is read and passed to the server for authentication. + +TIP: It is always advisable to use `https://` as the connection protocol, so that traffic is encrypted and passwords cannot be intercepted. + +TIP: If you need to use a proxy to access the remote application, configure the `spring.devtools.remote.proxy.host` and `spring.devtools.remote.proxy.port` properties. + + + +[[using-boot-devtools-remote-update]] +==== Remote Update +The remote client monitors your application classpath for changes in the same way as the <>. +Any updated resource is pushed to the remote application and (_if required_) triggers a restart. +This can be helpful if you iterate on a feature that uses a cloud service that you do not have locally. +Generally, remote updates and restarts are much quicker than a full rebuild and deploy cycle. + +NOTE: Files are only monitored when the remote client is running. +If you change a file before starting the remote client, it is not pushed to the remote server. + + + +[[configuring-file-system-watcher]] +==== Configuring File System Watcher +{spring-boot-devtools-module-code}/filewatch/FileSystemWatcher.java[FileSystemWatcher] works by polling the class changes with a certain time interval, and then waiting for a predefined quiet period to make sure there are no more changes. +The changes are then uploaded to the remote application. +On a slower development environment, it may happen that the quiet period is not enough, and the changes in the classes may be split into batches. +The server is restarted after the first batch of class changes is uploaded. +The next batch can’t be sent to the application, since the server is restarting. + +This is typically manifested by a warning in the `RemoteSpringApplication` logs about failing to upload some of the classes, and a consequent retry. +But it may also lead to application code inconsistency and failure to restart after the first batch of changes is uploaded. + +If you observe such problems constantly, try increasing the `spring.devtools.restart.poll-interval` and `spring.devtools.restart.quiet-period` parameters to the values that fit your development environment: + +[source,properties,indent=0,configprops] +---- + spring.devtools.restart.poll-interval=2s + spring.devtools.restart.quiet-period=1s +---- + +The monitored classpath folders are now polled every 2 seconds for changes, and a 1 second quiet period is maintained to make sure there are no additional class changes. + + + +[[using-boot-packaging-for-production]] +== Packaging Your Application for Production +Executable jars can be used for production deployment. +As they are self-contained, they are also ideally suited for cloud-based deployment. + +For additional "`production ready`" features, such as health, auditing, and metric REST or JMX end-points, consider adding `spring-boot-actuator`. +See _<>_ for details. + + + +[[using-boot-whats-next]] +== What to Read Next +You should now understand how you can use Spring Boot and some best practices that you should follow. +You can now go on to learn about specific _<>_ in depth, or you could skip ahead and read about the "`<>`" aspects of Spring Boot. diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc deleted file mode 100644 index 1afb9c5e92..0000000000 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ /dev/null @@ -1,78 +0,0 @@ -:numbered!: -[appendix] -[[common-application-properties]] -= Common Application properties -include::{asciidoc-sources-root}/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. - -TIP: Spring Boot provides various conversion mechanism with advanced value formatting, make sure to review <>. - -NOTE: Property contributions can come from additional jar files on your classpath, so you should not consider this an exhaustive list. -Also, you can define your own properties. - - -== Core properties - -include::{generated-resources-root}/config-docs/core.adoc[] - -== Cache properties - -include::{generated-resources-root}/config-docs/cache.adoc[] - -== Mail properties - -include::{generated-resources-root}/config-docs/mail.adoc[] - -== JSON properties - -include::{generated-resources-root}/config-docs/json.adoc[] - -== Data properties - -include::{generated-resources-root}/config-docs/data.adoc[] - -== Transaction properties - -include::{generated-resources-root}/config-docs/transaction.adoc[] - -== Data migration properties - -include::{generated-resources-root}/config-docs/data-migration.adoc[] - -== Integration properties - -include::{generated-resources-root}/config-docs/integration.adoc[] - -== Web properties - -include::{generated-resources-root}/config-docs/web.adoc[] - -== Templating properties - -include::{generated-resources-root}/config-docs/templating.adoc[] - -== Server properties - -include::{generated-resources-root}/config-docs/server.adoc[] - -== Security properties - -include::{generated-resources-root}/config-docs/security.adoc[] - -== RSocket properties - -include::{generated-resources-root}/config-docs/rsocket.adoc[] - -== Actuator properties - -include::{generated-resources-root}/config-docs/actuator.adoc[] - -== Devtools properties - -include::{generated-resources-root}/config-docs/devtools.adoc[] - -== Testing properties - -include::{generated-resources-root}/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/main/asciidoc/appendix-auto-configuration-classes.adoc deleted file mode 100644 index bfcbcf2101..0000000000 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-auto-configuration-classes.adoc +++ /dev/null @@ -1,24 +0,0 @@ -[appendix] -[[auto-configuration-classes]] -= Auto-configuration Classes -include::{asciidoc-sources-root}/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. -(To do so, start the app with `--debug` or `-Ddebug` or, in an Actuator application, use the `conditions` endpoint). - - - -[[auto-configuration-classes-from-autoconfigure-module]] -== `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[] - - - -[[auto-configuration-classes-from-actuator]] -== `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[] diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc deleted file mode 100644 index 83c266bb29..0000000000 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-configuration-metadata.adoc +++ /dev/null @@ -1,860 +0,0 @@ -[appendix] -[[configuration-metadata]] -= Configuration Metadata -include::{asciidoc-sources-root}/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. - -The majority of the metadata file is generated automatically at compile time by processing all items annotated with `@ConfigurationProperties`. -However, it is possible to <> for corner cases or more advanced use cases. - - - -[[configuration-metadata-format]] -== Metadata Format -Configuration metadata files are located inside jars under `META-INF/spring-configuration-metadata.json`. -They use a simple JSON format with items categorized under either "`groups`" or "`properties`" and additional values hints categorized under "hints", as shown in the following example: - -[source,json,indent=0] ----- - {"groups": [ - { - "name": "server", - "type": "org.springframework.boot.autoconfigure.web.ServerProperties", - "sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties" - }, - { - "name": "spring.jpa.hibernate", - "type": "org.springframework.boot.autoconfigure.orm.jpa.JpaProperties$Hibernate", - "sourceType": "org.springframework.boot.autoconfigure.orm.jpa.JpaProperties", - "sourceMethod": "getHibernate()" - } - ... - ],"properties": [ - { - "name": "server.port", - "type": "java.lang.Integer", - "sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties" - }, - { - "name": "server.address", - "type": "java.net.InetAddress", - "sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties" - }, - { - "name": "spring.jpa.hibernate.ddl-auto", - "type": "java.lang.String", - "description": "DDL mode. This is actually a shortcut for the \"hibernate.hbm2ddl.auto\" property.", - "sourceType": "org.springframework.boot.autoconfigure.orm.jpa.JpaProperties$Hibernate" - } - ... - ],"hints": [ - { - "name": "spring.jpa.hibernate.ddl-auto", - "values": [ - { - "value": "none", - "description": "Disable DDL handling." - }, - { - "value": "validate", - "description": "Validate the schema, make no changes to the database." - }, - { - "value": "update", - "description": "Update the schema if necessary." - }, - { - "value": "create", - "description": "Create the schema and destroy previous data." - }, - { - "value": "create-drop", - "description": "Create and then destroy the schema at the end of the session." - } - ] - } - ]} ----- - -Each "`property`" is a configuration item that the user specifies with a given value. -For example, `server.port` and `server.address` might be specified in `application.properties`, as follows: - -[source,properties,indent=0,configprops] ----- - server.port=9090 - server.address=127.0.0.1 ----- - -The "`groups`" are higher level items that do not themselves specify a value but instead provide a contextual grouping for properties. -For example, the `server.port` and `server.address` properties are part of the `server` group. - -NOTE: It is not required that every "`property`" has a "`group`". -Some properties might exist in their own right. - -Finally, "`hints`" are additional information used to assist the user in configuring a given property. -For example, when a developer is configuring the configprop:spring.jpa.hibernate.ddl-auto[] property, a tool can use the hints to offer some auto-completion help for the `none`, `validate`, `update`, `create`, and `create-drop` values. - - - -[[configuration-metadata-group-attributes]] -=== Group Attributes -The JSON object contained in the `groups` array can contain the attributes shown in the following table: - -[cols="1,1,4"] -|=== -| Name | Type | Purpose - -| `name` -| String -| The full name of the group. - This attribute is mandatory. - -| `type` -| String -| The class name of the data type of the group. - For example, if the group were based on a class annotated with `@ConfigurationProperties`, the attribute would contain the fully qualified name of that class. - If it were based on a `@Bean` method, it would be the return type of that method. - If the type is not known, the attribute may be omitted. - -| `description` -| String -| A short description of the group that can be displayed to users. - If no description is available, it may be omitted. - It is recommended that descriptions be short paragraphs, with the first line providing a concise summary. - The last line in the description should end with a period (`.`). - -| `sourceType` -| String -| The class name of the source that contributed this group. - For example, if the group were based on a `@Bean` method annotated with `@ConfigurationProperties`, this attribute would contain the fully qualified name of the `@Configuration` class that contains the method. - If the source type is not known, the attribute may be omitted. - -| `sourceMethod` -| String -| The full name of the method (include parenthesis and argument types) that contributed this group (for example, the name of a `@ConfigurationProperties` annotated `@Bean` method). - If the source method is not known, it may be omitted. -|=== - - - -[[configuration-metadata-property-attributes]] -=== Property Attributes -The JSON object contained in the `properties` array can contain the attributes described in the following table: - -[cols="1,1,4"] -|=== -| Name | Type | Purpose - -| `name` -| String -| The full name of the property. - Names are in lower-case period-separated form (for example, `server.address`). - This attribute is mandatory. - -| `type` -| String -| The full signature of the data type of the property (for example, `java.lang.String`) but also a full generic type (such as `java.util.Map`). - You can use this attribute to guide the user as to the types of values that they can enter. - For consistency, the type of a primitive is specified by using its wrapper counterpart (for example, `boolean` becomes `java.lang.Boolean`). - Note that this class may be a complex type that gets converted from a `String` as values are bound. - If the type is not known, it may be omitted. - -| `description` -| String -| A short description of the property that can be displayed to users. - If no description is available, it may be omitted. - It is recommended that descriptions be short paragraphs, with the first line providing a concise summary. - The last line in the description should end with a period (`.`). - -| `sourceType` -| String -| The class name of the source that contributed this property. - For example, if the property were from a class annotated with `@ConfigurationProperties`, this attribute would contain the fully qualified name of that class. - If the source type is unknown, it may be omitted. - -| `defaultValue` -| Object -| The default value, which is used if the property is not specified. - If the type of the property is an array, it can be an array of value(s). - If the default value is unknown, it may be omitted. - -| `deprecation` -| Deprecation -| Specify whether the property is deprecated. - If the field is not deprecated or if that information is not known, it may be omitted. - The next table offers more detail about the `deprecation` attribute. -|=== - -The JSON object contained in the `deprecation` attribute of each `properties` element can contain the following attributes: - -[cols="1,1,4"] -|=== -| Name | Type | Purpose - -| `level` -| String -| The level of deprecation, which can be either `warning` (the default) or `error`. - When a property has a `warning` deprecation level, it should still be bound in the environment. - However, when it has an `error` deprecation level, the property is no longer managed and is not bound. - -| `reason` -| String -| A short description of the reason why the property was deprecated. - If no reason is available, it may be omitted. - It is recommended that descriptions be short paragraphs, with the first line providing a concise summary. - The last line in the description should end with a period (`.`). - -| `replacement` -| String -| The full name of the property that _replaces_ this deprecated property. - If there is no replacement for this property, it may be omitted. -|=== - -NOTE: Prior to Spring Boot 1.3, a single `deprecated` boolean attribute can be used instead of the `deprecation` element. -This is still supported in a deprecated fashion and should no longer be used. -If no reason and replacement are available, an empty `deprecation` object should be set. - -Deprecation can also be specified declaratively in code by adding the `@DeprecatedConfigurationProperty` annotation to the getter exposing the deprecated property. -For instance, assume that the `app.acme.target` property was confusing and was renamed to `app.acme.name`. -The following example shows how to handle that situation: - -[source,java,indent=0] ----- - @ConfigurationProperties("app.acme") - public class AcmeProperties { - - private String name; - - public String getName() { ... } - - public void setName(String name) { ... } - - @DeprecatedConfigurationProperty(replacement = "app.acme.name") - @Deprecated - public String getTarget() { - return getName(); - } - - @Deprecated - public void setTarget(String target) { - setName(target); - } - } ----- - -NOTE: There is no way to set a `level`. -`warning` is always assumed, since code is still handling the property. - -The preceding code makes sure that the deprecated property still works (delegating to the `name` property behind the scenes). -Once the `getTarget` and `setTarget` methods can be removed from your public API, the automatic deprecation hint in the metadata goes away as well. -If you want to keep a hint, adding manual metadata with an `error` deprecation level ensures that users are still informed about that property. -Doing so is particularly useful when a `replacement` is provided. - - - -[[configuration-metadata-hints-attributes]] -=== Hint Attributes -The JSON object contained in the `hints` array can contain the attributes shown in the following table: - -[cols="1,1,4"] -|=== -| Name | Type | Purpose - -| `name` -| String -| The full name of the property to which this hint refers. - Names are in lower-case period-separated form (such as `spring.mvc.servlet.path`). - If the property refers to a map (such as `system.contexts`), the hint either applies to the _keys_ of the map (`system.contexts.keys`) or the _values_ (`system.contexts.values`) of the map. - This attribute is mandatory. - -| `values` -| ValueHint[] -| A list of valid values as defined by the `ValueHint` object (described in the next table). - Each entry defines the value and may have a description. - -| `providers` -| ValueProvider[] -| A list of providers as defined by the `ValueProvider` object (described later in this document). - Each entry defines the name of the provider and its parameters, if any. -|=== - -The JSON object contained in the `values` attribute of each `hint` element can contain the attributes described in the following table: - -[cols="1,1,4"] -|=== -| Name | Type | Purpose - -| `value` -| Object -| A valid value for the element to which the hint refers. - If the type of the property is an array, it can also be an array of value(s). - This attribute is mandatory. - -| `description` -| String -| A short description of the value that can be displayed to users. - If no description is available, it may be omitted. - It is recommended that descriptions be short paragraphs, with the first line providing a concise summary. - The last line in the description should end with a period (`.`). -|=== - -The JSON object contained in the `providers` attribute of each `hint` element can contain the attributes described in the following table: - -[cols="1,1,4"] -|=== -|Name | Type |Purpose - -| `name` -| String -| The name of the provider to use to offer additional content assistance for the element to which the hint refers. - -| `parameters` -| JSON object -| Any additional parameter that the provider supports (check the documentation of the provider for more details). -|=== - - - -[[configuration-metadata-repeated-items]] -=== Repeated Metadata Items -Objects with the same "`property`" and "`group`" name can appear multiple times within a metadata file. -For example, you could bind two separate classes to the same prefix, with each having potentially overlapping property names. -While the same names appearing in the metadata multiple times should not be common, consumers of metadata should take care to ensure that they support it. - - - -[[configuration-metadata-providing-manual-hints]] -== Providing Manual Hints -To improve the user experience and further assist the user in configuring a given property, you can provide additional metadata that: - -* Describes the list of potential values for a property. -* Associates a provider, to attach a well defined semantic to a property, so that a tool can discover the list of potential values based on the project's context. - - -=== Value Hint -The `name` attribute of each hint refers to the `name` of a property. -In the <>, we provide five values for the `spring.jpa.hibernate.ddl-auto` property: `none`, `validate`, `update`, `create`, and `create-drop`. -Each value may have a description as well. - -If your property is of type `Map`, you can provide hints for both the keys and the values (but not for the map itself). -The special `.keys` and `.values` suffixes must refer to the keys and the values, respectively. - -Assume a `sample.contexts` maps magic `String` values to an integer, as shown in the following example: - -[source,java,indent=0] ----- - @ConfigurationProperties("sample") - public class SampleProperties { - - private Map contexts; - // getters and setters - } ----- - -The magic values are (in this example) are `sample1` and `sample2`. -In order to offer additional content assistance for the keys, you could add the following JSON to <>: - -[source,json,indent=0] ----- - {"hints": [ - { - "name": "sample.contexts.keys", - "values": [ - { - "value": "sample1" - }, - { - "value": "sample2" - } - ] - } - ]} ----- - -TIP: We recommend that you use an `Enum` for those two values instead. -If your IDE supports it, this is by far the most effective approach to auto-completion. - - - -=== Value Providers -Providers are a powerful way to attach semantics to a property. -In this section, we define the official providers that you can use for your own hints. -However, your favorite IDE may implement some of these or none of them. -Also, it could eventually provide its own. - -NOTE: As this is a new feature, IDE vendors must catch up with how it works. -Adoption times naturally vary. - -The following table summarizes the list of supported providers: - -[cols="2,4"] -|=== -| Name | Description - -| `any` -| Permits any additional value to be provided. - -| `class-reference` -| Auto-completes the classes available in the project. - Usually constrained by a base class that is specified by the `target` parameter. - -| `handle-as` -| Handles the property as if it were defined by the type defined by the mandatory `target` parameter. - -| `logger-name` -| Auto-completes valid logger names and <>. - Typically, package and class names available in the current project can be auto-completed as well as defined groups. - -| `spring-bean-reference` -| Auto-completes the available bean names in the current project. - Usually constrained by a base class that is specified by the `target` parameter. - -| `spring-profile-name` -| Auto-completes the available Spring profile names in the project. -|=== - -TIP: Only one provider can be active for a given property, but you can specify several providers if they can all manage the property _in some way_. -Make sure to place the most powerful provider first, as the IDE must use the first one in the JSON section that it can handle. -If no provider for a given property is supported, no special content assistance is provided, either. - - - -==== Any -The special **any** provider value permits any additional values to be provided. -Regular value validation based on the property type should be applied if this is supported. - -This provider is typically used if you have a list of values and any extra values should still be considered as valid. - -The following example offers `on` and `off` as auto-completion values for `system.state`: - -[source,json,indent=0] ----- - {"hints": [ - { - "name": "system.state", - "values": [ - { - "value": "on" - }, - { - "value": "off" - } - ], - "providers": [ - { - "name": "any" - } - ] - } - ]} ----- - -Note that, in the preceding example, any other value is also allowed. - -==== Class Reference -The **class-reference** provider auto-completes classes available in the project. -This provider supports the following parameters: - -[cols="1,1,2,4"] -|=== -| Parameter | Type | Default value | Description - -| `target` -| `String` (`Class`) -| _none_ -| The fully qualified name of the class that should be assignable to the chosen value. - Typically used to filter out-non candidate classes. - Note that this information can be provided by the type itself by exposing a class with the appropriate upper bound. - -| `concrete` -| `boolean` -| true -| Specify whether only concrete classes are to be considered as valid candidates. -|=== - - -The following metadata snippet corresponds to the standard `server.servlet.jsp.class-name` property that defines the `JspServlet` class name to use: - -[source,json,indent=0] ----- - {"hints": [ - { - "name": "server.servlet.jsp.class-name", - "providers": [ - { - "name": "class-reference", - "parameters": { - "target": "javax.servlet.http.HttpServlet" - } - } - ] - } - ]} ----- - - - -==== Handle As -The **handle-as** provider lets you substitute the type of the property to a more high-level type. -This typically happens when the property has a `java.lang.String` type, because you do not want your configuration classes to rely on classes that may not be on the classpath. -This provider supports the following parameters: - -[cols="1,1,2,4"] -|=== -| Parameter | Type | Default value | Description - -| **`target`** -| `String` (`Class`) -| _none_ -| The fully qualified name of the type to consider for the property. - This parameter is mandatory. -|=== - -The following types can be used: - -* Any `java.lang.Enum`: Lists the possible values for the property. - (We recommend defining the property with the `Enum` type, as no further hint should be required for the IDE to auto-complete the values) -* `java.nio.charset.Charset`: Supports auto-completion of charset/encoding values (such as `UTF-8`) -* `java.util.Locale`: auto-completion of locales (such as `en_US`) -* `org.springframework.util.MimeType`: Supports auto-completion of content type values (such as `text/plain`) -* `org.springframework.core.io.Resource`: Supports auto-completion of Spring’s Resource abstraction to refer to a file on the filesystem or on the classpath (such as `classpath:/sample.properties`) - -TIP: If multiple values can be provided, use a `Collection` or _Array_ type to teach the IDE about it. - -The following metadata snippet corresponds to the standard `spring.liquibase.change-log` property that defines the path to the changelog to use. -It is actually used internally as a `org.springframework.core.io.Resource` but cannot be exposed as such, because we need to keep the original String value to pass it to the Liquibase API. - -[source,json,indent=0] ----- - {"hints": [ - { - "name": "spring.liquibase.change-log", - "providers": [ - { - "name": "handle-as", - "parameters": { - "target": "org.springframework.core.io.Resource" - } - } - ] - } - ]} ----- - - - -==== Logger Name -The **logger-name** provider auto-completes valid logger names and <>. -Typically, package and class names available in the current project can be auto-completed. -If groups are enabled (default) and if a custom logger group is identified in the configuration, auto-completion for it should be provided. -Specific frameworks may have extra magic logger names that can be supported as well. - -This provider supports the following parameters: - -[cols="1,1,2,4"] -|=== -| Parameter | Type | Default value | Description - -| `group` -| `boolean` -| `true` -| Specify whether known groups should be considered. -|=== - -Since a logger name can be any arbitrary name, this provider should allow any value but could highlight valid package and class names that are not available in the project's classpath. - -The following metadata snippet corresponds to the standard `logging.level` property. -Keys are _logger names_, and values correspond to the standard log levels or any custom level. -As Spring Boot defines a few logger groups out-of-the-box, dedicated value hints have been added for those. - -[source,json,indent=0] ----- - {"hints": [ - { - "name": "logging.level.keys", - "values": [ - { - "value": "root", - "description": "Root logger used to assign the default logging level." - }, - { - "value": "sql", - "description": "SQL logging group including Hibernate SQL logger." - }, - { - "value": "web", - "description": "Web logging group including codecs." - } - ], - "providers": [ - { - "name": "logger-name" - } - ] - }, - { - "name": "logging.level.values", - "values": [ - { - "value": "trace" - }, - { - "value": "debug" - }, - { - "value": "info" - }, - { - "value": "warn" - }, - { - "value": "error" - }, - { - "value": "fatal" - }, - { - "value": "off" - } - - ], - "providers": [ - { - "name": "any" - } - ] - } - ]} ----- - - - -==== Spring Bean Reference -The **spring-bean-reference** provider auto-completes the beans that are defined in the configuration of the current project. -This provider supports the following parameters: - -[cols="1,1,2,4"] -|=== -| Parameter | Type | Default value | Description - -| `target` -| `String` (`Class`) -| _none_ -| The fully qualified name of the bean class that should be assignable to the candidate. - Typically used to filter out non-candidate beans. -|=== - -The following metadata snippet corresponds to the standard `spring.jmx.server` property that defines the name of the `MBeanServer` bean to use: - -[source,json,indent=0] ----- - {"hints": [ - { - "name": "spring.jmx.server", - "providers": [ - { - "name": "spring-bean-reference", - "parameters": { - "target": "javax.management.MBeanServer" - } - } - ] - } - ]} ----- - -NOTE: The binder is not aware of the metadata. -If you provide that hint, you still need to transform the bean name into an actual Bean reference using by the `ApplicationContext`. - - - -==== Spring Profile Name -The **spring-profile-name** provider auto-completes the Spring profiles that are defined in the configuration of the current project. - -The following metadata snippet corresponds to the standard `spring.profiles.active` property that defines the name of the Spring profile(s) to enable: - -[source,json,indent=0] ----- - {"hints": [ - { - "name": "spring.profiles.active", - "providers": [ - { - "name": "spring-profile-name" - } - ] - } - ]} ----- - - - -[[configuration-metadata-annotation-processor]] -== Generating Your Own Metadata by Using the Annotation Processor -You can easily generate your own configuration metadata file from items annotated with `@ConfigurationProperties` by using the `spring-boot-configuration-processor` jar. -The jar includes a Java annotation processor which is invoked as your project is compiled. -To use the processor, include a dependency on `spring-boot-configuration-processor`. - -With Maven the dependency should be declared as optional, as shown in the following example: - -[source,xml,indent=0,subs="verbatim,quotes,attributes"] ----- - - org.springframework.boot - spring-boot-configuration-processor - true - ----- - -With Gradle 4.5 and earlier, the dependency should be declared in the `compileOnly` configuration, as shown in the following example: - -[source,groovy,indent=0,subs="verbatim,quotes,attributes"] ----- - dependencies { - compileOnly "org.springframework.boot:spring-boot-configuration-processor" - } ----- - -With Gradle 4.6 and later, the dependency should be declared in the `annotationProcessor` configuration, as shown in the following example: - -[source,groovy,indent=0,subs="verbatim,quotes,attributes"] ----- - dependencies { - annotationProcessor "org.springframework.boot:spring-boot-configuration-processor" - } ----- - -If you are using an `additional-spring-configuration-metadata.json` file, the `compileJava` task should be configured to depend on the `processResources` task, as shown in the following example: - -[source,groovy,indent=0,subs="verbatim,quotes,attributes"] ----- - compileJava.dependsOn(processResources) ----- - -This dependency ensures that the additional metadata is available when the annotation processor runs during compilation. - -The processor picks up both classes and methods that are annotated with `@ConfigurationProperties`. -The Javadoc for field values within configuration classes is used to populate the `description` attribute. - -NOTE: You should only use simple text with `@ConfigurationProperties` field Javadoc, since they are not processed before being added to the JSON. - -If the class has a single constructor with at least one parameters, one property is created per constructor parameter. -Otherwise, properties are discovered through the presence of standard getters and setters with special handling for collection types (that is detected even if only a getter is present). - -The annotation processor also supports the use of the `@Data`, `@Getter`, and `@Setter` lombok annotations. - -The annotation processor cannot auto-detect default values for ``Enum``s and ``Collections``s. -In the cases where a `Collection` or `Enum` property has a non-empty default value, <> should be provided. - -Consider the following class: - -[source,java,indent=0,subs="verbatim,quotes,attributes"] ----- - @ConfigurationProperties(prefix = "acme.messaging") - public class MessagingProperties { - - private List addresses = new ArrayList<>(Arrays.asList("a", "b")); - - private ContainerType containerType = ContainerType.SIMPLE; - - // ... getter and setters - - public enum ContainerType { - - SIMPLE, - DIRECT - - } - - } ----- - -In order to document default values for properties in the class above, you could add the following content to <>: - -[source,json,indent=0] ----- - {"properties": [ - { - "name": "acme.messaging.addresses", - "defaultValue": ["a", "b"] - }, - { - "name": "acme.messaging.container-type", - "defaultValue": "simple" - } - ]} ----- - -Only the `name` of the property is required to document additional fields with manual metadata. - -[NOTE] -==== -If you are using AspectJ in your project, you need to make sure that the annotation processor runs only once. -There are several ways to do this. -With Maven, you can configure the `maven-apt-plugin` explicitly and add the dependency to the annotation processor only there. -You could also let the AspectJ plugin run all the processing and disable annotation processing in the `maven-compiler-plugin` configuration, as follows: - -[source,xml,indent=0,subs="verbatim,quotes,attributes"] ----- - - org.apache.maven.plugins - maven-compiler-plugin - - none - - ----- -==== - - - -[[configuration-metadata-nested-properties]] -=== Nested Properties -The annotation processor automatically considers inner classes as nested properties. -Consider the following class: - -[source,java,indent=0,subs="verbatim,quotes,attributes"] ----- - @ConfigurationProperties(prefix="server") - public class ServerProperties { - - private String name; - - private Host host; - - // ... getter and setters - - public static class Host { - - private String ip; - - private int port; - - // ... getter and setters - - } - - } ----- - -The preceding example produces metadata information for `server.name`, `server.host.ip`, and `server.host.port` properties. -You can use the `@NestedConfigurationProperty` annotation on a field to indicate that a regular (non-inner) class should be treated as if it were nested. - -TIP: This has no effect on collections and maps, as those types are automatically identified, and a single metadata property is generated for each of them. - - - -[[configuration-metadata-additional-metadata]] -=== Adding Additional Metadata -Spring Boot's configuration file handling is quite flexible, and it is often the case that properties may exist that are not bound to a `@ConfigurationProperties` bean. -You may also need to tune some attributes of an existing key. -To support such cases and let you provide custom "hints", the annotation processor automatically merges items from `META-INF/additional-spring-configuration-metadata.json` into the main metadata file. - -If you refer to a property that has been detected automatically, the description, default value, and deprecation information are overridden, if specified. -If the manual property declaration is not identified in the current module, it is added as a new property. - -The format of the `additional-spring-configuration-metadata.json` file is exactly the same as the regular `spring-configuration-metadata.json`. -The additional properties file is optional. -If you do not have any additional properties, do not add the file. diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-dependency-versions.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-dependency-versions.adoc deleted file mode 100644 index 32653b9dfa..0000000000 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-dependency-versions.adoc +++ /dev/null @@ -1,14 +0,0 @@ -[appendix] -[[dependency-versions]] -= Dependency versions -include::{asciidoc-sources-root}/attributes.adoc[] - -This appendix provides details of the dependencies that are managed by Spring Boot. - -[[dependency-versions-coordinates]] -== Managed Dependency Coordinates - -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[] 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/main/asciidoc/appendix-executable-jar-format.adoc deleted file mode 100644 index 048aaee57c..0000000000 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc +++ /dev/null @@ -1,281 +0,0 @@ -[appendix] -[[executable-jar]] -= The Executable Jar Format -include::{asciidoc-sources-root}/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. - -If you need to create executable jars from a different build system or if you are just curious about the underlying technology, this appendix provides some background. - - - -[[executable-jar-nested-jars]] -== Nested JARs -Java does not provide any standard way to load nested jar files (that is, jar files that are themselves contained within a jar). -This can be problematic if you need to distribute a self-contained application that can be run from the command line without unpacking. - -To solve this problem, many developers use "`shaded`" jars. -A shaded jar packages all classes, from all jars, into a single "`uber jar`". -The problem with shaded jars is that it becomes hard to see which libraries are actually in your application. -It can also be problematic if the same filename is used (but with different content) in multiple jars. -Spring Boot takes a different approach and lets you actually nest jars directly. - - - -[[executable-jar-jar-file-structure]] -=== The Executable Jar File Structure -Spring Boot Loader-compatible jar files should be structured in the following way: - -[indent=0] ----- - example.jar - | - +-META-INF - | +-MANIFEST.MF - +-org - | +-springframework - | +-boot - | +-loader - | +- - +-BOOT-INF - +-classes - | +-mycompany - | +-project - | +-YourClasses.class - +-lib - +-dependency1.jar - +-dependency2.jar ----- - -Application classes should be placed in a nested `BOOT-INF/classes` directory. -Dependencies should be placed in a nested `BOOT-INF/lib` directory. - - - -[[executable-jar-war-file-structure]] -=== The Executable War File Structure -Spring Boot Loader-compatible war files should be structured in the following way: - -[indent=0] ----- - example.war - | - +-META-INF - | +-MANIFEST.MF - +-org - | +-springframework - | +-boot - | +-loader - | +- - +-WEB-INF - +-classes - | +-com - | +-mycompany - | +-project - | +-YourClasses.class - +-lib - | +-dependency1.jar - | +-dependency2.jar - +-lib-provided - +-servlet-api.jar - +-dependency3.jar ----- - -Dependencies should be placed in a nested `WEB-INF/lib` directory. -Any dependencies that are required when running embedded but are not required when deploying to a traditional web container should be placed in `WEB-INF/lib-provided`. - - - -[[executable-jar-jarfile]] -== Spring Boot's "`JarFile`" Class -The core class used to support loading nested jars is `org.springframework.boot.loader.jar.JarFile`. -It lets you load jar content from a standard jar file or from nested child jar data. -When first loaded, the location of each `JarEntry` is mapped to a physical file offset of the outer jar, as shown in the following example: - -[indent=0] ----- - myapp.jar - +-------------------+-------------------------+ - | /BOOT-INF/classes | /BOOT-INF/lib/mylib.jar | - |+-----------------+||+-----------+----------+| - || A.class ||| B.class | C.class || - |+-----------------+||+-----------+----------+| - +-------------------+-------------------------+ - ^ ^ ^ - 0063 3452 3980 ----- - -The preceding example shows how `A.class` can be found in `/BOOT-INF/classes` in `myapp.jar` at position `0063`. -`B.class` from the nested jar can actually be found in `myapp.jar` at position `3452`, and `C.class` is at position `3980`. - -Armed with this information, we can load specific nested entries by seeking to the appropriate part of the outer jar. -We do not need to unpack the archive, and we do not need to read all entry data into memory. - - - -[[executable-jar-jarfile-compatibility]] -=== Compatibility with the Standard Java "`JarFile`" -Spring Boot Loader strives to remain compatible with existing code and libraries. -`org.springframework.boot.loader.jar.JarFile` extends from `java.util.jar.JarFile` and should work as a drop-in replacement. -The `getURL()` method returns a `URL` that opens a connection compatible with `java.net.JarURLConnection` and can be used with Java's `URLClassLoader`. - - - -[[executable-jar-launching]] -== Launching Executable Jars -The `org.springframework.boot.loader.Launcher` class is a special bootstrap class that is used as an executable jar's main entry point. -It is the actual `Main-Class` in your jar file, and it is used to setup an appropriate `URLClassLoader` and ultimately call your `main()` method. - -There are three launcher subclasses (`JarLauncher`, `WarLauncher`, and `PropertiesLauncher`). -Their purpose is to load resources (`.class` files and so on) from nested jar files or war files in directories (as opposed to those explicitly on the classpath). -In the case of `JarLauncher` and `WarLauncher`, the nested paths are fixed. -`JarLauncher` looks in `BOOT-INF/lib/`, and `WarLauncher` looks in `WEB-INF/lib/` and `WEB-INF/lib-provided/`. -You can add extra jars in those locations if you want more. -The `PropertiesLauncher` looks in `BOOT-INF/lib/` in your application archive by default. -You can add additional locations by setting an environment variable called `LOADER_PATH` or `loader.path` in `loader.properties` (which is a comma-separated list of directories, archives, or directories within archives). - - - -[[executable-jar-launcher-manifest]] -=== Launcher Manifest -You need to specify an appropriate `Launcher` as the `Main-Class` attribute of `META-INF/MANIFEST.MF`. -The actual class that you want to launch (that is, the class that contains a `main` method) should be specified in the `Start-Class` attribute. - -The following example shows a typical `MANIFEST.MF` for an executable jar file: - -[indent=0] ----- - Main-Class: org.springframework.boot.loader.JarLauncher - Start-Class: com.mycompany.project.MyApplication ----- - -For a war file, it would be as follows: - -[indent=0] ----- - Main-Class: org.springframework.boot.loader.WarLauncher - Start-Class: com.mycompany.project.MyApplication ----- - -NOTE: You need not specify `Class-Path` entries in your manifest file. -The classpath is deduced from the nested jars. - - - -[[executable-jar-property-launcher-features]] -== `PropertiesLauncher` Features -`PropertiesLauncher` has a few special features that can be enabled with external properties (System properties, environment variables, manifest entries, or `loader.properties`). -The following table describes these properties: - -|=== -| Key | Purpose - -| `loader.path` -| Comma-separated Classpath, such as `lib,$\{HOME}/app/lib`. - Earlier entries take precedence, like a regular `-classpath` on the `javac` command line. - -| `loader.home` -| Used to resolve relative paths in `loader.path`. - For example, given `loader.path=lib`, then `${loader.home}/lib` is a classpath location (along with all jar files in that directory). - This property is also used to locate a `loader.properties` file, as in the following example `file:///opt/app` It defaults to `${user.dir}`. - -| `loader.args` -| Default arguments for the main method (space separated). - -| `loader.main` -| Name of main class to launch (for example, `com.app.Application`). - -| `loader.config.name` -| Name of properties file (for example, `launcher`). - It defaults to `loader`. - -| `loader.config.location` -| Path to properties file (for example, `classpath:loader.properties`). - It defaults to `loader.properties`. - -| `loader.system` -| Boolean flag to indicate that all properties should be added to System properties. - It defaults to `false`. -|=== - -When specified as environment variables or manifest entries, the following names should be used: - -|=== -| Key | Manifest entry | Environment variable - -| `loader.path` -| `Loader-Path` -| `LOADER_PATH` - -| `loader.home` -| `Loader-Home` -| `LOADER_HOME` - -| `loader.args` -| `Loader-Args` -| `LOADER_ARGS` - -| `loader.main` -| `Start-Class` -| `LOADER_MAIN` - -| `loader.config.location` -| `Loader-Config-Location` -| `LOADER_CONFIG_LOCATION` - -| `loader.system` -| `Loader-System` -| `LOADER_SYSTEM` -|=== - -TIP: Build plugins automatically move the `Main-Class` attribute to `Start-Class` when the fat jar is built. -If you use that, specify the name of the class to launch by using the `Main-Class` attribute and leaving out `Start-Class`. - -The following rules apply to working with `PropertiesLauncher`: - -* `loader.properties` is searched for in `loader.home`, then in the root of the classpath, and then in `classpath:/BOOT-INF/classes`. - The first location where a file with that name exists is used. -* `loader.home` is the directory location of an additional properties file (overriding the default) only when `loader.config.location` is not specified. -* `loader.path` can contain directories (which are scanned recursively for jar and zip files), archive paths, a directory within an archive that is scanned for jar files (for example, `dependencies.jar!/lib`), or wildcard patterns (for the default JVM behavior). - Archive paths can be relative to `loader.home` or anywhere in the file system with a `jar:file:` prefix. -* `loader.path` (if empty) defaults to `BOOT-INF/lib` (meaning a local directory or a nested one if running from an archive). - Because of this, `PropertiesLauncher` behaves the same as `JarLauncher` when no additional configuration is provided. -* `loader.path` can not be used to configure the location of `loader.properties` (the classpath used to search for the latter is the JVM classpath when `PropertiesLauncher` is launched). -* Placeholder replacement is done from System and environment variables plus the properties file itself on all values before use. -* The search order for properties (where it makes sense to look in more than one place) is environment variables, system properties, `loader.properties`, the exploded archive manifest, and the archive manifest. - - - -[[executable-jar-restrictions]] -== Executable Jar Restrictions -You need to consider the following restrictions when working with a Spring Boot Loader packaged application: - - - -[[executable-jar-zip-entry-compression]] -* Zip entry compression: -The `ZipEntry` for a nested jar must be saved by using the `ZipEntry.STORED` method. -This is required so that we can seek directly to individual content within the nested jar. -The content of the nested jar file itself can still be compressed, as can any other entries in the outer jar. - - - -[[executable-jar-system-classloader]] -* System classLoader: -Launched applications should use `Thread.getContextClassLoader()` when loading classes (most libraries and frameworks do so by default). -Trying to load nested jar classes with `ClassLoader.getSystemClassLoader()` fails. -`java.util.Logging` always uses the system classloader. -For this reason, you should consider a different logging implementation. - - - -[[executable-jar-alternatives]] -== Alternative Single Jar Solutions -If the preceding restrictions mean that you cannot use Spring Boot Loader, consider the following alternatives: - -* https://maven.apache.org/plugins/maven-shade-plugin/[Maven Shade Plugin] -* http://www.jdotsoft.com/JarClassLoader.php[JarClassLoader] -* https://sourceforge.net/projects/one-jar/[OneJar] -* https://imperceptiblethoughts.com/shadow/[Gradle Shadow Plugin] - 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/main/asciidoc/appendix-test-auto-configuration.adoc deleted file mode 100644 index a354ff5081..0000000000 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-test-auto-configuration.adoc +++ /dev/null @@ -1,13 +0,0 @@ -[appendix] -[[test-auto-configuration]] -= Test Auto-configuration Annotations -include::{asciidoc-sources-root}/attributes.adoc[] - -This appendix describes the `@…Test` auto-configuration annotations that Spring Boot provides to test slices of your application. - -[[test-auto-configuration-slices]] -== Test Slices - -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[] diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/attributes.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/attributes.adoc deleted file mode 100644 index a7ba014987..0000000000 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/attributes.adoc +++ /dev/null @@ -1,108 +0,0 @@ -:doctype: book -:idprefix: -:idseparator: - -:toc: left -:toclevels: 4 -:tabsize: 4 -:numbered: -:sectanchors: -:sectnums: -:icons: font -:hide-uri-scheme: -:docinfo: shared,private - -:spring-boot-artifactory-repo: snapshot -:github-tag: master -:spring-boot-version: current - -:github-repo: spring-projects/spring-boot -:github-raw: https://raw.githubusercontent.com/{github-repo}/{github-tag} -: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 - -: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/ -:spring-boot-docs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/reference -:spring-boot-master-code: https://github.com/{github-repo}/tree/master -:spring-boot-current-docs: https://docs.spring.io/spring-boot/docs/current/reference -:spring-boot-actuator-restapi: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/actuator-api/ -:spring-boot-maven-plugin-docs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/maven-plugin/html/ -:spring-boot-gradle-plugin-docs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/gradle-plugin/reference/html/ -:spring-boot-gradle-plugin-pdfdocs: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/gradle-plugin/reference/pdf/spring-boot-gradle-plugin-reference.pdf -:spring-boot-gradle-plugin-api: https://docs.spring.io/spring-boot/docs/{spring-boot-version}/gradle-plugin/reference/api/ - -:spring-boot-module-code: {spring-boot-code}/spring-boot-project/spring-boot/src/main/java/org/springframework/boot -:spring-boot-module-api: {spring-boot-api}/org/springframework/boot -:spring-boot-autoconfigure-module-code: {spring-boot-code}/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure -:spring-boot-autoconfigure-module-api: {spring-boot-api}/org/springframework/boot/autoconfigure -:spring-boot-actuator-module-code: {spring-boot-code}/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate -:spring-boot-actuator-module-api: {spring-boot-api}/org/springframework/boot/actuate -:spring-boot-actuator-autoconfigure-module-code: {spring-boot-code}/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure -:spring-boot-actuator-autoconfigure-module-api: : {spring-boot-api}/org/springframework/boot/actuate/autoconfigure -:spring-boot-cli-module-code: {spring-boot-code}/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli -:spring-boot-cli-module-api: {spring-boot-api}/org/springframework/boot/cli -:spring-boot-devtools-module-code: {spring-boot-code}/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools -:spring-boot-devtools-module-api: {spring-boot-api}/org/springframework/boot/devtools -:spring-boot-test-module-code: {spring-boot-code}/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test -:spring-boot-test-module-api: {spring-boot-api}/org/springframework/boot/test -:spring-boot-test-autoconfigure-module-code: {spring-boot-code}/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure -:spring-boot-test-autoconfigure-module-api: {spring-boot-api}/org/springframework/boot/test/autoconfigure - -:spring-amqp-api: https://docs.spring.io/spring-amqp/docs/{spring-amqp-version}/api/org/springframework/amqp -:spring-batch: https://spring.io/projects/spring-batch -:spring-batch-api: https://docs.spring.io/spring-batch/docs/{spring-batch-version}/api/org/springframework/batch -:spring-batch-docs: https://docs.spring.io/spring-batch/docs/{spring-batch-version}/reference/html/ -:spring-data: https://spring.io/projects/spring-data -:spring-data-cassandra: https://spring.io/projects/spring-data-cassandra -:spring-data-commons-api: https://docs.spring.io/spring-data/commons/docs/{spring-data-commons-version}/api/org/springframework/data -:spring-data-couchbase: https://spring.io/projects/spring-data-couchbase -:spring-data-couchbase-docs: https://docs.spring.io/spring-data/couchbase/docs/{spring-data-couchbase-version}/reference/html/ -:spring-data-elasticsearch: https://spring.io/projects/spring-data-elasticsearch -:spring-data-elasticsearch-docs: https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/ -:spring-data-gemfire: https://spring.io/projects/spring-data-gemfire -:spring-data-geode: https://spring.io/projects/spring-data-geode -:spring-data-jpa: https://spring.io/projects/spring-data-jpa -:spring-data-jpa-api: https://docs.spring.io/spring-data/jpa/docs/{spring-data-jpa-version}/api/org/springframework/data/jpa -:spring-data-jdbc-docs: https://docs.spring.io/spring-data/jdbc/docs/{spring-data-jdbc-version}/reference/html/ -:spring-data-ldap: https://spring.io/projects/spring-data-ldap -:spring-data-mongodb: https://spring.io/projects/spring-data-mongodb -:spring-data-mongodb-api: https://docs.spring.io/spring-data/mongodb/docs/{spring-data-mongodb-version}/api/org/springframework/data/mongodb -:spring-data-neo4j: https://spring.io/projects/spring-data-neo4j -:spring-data-neo4j-docs: https://docs.spring.io/spring-data/neo4j/docs/{spring-data-neo4j-version}/reference/html/ -:spring-data-redis: https://spring.io/projects/spring-data-redis -:spring-data-rest-api: https://docs.spring.io/spring-data/rest/docs/{spring-data-rest-version}/api/org/springframework/data/rest -:spring-data-solr: https://spring.io/projects/spring-data-solr -:spring-data-solr-docs: https://docs.spring.io/spring-data/solr/docs/{spring-data-solr-version}/reference/html/ -:spring-framework: https://spring.io/projects/spring-framework -:spring-framework-api: https://docs.spring.io/spring/docs/{spring-framework-version}/javadoc-api/org/springframework -:spring-framework-docs: https://docs.spring.io/spring/docs/{spring-framework-version}/spring-framework-reference/ -:spring-initializr-docs: https://docs.spring.io/initializr/docs/current/reference/html/ -:spring-integration: https://spring.io/projects/spring-integration -:spring-integration-docs: https://docs.spring.io/spring-integration/docs/{spring-integration-version}/reference/html/ -:spring-restdocs: https://spring.io/projects/spring-restdocs -:spring-security: https://spring.io/projects/spring-security -:spring-security-docs: https://docs.spring.io/spring-security/site/docs/{spring-security-version}/reference/htmlsingle/ -:spring-security-oauth2: https://spring.io/projects/spring-security-oauth -:spring-security-oauth2-docs: https://projects.spring.io/spring-security-oauth/docs/oauth2.html -:spring-session: https://spring.io/projects/spring-session -:spring-webservices-docs: https://docs.spring.io/spring-ws/docs/{spring-webservices-version}/reference/ - - - - -:ant-docs: https://ant.apache.org/manual -:dependency-management-plugin-code: https://github.com/spring-gradle-plugins/dependency-management-plugin -:gradle-docs: https://docs.gradle.org/current/userguide -:hibernate-docs: https://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html -:java-api: https://docs.oracle.com/javase/8/docs/api/ -:jetty-docs: https://www.eclipse.org/jetty/documentation/{jetty-version} -:jooq-docs: https://www.jooq.org/doc/{jooq-version}/manual-single-page -:junit5-docs: https://junit.org/junit5/docs/current/user-guide -:kotlin-docs: https://kotlinlang.org/docs/reference/ -:micrometer-docs: https://micrometer.io/docs -:micrometer-concepts-docs: {micrometer-docs}/concepts -:micrometer-registry-docs: {micrometer-docs}/registry -:tomcat-docs: https://tomcat.apache.org/tomcat-9.0-doc diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc deleted file mode 100644 index b9977e9a31..0000000000 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc +++ /dev/null @@ -1,1039 +0,0 @@ -[[using-boot]] -= Using Spring Boot -include::attributes.adoc[] - -This section goes into more detail about how you should use Spring Boot. -It covers topics such as build systems, auto-configuration, and how to run your applications. -We also cover some Spring Boot best practices. -Although there is nothing particularly special about Spring Boot (it is just another library that you can consume), there are a few recommendations that, when followed, make your development process a little easier. - -If you are starting out with Spring Boot, you should probably read the _<>_ guide before diving into this section. - - - -[[using-boot-build-systems]] -== Build Systems -It is strongly recommended that you choose a build system that supports <> and that can consume artifacts published to the "`Maven Central`" repository. -We would recommend that you choose Maven or Gradle. -It is possible to get Spring Boot to work with other build systems (Ant, for example), but they are not particularly well supported. - - - -[[using-boot-dependency-management]] -=== Dependency Management -Each release of Spring Boot provides a curated list of dependencies that it supports. -In practice, you do not need to provide a version for any of these dependencies in your build configuration, as Spring Boot manages that for you. -When you upgrade Spring Boot itself, these dependencies are upgraded as well in a consistent way. - -NOTE: You can still specify a version and override Spring Boot's recommendations if you need to do so. - -The curated list contains all the spring modules that you can use with Spring Boot as well as a refined list of third party libraries. -The list is available as a standard <> that can be used with both <> and <>. - -WARNING: Each release of Spring Boot is associated with a base version of the Spring Framework. -We **highly** recommend that you not specify its version. - - - -[[using-boot-maven]] -=== Maven -Maven users can inherit from the `spring-boot-starter-parent` project to obtain sensible defaults. -The parent project provides the following features: - -* Java 1.8 as the default compiler level. -* UTF-8 source encoding. -* A <>, inherited from the spring-boot-dependencies pom, that manages the versions of common dependencies. -This dependency management lets you omit tags for those dependencies when used in your own pom. -* An execution of the {spring-boot-maven-plugin-docs}/repackage-mojo.html[`repackage` goal] with a `repackage` execution id. -* Sensible https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html[resource filtering]. -* Sensible plugin configuration (https://www.mojohaus.org/exec-maven-plugin/[exec plugin], https://github.com/ktoso/maven-git-commit-id-plugin[Git commit ID], and https://maven.apache.org/plugins/maven-shade-plugin/[shade]). -* Sensible resource filtering for `application.properties` and `application.yml` including profile-specific files (for example, `application-dev.properties` and `application-dev.yml`) - -Note that, since the `application.properties` and `application.yml` files accept Spring style placeholders (`${...}`), the Maven filtering is changed to use `@..@` placeholders. -(You can override that by setting a Maven property called `resource.delimiter`.) - - - -[[using-boot-maven-parent-pom]] -==== Inheriting the Starter Parent -To configure your project to inherit from the `spring-boot-starter-parent`, set the `parent` as follows: - -[source,xml,indent=0,subs="verbatim,quotes,attributes"] ----- - - - org.springframework.boot - spring-boot-starter-parent - {spring-boot-version} - ----- - -NOTE: You should need to specify only the Spring Boot version number on this dependency. -If you import additional starters, you can safely omit the version number. - -With that setup, you can also override individual dependencies by overriding a property in your own project. -For instance, to upgrade to another Spring Data release train, you would add the following to your `pom.xml`: - -[source,xml,indent=0,subs="verbatim,quotes,attributes"] ----- - - Fowler-SR2 - ----- - -TIP: Check the {spring-boot-code}/spring-boot-project/spring-boot-dependencies/pom.xml[`spring-boot-dependencies` pom] for a list of supported properties. - - - -[[using-boot-maven-without-a-parent]] -==== Using Spring Boot without the Parent POM -Not everyone likes inheriting from the `spring-boot-starter-parent` POM. -You may have your own corporate standard parent that you need to use or you may prefer to explicitly declare all your Maven configuration. - -If you do not want to use the `spring-boot-starter-parent`, you can still keep the benefit of the dependency management (but not the plugin management) by using a `scope=import` dependency, as follows: - -[source,xml,indent=0,subs="verbatim,quotes,attributes"] ----- - - - - - org.springframework.boot - spring-boot-dependencies - {spring-boot-version} - pom - import - - - ----- - -The preceding sample setup does not let you override individual dependencies by using a property, as explained above. -To achieve the same result, you need to add an entry in the `dependencyManagement` of your project **before** the `spring-boot-dependencies` entry. -For instance, to upgrade to another Spring Data release train, you could add the following element to your `pom.xml`: - -[source,xml,indent=0,subs="verbatim,quotes,attributes"] ----- - - - - - org.springframework.data - spring-data-releasetrain - Fowler-SR2 - pom - import - - - org.springframework.boot - spring-boot-dependencies - {spring-boot-version} - pom - import - - - ----- - -NOTE: In the preceding example, we specify a _BOM_, but any dependency type can be overridden in the same way. - - - -[[using-boot-maven-plugin]] -==== Using the Spring Boot Maven Plugin -Spring Boot includes a <> that can package the project as an executable jar. -Add the plugin to your `` section if you want to use it, as shown in the following example: - -[source,xml,indent=0,subs="verbatim,quotes,attributes"] ----- - - - - org.springframework.boot - spring-boot-maven-plugin - - - ----- - -NOTE: If you use the Spring Boot starter parent pom, you need to add only the plugin. -There is no need to configure it unless you want to change the settings defined in the parent. - - - -[[using-boot-gradle]] -=== Gradle -To learn about using Spring Boot with Gradle, please refer to the documentation for Spring Boot's Gradle plugin: - -* Reference ({spring-boot-gradle-plugin-docs}[HTML] and {spring-boot-gradle-plugin-pdfdocs}[PDF]) -* {spring-boot-gradle-plugin-api}[API] - - - -[[using-boot-ant]] -=== Ant -It is possible to build a Spring Boot project using Apache Ant+Ivy. -The `spring-boot-antlib` "`AntLib`" module is also available to help Ant create executable jars. - -To declare dependencies, a typical `ivy.xml` file looks something like the following example: - -[source,xml,indent=0] ----- - - - - - - - - - - ----- - -A typical `build.xml` looks like the following example: - -[source,xml,indent=0,subs="verbatim,quotes,attributes"] ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ----- - -TIP: If you do not want to use the `spring-boot-antlib` module, see the _<>_ "`How-to`" . - - - -[[using-boot-starter]] -=== Starters -Starters are a set of convenient dependency descriptors that you can include in your application. -You get a one-stop shop for all the Spring and related technologies that you need without having to hunt through sample code and copy-paste loads of dependency descriptors. -For example, if you want to get started using Spring and JPA for database access, include the `spring-boot-starter-data-jpa` dependency in your project. - -The starters contain a lot of the dependencies that you need to get a project up and running quickly and with a consistent, supported set of managed transitive dependencies. - -.What's in a name -**** -All **official** starters follow a similar naming pattern; `+spring-boot-starter-*+`, where `+*+` is a particular type of application. -This naming structure is intended to help when you need to find a starter. -The Maven integration in many IDEs lets you search dependencies by name. -For example, with the appropriate Eclipse or STS plugin installed, you can press `ctrl-space` in the POM editor and type "`spring-boot-starter`" for a complete list. - -As explained in the "`<>`" section, third party starters should not start with `spring-boot`, as it is reserved for official Spring Boot artifacts. -Rather, a third-party starter typically starts with the name of the project. -For example, a third-party starter project called `thirdpartyproject` would typically be named `thirdpartyproject-spring-boot-starter`. -**** - -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[] - -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[] - -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[] - -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. - - - -[[using-boot-structuring-your-code]] -== Structuring Your Code -Spring Boot does not require any specific code layout to work. -However, there are some best practices that help. - - - -[[using-boot-using-the-default-package]] -=== Using the "`default`" Package -When a class does not include a `package` declaration, it is considered to be in the "`default package`". -The use of the "`default package`" is generally discouraged and should be avoided. -It can cause particular problems for Spring Boot applications that use the `@ComponentScan`, `@ConfigurationPropertiesScan`, `@EntityScan`, or `@SpringBootApplication` annotations, since every class from every jar is read. - -TIP: We recommend that you follow Java's recommended package naming conventions and use a reversed domain name (for example, `com.example.project`). - - - -[[using-boot-locating-the-main-class]] -=== Locating the Main Application Class -We generally recommend that you locate your main application class in a root package above other classes. -The <> is often placed on your main class, and it implicitly defines a base "`search package`" for certain items. -For example, if you are writing a JPA application, the package of the `@SpringBootApplication` annotated class is used to search for `@Entity` items. -Using a root package also allows component scan to apply only on your project. - -TIP: If you don't want to use `@SpringBootApplication`, the `@EnableAutoConfiguration` and `@ComponentScan` annotations that it imports defines that behaviour so you can also use those instead. - -The following listing shows a typical layout: - -[indent=0] ----- - com - +- example - +- myapplication - +- Application.java - | - +- customer - | +- Customer.java - | +- CustomerController.java - | +- CustomerService.java - | +- CustomerRepository.java - | - +- order - +- Order.java - +- OrderController.java - +- OrderService.java - +- OrderRepository.java ----- - -The `Application.java` file would declare the `main` method, along with the basic `@SpringBootApplication`, as follows: - -[source,java,indent=0] ----- - package com.example.myapplication; - - import org.springframework.boot.SpringApplication; - import org.springframework.boot.autoconfigure.SpringBootApplication; - - @SpringBootApplication - public class Application { - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - - } ----- - - - -[[using-boot-configuration-classes]] -== Configuration Classes -Spring Boot favors Java-based configuration. -Although it is possible to use `SpringApplication` with XML sources, we generally recommend that your primary source be a single `@Configuration` class. -Usually the class that defines the `main` method is a good candidate as the primary `@Configuration`. - -TIP: Many Spring configuration examples have been published on the Internet that use XML configuration. -If possible, always try to use the equivalent Java-based configuration. -Searching for `+Enable*+` annotations can be a good starting point. - - - -[[using-boot-importing-configuration]] -=== Importing Additional Configuration Classes -You need not put all your `@Configuration` into a single class. -The `@Import` annotation can be used to import additional configuration classes. -Alternatively, you can use `@ComponentScan` to automatically pick up all Spring components, including `@Configuration` classes. - - - -[[using-boot-importing-xml-configuration]] -=== Importing XML Configuration -If you absolutely must use XML based configuration, we recommend that you still start with a `@Configuration` class. -You can then use an `@ImportResource` annotation to load XML configuration files. - - - -[[using-boot-auto-configuration]] -== Auto-configuration -Spring Boot auto-configuration attempts to automatically configure your Spring application based on the jar dependencies that you have added. -For example, if `HSQLDB` is on your classpath, and you have not manually configured any database connection beans, then Spring Boot auto-configures an in-memory database. - -You need to opt-in to auto-configuration by adding the `@EnableAutoConfiguration` or `@SpringBootApplication` annotations to one of your `@Configuration` classes. - -TIP: You should only ever add one `@SpringBootApplication` or `@EnableAutoConfiguration` annotation. -We generally recommend that you add one or the other to your primary `@Configuration` class only. - - - -[[using-boot-replacing-auto-configuration]] -=== Gradually Replacing Auto-configuration -Auto-configuration is non-invasive. -At any point, you can start to define your own configuration to replace specific parts of the auto-configuration. -For example, if you add your own `DataSource` bean, the default embedded database support backs away. - -If you need to find out what auto-configuration is currently being applied, and why, start your application with the `--debug` switch. -Doing so enables debug logs for a selection of core loggers and logs a conditions report to the console. - - - -[[using-boot-disabling-specific-auto-configuration]] -=== Disabling Specific Auto-configuration Classes -If you find that specific auto-configuration classes that you do not want are being applied, you can use the exclude attribute of `@EnableAutoConfiguration` to disable them, as shown in the following example: - -[source,java,indent=0] ----- - import org.springframework.boot.autoconfigure.*; - import org.springframework.boot.autoconfigure.jdbc.*; - import org.springframework.context.annotation.*; - - @Configuration(proxyBeanMethods = false) - @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class}) - public class MyConfiguration { - } ----- - -If the class is not on the classpath, you can use the `excludeName` attribute of the annotation and specify the fully qualified name instead. -Finally, you can also control the list of auto-configuration classes to exclude by using the configprop:spring.autoconfigure.exclude[] property. - -TIP: You can define exclusions both at the annotation level and by using the property. - -NOTE: Even though auto-configuration classes are `public`, the only aspect of the class that is considered public API is the name of the class which can be used for disabling the auto-configuration. -The actual contents of those classes, such as nested configuration classes or bean methods are for internal use only and we do not recommend using those directly. - - - -[[using-boot-spring-beans-and-dependency-injection]] -== Spring Beans and Dependency Injection -You are free to use any of the standard Spring Framework techniques to define your beans and their injected dependencies. -For simplicity, we often find that using `@ComponentScan` (to find your beans) and using `@Autowired` (to do constructor injection) works well. - -If you structure your code as suggested above (locating your application class in a root package), you can add `@ComponentScan` without any arguments. -All of your application components (`@Component`, `@Service`, `@Repository`, `@Controller` etc.) are automatically registered as Spring Beans. - -The following example shows a `@Service` Bean that uses constructor injection to obtain a required `RiskAssessor` bean: - -[source,java,indent=0] ----- - package com.example.service; - - import org.springframework.beans.factory.annotation.Autowired; - import org.springframework.stereotype.Service; - - @Service - public class DatabaseAccountService implements AccountService { - - private final RiskAssessor riskAssessor; - - @Autowired - public DatabaseAccountService(RiskAssessor riskAssessor) { - this.riskAssessor = riskAssessor; - } - - // ... - - } ----- - -If a bean has one constructor, you can omit the `@Autowired`, as shown in the following example: - -[source,java,indent=0] ----- - @Service - public class DatabaseAccountService implements AccountService { - - private final RiskAssessor riskAssessor; - - public DatabaseAccountService(RiskAssessor riskAssessor) { - this.riskAssessor = riskAssessor; - } - - // ... - - } ----- - -TIP: Notice how using constructor injection lets the `riskAssessor` field be marked as `final`, indicating that it cannot be subsequently changed. - - - -[[using-boot-using-springbootapplication-annotation]] -== Using the @SpringBootApplication Annotation -Many Spring Boot developers like their apps to use auto-configuration, component scan and be able to define extra configuration on their "application class". -A single `@SpringBootApplication` annotation can be used to enable those three features, that is: - -* `@EnableAutoConfiguration`: enable <> -* `@ComponentScan`: enable `@Component` scan on the package where the application is located (see <>) -* `@Configuration`: allow to register extra beans in the context or import additional configuration classes - -[source,java,indent=0] ----- - package com.example.myapplication; - - import org.springframework.boot.SpringApplication; - import org.springframework.boot.autoconfigure.SpringBootApplication; - - @SpringBootApplication // same as @Configuration @EnableAutoConfiguration @ComponentScan - public class Application { - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - - } ----- - -NOTE: `@SpringBootApplication` also provides aliases to customize the attributes of `@EnableAutoConfiguration` and `@ComponentScan`. - -[NOTE] -==== -None of these features are mandatory and you may choose to replace this single annotation by any of the features that it enables. -For instance, you may not want to use component scan or configuration properties scan in your application: - -[source,java,indent=0] ----- - package com.example.myapplication; - - import org.springframework.boot.SpringApplication; - import org.springframework.context.annotation.ComponentScan - import org.springframework.context.annotation.Configuration; - import org.springframework.context.annotation.Import; - - @Configuration(proxyBeanMethods = false) - @EnableAutoConfiguration - @Import({ MyConfig.class, MyAnotherConfig.class }) - public class Application { - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - - } ----- - -In this example, `Application` is just like any other Spring Boot application except that `@Component`-annotated classes and `@ConfigurationProperties`-annotated classes are not detected automatically and the user-defined beans are imported explicitly (see `@Import`). -==== - - - -[[using-boot-running-your-application]] -== Running Your Application -One of the biggest advantages of packaging your application as a jar and using an embedded HTTP server is that you can run your application as you would any other. -Debugging Spring Boot applications is also easy. -You do not need any special IDE plugins or extensions. - -NOTE: This section only covers jar based packaging. -If you choose to package your application as a war file, you should refer to your server and IDE documentation. - - - -[[using-boot-running-from-an-ide]] -=== Running from an IDE -You can run a Spring Boot application from your IDE as a simple Java application. -However, you first need to import your project. -Import steps vary depending on your IDE and build system. -Most IDEs can import Maven projects directly. -For example, Eclipse users can select `Import...` -> `Existing Maven Projects` from the `File` menu. - -If you cannot directly import your project into your IDE, you may be able to generate IDE metadata by using a build plugin. -Maven includes plugins for https://maven.apache.org/plugins/maven-eclipse-plugin/[Eclipse] and https://maven.apache.org/plugins/maven-idea-plugin/[IDEA]. -Gradle offers plugins for {gradle-docs}/userguide.html[various IDEs]. - -TIP: If you accidentally run a web application twice, you see a "`Port already in use`" error. -STS users can use the `Relaunch` button rather than the `Run` button to ensure that any existing instance is closed. - - - -[[using-boot-running-as-a-packaged-application]] -=== Running as a Packaged Application -If you use the Spring Boot Maven or Gradle plugins to create an executable jar, you can run your application using `java -jar`, as shown in the following example: - -[indent=0,subs="attributes"] ----- - $ java -jar target/myapplication-0.0.1-SNAPSHOT.jar ----- - -It is also possible to run a packaged application with remote debugging support enabled. -Doing so lets you attach a debugger to your packaged application, as shown in the following example: - -[indent=0,subs="attributes"] ----- - $ java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n \ - -jar target/myapplication-0.0.1-SNAPSHOT.jar ----- - - - -[[using-boot-running-with-the-maven-plugin]] -=== Using the Maven Plugin -The Spring Boot Maven plugin includes a `run` goal that can be used to quickly compile and run your application. -Applications run in an exploded form, as they do in your IDE. -The following example shows a typical Maven command to run a Spring Boot application: - -[indent=0,subs="attributes"] ----- - $ mvn spring-boot:run ----- - -You might also want to use the `MAVEN_OPTS` operating system environment variable, as shown in the following example: - -[indent=0,subs="attributes"] ----- - $ export MAVEN_OPTS=-Xmx1024m ----- - - - -[[using-boot-running-with-the-gradle-plugin]] -=== Using the Gradle Plugin -The Spring Boot Gradle plugin also includes a `bootRun` task that can be used to run your application in an exploded form. -The `bootRun` task is added whenever you apply the `org.springframework.boot` and `java` plugins and is shown in the following example: - -[indent=0,subs="attributes"] ----- - $ gradle bootRun ----- - -You might also want to use the `JAVA_OPTS` operating system environment variable, as shown in the following example: - -[indent=0,subs="attributes"] ----- - $ export JAVA_OPTS=-Xmx1024m ----- - - - -[[using-boot-hot-swapping]] -=== Hot Swapping -Since Spring Boot applications are just plain Java applications, JVM hot-swapping should work out of the box. -JVM hot swapping is somewhat limited with the bytecode that it can replace. -For a more complete solution, https://jrebel.com/software/jrebel/[JRebel] can be used. - -The `spring-boot-devtools` module also includes support for quick application restarts. -See the <> section later in this chapter and the <> for details. - - - -[[using-boot-devtools]] -== Developer Tools -Spring Boot includes an additional set of tools that can make the application development experience a little more pleasant. -The `spring-boot-devtools` module can be included in any project to provide additional development-time features. -To include devtools support, add the module dependency to your build, as shown in the following listings for Maven and Gradle: - -.Maven -[source,xml,indent=0,subs="verbatim,quotes,attributes"] ----- - - - org.springframework.boot - spring-boot-devtools - true - - ----- - -.Gradle -[source,groovy,indent=0,subs="attributes"] ----- - configurations { - developmentOnly - runtimeClasspath { - extendsFrom developmentOnly - } - } - dependencies { - developmentOnly("org.springframework.boot:spring-boot-devtools") - } ----- - -NOTE: Developer tools are automatically disabled when running a fully packaged application. -If your application is launched from `java -jar` or if it is started from a special classloader, then it is considered a "`production application`". -If that does not apply to you (i.e. if you run your application from a container), consider excluding devtools or set the `-Dspring.devtools.restart.enabled=false` system property. - -TIP: Flagging the dependency as optional in Maven or using a custom `developmentOnly` configuration in Gradle (as shown above) is a best practice that prevents devtools from being transitively applied to other modules that use your project. - -TIP: Repackaged archives do not contain devtools by default. -If you want to use a <>, you need to disable the `excludeDevtools` build property to include it. -The property is supported with both the Maven and Gradle plugins. - - - -[[using-boot-devtools-property-defaults]] -=== Property Defaults -Several of the libraries supported by Spring Boot use caches to improve performance. -For example, <> cache compiled templates to avoid repeatedly parsing template files. -Also, Spring MVC can add HTTP caching headers to responses when serving static resources. - -While caching is very beneficial in production, it can be counter-productive during development, preventing you from seeing the changes you just made in your application. -For this reason, spring-boot-devtools disables the caching options by default. - -Cache options are usually configured by settings in your `application.properties` file. -For example, Thymeleaf offers the configprop:spring.thymeleaf.cache[] property. -Rather than needing to set these properties manually, the `spring-boot-devtools` module automatically applies sensible development-time configuration. - -Because you need more information about web requests while developing Spring MVC and Spring WebFlux applications, developer tools will enable `DEBUG` logging for the `web` logging group. -This will give you information about the incoming request, which handler is processing it, the response outcome, etc. -If you wish to log all request details (including potentially sensitive information), you can turn on the configprop:spring.http.log-request-details[] configuration property. - -NOTE: If you don't want property defaults to be applied you can set configprop:spring.devtools.add-properties[] to `false` in your `application.properties`. - -TIP: For a complete list of the properties that are applied by the devtools, see {spring-boot-devtools-module-code}/env/DevToolsPropertyDefaultsPostProcessor.java[DevToolsPropertyDefaultsPostProcessor]. - - - -[[using-boot-devtools-restart]] -=== Automatic Restart -Applications that use `spring-boot-devtools` automatically restart whenever files on the classpath change. -This can be a useful feature when working in an IDE, as it gives a very fast feedback loop for code changes. -By default, any entry on the classpath that points to a folder is monitored for changes. -Note that certain resources, such as static assets and view templates, <>. - -.Triggering a restart -**** -As DevTools monitors classpath resources, the only way to trigger a restart is to update the classpath. -The way in which you cause the classpath to be updated depends on the IDE that you are using. -In Eclipse, saving a modified file causes the classpath to be updated and triggers a restart. -In IntelliJ IDEA, building the project (`Build +->+ Build Project`) has the same effect. -**** - -NOTE: As long as forking is enabled, you can also start your application by using the supported build plugins (Maven and Gradle), since DevTools needs an isolated application classloader to operate properly. -By default, the Gradle and Maven plugins fork the application process. - -TIP: Automatic restart works very well when used with LiveReload. -<> for details. -If you use JRebel, automatic restarts are disabled in favor of dynamic class reloading. -Other devtools features (such as LiveReload and property overrides) can still be used. - -NOTE: DevTools relies on the application context's shutdown hook to close it during a restart. -It does not work correctly if you have disabled the shutdown hook (`SpringApplication.setRegisterShutdownHook(false)`). - -NOTE: When deciding if an entry on the classpath should trigger a restart when it changes, DevTools automatically ignores projects named `spring-boot`, `spring-boot-devtools`, `spring-boot-autoconfigure`, `spring-boot-actuator`, and `spring-boot-starter`. - -NOTE: DevTools needs to customize the `ResourceLoader` used by the `ApplicationContext`. -If your application provides one already, it is going to be wrapped. -Direct override of the `getResource` method on the `ApplicationContext` is not supported. - -[[using-spring-boot-restart-vs-reload]] -.Restart vs Reload -**** -The restart technology provided by Spring Boot works by using two classloaders. -Classes that do not change (for example, those from third-party jars) are loaded into a _base_ classloader. -Classes that you are actively developing are loaded into a _restart_ classloader. -When the application is restarted, the _restart_ classloader is thrown away and a new one is created. -This approach means that application restarts are typically much faster than "`cold starts`", since the _base_ classloader is already available and populated. - -If you find that restarts are not quick enough for your applications or you encounter classloading issues, you could consider reloading technologies such as https://jrebel.com/software/jrebel/[JRebel] from ZeroTurnaround. -These work by rewriting classes as they are loaded to make them more amenable to reloading. -**** - - - -[[using-boot-devtools-restart-logging-condition-delta]] -==== Logging changes in condition evaluation -By default, each time your application restarts, a report showing the condition evaluation delta is logged. -The report shows the changes to your application's auto-configuration as you make changes such as adding or removing beans and setting configuration properties. - -To disable the logging of the report, set the following property: - -[indent=0] ----- - spring.devtools.restart.log-condition-evaluation-delta=false ----- - - -[[using-boot-devtools-restart-exclude]] -==== Excluding Resources -Certain resources do not necessarily need to trigger a restart when they are changed. -For example, Thymeleaf templates can be edited in-place. -By default, changing resources in `/META-INF/maven`, `/META-INF/resources`, `/resources`, `/static`, `/public`, or `/templates` does not trigger a restart but does trigger a <>. -If you want to customize these exclusions, you can use the configprop:spring.devtools.restart.exclude[] property. -For example, to exclude only `/static` and `/public` you would set the following property: - -[indent=0] ----- - spring.devtools.restart.exclude=static/**,public/** ----- - -TIP: If you want to keep those defaults and _add_ additional exclusions, use the configprop:spring.devtools.restart.additional-exclude[] property instead. - - - -[[using-boot-devtools-restart-additional-paths]] -==== Watching Additional Paths -You may want your application to be restarted or reloaded when you make changes to files that are not on the classpath. -To do so, use the configprop:spring.devtools.restart.additional-paths[] property to configure additional paths to watch for changes. -You can use the configprop:spring.devtools.restart.exclude[] property <> to control whether changes beneath the additional paths trigger a full restart or a <>. - - - -[[using-boot-devtools-restart-disable]] -==== Disabling Restart -If you do not want to use the restart feature, you can disable it by using the configprop:spring.devtools.restart.enabled[] property. -In most cases, you can set this property in your `application.properties` (doing so still initializes the restart classloader, but it does not watch for file changes). - -If you need to _completely_ disable restart support (for example, because it does not work with a specific library), you need to set the configprop:spring.devtools.restart.enabled[] `System` property to `false` before calling `SpringApplication.run(...)`, as shown in the following example: - -[source,java,indent=0] ----- - public static void main(String[] args) { - System.setProperty("spring.devtools.restart.enabled", "false"); - SpringApplication.run(MyApp.class, args); - } ----- - - - -[[using-boot-devtools-restart-triggerfile]] -==== Using a Trigger File -If you work with an IDE that continuously compiles changed files, you might prefer to trigger restarts only at specific times. -To do so, you can use a "`trigger file`", which is a special file that must be modified when you want to actually trigger a restart check. - -NOTE: Any update to the file will trigger a check, but restart only actually occurs if Devtools has detected it has something to do. - -To use a trigger file, set the configprop:spring.devtools.restart.trigger-file[] property to the name (excluding any path) of your trigger file. -The trigger file must appear somewhere on your classpath. - -For example, if you have a project with the following structure: - -[indent=0] ----- - src - +- main - +- resources - +- .reloadtrigger ----- - -Then your `trigger-file` property would be: - -[source,properties,indent=0,configprops] ----- - spring.devtools.restart.trigger-file=.reloadtrigger ----- - -Restarts will now only happen when the `src/main/resources/.reloadtrigger` is updated. - -TIP: You might want to set `spring.devtools.restart.trigger-file` as a <>, so that all your projects behave in the same way. - -Some IDEs have features that save you from needing to update your trigger file manually. -https://spring.io/tools[Spring Tools for Eclipse] and https://www.jetbrains.com/idea/[IntelliJ IDEA (Ultimate Edition)] both have such support. -With Spring Tools, you can use the "`reload`" button from the console view (as long as your `trigger-file` is named `.reloadtrigger`). -For IntelliJ, you can follow the https://www.jetbrains.com/help/idea/spring-boot.html#configure-application-update-policies-with-devtools[instructions in their documentation]. - - - -[[using-boot-devtools-customizing-classload]] -==== Customizing the Restart Classloader -As described earlier in the <> section, restart functionality is implemented by using two classloaders. -For most applications, this approach works well. -However, it can sometimes cause classloading issues. - -By default, any open project in your IDE is loaded with the "`restart`" classloader, and any regular `.jar` file is loaded with the "`base`" classloader. -If you work on a multi-module project, and not every module is imported into your IDE, you may need to customize things. -To do so, you can create a `META-INF/spring-devtools.properties` file. - -The `spring-devtools.properties` file can contain properties prefixed with `restart.exclude` and `restart.include`. -The `include` elements are items that should be pulled up into the "`restart`" classloader, and the `exclude` elements are items that should be pushed down into the "`base`" classloader. -The value of the property is a regex pattern that is applied to the classpath, as shown in the following example: - -[source,properties,indent=0] ----- - restart.exclude.companycommonlibs=/mycorp-common-[\\w\\d-\.]+\.jar - restart.include.projectcommon=/mycorp-myproj-[\\w\\d-\.]+\.jar ----- - -NOTE: All property keys must be unique. -As long as a property starts with `restart.include.` or `restart.exclude.` it is considered. - -TIP: All `META-INF/spring-devtools.properties` from the classpath are loaded. -You can package files inside your project, or in the libraries that the project consumes. - - - -[[using-boot-devtools-known-restart-limitations]] -==== Known Limitations -Restart functionality does not work well with objects that are deserialized by using a standard `ObjectInputStream`. -If you need to deserialize data, you may need to use Spring's `ConfigurableObjectInputStream` in combination with `Thread.currentThread().getContextClassLoader()`. - -Unfortunately, several third-party libraries deserialize without considering the context classloader. -If you find such a problem, you need to request a fix with the original authors. - - - -[[using-boot-devtools-livereload]] -=== LiveReload -The `spring-boot-devtools` module includes an embedded LiveReload server that can be used to trigger a browser refresh when a resource is changed. -LiveReload browser extensions are freely available for Chrome, Firefox and Safari from http://livereload.com/extensions/[livereload.com]. - -If you do not want to start the LiveReload server when your application runs, you can set the configprop:spring.devtools.livereload.enabled[] property to `false`. - -NOTE: You can only run one LiveReload server at a time. -Before starting your application, ensure that no other LiveReload servers are running. -If you start multiple applications from your IDE, only the first has LiveReload support. - - - -[[using-boot-devtools-globalsettings]] -=== Global Settings -You can configure global devtools settings by adding any of the following files to the `$HOME/.config/spring-boot` folder: - -. `spring-boot-devtools.properties` -. `spring-boot-devtools.yaml` -. `spring-boot-devtools.yml` - -Any properties added to these file apply to _all_ Spring Boot applications on your machine that use devtools. -For example, to configure restart to always use a <>, you would add the following property: - -.~/.config/spring-boot/spring-boot-devtools.properties -[source,properties,indent=0,configprops] ----- - spring.devtools.restart.trigger-file=.reloadtrigger ----- - -NOTE: If devtools configuration files are not found in `$HOME/.config/spring-boot`, the root of the `$HOME` folder is searched for the presence of a `.spring-boot-devtools.properties` file. -This allows you to share the devtools global configuration with applications that are on an older version of Spring Boot that does not support the `$HOME/.config/spring-boot` location. - -NOTE: Profiles activated in the above files will not affect the loading of <>. - - - -[[using-boot-devtools-remote]] -=== Remote Applications -The Spring Boot developer tools are not limited to local development. -You can also use several features when running applications remotely. -Remote support is opt-in as enabling it can be a security risk. -It should only be enabled when running on a trusted network or when secured with SSL. -If neither of these options is available to you, you should not use DevTools' remote support. -You should never enable support on a production deployment. - -To enable it, you need to make sure that `devtools` is included in the repackaged archive, as shown in the following listing: - -[source,xml,indent=0,subs="verbatim,quotes,attributes"] ----- - - - - org.springframework.boot - spring-boot-maven-plugin - - false - - - - ----- - -Then you need to set the configprop:spring.devtools.remote.secret[] property. -Like any important password or secret, the value should be unique and strong such that it cannot be guessed or brute-forced. - -Remote devtools support is provided in two parts: a server-side endpoint that accepts connections and a client application that you run in your IDE. -The server component is automatically enabled when the configprop:spring.devtools.remote.secret[] property is set. -The client component must be launched manually. - - - -==== Running the Remote Client Application -The remote client application is designed to be run from within your IDE. -You need to run `org.springframework.boot.devtools.RemoteSpringApplication` with the same classpath as the remote project that you connect to. -The application's single required argument is the remote URL to which it connects. - -For example, if you are using Eclipse or STS and you have a project named `my-app` that you have deployed to Cloud Foundry, you would do the following: - -* Select `Run Configurations...` from the `Run` menu. -* Create a new `Java Application` "`launch configuration`". -* Browse for the `my-app` project. -* Use `org.springframework.boot.devtools.RemoteSpringApplication` as the main class. -* Add `+++https://myapp.cfapps.io+++` to the `Program arguments` (or whatever your remote URL is). - -A running remote client might resemble the following listing: - -[indent=0,subs="attributes"] ----- - . ____ _ __ _ _ - /\\ / ___'_ __ _ _(_)_ __ __ _ ___ _ \ \ \ \ - ( ( )\___ | '_ | '_| | '_ \/ _` | | _ \___ _ __ ___| |_ ___ \ \ \ \ - \\/ ___)| |_)| | | | | || (_| []::::::[] / -_) ' \/ _ \ _/ -_) ) ) ) ) - ' |____| .__|_| |_|_| |_\__, | |_|_\___|_|_|_\___/\__\___|/ / / / - =========|_|==============|___/===================================/_/_/_/ - :: Spring Boot Remote :: {spring-boot-version} - - 2015-06-10 18:25:06.632 INFO 14938 --- [ main] o.s.b.devtools.RemoteSpringApplication : Starting RemoteSpringApplication on pwmbp with PID 14938 (/Users/pwebb/projects/spring-boot/code/spring-boot-project/spring-boot-devtools/target/classes started by pwebb in /Users/pwebb/projects/spring-boot/code) - 2015-06-10 18:25:06.671 INFO 14938 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2a17b7b6: startup date [Wed Jun 10 18:25:06 PDT 2015]; root of context hierarchy - 2015-06-10 18:25:07.043 WARN 14938 --- [ main] o.s.b.d.r.c.RemoteClientConfiguration : The connection to http://localhost:8080 is insecure. You should use a URL starting with 'https://'. - 2015-06-10 18:25:07.074 INFO 14938 --- [ main] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729 - 2015-06-10 18:25:07.130 INFO 14938 --- [ main] o.s.b.devtools.RemoteSpringApplication : Started RemoteSpringApplication in 0.74 seconds (JVM running for 1.105) ----- - -NOTE: Because the remote client is using the same classpath as the real application it can directly read application properties. -This is how the configprop:spring.devtools.remote.secret[] property is read and passed to the server for authentication. - -TIP: It is always advisable to use `https://` as the connection protocol, so that traffic is encrypted and passwords cannot be intercepted. - -TIP: If you need to use a proxy to access the remote application, configure the `spring.devtools.remote.proxy.host` and `spring.devtools.remote.proxy.port` properties. - - - -[[using-boot-devtools-remote-update]] -==== Remote Update -The remote client monitors your application classpath for changes in the same way as the <>. -Any updated resource is pushed to the remote application and (_if required_) triggers a restart. -This can be helpful if you iterate on a feature that uses a cloud service that you do not have locally. -Generally, remote updates and restarts are much quicker than a full rebuild and deploy cycle. - -NOTE: Files are only monitored when the remote client is running. -If you change a file before starting the remote client, it is not pushed to the remote server. - - - -[[configuring-file-system-watcher]] -==== Configuring File System Watcher -{spring-boot-devtools-module-code}/filewatch/FileSystemWatcher.java[FileSystemWatcher] works by polling the class changes with a certain time interval, and then waiting for a predefined quiet period to make sure there are no more changes. -The changes are then uploaded to the remote application. -On a slower development environment, it may happen that the quiet period is not enough, and the changes in the classes may be split into batches. -The server is restarted after the first batch of class changes is uploaded. -The next batch can’t be sent to the application, since the server is restarting. - -This is typically manifested by a warning in the `RemoteSpringApplication` logs about failing to upload some of the classes, and a consequent retry. -But it may also lead to application code inconsistency and failure to restart after the first batch of changes is uploaded. - -If you observe such problems constantly, try increasing the `spring.devtools.restart.poll-interval` and `spring.devtools.restart.quiet-period` parameters to the values that fit your development environment: - -[source,properties,indent=0,configprops] ----- - spring.devtools.restart.poll-interval=2s - spring.devtools.restart.quiet-period=1s ----- - -The monitored classpath folders are now polled every 2 seconds for changes, and a 1 second quiet period is maintained to make sure there are no additional class changes. - - - -[[using-boot-packaging-for-production]] -== Packaging Your Application for Production -Executable jars can be used for production deployment. -As they are self-contained, they are also ideally suited for cloud-based deployment. - -For additional "`production ready`" features, such as health, auditing, and metric REST or JMX end-points, consider adding `spring-boot-actuator`. -See _<>_ for details. - - - -[[using-boot-whats-next]] -== What to Read Next -You should now understand how you can use Spring Boot and some best practices that you should follow. -You can now go on to learn about specific _<>_ in depth, or you could skip ahead and read about the "`<>`" aspects of Spring Boot. 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 0000000000..a01df3f025 --- /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 b9076dc95a..0000000000 --- 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 0000000000..5ef68ecb10 --- /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 da34e62b70..0000000000 --- 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 6bffde0ba0..0000000000 --- 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 0000000000..aac1103f14 --- /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 11bfe14e5b..0000000000 --- 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 0000000000..96a273b712 --- /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 c381b6c5df..0000000000 --- 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 0000000000..83197a3b18 --- /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 d3d470ad70..0000000000 --- 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 0000000000..c5959cadb6 --- /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 bb697fb54f..0000000000 --- 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 0000000000..033a409c93 --- /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 e9d8dffddd..0000000000 --- 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 0000000000..36eeadbba9 --- /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 24d2499495..0000000000 --- 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 0000000000..14614a195d --- /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 45c6796929..0000000000 --- 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 0000000000..50400b1566 --- /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 012ad17567..0000000000 --- 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 0000000000..0f870c33e6 --- /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 8202656b75..0000000000 --- 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 0000000000..06219aed30 --- /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 12524d9c2d..0000000000 --- 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 0000000000..b2969f80c3 --- /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 6e159e0447..0000000000 --- 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 0000000000..b551d58880 --- /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 62f40f704a..0000000000 --- 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 0000000000..bc78b8ba50 --- /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 18e4b779b7..0000000000 --- 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 0000000000..010e9a905e --- /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 0e6e909c8c..0000000000 --- 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 0000000000..0b74593c60 --- /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 1a4c0ba8fc..0000000000 --- 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 0000000000..397e51d579 --- /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 fbdda52b11..0000000000 --- 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 0000000000..e32f7f97a3 --- /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 54162c3f1a..0000000000 --- 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 0000000000..b6b001fc84 --- /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 0c6824c04d..0000000000 --- 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 0000000000..b4fabd9c66 --- /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 5beaa0a271..0000000000 --- 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 0000000000..6c1219bd4d --- /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 adef6cad1b..0000000000 --- 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 0000000000..34dd4d4a10 --- /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 84b5b9e361..0000000000 --- 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 0000000000..6258a7bb8d --- /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 fb21cd4b30..0000000000 --- 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 0000000000..287a62e3b6 --- /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 87c474c8ad..0000000000 --- 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 0000000000..e6151b55d3 --- /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 f480476e44..0000000000 --- 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 0000000000..640b44e5f6 --- /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 0ab1b3459e..0000000000 --- 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 0000000000..ca4129e0f0 --- /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 d23fa1563a..0000000000 --- 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 0000000000..7141809230 --- /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 6918380b3f..0000000000 --- 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 0000000000..71132155c6 --- /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 5c1a997858..0000000000 --- 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 0000000000..dc8b36a02e --- /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 ee33ee1264..0000000000 --- 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 0000000000..c44bae2678 --- /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 f9bf5d3a86..0000000000 --- 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 0000000000..244f4391f7 --- /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 0d938f17dd..0000000000 --- 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 0000000000..3d2633702b --- /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 ba198fc5f1..0000000000 --- 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 0000000000..9dbb582216 --- /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 952efd70e1..0000000000 --- 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 0000000000..8196709090 --- /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 374205006a..0000000000 --- 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 0000000000..5490015749 --- /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 3f6bb33c49..0000000000 --- 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 0000000000..a38b29fd62 --- /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 80dc82f26f..0000000000 --- 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 0000000000..641440d7be --- /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 2378dfa551..0000000000 --- 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 0000000000..83a4f7c7ed --- /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 c71dcaa464..0000000000 --- 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 0000000000..d31b8573ae --- /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 63ecdd1d49..0000000000 --- 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 0000000000..39685e87b0 --- /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 0a4f791f0f..0000000000 --- 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 0000000000..00a9bf070f --- /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 23b32d80e7..0000000000 --- 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 0000000000..c00a3a0166 --- /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 7edae6ae0d..0000000000 --- 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 0000000000..b3c8171ac4 --- /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 fa72cb97dd..0000000000 --- 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 0000000000..abc5ee6b57 --- /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 b83a43efce..0000000000 --- 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 0000000000..598adca065 --- /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 7b3112de86..0000000000 --- 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 0000000000..8812987674 --- /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 03f9a83d7b..0000000000 --- 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 0000000000..eefd35fbf1 --- /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 303066ffb2..0000000000 --- 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 0000000000..5454e244cf --- /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 6793676484..0000000000 --- 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 0000000000..9c0f4b05b7 --- /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 83d5a29bdc..0000000000 --- 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 0000000000..c8f959aca5 --- /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 542f96b067..0000000000 --- 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 0000000000..5cf4d06251 --- /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 8e191dae28..0000000000 --- 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 0000000000..85adc9003d --- /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 94a0b6d4da..0000000000 --- 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 0000000000..dbfa136c50 --- /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 b159eec6cb..0000000000 --- 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 0000000000..5b78056e50 --- /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 6e6755ce7d..0000000000 --- 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 0000000000..5629d533d5 --- /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 a4029e6655..0000000000 --- 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 0000000000..e6e7364e86 --- /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 1af6f9b299..0000000000 --- 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 eba313f1ab..c858842375 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 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; 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 642c536f13..5b46d62339 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 @@ import static org.assertj.core.api.Assertions.assertThat; 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 e82fba702c..4a12980b10 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 @@ import static org.assertj.core.api.Assertions.assertThat; 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 0000000000..f8033155f1 --- /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 2e59fa5bde..0000000000 --- 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 754672d746..0000000000 --- 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 1dd0d293d6..0000000000 --- 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 0000000000..db29b70576 --- /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 d40a79a8ea..0000000000 --- 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 c6992bb33e..1ea131312e 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 0000000000..40eafac68b --- /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 6e9fd42e10..0000000000 --- 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 a2af1b413c..0000000000 --- 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/AsciidocBuilder.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/AsciidocBuilder.java deleted file mode 100644 index e4cab45468..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/AsciidocBuilder.java +++ /dev/null @@ -1,59 +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.configurationdocs; - -/** - * Simple builder to help construct Asciidoc markup. - * - * @author Phillip Webb - */ -class AsciidocBuilder { - - private final StringBuilder content; - - AsciidocBuilder() { - this.content = new StringBuilder(); - } - - AsciidocBuilder appendKey(Object... items) { - for (Object item : items) { - appendln("`+", item, "+` +"); - } - return this; - } - - AsciidocBuilder newLine() { - return append(System.lineSeparator()); - } - - AsciidocBuilder appendln(Object... items) { - return append(items).newLine(); - } - - AsciidocBuilder append(Object... items) { - for (Object item : items) { - this.content.append(item); - } - return this; - } - - @Override - public String toString() { - return this.content.toString(); - } - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.java deleted file mode 100644 index 603e902f5d..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntry.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.configurationdocs; - -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. - * - * @author Brian Clozel - */ -class CompoundConfigurationTableEntry extends ConfigurationTableEntry { - - private Set configurationKeys; - - private String description; - - CompoundConfigurationTableEntry(String key, String description) { - this.key = key; - this.description = description; - this.configurationKeys = new TreeSet<>(); - } - - void addConfigurationKeys(ConfigurationMetadataProperty... properties) { - Stream.of(properties).map(ConfigurationMetadataProperty::getId).forEach(this.configurationKeys::add); - } - - @Override - void write(AsciidocBuilder builder) { - builder.append("|"); - this.configurationKeys.forEach(builder::appendKey); - builder.newLine().appendln("|").appendln("|+++", this.description, "+++"); - } - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationMetadataDocumentWriter.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationMetadataDocumentWriter.java deleted file mode 100644 index 0269c91cf4..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationMetadataDocumentWriter.java +++ /dev/null @@ -1,142 +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.configurationdocs; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty; -import org.springframework.boot.configurationmetadata.ConfigurationMetadataRepositoryJsonBuilder; - -/** - * Write Asciidoc documents with configuration properties listings. - * - * @author Brian Clozel - * @since 2.0.0 - */ -public class ConfigurationMetadataDocumentWriter { - - public void writeDocument(Path outputDirectory, DocumentOptions options, InputStream... metadata) - throws IOException { - assertValidOutputDirectory(outputDirectory); - if (!Files.exists(outputDirectory)) { - Files.createDirectory(outputDirectory); - } - assertMetadata(metadata); - List tables = createConfigTables(getMetadataProperties(metadata), options); - for (ConfigurationTable table : tables) { - writeConfigurationTable(table, outputDirectory); - } - } - - private void assertValidOutputDirectory(Path outputDirPath) { - if (outputDirPath == null) { - throw new IllegalArgumentException("output path should not be null"); - } - if (Files.exists(outputDirPath) && !Files.isDirectory(outputDirPath)) { - throw new IllegalArgumentException("output path already exists and is not a directory"); - } - } - - 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, - DocumentOptions options) { - List tables = new ArrayList<>(); - List unmappedKeys = metadataProperties.values().stream().filter((property) -> !property.isDeprecated()) - .map(ConfigurationMetadataProperty::getId).collect(Collectors.toList()); - Map overrides = getOverrides(metadataProperties, unmappedKeys, - options); - options.getMetadataSections().forEach((id, keyPrefixes) -> tables - .add(createConfigTable(metadataProperties, unmappedKeys, overrides, id, keyPrefixes))); - if (!unmappedKeys.isEmpty()) { - throw new IllegalStateException( - "The following keys were not written to the documentation: " + String.join(", ", unmappedKeys)); - } - if (!overrides.isEmpty()) { - throw new IllegalStateException("The following keys were not written to the documentation: " - + String.join(", ", overrides.keySet())); - } - return tables; - } - - private Map getOverrides( - Map metadataProperties, List unmappedKeys, - DocumentOptions options) { - Map overrides = new HashMap<>(); - options.getOverrides().forEach((keyPrefix, description) -> { - CompoundConfigurationTableEntry entry = new CompoundConfigurationTableEntry(keyPrefix, description); - List matchingKeys = unmappedKeys.stream().filter((key) -> key.startsWith(keyPrefix)) - .collect(Collectors.toList()); - for (String matchingKey : matchingKeys) { - entry.addConfigurationKeys(metadataProperties.get(matchingKey)); - } - overrides.put(keyPrefix, entry); - unmappedKeys.removeAll(matchingKeys); - }); - return overrides; - } - - private ConfigurationTable createConfigTable(Map metadataProperties, - List unmappedKeys, Map overrides, String id, - List keyPrefixes) { - ConfigurationTable table = new ConfigurationTable(id); - for (String keyPrefix : keyPrefixes) { - List matchingOverrides = overrides.keySet().stream() - .filter((overrideKey) -> overrideKey.startsWith(keyPrefix)).collect(Collectors.toList()); - matchingOverrides.forEach((match) -> table.addEntry(overrides.remove(match))); - } - List matchingKeys = unmappedKeys.stream() - .filter((key) -> keyPrefixes.stream().anyMatch(key::startsWith)).collect(Collectors.toList()); - for (String matchingKey : matchingKeys) { - ConfigurationMetadataProperty property = metadataProperties.get(matchingKey); - table.addEntry(new SingleConfigurationTableEntry(property)); - } - unmappedKeys.removeAll(matchingKeys); - return table; - } - - private void writeConfigurationTable(ConfigurationTable table, Path outputDirectory) throws IOException { - Path outputFilePath = outputDirectory.resolve(table.getId() + ".adoc"); - Files.deleteIfExists(outputFilePath); - Files.createFile(outputFilePath); - try (OutputStream outputStream = Files.newOutputStream(outputFilePath)) { - outputStream.write(table.toAsciidocTable().getBytes(StandardCharsets.UTF_8)); - } - } - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationTable.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationTable.java deleted file mode 100644 index 83a36d9bb1..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationTable.java +++ /dev/null @@ -1,60 +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.configurationdocs; - -import java.util.Arrays; -import java.util.Set; -import java.util.TreeSet; - -/** - * Asciidoctor table listing configuration properties sharing to a common theme. - * - * @author Brian Clozel - */ -class ConfigurationTable { - - private final String id; - - private final Set entries; - - ConfigurationTable(String id) { - this.id = id; - this.entries = new TreeSet<>(); - } - - String getId() { - return this.id; - } - - void addEntry(ConfigurationTableEntry... entries) { - this.entries.addAll(Arrays.asList(entries)); - } - - String toAsciidocTable() { - AsciidocBuilder builder = new AsciidocBuilder(); - builder.appendln("[cols=\"1,1,2\", options=\"header\"]"); - builder.appendln("|==="); - builder.appendln("|Key|Default Value|Description"); - builder.appendln(); - this.entries.forEach((entry) -> { - entry.write(builder); - builder.appendln(); - }); - return builder.appendln("|===").toString(); - } - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationTableEntry.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationTableEntry.java deleted file mode 100644 index 8c81a96017..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/ConfigurationTableEntry.java +++ /dev/null @@ -1,56 +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.configurationdocs; - -/** - * Abstract class for entries in {@link ConfigurationTable}. - * - * @author Brian Clozel - */ -abstract class ConfigurationTableEntry implements Comparable { - - protected String key; - - String getKey() { - return this.key; - } - - abstract void write(AsciidocBuilder builder); - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null || getClass() != obj.getClass()) { - return false; - } - ConfigurationTableEntry other = (ConfigurationTableEntry) obj; - return this.key.equals(other.key); - } - - @Override - public int hashCode() { - return this.key.hashCode(); - } - - @Override - public int compareTo(ConfigurationTableEntry other) { - return this.key.compareTo(other.getKey()); - } - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/DocumentOptions.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/DocumentOptions.java deleted file mode 100644 index 6e96e8d94b..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/DocumentOptions.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 org.springframework.boot.configurationdocs; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Options for generating documentation for configuration properties. - * - * @author Brian Clozel - * @since 2.0.0 - */ -public final class DocumentOptions { - - private final Map> metadataSections; - - private final Map overrides; - - private DocumentOptions(Map> metadataSections, Map overrides) { - this.metadataSections = metadataSections; - this.overrides = overrides; - } - - Map> getMetadataSections() { - return this.metadataSections; - } - - Map getOverrides() { - return this.overrides; - } - - static Builder builder() { - return new Builder(); - } - - /** - * Builder for DocumentOptions. - */ - public static class Builder { - - Map> metadataSections = new HashMap<>(); - - Map overrides = new HashMap<>(); - - SectionSpec addSection(String name) { - return new SectionSpec(this, name); - } - - Builder addOverride(String keyPrefix, String description) { - this.overrides.put(keyPrefix, description); - return this; - } - - DocumentOptions build() { - return new DocumentOptions(this.metadataSections, this.overrides); - } - - } - - /** - * Configuration for a documentation section listing properties for a specific theme. - */ - public static class SectionSpec { - - private final String name; - - private final Builder builder; - - SectionSpec(Builder builder, String name) { - this.builder = builder; - this.name = name; - } - - Builder withKeyPrefixes(String... keyPrefixes) { - this.builder.metadataSections.put(this.name, Arrays.asList(keyPrefixes)); - return this.builder; - } - - } - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntry.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntry.java deleted file mode 100644 index 17ac8bc32a..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/main/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntry.java +++ /dev/null @@ -1,84 +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.configurationdocs; - -import java.util.Arrays; -import java.util.stream.Collectors; - -import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty; - -/** - * Table entry containing a single configuration property. - * - * @author Brian Clozel - */ -class SingleConfigurationTableEntry extends ConfigurationTableEntry { - - private final String description; - - private final String defaultValue; - - SingleConfigurationTableEntry(ConfigurationMetadataProperty property) { - this.key = property.getId(); - if (property.getType() != null && property.getType().startsWith("java.util.Map")) { - this.key += ".*"; - } - this.description = property.getDescription(); - this.defaultValue = getDefaultValue(property.getDefaultValue()); - } - - private String getDefaultValue(Object defaultValue) { - if (defaultValue == null) { - return null; - } - if (defaultValue.getClass().isArray()) { - return Arrays.stream((Object[]) defaultValue).map(Object::toString) - .collect(Collectors.joining("," + System.lineSeparator())); - } - return defaultValue.toString(); - } - - @Override - void write(AsciidocBuilder builder) { - builder.appendln("|`+", this.key, "+`"); - writeDefaultValue(builder); - writeDescription(builder); - builder.appendln(); - } - - private void writeDefaultValue(AsciidocBuilder builder) { - String defaultValue = (this.defaultValue != null) ? this.defaultValue : ""; - if (defaultValue.isEmpty()) { - builder.appendln("|"); - } - else { - defaultValue = defaultValue.replace("\\", "\\\\").replace("|", "\\|"); - builder.appendln("|`+", defaultValue, "+`"); - } - } - - private void writeDescription(AsciidocBuilder builder) { - if (this.description == null || this.description.isEmpty()) { - builder.append("|"); - } - else { - String cleanedDescription = this.description.replace("|", "\\|"); - builder.append("|+++", cleanedDescription, "+++"); - } - } - -} 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 1c9c21ac81..0000000000 --- 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-docs/src/test/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntryTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntryTests.java deleted file mode 100644 index 0e06b59509..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/CompoundConfigurationTableEntryTests.java +++ /dev/null @@ -1,55 +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.configurationdocs; - -import org.junit.jupiter.api.Test; - -import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests for {@link CompoundConfigurationTableEntry}. - * - * @author Brian Clozel - */ -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"); - CompoundConfigurationTableEntry entry = new CompoundConfigurationTableEntry("spring.test", - "This is a description."); - entry.addConfigurationKeys(firstProp, secondProp, thirdProp); - AsciidocBuilder builder = new AsciidocBuilder(); - entry.write(builder); - assertThat(builder.toString()).isEqualTo( - "|`+spring.test.first+` +" + NEWLINE + "`+spring.test.second+` +" + NEWLINE + "`+spring.test.third+` +" - + NEWLINE + NEWLINE + "|" + NEWLINE + "|+++This is a description.+++" + NEWLINE); - } - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/ConfigurationTableTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/ConfigurationTableTests.java deleted file mode 100644 index 2b15a47675..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/ConfigurationTableTests.java +++ /dev/null @@ -1,56 +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.configurationdocs; - -import org.junit.jupiter.api.Test; - -import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests for {@link ConfigurationTable}. - * - * @author Brian Clozel - */ -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"); - table.addEntry(new SingleConfigurationTableEntry(first)); - table.addEntry(new SingleConfigurationTableEntry(second)); - assertThat(table.toAsciidocTable()).isEqualTo("[cols=\"1,1,2\", options=\"header\"]" + NEWLINE + "|===" - + NEWLINE + "|Key|Default Value|Description" + NEWLINE + NEWLINE + "|`+spring.test.other+`" + NEWLINE - + "|`+other value+`" + NEWLINE + "|+++This is another description.+++" + NEWLINE + NEWLINE - + "|`+spring.test.prop+`" + NEWLINE + "|`+something+`" + NEWLINE + "|+++This is a description.+++" - + NEWLINE + NEWLINE + "|===" + NEWLINE); - } - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntryTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntryTests.java deleted file mode 100644 index 013320c729..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-docs/src/test/java/org/springframework/boot/configurationdocs/SingleConfigurationTableEntryTests.java +++ /dev/null @@ -1,130 +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.configurationdocs; - -import org.junit.jupiter.api.Test; - -import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests for {@link SingleConfigurationTableEntry}. - * - * @author Brian Clozel - */ -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"); - SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); - AsciidocBuilder builder = new AsciidocBuilder(); - entry.write(builder); - assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+something+`" + NEWLINE - + "|+++This is a description.+++" + NEWLINE); - } - - @Test - void noDefaultValue() { - ConfigurationMetadataProperty property = new ConfigurationMetadataProperty(); - property.setId("spring.test.prop"); - property.setDescription("This is a description."); - property.setType("java.lang.String"); - SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); - AsciidocBuilder builder = new AsciidocBuilder(); - entry.write(builder); - assertThat(builder.toString()).isEqualTo( - "|`+spring.test.prop+`" + NEWLINE + "|" + NEWLINE + "|+++This is a description.+++" + NEWLINE); - } - - @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"); - SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); - AsciidocBuilder builder = new AsciidocBuilder(); - entry.write(builder); - assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+first\\|second+`" + NEWLINE - + "|+++This is a description.+++" + NEWLINE); - } - - @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"); - SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); - AsciidocBuilder builder = new AsciidocBuilder(); - entry.write(builder); - assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+first\\\\second+`" + NEWLINE - + "|+++This is a description.+++" + NEWLINE); - } - - @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"); - SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); - AsciidocBuilder builder = new AsciidocBuilder(); - entry.write(builder); - assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|" + NEWLINE - + "|+++This is a description with a \\| pipe.+++" + NEWLINE); - } - - @Test - void mapProperty() { - ConfigurationMetadataProperty property = new ConfigurationMetadataProperty(); - property.setId("spring.test.prop"); - property.setDescription("This is a description."); - property.setType("java.util.Map"); - SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); - AsciidocBuilder builder = new AsciidocBuilder(); - entry.write(builder); - assertThat(builder.toString()).isEqualTo( - "|`+spring.test.prop.*+`" + NEWLINE + "|" + NEWLINE + "|+++This is a description.+++" + NEWLINE); - } - - @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); - SingleConfigurationTableEntry entry = new SingleConfigurationTableEntry(property); - AsciidocBuilder builder = new AsciidocBuilder(); - entry.write(builder); - assertThat(builder.toString()).isEqualTo("|`+spring.test.prop+`" + NEWLINE + "|`+first," + NEWLINE + "second," - + NEWLINE + "third+`" + NEWLINE + "|+++This is a description.+++" + NEWLINE); - } - -} 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 0000000000..6e651c7df6 --- /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 68862f4c88..0000000000 --- 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 0000000000..c358dab711 --- /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 09c2e75112..0000000000 --- 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 f8876a599d..f207c3912d 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 @@ class JSON { 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 06d3a2c4b7..ebd63c4be0 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 class JSONArray { /** * Appends {@code value} to the end of this array. - * * @param value the value * @return this array. */ @@ -138,7 +137,6 @@ public class JSONArray { /** * 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 class JSONArray { /** * 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 class JSONArray { 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 class JSONArray { * 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 class JSONArray { * 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 e2377bec6d..b7a34606bb 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 @@ import java.util.Map; *
  • 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 class 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 @@ public class JSONObject { /** * 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 class JSONObject { /** * 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 class JSONObject { * @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 @@ public class JSONObject { 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 df2c8d7ec4..c3d73a970a 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 @@ public class JSONStringer { * @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 6bc692e71e..2a47e73e94 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 @@ public class JSONTokener { 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 85454c1f9d..b5ca902545 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 6b1823d86a..0000000000 --- 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 1353677005..0000000000 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/gradle/wrapper/gradle-wrapper.properties b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 290541c738..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradlew b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradlew deleted file mode 100755 index cccdd3d517..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradlew +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env sh - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -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="" - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -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 - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((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" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -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/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradlew.bat deleted file mode 100644 index f9553162f1..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/gradlew.bat +++ /dev/null @@ -1,84 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -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= - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega 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 94a48efafa..0000000000 --- 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/docs/asciidoc/index.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/index.adoc new file mode 100644 index 0000000000..efe4d2e371 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/index.adoc @@ -0,0 +1,51 @@ += Spring Boot Gradle Plugin Reference Guide +Andy Wilkinson +:doctype: book +:toc: left +:toclevels: 4 +:source-highlighter: prettify +:numbered: +:icons: font +:hide-uri-scheme: +:docinfo: shared,private + +:dependency-management-plugin: https://github.com/spring-gradle-plugins/dependency-management-plugin +:dependency-management-plugin-documentation: {dependency-management-plugin}/blob/master/README.md +:gradle-userguide: https://docs.gradle.org/current/userguide +:gradle-dsl: https://docs.gradle.org/current/dsl +:gradle-api: https://docs.gradle.org/current/javadoc +:application-plugin: {gradle-userguide}/application_plugin.html +:groovy-plugin: {gradle-userguide}/groovy_plugin.html +:java-plugin: {gradle-userguide}/java_plugin.html +:war-plugin: {gradle-userguide}/war_plugin.html +:maven-plugin: {gradle-userguide}/maven_plugin.html +: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/{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 +:boot-jar-javadoc: {api-documentation}/org/springframework/boot/gradle/tasks/bundling/BootJar.html +:boot-war-javadoc: {api-documentation}/org/springframework/boot/gradle/tasks/bundling/BootWar.html +:boot-run-javadoc: {api-documentation}/org/springframework/boot/gradle/tasks/run/BootRun.html +:github-code: https://github.com/spring-projects/spring-boot/tree/{github-tag} + + + +[[introduction]] +== Introduction + +The Spring Boot Gradle Plugin provides Spring Boot support in https://gradle.org[Gradle]. +It allows you to package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by `spring-boot-dependencies`. +Spring Boot's Gradle plugin requires Gradle 5.x or 6.x (4.10 is also supported but this support is deprecated and will be removed in a future release). + +In addition to this user guide, {api-documentation}[API documentation] is also available. + +include::getting-started.adoc[] +include::managing-dependencies.adoc[] +include::packaging.adoc[] +include::publishing.adoc[] +include::running.adoc[] +include::integrating-with-actuator.adoc[] +include::reacting.adoc[] 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/asciidoc/index.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/index.adoc deleted file mode 100644 index c13bb7fdc0..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/asciidoc/index.adoc +++ /dev/null @@ -1,51 +0,0 @@ -= Spring Boot Gradle Plugin Reference Guide -Andy Wilkinson -:doctype: book -:toc: left -:toclevels: 4 -:source-highlighter: prettify -:numbered: -:icons: font -:hide-uri-scheme: -:docinfo: shared,private - -:dependency-management-plugin: https://github.com/spring-gradle-plugins/dependency-management-plugin -:dependency-management-plugin-documentation: {dependency-management-plugin}/blob/master/README.md -:gradle-userguide: https://docs.gradle.org/current/userguide -:gradle-dsl: https://docs.gradle.org/current/dsl -:gradle-api: https://docs.gradle.org/current/javadoc -:application-plugin: {gradle-userguide}/application_plugin.html -:groovy-plugin: {gradle-userguide}/groovy_plugin.html -:java-plugin: {gradle-userguide}/java_plugin.html -:war-plugin: {gradle-userguide}/war_plugin.html -:maven-plugin: {gradle-userguide}/maven_plugin.html -: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} -: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 -:boot-jar-javadoc: {api-documentation}/org/springframework/boot/gradle/tasks/bundling/BootJar.html -:boot-war-javadoc: {api-documentation}/org/springframework/boot/gradle/tasks/bundling/BootWar.html -:boot-run-javadoc: {api-documentation}/org/springframework/boot/gradle/tasks/run/BootRun.html -:github-code: https://github.com/spring-projects/spring-boot/tree/{github-tag} - - - -[[introduction]] -== Introduction - -The Spring Boot Gradle Plugin provides Spring Boot support in https://gradle.org[Gradle]. -It allows you to package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by `spring-boot-dependencies`. -Spring Boot's Gradle plugin requires Gradle 5.x or 6.x (4.10 is also supported but this support is deprecated and will be removed in a future release). - -In addition to this user guide, {api-documentation}[API documentation] is also available. - -include::getting-started.adoc[] -include::managing-dependencies.adoc[] -include::packaging.adoc[] -include::publishing.adoc[] -include::running.adoc[] -include::integrating-with-actuator.adoc[] -include::reacting.adoc[] 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 730938f5c3..0000000000 --- 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 1d52c421af..2176bc64f3 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 02579592db..a11e84eb07 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 @@ class IntegratingWithActuatorDocumentationTests { @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 91d43545c5..1b75a2ac62 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 @@ class ManagingDependenciesDocumentationTests { 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 badd512745..5f06a97597 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 @@ class PackagingDocumentationTests { @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 @@ class PackagingDocumentationTests { @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 @@ class PackagingDocumentationTests { @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 @@ class PackagingDocumentationTests { @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 @@ class PackagingDocumentationTests { @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 @@ class PackagingDocumentationTests { @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 @@ class PackagingDocumentationTests { @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 @@ class PackagingDocumentationTests { 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 @@ class PackagingDocumentationTests { @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 @@ class PackagingDocumentationTests { @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 0e3fd00c29..f1d4bb2014 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 cad05fca05..cf666000e7 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.File; 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 3ad999ec12..8d84f1dc6f 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 @@ import org.springframework.boot.gradle.testkit.GradleBuildExtension; */ 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 9b2ecd048c..0735d55ded 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 @@ abstract class AbstractBootArchiveTests { 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 5fae9e8d13..141c992dca 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 @@ class BootJarTests extends AbstractBootArchiveTests { 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 @@ class BootJarTests extends AbstractBootArchiveTests { 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 107a827283..e29ca6a0a3 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 @@ class BootWarTests extends AbstractBootArchiveTests { 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 @@ class BootWarTests extends AbstractBootArchiveTests { 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 @@ class BootWarTests extends AbstractBootArchiveTests { 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 @@ class BootWarTests extends AbstractBootArchiveTests { 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 @@ class BootWarTests extends AbstractBootArchiveTests { 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 @@ class BootWarTests extends AbstractBootArchiveTests { 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 @@ class BootWarTests extends AbstractBootArchiveTests { 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 bbff7099e9..895cde6b3d 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 @@ class LaunchScriptConfigurationTests { @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 @@ class LaunchScriptConfigurationTests { @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 @@ class LaunchScriptConfigurationTests { @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 @@ class LaunchScriptConfigurationTests { "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 b4cccc4276..0b56478f6b 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 @@ package org.springframework.boot.gradle.tasks.run; 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 @@ class BootRunIntegrationTests { 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 @@ class BootRunIntegrationTests { 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 0000000000..161f106bb2 --- /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 889fc90bfe..0000000000 --- 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 0000000000..b80575d23b --- /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 09f459c6ef..0000000000 --- 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 42acafa985..0000000000 --- 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 62ccd436bd..0000000000 --- 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 86afc3a61e..0000000000 --- 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/ExampleController.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/src/main/java/org/springframework/launcher/it/jar/ExampleController.java deleted file mode 100644 index 41df3759ee..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-dir/src/main/java/org/springframework/launcher/it/jar/ExampleController.java +++ /dev/null @@ -1,37 +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.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -/** - * Simple example Spring MVC Controller. - * - * @author Phillip Webb - */ -@Controller -public class ExampleController { - - @RequestMapping("/") - @ResponseBody - public String helloWorld() { - return "Hello Embedded Jar World!"; - } - -} 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 c7c0d0bf20..0000000000 --- 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 7111e1f217..0000000000 --- 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 1f7cf8ec13..0000000000 --- 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 86afc3a61e..0000000000 --- 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/ExampleController.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/src/main/java/org/springframework/launcher/it/jar/ExampleController.java deleted file mode 100644 index 41df3759ee..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-jar/src/main/java/org/springframework/launcher/it/jar/ExampleController.java +++ /dev/null @@ -1,37 +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.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -/** - * Simple example Spring MVC Controller. - * - * @author Phillip Webb - */ -@Controller -public class ExampleController { - - @RequestMapping("/") - @ResponseBody - public String helloWorld() { - return "Hello Embedded Jar World!"; - } - -} 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 c7c0d0bf20..0000000000 --- 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 48a576ba04..0000000000 --- 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 c466d86f44..0000000000 --- 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 83a4f927e2..0000000000 --- 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 306b55e4e9..0000000000 --- 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 23a4a38fd0..0000000000 --- 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 9bdd06d447..0000000000 --- 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 c11051e347..0000000000 --- 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 b855fbe7c7..0000000000 --- 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 3e2a75482c..0000000000 --- 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 2dbf0f3a50..0000000000 --- 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 1837293b52..0000000000 --- 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 eb5bc598b1..0000000000 --- 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 c11051e347..0000000000 --- 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 0a0c034267..0000000000 --- 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 af6d71231e..0000000000 --- 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/ExampleController.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/ExampleController.java deleted file mode 100644 index 6c0cbe3ca0..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/executable-war/src/main/java/org/springframework/launcher/it/war/ExampleController.java +++ /dev/null @@ -1,37 +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.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -/** - * Simple example Spring MVC Controller. - * - * @author Phillip Webb - */ -@Controller -public class ExampleController { - - @RequestMapping("/") - @ResponseBody - public String helloWorld() { - return "Hello Embedded WAR World!"; - } - -} 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 1bc22a2efd..0000000000 --- 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 ee0cf7f882..0000000000 --- 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 4aac0a7dc6..0000000000 --- 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 0d544e3076..0000000000 --- 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/it/settings.xml b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/it/settings.xml deleted file mode 100644 index e1e0ace341..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/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-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 71fce71184..1777912765 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 @@ class PropertiesLauncherTests { 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 0000000000..aa76c5c447 --- /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 10d5f0dc7b..0000000000 --- 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/docs/asciidoc/build-info.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/build-info.adoc new file mode 100644 index 0000000000..f51b71b6a0 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/build-info.adoc @@ -0,0 +1,41 @@ +[[build-info]] +== Integrating with Actuator +Spring Boot Actuator displays build-related information if a `META-INF/build-info.properties` file is present. +The `build-info` goal generates such file with the coordinates of the project and the build time. +It also allows you to add an arbitrary number of additional properties, as shown in the following example: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + + + build-info + + + + UTF-8 + UTF-8 + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + + + +---- + +This configuration will generate a `build-info.properties` at the expected location with four additional keys. +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::goals/build-info.adoc[leveloffset=+1] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/getting-started.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/getting-started.adoc new file mode 100644 index 0000000000..e3121cbeac --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/getting-started.adoc @@ -0,0 +1,7 @@ +[[getting-started]] +== Getting started + +The Spring Boot Plugin has the following goals: + +include::goals/overview.adoc[] + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/help.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/help.adoc new file mode 100644 index 0000000000..79eb182a23 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/help.adoc @@ -0,0 +1,5 @@ +[[help]] +== Help information +The `help` goal is a standard goal that displays information on the capabilities of the plugin. + +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/docs/asciidoc/integration-tests.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/integration-tests.adoc new file mode 100644 index 0000000000..1915596155 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/integration-tests.adoc @@ -0,0 +1,179 @@ +[[integration-tests]] +== Running Integration tests + +While you may start your Spring Boot application very easily from your test (or test suite) itself, it may be desirable to handle that in the build itself. +To make sure that the lifecycle of your Spring Boot application is properly managed around your integration tests, you can use the `start` and `stop` goals, as shown in the following example: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + + pre-integration-test + + start + + + + post-integration-test + + stop + + + + + + +---- + +Such setup can now use the https://maven.apache.org/surefire/maven-failsafe-plugin[failsafe-plugin] to run your integration tests as you would expect. + +You could also configure a more advanced setup to skip the integration tests when a specific property has been set, see <>. + +include::goals/start.adoc[leveloffset=+1] + +include::goals/stop.adoc[leveloffset=+1] + + +[[integration-tests-example]] +=== Examples + + + +[[integration-tests-example-random-port]] +==== Random Port for Integration Tests +One nice feature of the Spring Boot test integration is that it can allocate a free port for the web application. +When the `start` goal of the plugin is used, the Spring Boot application is started separately, making it difficult to pass the actual port to the integration test itself. + +The example below showcases how you could achieve the same feature using the https://www.mojohaus.org/build-helper-maven-plugin[Build Helper Maven Plugin]: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + + org.codehaus.mojo + build-helper-maven-plugin + {build-helper-maven-plugin-version} + + + reserve-tomcat-port + + reserve-network-port + + process-resources + + + tomcat.http.port + + + + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + + pre-integration-test + + start + + + + --server.port=${tomcat.http.port} + + + + + post-integration-test + + stop + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + {maven-failsafe-plugin-version} + + + ${tomcat.http.port} + + + + + + +---- + +You can now retrieve the `test.server.port` system property in any of your integration test to create a proper `URL` to the server. + + + +[[integration-tests-example-skip]] +==== Skip Integration Tests +The `skip` property allows to skip the execution of the Spring Boot maven plugin altogether. + +This example shows how you can skip integration tests with a command-line property and still make sure that the `repackage` goal runs: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + false + + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + + pre-integration-test + + start + + + ${skip.it} + + + + post-integration-test + + stop + + + ${skip.it} + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + {maven-failsafe-plugin-version} + + ${skip.it} + + + + + +---- + +By default, the integration tests will run but this setup allows you to easily disable them on the command-line as follows: + +[indent=0] +---- + $ mvn verify -Dskip.it=true +---- diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging.adoc new file mode 100644 index 0000000000..9a9aa22dee --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/packaging.adoc @@ -0,0 +1,395 @@ +[[repackage]] +== Packaging executable archives + +The plugin can create executable archives (jar files and war files) that contain all of an application's dependencies and can then be run with `java -jar`. + +Packaging an executable archive is performed by the `repackage` goal, as shown in the following example: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + + + repackage + + + + + + +---- + +TIP: If you are using `spring-boot-starter-parent`, such execution is already pre-configured with a `repackage` execution id so that only the plugin definition should be added. + +The example above repackages a jar or war that is built during the package phase of the Maven lifecycle, including any `provided` dependencies that are defined in the project. +If some of these dependencies need to be excluded, you can use one of the exclude options, see the <> for more details. + +NOTE: The `outputFileNameMapping` feature of the `maven-war-plugin` is currently not supported. + +Devtools is automatically excluded by default (you can control that using the `excludeDevtools` property). +In order to make that work with `war` packaging, the `spring-boot-devtools` dependency must be set as `optional` or with the `provided` scope. + +The original (i.e. non executable) artifact is renamed to `.original` by default but it is also possible to keep the original artifact using a custom classifier. + +The plugin rewrites your manifest, and in particular it manages the "Main-Class" and "Start-Class" entries, so if the defaults don't work you have to configure those there (not in the jar plugin). +The "Main-Class" in the manifest is actually controlled by the "layout" property of the Spring Boot plugin, as shown in the following example: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + ${start.class} + ZIP + + + + + repackage + + + + + + +---- + +The `layout` property defaults to a guess based on the archive type (`jar` or `war`). The following layouts are available: + +* `JAR`: regular executable JAR layout. +* `WAR`: executable WAR layout. `provided` dependencies are placed in `WEB-INF/lib-provided` to avoid any clash when the `war` is deployed in a servlet container. +* `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::goals/repackage.adoc[leveloffset=+1] + +[[repackage-examples]] +=== Examples + +[[repackage-example-custom-classifier]] +==== Custom Classifier +By default, the `repackage` goal replaces the original artifact with the repackaged one. +That is a sane behavior for modules that represent an application but if your module is used as a dependency of another module, you need to provide a classifier for the repackaged one. +The reason for that is that application classes are packaged in `BOOT-INF/classes` so that the dependent module cannot load a repackaged jar's classes. + +If that is the case or if you prefer to keep the original artifact and attach the repackaged one with a different classifier, configure the plugin as shown in the following example: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + + repackage + + repackage + + + exec + + + + + + + +---- + +If you are using `spring-boot-starter-parent`, the `repackage` goal is executed automatically in an execution with id `repackage`. +In that setup, only the configuration should be specified, as shown in the following example: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + + org.springframework.boot + spring-boot-maven-plugin + + + repackage + + exec + + + + + + + +---- + +This configuration will generate two artifacts: the original one and the repackaged counter part produced by the repackage goal. +Both will be installed/deployed transparently. + +You can also use the same configuration if you want to repackage a secondary artifact the same way the main artifact is replaced. +The following configuration installs/deploys a single `task` classified artifact with the repackaged application: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + + org.apache.maven.plugins + maven-jar-plugin + {maven-jar-plugin-version} + + + + jar + + package + + task + + + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + + repackage + + repackage + + + task + + + + + + + +---- + +As both the `maven-jar-plugin` and the `spring-boot-maven-plugin` runs at the same phase, it is important that the jar plugin is defined first (so that it runs before the repackage goal). +Again, if you are using `spring-boot-starter-parent`, this can be simplified as follows: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + + org.apache.maven.plugins + maven-jar-plugin + + + default-jar + + task + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + repackage + + task + + + + + + + +---- + + + +[[repackage-example-custom-name]] +==== Custom Name +If you need the repackaged jar to have a different local name than the one defined by the `artifactId` attribute of the project, simply use the standard `finalName`, as shown in the following example: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + my-app + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + + repackage + + repackage + + + + + + + +---- + +This configuration will generate the repackaged artifact in `target/my-app.jar`. + + + +[[repackage-example-local-artifact]] +==== Local Repackaged Artifact +By default, the `repackage` goal replaces the original artifact with the executable one. +If you need to only deploy the original jar and yet be able to run your app with the regular file name, configure the plugin as follows: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + + repackage + + repackage + + + false + + + + + + + +---- + +This configuration generates two artifacts: the original one and the executable counter part produced by the `repackage` goal. +Only the original one will be installed/deployed. + + + +[[repackage-example-custom-layout]] +==== Custom Layout +Spring Boot repackages the jar file for this project using a custom layout factory defined in the additional jar file, provided as a dependency to the build plugin: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + + repackage + + repackage + + + + value + + + + + + + com.example + custom-layout + 0.0.1.BUILD-SNAPSHOT + + + + + + +---- + +The layout factory is provided as an implementation of `LayoutFactory` (from `spring-boot-loader-tools`) explicitly specified in the pom. +If there is only one custom `LayoutFactory` on the plugin classpath and it is listed in `META-INF/spring.factories` then it is unnecessary to explicitly set it in the plugin configuration. + +Layout factories are always ignored if an explicit <> is set. + + + +[[repackage-example-exclude-dependency]] +==== Dependency Exclusion +By default, both the `repackage` and the `run` goals will include any `provided` dependencies that are defined in the project. +A Spring Boot project should consider `provided` dependencies as "container" dependencies that are required to run the application. + +Some of these dependencies may not be required at all and should be excluded from the executable jar. +For consistency, they should not be present either when running the application. + +There are two ways one can exclude a dependency from being packaged/used at runtime: + +* Exclude a specific artifact identified by `groupId` and `artifactId`, optionally with a `classifier` if needed. +* Exclude any artifact belonging to a given `groupId`. + +The following example excludes `com.foo:bar`, and only that artifact: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + + + com.foo + bar + + + + + + + +---- + +This example excludes any artifact belonging to the `com.foo` group: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + com.foo + + + + + +---- diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/running.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/running.adoc new file mode 100644 index 0000000000..cf9cfcfe59 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/docs/asciidoc/running.adoc @@ -0,0 +1,241 @@ +[[run]] +== Running your application with Maven + +The plugin includes a run goal which can be used to launch your application from the command line, as shown in the following example: + +[indent=0] +---- + $ mvn spring-boot:run +---- + +By default the application is executed in a forked process and setting properties on the command-line will not affect the application. +If you need to specify some JVM arguments (i.e. for debugging purposes), you can use the `jvmArguments` parameter, see <> for more details. +There is also explicit support for <> and <>. + +As enabling a profile is quite common, there is dedicated `profiles` property that offers a shortcut for `-Dspring-boot.run.jvmArguments="-Dspring.profiles.active=dev"`, see <>. + +Although this is not recommended, it is possible to execute the application directly from the Maven JVM by disabling the `fork` property. +Doing so means that the `jvmArguments`, `systemPropertyVariables`, `environmentVariables` and `agents` options are ignored. + +Spring Boot `devtools` is a module to improve the development-time experience when working on Spring Boot applications. +To enable it, just add the following dependency to your project: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + org.springframework.boot + spring-boot-devtools + {version} + true + + +---- + +When `devtools` is running, it detects change when you recompile your application and automatically refreshes it. +This works for not only resources but code as well. +It also provides a LiveReload server so that it can automatically trigger a browser refresh whenever things change. + +Devtools can also be configured to only refresh the browser whenever a static resource has changed (and ignore any change in the code). +Just include the following property in your project: + +[source,properties,indent=0] +---- + spring.devtools.remote.restart.enabled=false +---- + +Prior to `devtools`, the plugin supported hot refreshing of resources by default which has now be disabled in favour of the solution described above. +You can restore it at any time by configuring your project: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + true + + + + +---- + +When `addResources` is enabled, any `src/main/resources` folder will be added to the application classpath when you run the application and any duplicate found in `target/classes` will be removed. +This allows hot refreshing of resources which can be very useful when developing web applications. +For example, you can work on HTML, CSS or JavaScript files and see your changes immediately without recompiling your application. +It is also a helpful way of allowing your front end developers to work without needing to download and install a Java IDE. + +NOTE: A side effect of using this feature is that filtering of resources at build time will not work. + +In order to be consistent with the `repackage` goal, the `run` goal builds the classpath in such a way that any dependency that is excluded in the plugin's configuration gets excluded from the classpath as well. +For more details, see <>. + +Sometimes it is useful to include test dependencies when running the application. +For example, if you want to run your application in a test mode that uses stub classes. +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::goals/run.adoc[leveloffset=+1] + +[[run-examples]] +=== Examples + + + +[[run-example-debug]] +==== Debug the Application +By default, the `run` goal runs your application in a forked process. +If you need to debug it, you should add the necessary JVM arguments to enable remote debugging. +The following configuration suspend the process until a debugger has joined on port 5005: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + + -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 + + + + + + +---- + +These arguments can be specified on the command line as well, make sure to wrap that properly, that is: + +[indent=0] +---- + $ mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" +---- + + + +[[run-example-system-properties]] +==== Using System Properties +System properties can be specified using the `systemPropertyVariables` attribute. +The following example sets `property1` to `test` and `property2` to 42: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + 42 + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + + test + ${my.value} + + + + + + +---- + +If the value is empty or not defined (i.e. `), the system property is set with an empty String as the value. +Maven trims values specified in the pom so it is not possible to specify a System property which needs to start or end with a space via this mechanism: consider using `jvmArguments` instead. + +Any String typed Maven variable can be passed as system properties. +Any attempt to pass any other Maven variable type (e.g. a `List` or a `URL` variable) will cause the variable expression to be passed literally (unevaluated). + +The `jvmArguments` parameter takes precedence over system properties defined with the mechanism above. +In the following example, the value for `property1` is `overridden`: + +[indent=0] +---- + $ mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dproperty1=overridden" +---- + + + +[[run-example-environment-variables]] +==== Using Environment Variables +Environment variables can be specified using the `environmentVariables` attribute. +The following example sets the 'ENV1', 'ENV2', 'ENV3', 'ENV4' env variables: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + + 5000 + Some Text + + + + + + + + +---- + +If the value is empty or not defined (i.e. `), the env variable is set with an empty String as the value. +Maven trims values specified in the pom so it is not possible to specify an env variable which needs to start or end with a space. + +Any String typed Maven variable can be passed as system properties. +Any attempt to pass any other Maven variable type (e.g. a `List` or a `URL` variable) will cause the variable expression to be passed literally (unevaluated). + +Environment variables defined this way take precedence over existing values. + + + +[[run-example-active-profiles]] +==== Specify Active Profiles +The active profiles to use for a particular application can be specified using the `profiles` argument. + +The following configuration enables the `foo` and `bar` profiles: + +[source,xml,indent=0,subs="verbatim,attributes"] +---- + + + + + org.springframework.boot + spring-boot-maven-plugin + {version} + + + foo + bar + + + + + + +---- + +The profiles to enable can be specified on the command line as well, make sure to separate them with a comma, as shown in the following example: + +[indent=0] +---- + $ mvn spring-boot:run -Dspring-boot.run.profiles=foo,bar +---- + + + 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 0000000000..8a373314a2 --- /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 0000000000..ac36d2eba2 --- /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 0000000000..f05dcc4750 --- /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 0000000000..7c1609b34e --- /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 0000000000..a9e0f668c5 --- /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 0000000000..9c20e96fa6 --- /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 0000000000..34736018c3 --- /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 0000000000..63c89ac538 --- /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/intTest/projects/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 new file mode 100644 index 0000000000..e6ba60b03a --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-additional-properties/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + org.springframework.boot.maven.it + build-info-additional-properties + 0.0.1.BUILD-SNAPSHOT + Generate build info with additional properties + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + build-info + + + + bar + ${project.build.sourceEncoding} + 1.8 + + + + + + + + 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/intTest/projects/build-info-custom-build-time/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-custom-build-time/pom.xml new file mode 100644 index 0000000000..c5668a93c9 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-info-custom-build-time/pom.xml @@ -0,0 +1,33 @@ + + + 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 + + + + + + + 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 0000000000..3e20c5c9c1 --- /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 0000000000..9f0e5a1503 --- /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/intTest/projects/jar-attach-disabled/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-attach-disabled/pom.xml new file mode 100644 index 0000000000..d6fa5cf6af --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-attach-disabled/pom.xml @@ -0,0 +1,32 @@ + + + 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 + + + + + + + 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 0000000000..3fd4d7b8df --- /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 0000000000..d05d5c4488 --- /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/intTest/projects/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 new file mode 100644 index 0000000000..357399d589 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-source-attach-disabled/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + org.springframework.boot.maven.it + jar-classifier-source-attach-disabled + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + org.apache.maven.plugins + maven-jar-plugin + @maven-jar-plugin.version@ + + + + jar + + package + + test + + + + + + @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-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/intTest/projects/jar-classifier-source/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-source/pom.xml new file mode 100644 index 0000000000..98d744d151 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-classifier-source/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + org.springframework.boot.maven.it + jar-classifier-source + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + org.apache.maven.plugins + maven-jar-plugin + @maven-jar-plugin.version@ + + + + jar + + package + + test + + + + + + @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-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 0000000000..0920206fd4 --- /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/intTest/projects/jar-custom-dir/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-dir/pom.xml new file mode 100644 index 0000000000..f6a0ab30db --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-dir/pom.xml @@ -0,0 +1,32 @@ + + + 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 + + + + + + + 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 0000000000..6e78c3ea63 --- /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-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/custom/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/custom/pom.xml new file mode 100644 index 0000000000..e64b294529 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/custom/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + org.springframework.boot.maven.it + custom + 0.0.1.BUILD-SNAPSHOT + + 1.8 + 1.8 + UTF-8 + + + + + org.springframework.boot + spring-boot-maven-plugin + @project.version@ + + + + repackage + + + + custom + + + + + + + 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-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/default/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/default/pom.xml new file mode 100644 index 0000000000..f568c759e3 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-custom-layout/default/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + org.springframework.boot.maven.it + default + 0.0.1.BUILD-SNAPSHOT + + 1.8 + 1.8 + UTF-8 + + + + + org.springframework.boot + spring-boot-maven-plugin + @project.version@ + + + + repackage + + + + + + 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 0000000000..965a8b8d9d --- /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 0000000000..7022544d57 --- /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/intTest/projects/jar-exclude-entry/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-exclude-entry/pom.xml new file mode 100644 index 0000000000..d37e11e152 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-exclude-entry/pom.xml @@ -0,0 +1,50 @@ + + + 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.springframework + spring-context + @spring-framework.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/intTest/projects/jar-exclude-group/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-exclude-group/pom.xml new file mode 100644 index 0000000000..4da81b2f08 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-exclude-group/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + org.springframework.boot.maven.it + jar-exclude-group + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + repackage + + + org.apache.logging.log4j + + + + + + org.apache.maven.plugins + maven-jar-plugin + @maven-jar-plugin.version@ + + + + Foo + + + + + + + + + org.springframework + spring-context + @spring-framework.version@ + + + org.apache.logging.log4j + log4j-api + @log4j2.version@ + + + 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/intTest/projects/jar-executable/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-executable/pom.xml new file mode 100644 index 0000000000..802d166a27 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-executable/pom.xml @@ -0,0 +1,46 @@ + + + 4.0.0 + org.springframework.boot.maven.it + jar-executable + MyFullyExecutableJarName + MyFullyExecutableJarDesc + 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@ + + + + some.random.Main + + + + + + + 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/intTest/projects/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 new file mode 100644 index 0000000000..f0c7626623 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-lib-name-conflict/acme-lib/pom.xml @@ -0,0 +1,13 @@ + + + 4.0.0 + acme-lib + + + org.springframework.boot.maven.it + jar-lib-name-conflict + 0.0.1.BUILD-SNAPSHOT + + + 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/intTest/projects/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 new file mode 100644 index 0000000000..535fedc387 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-lib-name-conflict/test-project/pom.xml @@ -0,0 +1,42 @@ + + + 4.0.0 + org.springframework.boot.maven.it + test-project + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + repackage + + + + + + + + + + org.springframework.boot.maven.it + acme-lib + 0.0.1.BUILD-SNAPSHOT + + + org.springframework.boot.maven.it.another + acme-lib + 0.0.1.BUILD-SNAPSHOT + + + 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/intTest/projects/jar-pom/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-pom/pom.xml new file mode 100644 index 0000000000..f8eb3dae58 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-pom/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + org.springframework.boot.maven.it + jar-pom + pom + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + repackage + + + + + + + diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-skip/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-skip/pom.xml new file mode 100644 index 0000000000..15eea089cb --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-skip/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + org.springframework.boot.maven.it + jar-skip + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + repackage + + + 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 0000000000..f455d43879 --- /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/intTest/projects/jar-system-scope/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-system-scope/pom.xml new file mode 100644 index 0000000000..2a5de56091 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-system-scope/pom.xml @@ -0,0 +1,41 @@ + + + 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 + + + + + + + + + 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/intTest/projects/jar-test-scope/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-test-scope/pom.xml new file mode 100644 index 0000000000..5ea032cdd7 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-test-scope/pom.xml @@ -0,0 +1,42 @@ + + + 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 + + + + + + + + + org.springframework + spring-context + @spring-framework.version@ + + + 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/intTest/projects/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 new file mode 100644 index 0000000000..eea70adbfd --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-kotlin-module/pom.xml @@ -0,0 +1,69 @@ + + + 4.0.0 + org.springframework.boot.maven.it + jar-with-kotlin-module + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/test/kotlin + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + repackage + + + + + + org.jetbrains.kotlin + kotlin-maven-plugin + @kotlin.version@ + + + compile + process-resources + + compile + + + + test-compile + process-test-resources + + compile + + + + + + + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + @kotlin.version@ + + + org.jetbrains.kotlin + kotlin-reflect + @kotlin.version@ + + + org.jetbrains.kotlin + kotlin-compiler + @kotlin.version@ + + + 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/intTest/projects/jar-with-zip-layout/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-zip-layout/pom.xml new file mode 100644 index 0000000000..e4171d27cb --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/jar-with-zip-layout/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + org.springframework.boot.maven.it + jar-with-zip-layout + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + repackage + + + 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/intTest/projects/run-arguments-commandline/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-arguments-commandline/pom.xml new file mode 100644 index 0000000000..041d9b2ff7 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-arguments-commandline/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + org.springframework.boot.maven.it + run-arguments-commandline + 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-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/intTest/projects/run-arguments/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-arguments/pom.xml new file mode 100644 index 0000000000..84563c8b97 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-arguments/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + org.springframework.boot.maven.it + run-arguments + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + --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 0000000000..4f6bcd76fa --- /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 0000000000..fa5832c24e --- /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/intTest/projects/run-envargs/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-envargs/pom.xml new file mode 100644 index 0000000000..8360378517 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-envargs/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + org.springframework.boot.maven.it + run-envargs + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + 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/intTest/projects/run-exclude/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-exclude/pom.xml new file mode 100644 index 0000000000..f92c952115 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-exclude/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + org.springframework.boot.maven.it + run-exclude + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + org.apache.logging.log4j + log4j-api + + + jakarta.servlet,javax.servlet + + + + + + + org.apache.logging.log4j + log4j-api + @log4j2.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/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 0000000000..6e76f7526b --- /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 0000000000..849ed35c67 --- /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/intTest/projects/run-profiles-fork-disabled/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-profiles-fork-disabled/pom.xml new file mode 100644 index 0000000000..1a222c8897 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-profiles-fork-disabled/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + org.springframework.boot.maven.it + run-profiles + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + 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/intTest/projects/run-profiles/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-profiles/pom.xml new file mode 100644 index 0000000000..b46f899608 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-profiles/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + org.springframework.boot.maven.it + run-profiles + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + 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/intTest/projects/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 new file mode 100644 index 0000000000..a652f2ca53 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/run-use-test-classpath/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + org.springframework.boot.maven.it + run-use-test-classpath + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + true + + + + + + + org.springframework + spring-context + @spring-framework.version@ + test + + + 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 0000000000..1dd1d52817 --- /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 0000000000..5202b61be3 --- /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 0000000000..73ac7d2841 --- /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/intTest/projects/start-stop-fork-disabled/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop-fork-disabled/pom.xml new file mode 100644 index 0000000000..8a1a8ad671 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/start-stop-fork-disabled/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + org.springframework.boot.maven.it + start-stop + 0.0.1.BUILD-SNAPSHOT + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + pre-integration-test + + start + + + + post-integration-test + + stop + + + + + + + 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/intTest/projects/war-with-unpack/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-with-unpack/pom.xml new file mode 100644 index 0000000000..bb13ba1acd --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/war-with-unpack/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + org.springframework.boot.maven.it + war-with-unpack + 0.0.1.BUILD-SNAPSHOT + war + + UTF-8 + @java.version@ + @java.version@ + + + + + @project.groupId@ + @project.artifactId@ + @project.version@ + + + + repackage + + + + + org.springframework + spring-core + + + + + + + + org.apache.maven.plugins + maven-war-plugin + @maven-war-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/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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-additional-properties/pom.xml deleted file mode 100644 index 1b5cd9fcb9..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-additional-properties/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - build-info-additional-properties - 0.0.1.BUILD-SNAPSHOT - Generate build info - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - build-info - - - - bar - ${project.build.sourceEncoding} - 1.8 - - - - - - - - - - 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/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 10f6bfa4f7..0000000000 --- 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 bfa9a51de3..0000000000 --- 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 e6ec4d3e1d..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-file/pom.xml deleted file mode 100644 index 65bf4155f3..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info-custom-file/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - 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 - - - - - - - - - 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-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 eecd9e10d8..0000000000 --- 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 7b5971224b..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info/pom.xml deleted file mode 100644 index 1f83522c8f..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - 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 - - - - - - - - - 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/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/build-info/verify.groovy deleted file mode 100644 index e266446a8a..0000000000 --- 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 c0c3f7cc07..0000000000 --- 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 5c8f7f2ef1..0000000000 --- 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 7cfb591705..0000000000 --- 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 c0c3f7cc07..0000000000 --- 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 ba65f7d5ec..0000000000 --- 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 8a40399d7e..0000000000 --- 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 c0c3f7cc07..0000000000 --- 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 b754ff6d29..0000000000 --- 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 a575beda0a..0000000000 --- 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 c0c3f7cc07..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/pom.xml deleted file mode 100644 index 33b21884ec..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source-attach-disabled/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-classifier-source-attach-disabled - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - jar - - package - - test - - - Foo - - - - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - test - false - - - - - - - - - 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/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 dae20efad3..0000000000 --- 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 c0c3f7cc07..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/pom.xml deleted file mode 100644 index a7b24d9cda..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-classifier-source/pom.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-classifier-source - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - jar - - package - - test - - - Foo - - - - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - test - - - - - - - - - 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/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 d85fe41262..0000000000 --- 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 33e076fcfb..0000000000 --- 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 9a3e445474..0000000000 --- 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 c0c3f7cc07..0000000000 --- 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 fa75c04236..0000000000 --- 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 0960d4ee3e..0000000000 --- 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 f91261e245..0000000000 --- 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 738a8ad142..0000000000 --- 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 ba0c43d463..0000000000 --- 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 61011b7aa5..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/pom.xml deleted file mode 100644 index 19ae153fdf..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/pom.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-exclude-group - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - org.apache.logging.log4j - - - - - - 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@ - - - 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 bf712e6801..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-executable/pom.xml deleted file mode 100644 index f014731810..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-executable/pom.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-executable - MyFullyExecutableJarName - MyFullyExecutableJarDesc - 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@ - - - - 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-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 8c2522ba68..0000000000 --- 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/acme-lib/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/acme-lib/pom.xml deleted file mode 100644 index 25d2c815b5..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/acme-lib/pom.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - 4.0.0 - acme-lib - - - org.springframework.boot.maven.it - jar-lib-name-conflict - 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/test-project/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/test-project/pom.xml deleted file mode 100644 index 65d9663c24..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/test-project/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - test-project - 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.boot.maven.it - acme-lib - 0.0.1.BUILD-SNAPSHOT - - - org.springframework.boot.maven.it.another - 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-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 1294e4aeb7..0000000000 --- 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 587f8a8695..0000000000 --- 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 5d0f840e17..0000000000 --- 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-pom/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-pom/pom.xml deleted file mode 100644 index bbf54cebee..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-pom/pom.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-pom - pom - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - - - - - - - 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/it/jar-skip/pom.xml deleted file mode 100644 index 23021a8af8..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-skip/pom.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-skip - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - true - - - - - - - - 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 cff568c8cb..0000000000 --- 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 15c4b16a57..0000000000 --- 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 0a1ef4fc8f..0000000000 --- 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 22c2be9387..0000000000 --- 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 20097b2b78..0000000000 --- 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 11985a8b8a..0000000000 --- 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 24a032bfc2..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/pom.xml deleted file mode 100644 index 770402c9d6..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-kotlin-module/pom.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-with-kotlin-module - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - ${project.basedir}/src/main/kotlin - ${project.basedir}/src/test/kotlin - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - - - org.jetbrains.kotlin - kotlin-compiler - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - Foo - - - - - - org.jetbrains.kotlin - kotlin-maven-plugin - @kotlin.version@ - - - compile - process-resources - - compile - - - - test-compile - process-test-resources - - compile - - - - - - - - - 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 - @kotlin.version@ - - - org.jetbrains.kotlin - kotlin-reflect - @kotlin.version@ - - - org.jetbrains.kotlin - kotlin-compiler - @kotlin.version@ - - - 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 6000b59e5c..0000000000 --- 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 034be12754..0000000000 --- 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 74a5ff22db..0000000000 --- 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 ea7eee6d12..0000000000 --- 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 c0c3f7cc07..0000000000 --- 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 248bf1acf3..0000000000 --- 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 572465bd44..0000000000 --- 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 39e9cd8496..0000000000 --- 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 9225c36f9e..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments-commandline/pom.xml deleted file mode 100644 index af5471f4de..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments-commandline/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - run-arguments-commandline - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @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/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 4de2d29f21..0000000000 --- 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 9963e64c2e..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments/pom.xml deleted file mode 100644 index 34ca2c0386..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - run-arguments - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - package - - run - - - - --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/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-arguments/verify.groovy deleted file mode 100644 index 2a7cc17ab5..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-devtools/pom.xml deleted file mode 100644 index eeac82763d..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-devtools/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - 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@ - - - package - - run - - - false - - - - - - - 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 ac9957acf2..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-disable-fork/pom.xml deleted file mode 100644 index 4d7d9a226d..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-disable-fork/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - 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@ - - - package - - run - - - 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/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 752e0988f0..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-envargs/pom.xml deleted file mode 100644 index 5d40d970c3..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-envargs/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - run-envargs - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - package - - run - - - - 5000 - Some Text - - - - - - - - - - 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 841c4a97de..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-exclude/pom.xml deleted file mode 100644 index 2f02afbabd..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-exclude/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - run-exclude - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - package - - run - - - - - org.apache.logging.log4j - log4j-api - - - jakarta.servlet,javax.servlet - - - - - - - - - org.apache.logging.log4j - log4j-api - @log4j2.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/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 841c4a97de..0000000000 --- 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 8056f772da..0000000000 --- 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 f675a4fa61..0000000000 --- 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 4828ceec96..0000000000 --- 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 841c4a97de..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvmargs/pom.xml deleted file mode 100644 index d7f82c8cd4..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-jvmargs/pom.xml +++ /dev/null @@ -1,33 +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 - - - - - - - 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 841c4a97de..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles-fork/pom.xml deleted file mode 100644 index 0504978714..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles-fork/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - run-profiles - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - package - - run - - - - foo - bar - - - - - - - - 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 c9cb44bb05..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles/pom.xml deleted file mode 100644 index 0504978714..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-profiles/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - run-profiles - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - package - - run - - - - foo - bar - - - - - - - - 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 c9cb44bb05..0000000000 --- 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 12b66a0fa5..0000000000 --- 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 7140f782d8..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-use-test-classpath/pom.xml deleted file mode 100644 index 419080b62d..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-use-test-classpath/pom.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - run-use-test-classpath - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - package - - run - - - true - - - - - - - - - org.springframework - spring-context - @spring-framework.version@ - test - - - 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 841c4a97de..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-working-directory/pom.xml deleted file mode 100644 index c82a150c74..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run-working-directory/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - 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@ - - - package - - run - - - ${project.build.sourceDirectory} - - - - - - - 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 4f1b8234fc..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run/pom.xml deleted file mode 100644 index 19743c2c37..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/run/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - 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@ - - - package - - run - - - false - - - - - - - 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 841c4a97de..0000000000 --- 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 e1e0ace341..0000000000 --- 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 793d89fcd3..0000000000 --- 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 5aa87af683..0000000000 --- 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 793d89fcd3..0000000000 --- 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 0d3ec538c9..0000000000 --- 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 793d89fcd3..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/pom.xml deleted file mode 100644 index c079184547..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/start-stop/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - start-stop - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - pre-integration-test - - start - - - - post-integration-test - - stop - - - - - false - - - - - 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 5aa87af683..0000000000 --- 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 48d805aaac..0000000000 --- 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/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-with-unpack/pom.xml deleted file mode 100644 index 9238324238..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/war-with-unpack/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - war - 0.0.1.BUILD-SNAPSHOT - war - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - - - org.springframework - spring-core - - - - - - - - org.apache.maven.plugins - maven-war-plugin - @maven-war-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/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 d1c8e547fb..0000000000 --- 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 e0c145c834..0000000000 --- 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/main/asciidoc/build-info.adoc b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/build-info.adoc deleted file mode 100644 index 487b24d61c..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/build-info.adoc +++ /dev/null @@ -1,41 +0,0 @@ -[[build-info]] -== Integrating with Actuator -Spring Boot Actuator displays build-related information if a `META-INF/build-info.properties` file is present. -The `build-info` goal generates such file with the coordinates of the project and the build time. -It also allows you to add an arbitrary number of additional properties, as shown in the following example: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - - - build-info - - - - UTF-8 - UTF-8 - ${maven.compiler.source} - ${maven.compiler.target} - - - - - - - - ----- - -This configuration will generate a `build-info.properties` at the expected location with four additional keys. -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] 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/main/asciidoc/getting-started.adoc deleted file mode 100644 index 6501051115..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/getting-started.adoc +++ /dev/null @@ -1,7 +0,0 @@ -[[getting-started]] -== Getting started - -The Spring Boot Plugin has the following goals: - -include::{generated-resources-root}/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/main/asciidoc/help.adoc deleted file mode 100644 index 49d5452ea4..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/help.adoc +++ /dev/null @@ -1,5 +0,0 @@ -[[help]] -== 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] 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/main/asciidoc/integration-tests.adoc deleted file mode 100644 index 31317f4298..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/integration-tests.adoc +++ /dev/null @@ -1,179 +0,0 @@ -[[integration-tests]] -== Running Integration tests - -While you may start your Spring Boot application very easily from your test (or test suite) itself, it may be desirable to handle that in the build itself. -To make sure that the lifecycle of your Spring Boot application is properly managed around your integration tests, you can use the `start` and `stop` goals, as shown in the following example: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - - pre-integration-test - - start - - - - post-integration-test - - stop - - - - - - ----- - -Such setup can now use the https://maven.apache.org/surefire/maven-failsafe-plugin[failsafe-plugin] to run your integration tests as you would expect. - -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::{generated-resources-root}/goals/stop.adoc[leveloffset=+1] - - -[[integration-tests-example]] -=== Examples - - - -[[integration-tests-example-random-port]] -==== Random Port for Integration Tests -One nice feature of the Spring Boot test integration is that it can allocate a free port for the web application. -When the `start` goal of the plugin is used, the Spring Boot application is started separately, making it difficult to pass the actual port to the integration test itself. - -The example below showcases how you could achieve the same feature using the https://www.mojohaus.org/build-helper-maven-plugin[Build Helper Maven Plugin]: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.codehaus.mojo - build-helper-maven-plugin - {build-helper-maven-plugin-version} - - - reserve-tomcat-port - - reserve-network-port - - process-resources - - - tomcat.http.port - - - - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - - pre-integration-test - - start - - - - --server.port=${tomcat.http.port} - - - - - post-integration-test - - stop - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - {maven-failsafe-plugin-version} - - - ${tomcat.http.port} - - - - - - ----- - -You can now retrieve the `test.server.port` system property in any of your integration test to create a proper `URL` to the server. - - - -[[integration-tests-example-skip]] -==== Skip Integration Tests -The `skip` property allows to skip the execution of the Spring Boot maven plugin altogether. - -This example shows how you can skip integration tests with a command-line property and still make sure that the `repackage` goal runs: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - false - - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - - pre-integration-test - - start - - - ${skip.it} - - - - post-integration-test - - stop - - - ${skip.it} - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - {maven-failsafe-plugin-version} - - ${skip.it} - - - - - ----- - -By default, the integration tests will run but this setup allows you to easily disable them on the command-line as follows: - -[indent=0] ----- - $ mvn verify -Dskip.it=true ----- 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/main/asciidoc/packaging.adoc deleted file mode 100644 index 495dca330f..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/packaging.adoc +++ /dev/null @@ -1,395 +0,0 @@ -[[repackage]] -== Packaging executable archives - -The plugin can create executable archives (jar files and war files) that contain all of an application's dependencies and can then be run with `java -jar`. - -Packaging an executable archive is performed by the `repackage` goal, as shown in the following example: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - - - repackage - - - - - - ----- - -TIP: If you are using `spring-boot-starter-parent`, such execution is already pre-configured with a `repackage` execution id so that only the plugin definition should be added. - -The example above repackages a jar or war that is built during the package phase of the Maven lifecycle, including any `provided` dependencies that are defined in the project. -If some of these dependencies need to be excluded, you can use one of the exclude options, see the <> for more details. - -NOTE: The `outputFileNameMapping` feature of the `maven-war-plugin` is currently not supported. - -Devtools is automatically excluded by default (you can control that using the `excludeDevtools` property). -In order to make that work with `war` packaging, the `spring-boot-devtools` dependency must be set as `optional` or with the `provided` scope. - -The original (i.e. non executable) artifact is renamed to `.original` by default but it is also possible to keep the original artifact using a custom classifier. - -The plugin rewrites your manifest, and in particular it manages the "Main-Class" and "Start-Class" entries, so if the defaults don't work you have to configure those there (not in the jar plugin). -The "Main-Class" in the manifest is actually controlled by the "layout" property of the Spring Boot plugin, as shown in the following example: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - ${start.class} - ZIP - - - - - repackage - - - - - - ----- - -The `layout` property defaults to a guess based on the archive type (`jar` or `war`). The following layouts are available: - -* `JAR`: regular executable JAR layout. -* `WAR`: executable WAR layout. `provided` dependencies are placed in `WEB-INF/lib-provided` to avoid any clash when the `war` is deployed in a servlet container. -* `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] - -[[repackage-examples]] -=== Examples - -[[repackage-example-custom-classifier]] -==== Custom Classifier -By default, the `repackage` goal replaces the original artifact with the repackaged one. -That is a sane behavior for modules that represent an application but if your module is used as a dependency of another module, you need to provide a classifier for the repackaged one. -The reason for that is that application classes are packaged in `BOOT-INF/classes` so that the dependent module cannot load a repackaged jar's classes. - -If that is the case or if you prefer to keep the original artifact and attach the repackaged one with a different classifier, configure the plugin as shown in the following example: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - - repackage - - repackage - - - exec - - - - - - - ----- - -If you are using `spring-boot-starter-parent`, the `repackage` goal is executed automatically in an execution with id `repackage`. -In that setup, only the configuration should be specified, as shown in the following example: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.springframework.boot - spring-boot-maven-plugin - - - repackage - - exec - - - - - - - ----- - -This configuration will generate two artifacts: the original one and the repackaged counter part produced by the repackage goal. -Both will be installed/deployed transparently. - -You can also use the same configuration if you want to repackage a secondary artifact the same way the main artifact is replaced. -The following configuration installs/deploys a single `task` classified artifact with the repackaged application: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.apache.maven.plugins - maven-jar-plugin - {maven-jar-plugin-version} - - - - jar - - package - - task - - - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - - repackage - - repackage - - - task - - - - - - - ----- - -As both the `maven-jar-plugin` and the `spring-boot-maven-plugin` runs at the same phase, it is important that the jar plugin is defined first (so that it runs before the repackage goal). -Again, if you are using `spring-boot-starter-parent`, this can be simplified as follows: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.apache.maven.plugins - maven-jar-plugin - - - default-jar - - task - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - repackage - - task - - - - - - - ----- - - - -[[repackage-example-custom-name]] -==== Custom Name -If you need the repackaged jar to have a different local name than the one defined by the `artifactId` attribute of the project, simply use the standard `finalName`, as shown in the following example: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - my-app - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - - repackage - - repackage - - - - - - - ----- - -This configuration will generate the repackaged artifact in `target/my-app.jar`. - - - -[[repackage-example-local-artifact]] -==== Local Repackaged Artifact -By default, the `repackage` goal replaces the original artifact with the executable one. -If you need to only deploy the original jar and yet be able to run your app with the regular file name, configure the plugin as follows: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - - repackage - - repackage - - - false - - - - - - - ----- - -This configuration generates two artifacts: the original one and the executable counter part produced by the `repackage` goal. -Only the original one will be installed/deployed. - - - -[[repackage-example-custom-layout]] -==== Custom Layout -Spring Boot repackages the jar file for this project using a custom layout factory defined in the additional jar file, provided as a dependency to the build plugin: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - - repackage - - repackage - - - - value - - - - - - - com.example - custom-layout - 0.0.1.BUILD-SNAPSHOT - - - - - - ----- - -The layout factory is provided as an implementation of `LayoutFactory` (from `spring-boot-loader-tools`) explicitly specified in the pom. -If there is only one custom `LayoutFactory` on the plugin classpath and it is listed in `META-INF/spring.factories` then it is unnecessary to explicitly set it in the plugin configuration. - -Layout factories are always ignored if an explicit <> is set. - - - -[[repackage-example-exclude-dependency]] -==== Dependency Exclusion -By default, both the `repackage` and the `run` goals will include any `provided` dependencies that are defined in the project. -A Spring Boot project should consider `provided` dependencies as "container" dependencies that are required to run the application. - -Some of these dependencies may not be required at all and should be excluded from the executable jar. -For consistency, they should not be present either when running the application. - -There are two ways one can exclude a dependency from being packaged/used at runtime: - -* Exclude a specific artifact identified by `groupId` and `artifactId`, optionally with a `classifier` if needed. -* Exclude any artifact belonging to a given `groupId`. - -The following example excludes `com.foo:bar`, and only that artifact: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - - - com.foo - bar - - - - - - - ----- - -This example excludes any artifact belonging to the `com.foo` group: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - com.foo - - - - - ----- 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/main/asciidoc/running.adoc deleted file mode 100644 index 59f5918eed..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/asciidoc/running.adoc +++ /dev/null @@ -1,241 +0,0 @@ -[[run]] -== Running your application with Maven - -The plugin includes a run goal which can be used to launch your application from the command line, as shown in the following example: - -[indent=0] ----- - $ mvn spring-boot:run ----- - -By default the application is executed in a forked process and setting properties on the command-line will not affect the application. -If you need to specify some JVM arguments (i.e. for debugging purposes), you can use the `jvmArguments` parameter, see <> for more details. -There is also explicit support for <> and <>. - -As enabling a profile is quite common, there is dedicated `profiles` property that offers a shortcut for `-Dspring-boot.run.jvmArguments="-Dspring.profiles.active=dev"`, see <>. - -Although this is not recommended, it is possible to execute the application directly from the Maven JVM by disabling the `fork` property. -Doing so means that the `jvmArguments`, `systemPropertyVariables`, `environmentVariables` and `agents` options are ignored. - -Spring Boot `devtools` is a module to improve the development-time experience when working on Spring Boot applications. -To enable it, just add the following dependency to your project: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - org.springframework.boot - spring-boot-devtools - {version} - true - - ----- - -When `devtools` is running, it detects change when you recompile your application and automatically refreshes it. -This works for not only resources but code as well. -It also provides a LiveReload server so that it can automatically trigger a browser refresh whenever things change. - -Devtools can also be configured to only refresh the browser whenever a static resource has changed (and ignore any change in the code). -Just include the following property in your project: - -[source,properties,indent=0] ----- - spring.devtools.remote.restart.enabled=false ----- - -Prior to `devtools`, the plugin supported hot refreshing of resources by default which has now be disabled in favour of the solution described above. -You can restore it at any time by configuring your project: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - true - - - - ----- - -When `addResources` is enabled, any `src/main/resources` folder will be added to the application classpath when you run the application and any duplicate found in `target/classes` will be removed. -This allows hot refreshing of resources which can be very useful when developing web applications. -For example, you can work on HTML, CSS or JavaScript files and see your changes immediately without recompiling your application. -It is also a helpful way of allowing your front end developers to work without needing to download and install a Java IDE. - -NOTE: A side effect of using this feature is that filtering of resources at build time will not work. - -In order to be consistent with the `repackage` goal, the `run` goal builds the classpath in such a way that any dependency that is excluded in the plugin's configuration gets excluded from the classpath as well. -For more details, see <>. - -Sometimes it is useful to include test dependencies when running the application. -For example, if you want to run your application in a test mode that uses stub classes. -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] - -[[run-examples]] -=== Examples - - - -[[run-example-debug]] -==== Debug the Application -By default, the `run` goal runs your application in a forked process. -If you need to debug it, you should add the necessary JVM arguments to enable remote debugging. -The following configuration suspend the process until a debugger has joined on port 5005: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - - -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 - - - - - - ----- - -These arguments can be specified on the command line as well, make sure to wrap that properly, that is: - -[indent=0] ----- - $ mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" ----- - - - -[[run-example-system-properties]] -==== Using System Properties -System properties can be specified using the `systemPropertyVariables` attribute. -The following example sets `property1` to `test` and `property2` to 42: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - 42 - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - - test - ${my.value} - - - - - - ----- - -If the value is empty or not defined (i.e. `), the system property is set with an empty String as the value. -Maven trims values specified in the pom so it is not possible to specify a System property which needs to start or end with a space via this mechanism: consider using `jvmArguments` instead. - -Any String typed Maven variable can be passed as system properties. -Any attempt to pass any other Maven variable type (e.g. a `List` or a `URL` variable) will cause the variable expression to be passed literally (unevaluated). - -The `jvmArguments` parameter takes precedence over system properties defined with the mechanism above. -In the following example, the value for `property1` is `overridden`: - -[indent=0] ----- - $ mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dproperty1=overridden" ----- - - - -[[run-example-environment-variables]] -==== Using Environment Variables -Environment variables can be specified using the `environmentVariables` attribute. -The following example sets the 'ENV1', 'ENV2', 'ENV3', 'ENV4' env variables: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - - 5000 - Some Text - - - - - - - - ----- - -If the value is empty or not defined (i.e. `), the env variable is set with an empty String as the value. -Maven trims values specified in the pom so it is not possible to specify an env variable which needs to start or end with a space. - -Any String typed Maven variable can be passed as system properties. -Any attempt to pass any other Maven variable type (e.g. a `List` or a `URL` variable) will cause the variable expression to be passed literally (unevaluated). - -Environment variables defined this way take precedence over existing values. - - - -[[run-example-active-profiles]] -==== Specify Active Profiles -The active profiles to use for a particular application can be specified using the `profiles` argument. - -The following configuration enables the `foo` and `bar` profiles: - -[source,xml,indent=0,subs="verbatim,attributes"] ----- - - - - - org.springframework.boot - spring-boot-maven-plugin - {version} - - - foo - bar - - - - - - ----- - -The profiles to enable can be specified on the command line as well, make sure to separate them with a comma, as shown in the following example: - -[indent=0] ----- - $ mvn spring-boot:run -Dspring-boot.run.profiles=foo,bar ----- - - - 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 0000000000..9a7c8e0cde --- /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 c69a060bb4..0000000000 --- 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 0000000000..b4b18cc55c --- /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 580c05156d..0000000000 --- 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 a0e1c3bd5b..41d055f396 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 class BuildOutput { 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 class BuildOutput { */ 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 class BuildOutput { * @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 0000000000..60a897770f --- /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 e42cf62672..0000000000 --- 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 a90c97f64f..fdde9a62d6 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 @@ class SpringApplicationTests { @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 e5a957e554..2a92a97bfc 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.ArrayList; 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.Configuration; 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 @@ class Log4J2LoggingSystemTests extends AbstractLoggingSystemTests { } @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 7b69ffb6b7..dbf98c89b0 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.Map; 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.entity.InputStreamFactory; 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 @@ public abstract class AbstractServletWebServerFactoryTests { // 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 @@ public abstract class AbstractServletWebServerFactoryTests { 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 @@ public abstract class AbstractServletWebServerFactoryTests { 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 @@ public abstract class AbstractServletWebServerFactoryTests { 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 @@ public abstract class AbstractServletWebServerFactoryTests { 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 @@ public abstract class AbstractServletWebServerFactoryTests { 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 @@ public abstract class AbstractServletWebServerFactoryTests { 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 @@ public abstract class AbstractServletWebServerFactoryTests { 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 @@ public abstract class AbstractServletWebServerFactoryTests { 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 @@ public abstract class AbstractServletWebServerFactoryTests { 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 @@ public abstract class AbstractServletWebServerFactoryTests { 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 @@ public abstract class AbstractServletWebServerFactoryTests { 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 @@ public abstract class AbstractServletWebServerFactoryTests { 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 fc79c4ae82..0000000000 --- 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 0000000000..942627d5fa --- /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 75d26a05f2..0000000000 --- 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 3d2fad57a2..0000000000 --- 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 b37ed0d48e..0000000000 --- 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 4ff13ba3c2..0000000000 --- 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 491b5d505a..0000000000 --- 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 2039e27f02..0000000000 --- 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 7023f3b990..0000000000 --- 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 42a0fc03b8..0000000000 --- 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 a4c9f14410..0000000000 --- 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 f06085fd1c..0000000000 --- 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 819f68150b..0000000000 --- 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 d9aee11660..0000000000 --- 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 cb9acd56c6..0000000000 --- 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 cb572e6c5c..0000000000 --- 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/SampleController.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/main/java/sample/SampleController.java deleted file mode 100644 index 819f68150b..0000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/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-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 3385e2d348..0000000000 --- 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 5e5bd73881..0000000000 --- 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 001ffe6f5b..0000000000 --- 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 b8b7ca8706..0000000000 --- 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 819f68150b..0000000000 --- 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/main/java/sample/SampleWlpDeployApplication.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/main/java/sample/SampleWlpDeployApplication.java deleted file mode 100644 index e1cda220c3..0000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/main/java/sample/SampleWlpDeployApplication.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 SampleWlpDeployApplication extends SpringBootServletInitializer { - -} 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 64b2ca4847..0000000000 --- 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 0000000000..3e892569f4 --- /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/src/main/java/sample/DeploymentTestApplication.java b/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/DeploymentTestApplication.java new file mode 100644 index 0000000000..38c310428b --- /dev/null +++ b/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/DeploymentTestApplication.java @@ -0,0 +1,25 @@ +/* + * 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 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 16c814635a..0000000000 --- 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 0000000000..92038132c0 --- /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 8b8d7363d2..0000000000 --- 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 1eae491ae0..0000000000 --- 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-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java deleted file mode 100644 index 4c816949a4..0000000000 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java +++ /dev/null @@ -1,114 +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.devtools.tests; - -import java.io.File; -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; - -import net.bytebuddy.ByteBuddy; -import net.bytebuddy.description.annotation.AnnotationDescription; -import net.bytebuddy.description.modifier.Visibility; -import net.bytebuddy.dynamic.DynamicType; -import net.bytebuddy.implementation.FixedValue; -import org.awaitility.Awaitility; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.extension.RegisterExtension; -import org.junit.jupiter.api.io.TempDir; - -import org.springframework.boot.testsupport.BuildOutput; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * Base class for DevTools integration tests. - * - * @author Andy Wilkinson - */ -abstract class AbstractDevToolsIntegrationTests { - - protected static final BuildOutput buildOutput = new BuildOutput(AbstractDevToolsIntegrationTests.class); - - protected final File serverPortFile = new File(buildOutput.getRootLocation(), "server.port"); - - @RegisterExtension - protected final JvmLauncher javaLauncher = new JvmLauncher(); - - @TempDir - protected static File temp; - - protected LaunchedApplication launchedApplication; - - protected void launchApplication(ApplicationLauncher applicationLauncher, String... args) throws Exception { - this.serverPortFile.delete(); - this.launchedApplication = applicationLauncher.launchApplication(this.javaLauncher, this.serverPortFile, args); - } - - @AfterEach - void stopApplication() throws InterruptedException { - this.launchedApplication.stop(); - } - - protected int awaitServerPort() throws Exception { - int port = Awaitility.waitAtMost(Duration.ofSeconds(30)) - .until(() -> new ApplicationState(this.serverPortFile, this.launchedApplication), - ApplicationState::hasServerPort) - .getServerPort(); - this.serverPortFile.delete(); - System.out.println("Got port " + port); - this.launchedApplication.restartRemote(port); - Thread.sleep(1000); - return port; - } - - protected ControllerBuilder controller(String name) { - return new ControllerBuilder(name, this.launchedApplication.getClassesDirectory()); - } - - protected static final class ControllerBuilder { - - private final List mappings = new ArrayList<>(); - - private final String name; - - private final File classesDirectory; - - protected ControllerBuilder(String name, File classesDirectory) { - this.name = name; - this.classesDirectory = classesDirectory; - } - - protected ControllerBuilder withRequestMapping(String mapping) { - this.mappings.add(mapping); - return this; - } - - protected void build() throws Exception { - DynamicType.Builder builder = new ByteBuddy().subclass(Object.class).name(this.name) - .annotateType(AnnotationDescription.Builder.ofType(RestController.class).build()); - for (String mapping : this.mappings) { - builder = builder.defineMethod(mapping, String.class, Visibility.PUBLIC) - .intercept(FixedValue.value(mapping)).annotateMethod(AnnotationDescription.Builder - .ofType(RequestMapping.class).defineArray("value", mapping).build()); - } - builder.make().saveIn(this.classesDirectory); - } - - } - -} 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-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java deleted file mode 100644 index 3bad93d99d..0000000000 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-devtools-tests/src/test/java/org/springframework/boot/devtools/tests/DevToolsIntegrationTests.java +++ /dev/null @@ -1,162 +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.devtools.tests; - -import java.io.File; -import java.io.IOException; - -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpStatus; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Integration tests for DevTools. - * - * @author Andy Wilkinson - */ -class DevToolsIntegrationTests extends AbstractDevToolsIntegrationTests { - - @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()) - .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"); - } - - @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"); - controller("com.example.ControllerOne").build(); - urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForEntity(urlBase + "/one", String.class).getStatusCode()) - .isEqualTo(HttpStatus.NOT_FOUND); - } - - @ParameterizedTest(name = "{0}") - @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()) - .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"); - - } - - @ParameterizedTest(name = "{0}") - @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()) - .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"); - controller("com.example.ControllerTwo").withRequestMapping("two").withRequestMapping("three").build(); - urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForObject(urlBase + "/three", String.class)).isEqualTo("three"); - } - - @ParameterizedTest(name = "{0}") - @MethodSource("parameters") - 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()) - .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"); - 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"); - } - - @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(new File(this.launchedApplication.getClassesDirectory(), "com/example/ControllerOne.class").delete()) - .isTrue(); - urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForEntity(urlBase + "/one", String.class).getStatusCode()) - .isEqualTo(HttpStatus.NOT_FOUND); - - } - - @ParameterizedTest(name = "{0}") - @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()) - .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(new File(this.launchedApplication.getClassesDirectory(), "com/example/ControllerTwo.class").delete()) - .isTrue(); - urlBase = "http://localhost:" + awaitServerPort(); - assertThat(template.getForEntity(urlBase + "/two", String.class).getStatusCode()) - .isEqualTo(HttpStatus.NOT_FOUND); - } - - static Object[] parameters() throws IOException { - Directories directories = new Directories(buildOutput, temp); - return new Object[] { new Object[] { new LocalApplicationLauncher(directories) }, - new Object[] { new ExplodedRemoteApplicationLauncher(directories) }, - new Object[] { new JarFileRemoteApplicationLauncher(directories) } }; - } - -} 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 0000000000..4ae4cbceb4 --- /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 0000000000..85bf6bdb43 --- /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 0000000000..5d7f20909b --- /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 f74e08f87b..0000000000 --- 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/intTest/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIntegrationTests.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIntegrationTests.java new file mode 100644 index 0000000000..2f1f4ea3d0 --- /dev/null +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIntegrationTests.java @@ -0,0 +1,356 @@ +/* + * 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.launchscript; + +import java.io.File; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Pattern; + +import org.assertj.core.api.Condition; +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.output.ToStringConsumer; +import org.testcontainers.images.builder.ImageFromDockerfile; +import org.testcontainers.utility.MountableFile; + +import org.springframework.boot.ansi.AnsiColor; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.hamcrest.Matchers.containsString; + +/** + * Integration tests for Spring Boot's launch script on OSs that use SysVinit. + * + * @author Andy Wilkinson + * @author Ali Shahbour + */ +class SysVinitLaunchScriptIntegrationTests { + + private static final char ESC = 27; + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void statusWhenStopped(String os, String version) throws Exception { + String output = doTest(os, version, "status-when-stopped.sh"); + assertThat(output).contains("Status: 3"); + assertThat(output).has(coloredString(AnsiColor.RED, "Not running")); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void statusWhenStarted(String os, String version) throws Exception { + String output = doTest(os, version, "status-when-started.sh"); + assertThat(output).contains("Status: 0"); + assertThat(output).has(coloredString(AnsiColor.GREEN, "Started [" + extractPid(output) + "]")); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void statusWhenKilled(String os, String version) throws Exception { + String output = doTest(os, version, "status-when-killed.sh"); + assertThat(output).contains("Status: 1"); + assertThat(output) + .has(coloredString(AnsiColor.RED, "Not running (process " + extractPid(output) + " not found)")); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void stopWhenStopped(String os, String version) throws Exception { + String output = doTest(os, version, "stop-when-stopped.sh"); + assertThat(output).contains("Status: 0"); + assertThat(output).has(coloredString(AnsiColor.YELLOW, "Not running (pidfile not found)")); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void forceStopWhenStopped(String os, String version) throws Exception { + String output = doTest(os, version, "force-stop-when-stopped.sh"); + assertThat(output).contains("Status: 0"); + assertThat(output).has(coloredString(AnsiColor.YELLOW, "Not running (pidfile not found)")); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void startWhenStarted(String os, String version) throws Exception { + String output = doTest(os, version, "start-when-started.sh"); + assertThat(output).contains("Status: 0"); + assertThat(output).has(coloredString(AnsiColor.YELLOW, "Already running [" + extractPid(output) + "]")); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void restartWhenStopped(String os, String version) throws Exception { + String output = doTest(os, version, "restart-when-stopped.sh"); + assertThat(output).contains("Status: 0"); + assertThat(output).has(coloredString(AnsiColor.YELLOW, "Not running (pidfile not found)")); + assertThat(output).has(coloredString(AnsiColor.GREEN, "Started [" + extractPid(output) + "]")); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void restartWhenStarted(String os, String version) throws Exception { + String output = doTest(os, version, "restart-when-started.sh"); + assertThat(output).contains("Status: 0"); + assertThat(output).has(coloredString(AnsiColor.GREEN, "Started [" + extract("PID1", output) + "]")); + assertThat(output).has(coloredString(AnsiColor.GREEN, "Stopped [" + extract("PID1", output) + "]")); + assertThat(output).has(coloredString(AnsiColor.GREEN, "Started [" + extract("PID2", output) + "]")); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void startWhenStopped(String os, String version) throws Exception { + String output = doTest(os, version, "start-when-stopped.sh"); + assertThat(output).contains("Status: 0"); + assertThat(output).has(coloredString(AnsiColor.GREEN, "Started [" + extractPid(output) + "]")); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void basicLaunch(String os, String version) throws Exception { + String output = doTest(os, version, "basic-launch.sh"); + assertThat(output).doesNotContain("PID_FOLDER"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void launchWithMissingLogFolderGeneratesAWarning(String os, String version) throws Exception { + String output = doTest(os, version, "launch-with-missing-log-folder.sh"); + assertThat(output).has( + coloredString(AnsiColor.YELLOW, "LOG_FOLDER /does/not/exist does not exist. Falling back to /tmp")); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void launchWithMissingPidFolderGeneratesAWarning(String os, String version) throws Exception { + String output = doTest(os, version, "launch-with-missing-pid-folder.sh"); + assertThat(output).has( + coloredString(AnsiColor.YELLOW, "PID_FOLDER /does/not/exist does not exist. Falling back to /tmp")); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void launchWithSingleCommandLineArgument(String os, String version) throws Exception { + doLaunch(os, version, "launch-with-single-command-line-argument.sh"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void launchWithMultipleCommandLineArguments(String os, String version) throws Exception { + doLaunch(os, version, "launch-with-multiple-command-line-arguments.sh"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void launchWithSingleRunArg(String os, String version) throws Exception { + doLaunch(os, version, "launch-with-single-run-arg.sh"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void launchWithMultipleRunArgs(String os, String version) throws Exception { + doLaunch(os, version, "launch-with-multiple-run-args.sh"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void launchWithSingleJavaOpt(String os, String version) throws Exception { + doLaunch(os, version, "launch-with-single-java-opt.sh"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void launchWithDoubleLinkSingleJavaOpt(String os, String version) throws Exception { + doLaunch(os, version, "launch-with-double-link-single-java-opt.sh"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void launchWithMultipleJavaOpts(String os, String version) throws Exception { + doLaunch(os, version, "launch-with-multiple-java-opts.sh"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void launchWithUseOfStartStopDaemonDisabled(String os, String version) throws Exception { + // CentOS doesn't have start-stop-daemon + Assumptions.assumeFalse(os.equals("CentOS")); + doLaunch(os, version, "launch-with-use-of-start-stop-daemon-disabled.sh"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void launchWithRelativePidFolder(String os, String version) throws Exception { + String output = doTest(os, version, "launch-with-relative-pid-folder.sh"); + assertThat(output).has(coloredString(AnsiColor.GREEN, "Started [" + extractPid(output) + "]")); + assertThat(output).has(coloredString(AnsiColor.GREEN, "Running [" + extractPid(output) + "]")); + assertThat(output).has(coloredString(AnsiColor.GREEN, "Stopped [" + extractPid(output) + "]")); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void pidFolderOwnership(String os, String version) throws Exception { + String output = doTest(os, version, "pid-folder-ownership.sh"); + assertThat(output).contains("phil root"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void pidFileOwnership(String os, String version) throws Exception { + String output = doTest(os, version, "pid-file-ownership.sh"); + assertThat(output).contains("phil root"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void logFileOwnership(String os, String version) throws Exception { + String output = doTest(os, version, "log-file-ownership.sh"); + assertThat(output).contains("phil root"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void logFileOwnershipIsChangedWhenCreated(String os, String version) throws Exception { + String output = doTest(os, version, "log-file-ownership-is-changed-when-created.sh"); + assertThat(output).contains("andy root"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void logFileOwnershipIsUnchangedWhenExists(String os, String version) throws Exception { + String output = doTest(os, version, "log-file-ownership-is-unchanged-when-exists.sh"); + assertThat(output).contains("root root"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void launchWithRelativeLogFolder(String os, String version) throws Exception { + String output = doTest(os, version, "launch-with-relative-log-folder.sh"); + assertThat(output).contains("Log written"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void launchWithRunAsUser(String os, String version) throws Exception { + String output = doTest(os, version, "launch-with-run-as-user.sh"); + assertThat(output).contains("wagner root"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void whenRunAsUserDoesNotExistLaunchFailsWithInvalidArgument(String os, String version) throws Exception { + String output = doTest(os, version, "launch-with-run-as-invalid-user.sh"); + assertThat(output).contains("Status: 2"); + assertThat(output).has(coloredString(AnsiColor.RED, "Cannot run as 'johndoe': no such user")); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void whenJarOwnerAndRunAsUserAreBothSpecifiedRunAsUserTakesPrecedence(String os, String version) throws Exception { + String output = doTest(os, version, "launch-with-run-as-user-preferred-to-jar-owner.sh"); + assertThat(output).contains("wagner root"); + } + + @ParameterizedTest(name = "{0} {1}") + @MethodSource("parameters") + void whenLaunchedUsingNonRootUserWithRunAsUserSpecifiedLaunchFailsWithInsufficientPrivilege(String os, + String version) throws Exception { + String output = doTest(os, version, "launch-with-run-as-user-root-required.sh"); + assertThat(output).contains("Status: 4"); + assertThat(output).has(coloredString(AnsiColor.RED, "Cannot run as 'wagner': current user is not root")); + } + + static List parameters() { + List parameters = new ArrayList<>(); + for (File os : new File("src/intTest/resources/conf").listFiles()) { + for (File version : os.listFiles()) { + parameters.add(new Object[] { os.getName(), version.getName() }); + } + } + return parameters; + } + + private void doLaunch(String os, String version, String script) throws Exception { + assertThat(doTest(os, version, script)).contains("Launched"); + } + + private String doTest(String os, String version, String script) throws Exception { + ToStringConsumer consumer = new ToStringConsumer().withRemoveAnsiCodes(false); + try (LaunchScriptTestContainer container = new LaunchScriptTestContainer(os, version, script)) { + container.withLogConsumer(consumer); + container.start(); + while (container.isRunning()) { + Thread.sleep(100); + } + } + return consumer.toUtf8String(); + } + + private Condition coloredString(AnsiColor color, String string) { + String colorString = ESC + "[0;" + color + "m" + string + ESC + "[0m"; + return new Condition() { + + @Override + public boolean matches(String value) { + return containsString(colorString).matches(value); + } + + }; + } + + private String extractPid(String output) { + return extract("PID", output); + } + + private String extract(String label, String output) { + Pattern pattern = Pattern.compile(".*" + label + ": ([0-9]+).*", Pattern.DOTALL); + java.util.regex.Matcher matcher = pattern.matcher(output); + if (matcher.matches()) { + return matcher.group(1); + } + throw new IllegalArgumentException("Failed to extract " + label + " from output: " + output); + } + + private static final class LaunchScriptTestContainer extends GenericContainer { + + private LaunchScriptTestContainer(String os, String version, String testScript) { + super(new ImageFromDockerfile("spring-boot-launch-script/" + os.toLowerCase() + "-" + version) + .withFileFromFile("Dockerfile", + new File("src/intTest/resources/conf/" + os + "/" + version + "/Dockerfile")) + .withFileFromFile("app.jar", findApplication()).withFileFromFile("test-functions.sh", + new File("src/intTest/resources/scripts/test-functions.sh"))); + withCopyFileToContainer(MountableFile.forHostPath("src/intTest/resources/scripts/" + testScript), + "/" + testScript); + withCommand("/bin/bash", "-c", "chmod +x " + testScript + " && ./" + testScript); + withStartupTimeout(Duration.ofMinutes(10)); + } + + private static File findApplication() { + File appJar = new File("build/app/build/libs/app.jar"); + if (appJar.isFile()) { + return appJar; + } + throw new IllegalStateException( + "Could not find test application in build/app/build/libs directory. Have you built it?"); + } + + } + +} diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/conf/CentOS/6.9-a23bced6/Dockerfile b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/conf/CentOS/6.9-a23bced6/Dockerfile new file mode 100644 index 0000000000..c97b60e602 --- /dev/null +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/conf/CentOS/6.9-a23bced6/Dockerfile @@ -0,0 +1,11 @@ +# CentOS 6.9 from 02/06/2017 +FROM centos@sha256:a23bced61701af9a0a758e94229676d9f09996a3ff0f3d26955b06bac8c282e0 +RUN yum install -y wget && \ + yum install -y system-config-services && \ + yum install -y curl && \ + wget --output-document jdk.rpm \ + https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-linux.x86_64.rpm && \ + yum --nogpg localinstall -y jdk.rpm && \ + rm -f jdk.rpm +ADD app.jar /app.jar +ADD test-functions.sh /test-functions.sh \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/conf/Ubuntu/trusty-20160914/Dockerfile b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/conf/Ubuntu/trusty-20160914/Dockerfile new file mode 100644 index 0000000000..7e7a726f49 --- /dev/null +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/conf/Ubuntu/trusty-20160914/Dockerfile @@ -0,0 +1,10 @@ +FROM ubuntu:trusty-20160914 +RUN apt-get update && \ + apt-get install -y software-properties-common curl && \ + mkdir -p /opt/openjdk && \ + cd /opt/openjdk && \ + curl -L https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u202-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz | tar zx --strip-components=1 +ENV JAVA_HOME /opt/openjdk +ENV PATH $JAVA_HOME/bin:$PATH +ADD app.jar /app.jar +ADD test-functions.sh /test-functions.sh \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/conf/Ubuntu/xenial-20160914/Dockerfile b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/conf/Ubuntu/xenial-20160914/Dockerfile new file mode 100644 index 0000000000..8f8cae543f --- /dev/null +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/conf/Ubuntu/xenial-20160914/Dockerfile @@ -0,0 +1,10 @@ +FROM ubuntu:xenial-20160914 +RUN apt-get update && \ + apt-get install -y software-properties-common curl && \ + mkdir -p /opt/openjdk && \ + cd /opt/openjdk && \ + curl -L https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u202-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz | tar zx --strip-components=1 +ENV JAVA_HOME /opt/openjdk +ENV PATH $JAVA_HOME/bin:$PATH +ADD app.jar /app.jar +ADD test-functions.sh /test-functions.sh \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/logback.xml b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/logback.xml similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/logback.xml rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/logback.xml diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/basic-launch.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/basic-launch.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/basic-launch.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/basic-launch.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/force-stop-when-stopped.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/force-stop-when-stopped.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/force-stop-when-stopped.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/force-stop-when-stopped.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-double-link-single-java-opt.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-double-link-single-java-opt.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-double-link-single-java-opt.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-double-link-single-java-opt.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-missing-log-folder.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-missing-log-folder.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-missing-log-folder.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-missing-log-folder.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-missing-pid-folder.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-missing-pid-folder.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-missing-pid-folder.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-missing-pid-folder.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-multiple-command-line-arguments.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-multiple-command-line-arguments.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-multiple-command-line-arguments.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-multiple-command-line-arguments.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-multiple-java-opts.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-multiple-java-opts.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-multiple-java-opts.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-multiple-java-opts.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-multiple-run-args.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-multiple-run-args.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-multiple-run-args.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-multiple-run-args.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-relative-log-folder.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-relative-log-folder.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-relative-log-folder.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-relative-log-folder.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-relative-pid-folder.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-relative-pid-folder.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-relative-pid-folder.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-relative-pid-folder.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-run-as-invalid-user.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-run-as-invalid-user.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-run-as-invalid-user.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-run-as-invalid-user.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-run-as-user-preferred-to-jar-owner.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-run-as-user-preferred-to-jar-owner.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-run-as-user-preferred-to-jar-owner.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-run-as-user-preferred-to-jar-owner.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-run-as-user-root-required.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-run-as-user-root-required.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-run-as-user-root-required.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-run-as-user-root-required.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-run-as-user.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-run-as-user.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-run-as-user.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-run-as-user.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-single-command-line-argument.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-single-command-line-argument.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-single-command-line-argument.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-single-command-line-argument.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-single-java-opt.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-single-java-opt.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-single-java-opt.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-single-java-opt.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-single-run-arg.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-single-run-arg.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-single-run-arg.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-single-run-arg.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-use-of-start-stop-daemon-disabled.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-use-of-start-stop-daemon-disabled.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/launch-with-use-of-start-stop-daemon-disabled.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/launch-with-use-of-start-stop-daemon-disabled.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/log-file-ownership-is-changed-when-created.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/log-file-ownership-is-changed-when-created.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/log-file-ownership-is-changed-when-created.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/log-file-ownership-is-changed-when-created.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/log-file-ownership-is-unchanged-when-exists.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/log-file-ownership-is-unchanged-when-exists.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/log-file-ownership-is-unchanged-when-exists.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/log-file-ownership-is-unchanged-when-exists.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/log-file-ownership.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/log-file-ownership.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/log-file-ownership.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/log-file-ownership.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/pid-file-ownership.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/pid-file-ownership.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/pid-file-ownership.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/pid-file-ownership.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/pid-folder-ownership.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/pid-folder-ownership.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/pid-folder-ownership.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/pid-folder-ownership.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/restart-when-started.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/restart-when-started.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/restart-when-started.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/restart-when-started.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/restart-when-stopped.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/restart-when-stopped.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/restart-when-stopped.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/restart-when-stopped.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/start-when-started.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/start-when-started.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/start-when-started.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/start-when-started.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/start-when-stopped.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/start-when-stopped.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/start-when-stopped.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/start-when-stopped.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/status-when-killed.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/status-when-killed.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/status-when-killed.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/status-when-killed.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/status-when-started.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/status-when-started.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/status-when-started.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/status-when-started.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/status-when-stopped.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/status-when-stopped.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/status-when-stopped.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/status-when-stopped.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/stop-when-stopped.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/stop-when-stopped.sh similarity index 100% rename from spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/stop-when-stopped.sh rename to spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/stop-when-stopped.sh diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/test-functions.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/test-functions.sh new file mode 100644 index 0000000000..e7430eb770 --- /dev/null +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/intTest/resources/scripts/test-functions.sh @@ -0,0 +1,53 @@ +install_service() { + mkdir /test-service + mv /app.jar /test-service/spring-boot-app.jar + chmod +x /test-service/spring-boot-app.jar + ln -s /test-service/spring-boot-app.jar /etc/init.d/spring-boot-app +} + +install_double_link_service() { + mkdir /test-service + mv /app.jar /test-service/ + chmod +x /test-service/app.jar + ln -s /test-service/app.jar /test-service/spring-boot-app.jar + ln -s /test-service/spring-boot-app.jar /etc/init.d/spring-boot-app +} + +start_service() { + service spring-boot-app start $@ +} + +restart_service() { + service spring-boot-app restart +} + +status_service() { + service spring-boot-app status +} + +stop_service() { + service spring-boot-app stop +} + +force_stop_service() { + service spring-boot-app force-stop +} + +await_app() { + if [ -z $1 ] + then + url=http://127.0.0.1:8080 + else + url=$1 + fi + end=$(date +%s) + let "end+=600" + until curl -s $url > /dev/null + do + now=$(date +%s) + if [[ $now -ge $end ]]; then + break + fi + sleep 1 + done +} 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/test/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIT.java deleted file mode 100644 index a4014dcb47..0000000000 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIT.java +++ /dev/null @@ -1,359 +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.launchscript; - -import java.io.File; -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Pattern; - -import org.assertj.core.api.Condition; -import org.junit.jupiter.api.Assumptions; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; -import org.testcontainers.containers.GenericContainer; -import org.testcontainers.containers.output.ToStringConsumer; -import org.testcontainers.images.builder.ImageFromDockerfile; -import org.testcontainers.utility.MountableFile; - -import org.springframework.boot.ansi.AnsiColor; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.hamcrest.Matchers.containsString; - -/** - * Integration tests for Spring Boot's launch script on OSs that use SysVinit. - * - * @author Andy Wilkinson - * @author Ali Shahbour - */ -class SysVinitLaunchScriptIT { - - private static final char ESC = 27; - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void statusWhenStopped(String os, String version) throws Exception { - String output = doTest(os, version, "status-when-stopped.sh"); - assertThat(output).contains("Status: 3"); - assertThat(output).has(coloredString(AnsiColor.RED, "Not running")); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void statusWhenStarted(String os, String version) throws Exception { - String output = doTest(os, version, "status-when-started.sh"); - assertThat(output).contains("Status: 0"); - assertThat(output).has(coloredString(AnsiColor.GREEN, "Started [" + extractPid(output) + "]")); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void statusWhenKilled(String os, String version) throws Exception { - String output = doTest(os, version, "status-when-killed.sh"); - assertThat(output).contains("Status: 1"); - assertThat(output) - .has(coloredString(AnsiColor.RED, "Not running (process " + extractPid(output) + " not found)")); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void stopWhenStopped(String os, String version) throws Exception { - String output = doTest(os, version, "stop-when-stopped.sh"); - assertThat(output).contains("Status: 0"); - assertThat(output).has(coloredString(AnsiColor.YELLOW, "Not running (pidfile not found)")); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void forceStopWhenStopped(String os, String version) throws Exception { - String output = doTest(os, version, "force-stop-when-stopped.sh"); - assertThat(output).contains("Status: 0"); - assertThat(output).has(coloredString(AnsiColor.YELLOW, "Not running (pidfile not found)")); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void startWhenStarted(String os, String version) throws Exception { - String output = doTest(os, version, "start-when-started.sh"); - assertThat(output).contains("Status: 0"); - assertThat(output).has(coloredString(AnsiColor.YELLOW, "Already running [" + extractPid(output) + "]")); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void restartWhenStopped(String os, String version) throws Exception { - String output = doTest(os, version, "restart-when-stopped.sh"); - assertThat(output).contains("Status: 0"); - assertThat(output).has(coloredString(AnsiColor.YELLOW, "Not running (pidfile not found)")); - assertThat(output).has(coloredString(AnsiColor.GREEN, "Started [" + extractPid(output) + "]")); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void restartWhenStarted(String os, String version) throws Exception { - String output = doTest(os, version, "restart-when-started.sh"); - assertThat(output).contains("Status: 0"); - assertThat(output).has(coloredString(AnsiColor.GREEN, "Started [" + extract("PID1", output) + "]")); - assertThat(output).has(coloredString(AnsiColor.GREEN, "Stopped [" + extract("PID1", output) + "]")); - assertThat(output).has(coloredString(AnsiColor.GREEN, "Started [" + extract("PID2", output) + "]")); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void startWhenStopped(String os, String version) throws Exception { - String output = doTest(os, version, "start-when-stopped.sh"); - assertThat(output).contains("Status: 0"); - assertThat(output).has(coloredString(AnsiColor.GREEN, "Started [" + extractPid(output) + "]")); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void basicLaunch(String os, String version) throws Exception { - String output = doTest(os, version, "basic-launch.sh"); - assertThat(output).doesNotContain("PID_FOLDER"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void launchWithMissingLogFolderGeneratesAWarning(String os, String version) throws Exception { - String output = doTest(os, version, "launch-with-missing-log-folder.sh"); - assertThat(output).has( - coloredString(AnsiColor.YELLOW, "LOG_FOLDER /does/not/exist does not exist. Falling back to /tmp")); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void launchWithMissingPidFolderGeneratesAWarning(String os, String version) throws Exception { - String output = doTest(os, version, "launch-with-missing-pid-folder.sh"); - assertThat(output).has( - coloredString(AnsiColor.YELLOW, "PID_FOLDER /does/not/exist does not exist. Falling back to /tmp")); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void launchWithSingleCommandLineArgument(String os, String version) throws Exception { - doLaunch(os, version, "launch-with-single-command-line-argument.sh"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void launchWithMultipleCommandLineArguments(String os, String version) throws Exception { - doLaunch(os, version, "launch-with-multiple-command-line-arguments.sh"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void launchWithSingleRunArg(String os, String version) throws Exception { - doLaunch(os, version, "launch-with-single-run-arg.sh"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void launchWithMultipleRunArgs(String os, String version) throws Exception { - doLaunch(os, version, "launch-with-multiple-run-args.sh"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void launchWithSingleJavaOpt(String os, String version) throws Exception { - doLaunch(os, version, "launch-with-single-java-opt.sh"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void launchWithDoubleLinkSingleJavaOpt(String os, String version) throws Exception { - doLaunch(os, version, "launch-with-double-link-single-java-opt.sh"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void launchWithMultipleJavaOpts(String os, String version) throws Exception { - doLaunch(os, version, "launch-with-multiple-java-opts.sh"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void launchWithUseOfStartStopDaemonDisabled(String os, String version) throws Exception { - // CentOS doesn't have start-stop-daemon - Assumptions.assumeFalse(os.equals("CentOS")); - doLaunch(os, version, "launch-with-use-of-start-stop-daemon-disabled.sh"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void launchWithRelativePidFolder(String os, String version) throws Exception { - String output = doTest(os, version, "launch-with-relative-pid-folder.sh"); - assertThat(output).has(coloredString(AnsiColor.GREEN, "Started [" + extractPid(output) + "]")); - assertThat(output).has(coloredString(AnsiColor.GREEN, "Running [" + extractPid(output) + "]")); - assertThat(output).has(coloredString(AnsiColor.GREEN, "Stopped [" + extractPid(output) + "]")); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void pidFolderOwnership(String os, String version) throws Exception { - String output = doTest(os, version, "pid-folder-ownership.sh"); - assertThat(output).contains("phil root"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void pidFileOwnership(String os, String version) throws Exception { - String output = doTest(os, version, "pid-file-ownership.sh"); - assertThat(output).contains("phil root"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void logFileOwnership(String os, String version) throws Exception { - String output = doTest(os, version, "log-file-ownership.sh"); - assertThat(output).contains("phil root"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void logFileOwnershipIsChangedWhenCreated(String os, String version) throws Exception { - String output = doTest(os, version, "log-file-ownership-is-changed-when-created.sh"); - assertThat(output).contains("andy root"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void logFileOwnershipIsUnchangedWhenExists(String os, String version) throws Exception { - String output = doTest(os, version, "log-file-ownership-is-unchanged-when-exists.sh"); - assertThat(output).contains("root root"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void launchWithRelativeLogFolder(String os, String version) throws Exception { - String output = doTest(os, version, "launch-with-relative-log-folder.sh"); - assertThat(output).contains("Log written"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void launchWithRunAsUser(String os, String version) throws Exception { - String output = doTest(os, version, "launch-with-run-as-user.sh"); - assertThat(output).contains("wagner root"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void whenRunAsUserDoesNotExistLaunchFailsWithInvalidArgument(String os, String version) throws Exception { - String output = doTest(os, version, "launch-with-run-as-invalid-user.sh"); - assertThat(output).contains("Status: 2"); - assertThat(output).has(coloredString(AnsiColor.RED, "Cannot run as 'johndoe': no such user")); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void whenJarOwnerAndRunAsUserAreBothSpecifiedRunAsUserTakesPrecedence(String os, String version) throws Exception { - String output = doTest(os, version, "launch-with-run-as-user-preferred-to-jar-owner.sh"); - assertThat(output).contains("wagner root"); - } - - @ParameterizedTest(name = "{0} {1}") - @MethodSource("parameters") - void whenLaunchedUsingNonRootUserWithRunAsUserSpecifiedLaunchFailsWithInsufficientPrivilege(String os, - String version) throws Exception { - String output = doTest(os, version, "launch-with-run-as-user-root-required.sh"); - assertThat(output).contains("Status: 4"); - assertThat(output).has(coloredString(AnsiColor.RED, "Cannot run as 'wagner': current user is not root")); - } - - static List parameters() { - List parameters = new ArrayList<>(); - for (File os : new File("src/test/resources/conf").listFiles()) { - for (File version : os.listFiles()) { - parameters.add(new Object[] { os.getName(), version.getName() }); - } - } - return parameters; - } - - private void doLaunch(String os, String version, String script) throws Exception { - assertThat(doTest(os, version, script)).contains("Launched"); - } - - private String doTest(String os, String version, String script) throws Exception { - ToStringConsumer consumer = new ToStringConsumer().withRemoveAnsiCodes(false); - try (LaunchScriptTestContainer container = new LaunchScriptTestContainer(os, version, script)) { - container.withLogConsumer(consumer); - container.start(); - while (container.isRunning()) { - Thread.sleep(100); - } - } - return consumer.toUtf8String(); - } - - private Condition coloredString(AnsiColor color, String string) { - String colorString = ESC + "[0;" + color + "m" + string + ESC + "[0m"; - return new Condition() { - - @Override - public boolean matches(String value) { - return containsString(colorString).matches(value); - } - - }; - } - - private String extractPid(String output) { - return extract("PID", output); - } - - private String extract(String label, String output) { - Pattern pattern = Pattern.compile(".*" + label + ": ([0-9]+).*", Pattern.DOTALL); - java.util.regex.Matcher matcher = pattern.matcher(output); - if (matcher.matches()) { - return matcher.group(1); - } - throw new IllegalArgumentException("Failed to extract " + label + " from output: " + output); - } - - private static final class LaunchScriptTestContainer extends GenericContainer { - - private LaunchScriptTestContainer(String os, String version, String testScript) { - super(new ImageFromDockerfile("spring-boot-launch-script/" + os.toLowerCase() + "-" + version) - .withFileFromFile("Dockerfile", - new File("src/test/resources/conf/" + os + "/" + version + "/Dockerfile")) - .withFileFromFile("spring-boot-launch-script-tests.jar", findApplication()) - .withFileFromFile("test-functions.sh", new File("src/test/resources/scripts/test-functions.sh"))); - withCopyFileToContainer(MountableFile.forHostPath("src/test/resources/scripts/" + testScript), - "/" + testScript); - withCommand("/bin/bash", "-c", "chmod +x " + testScript + " && ./" + testScript); - withStartupTimeout(Duration.ofMinutes(10)); - } - - private static File findApplication() { - File targetDir = new File("target"); - for (File file : targetDir.listFiles()) { - if (file.getName().startsWith("spring-boot-launch-script-tests") && file.getName().endsWith(".jar") - && !file.getName().endsWith("-sources.jar")) { - return file; - } - } - throw new IllegalStateException( - "Could not find test application in target directory. Have you built it (mvn package)?"); - } - - } - -} diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/conf/CentOS/6.9-a23bced6/Dockerfile b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/conf/CentOS/6.9-a23bced6/Dockerfile deleted file mode 100644 index 70513764d0..0000000000 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/conf/CentOS/6.9-a23bced6/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# CentOS 6.9 from 02/06/2017 -FROM centos@sha256:a23bced61701af9a0a758e94229676d9f09996a3ff0f3d26955b06bac8c282e0 -RUN yum install -y wget && \ - yum install -y system-config-services && \ - yum install -y curl && \ - wget --output-document jdk.rpm \ - https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-linux.x86_64.rpm && \ - yum --nogpg localinstall -y jdk.rpm && \ - rm -f jdk.rpm -ADD spring-boot-launch-script-tests.jar /spring-boot-launch-script-tests.jar -ADD test-functions.sh /test-functions.sh \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/conf/Ubuntu/trusty-20160914/Dockerfile b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/conf/Ubuntu/trusty-20160914/Dockerfile deleted file mode 100644 index cf95d7cacf..0000000000 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/conf/Ubuntu/trusty-20160914/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM ubuntu:trusty-20160914 -RUN apt-get update && \ - apt-get install -y software-properties-common curl && \ - mkdir -p /opt/openjdk && \ - cd /opt/openjdk && \ - curl -L https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u202-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz | tar zx --strip-components=1 -ENV JAVA_HOME /opt/openjdk -ENV PATH $JAVA_HOME/bin:$PATH -ADD spring-boot-launch-script-tests.jar /spring-boot-launch-script-tests.jar -ADD test-functions.sh /test-functions.sh \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/conf/Ubuntu/xenial-20160914/Dockerfile b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/conf/Ubuntu/xenial-20160914/Dockerfile deleted file mode 100644 index d1a37468b5..0000000000 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/conf/Ubuntu/xenial-20160914/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM ubuntu:xenial-20160914 -RUN apt-get update && \ - apt-get install -y software-properties-common curl && \ - mkdir -p /opt/openjdk && \ - cd /opt/openjdk && \ - curl -L https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u202-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz | tar zx --strip-components=1 -ENV JAVA_HOME /opt/openjdk -ENV PATH $JAVA_HOME/bin:$PATH -ADD spring-boot-launch-script-tests.jar /spring-boot-launch-script-tests.jar -ADD test-functions.sh /test-functions.sh \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/test-functions.sh b/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/test-functions.sh deleted file mode 100644 index 903713b888..0000000000 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/resources/scripts/test-functions.sh +++ /dev/null @@ -1,53 +0,0 @@ -install_service() { - mkdir /test-service - mv /spring-boot-launch-script-tests.jar /test-service/spring-boot-app.jar - chmod +x /test-service/spring-boot-app.jar - ln -s /test-service/spring-boot-app.jar /etc/init.d/spring-boot-app -} - -install_double_link_service() { - mkdir /test-service - mv /spring-boot-launch-script-tests.jar /test-service/ - chmod +x /test-service/spring-boot-launch-script-tests.jar - ln -s /test-service/spring-boot-launch-script-tests.jar /test-service/spring-boot-app.jar - ln -s /test-service/spring-boot-app.jar /etc/init.d/spring-boot-app -} - -start_service() { - service spring-boot-app start $@ -} - -restart_service() { - service spring-boot-app restart -} - -status_service() { - service spring-boot-app status -} - -stop_service() { - service spring-boot-app stop -} - -force_stop_service() { - service spring-boot-app force-stop -} - -await_app() { - if [ -z $1 ] - then - url=http://127.0.0.1:8080 - else - url=$1 - fi - end=$(date +%s) - let "end+=30" - until curl -s $url > /dev/null - do - now=$(date +%s) - if [[ $now -ge $end ]]; then - break - fi - sleep 1 - done -} 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 0000000000..b7c4cd5a04 --- /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 95ddd77d9c..0000000000 --- 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 42caaae4d6..d22fa9c880 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 @@ abstract class AbstractApplicationLauncher implements BeforeEachCallback, AfterE } 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 198c8ec420..2b02843546 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.InvocationResult; 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 @@ class ApplicationBuilder { } 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 @@ class ApplicationBuilder { 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 cf09b7fb04..083d0ad3b7 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.Map; 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.junit.platform.commons.util.ReflectionUtils; 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 @@ class EmbeddedServerContainerInvocationContextProvider @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 2370caa7d1..5e9be691a2 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 @@ class ExplodedApplicationLauncher extends AbstractApplicationLauncher { 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 5d7a5fbc02..4028cd0255 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 5cf9a073f9..8f5030fac9 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 9dc633c60c..0000000000 --- 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 10de667638..0000000000 --- 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 0000000000..b1de23afa1 --- /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 94d0db4ada..0000000000 --- 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 0000000000..02c2597511 --- /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 de0f0b25f8..0000000000 --- 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 0000000000..25f853b428 --- /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 a697d566f9..0000000000 --- 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 0000000000..c031508fc0 --- /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 863864bd57..0000000000 --- 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 0000000000..65379711f0 --- /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 d53df3d901..0000000000 --- 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 0000000000..6626aa97dc --- /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 4093b2cb40..0000000000 --- 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 0000000000..1ca9f92804 --- /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 0000000000..0d4dbfb422 --- /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 66e0dd896c..0000000000 --- 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 0000000000..2b04032ab9 --- /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 b62aff0376..0000000000 --- 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 0000000000..9b26aae89d --- /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 31e5018195..1cc4fcae34 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 a96e5a5c7f..37ccec0280 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 cf2a8c9675..0000000000 --- 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 51e870bff4..9d0f7cde7b 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 0000000000..7c7c7fa9d3 --- /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 8a47c6a21a..0000000000 --- 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 0000000000..75edfaedf1 --- /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 d3b7058a5c..0000000000 --- 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 0000000000..2af7bc92de --- /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 3249ad312e..0000000000 --- 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 0000000000..3f1c407436 --- /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 79e99e6b2f..0000000000 --- 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 a87f8d0575..0000000000 --- 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/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/custom/pom.xml deleted file mode 100644 index 2216ebfca8..0000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/custom/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - custom - 0.0.1.BUILD-SNAPSHOT - - 1.8 - 1.8 - UTF-8 - - - - - org.springframework.boot - spring-boot-maven-plugin - @project.version@ - - - - repackage - - - - custom - - - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - - - - - 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 7da68e56a2..0000000000 --- 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/pom.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/default/pom.xml deleted file mode 100644 index 3937a72a21..0000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-custom-layout/src/it/default/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - default - 0.0.1.BUILD-SNAPSHOT - - 1.8 - 1.8 - UTF-8 - - - - - org.springframework.boot - spring-boot-maven-plugin - @project.version@ - - - - repackage - - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - - - - - 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 672d96a2a6..0000000000 --- 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 aca02ce428..0000000000 --- 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 e1e0ace341..0000000000 --- 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 f7d5c924e8..0000000000 --- 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 0000000000..34c0983d74 --- /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 607cc194ee..0000000000 --- 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 0000000000..8480164a8e --- /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 58a8b51d99..0000000000 --- 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 0000000000..fa4759b310 --- /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 a7e1a39369..0000000000 --- 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 0000000000..b91d1d72fb --- /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 d631952f91..0000000000 --- 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 0000000000..01abdb2150 --- /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 6a616898b3..0000000000 --- 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 0000000000..abcf5208e9 --- /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 5dd86ff90b..0000000000 --- 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 0000000000..9d31618775 --- /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 5b6c9509c0..0000000000 --- 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 0000000000..0a5d557bdd --- /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 071ef99619..0000000000 --- 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 0000000000..9fb8091008 --- /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 f354ac153e..0000000000 --- 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 0000000000..5eb4857318 --- /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 8268687c67..0000000000 --- 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 0000000000..9575c1022e --- /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 69ba3dfcea..0000000000 --- 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 0000000000..f451df2412 --- /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 bdab3466c0..0000000000 --- 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 0000000000..408d0ff3ea --- /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 8bf6446af7..0000000000 --- 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 0000000000..8b8163d150 --- /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 b124977934..0000000000 --- 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 0000000000..25972c05c1 --- /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 526fd2f360..0000000000 --- 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 0000000000..960f09ca56 --- /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 9c2026d12b..0000000000 --- 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 0000000000..7a3b3c2a2e --- /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 d2d2b2164a..0000000000 --- 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 0000000000..75490b6c9c --- /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 795f4ddc70..0000000000 --- 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 0000000000..5c52b3e364 --- /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 fffed29070..0000000000 --- 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 0000000000..ae3b1c1f49 --- /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 d36c7dbe1b..0000000000 --- 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 0000000000..790d9fd6a2 --- /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 e6e5c10cac..0000000000 --- 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 0000000000..b6e319a8a8 --- /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 3a718411f5..0000000000 --- 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 0000000000..46979b6018 --- /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 b117c9ec0a..0000000000 --- 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 0000000000..c30bea68d4 --- /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 fbc875808f..0000000000 --- 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 d69a7e7d7f..0000000000 --- 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 0000000000..d48beca8ba --- /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 1c661d1f34..0000000000 --- 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 0000000000..2ae43e941a --- /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 6452cb757f..0000000000 --- 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 0000000000..2abfa04180 --- /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 2b0b0fd109..0000000000 --- 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 0000000000..9ca130e1ee --- /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 0454135098..0000000000 --- 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 0000000000..9889556499 --- /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 fe1daa14a1..0000000000 --- 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 0000000000..3d14d0b45b --- /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 4682992ad3..0000000000 --- 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 0000000000..ff995cdfe2 --- /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 08064623a6..0000000000 --- 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 0000000000..4596ddac2b --- /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 970261a078..0000000000 --- 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 0000000000..70937058ff --- /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 c450b9540a..0000000000 --- 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 0000000000..e430ee65d9 --- /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 772aac45c5..0000000000 --- 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 0000000000..792ce334e8 --- /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 a31b639a03..0000000000 --- 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 0000000000..7415212766 --- /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 4ea448e9d6..0000000000 --- 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 0000000000..0aee1a03c4 --- /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 89056132a7..0000000000 --- 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 0000000000..6176f9e03a --- /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 99bfae491f..0000000000 --- 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 0000000000..9cf22b2ea3 --- /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 a09b044368..0000000000 --- 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 0000000000..c8d2548a58 --- /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 5ad8da0f5d..0000000000 --- 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 0000000000..66f73aedce --- /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 c92dcf5052..0000000000 --- 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 0000000000..e4bd622b0b --- /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 8e3eec4a94..0000000000 --- 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 0000000000..3cd180ab43 --- /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 e40be5a1b0..0000000000 --- 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 0000000000..4fee4d429f --- /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 4028c68679..0000000000 --- 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 0000000000..46cc84d54a --- /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 a806f3a006..0000000000 --- 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 0000000000..c038dfeb9a --- /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 7fca8bb43a..0000000000 --- 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 0000000000..88d23d3fa8 --- /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 6f239374fd..0000000000 --- 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 0000000000..b4470ce126 --- /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 fc6c5a58d8..0000000000 --- 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 0000000000..0bfa9d67c6 --- /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 28c4100b31..0000000000 --- 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 84cf1b164b..0d382dbc08 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 @@ import static org.assertj.core.api.Assertions.assertThat; * @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 0000000000..e7b096cfcc --- /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 09a70d9579..0000000000 --- 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 0000000000..5079c8f8a0 --- /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 7aef1489a8..0000000000 --- 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 0000000000..08d55bdb6c --- /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 4b9acb73d4..0000000000 --- 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 0000000000..befc755c95 --- /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 1be0cce0f2..0000000000 --- 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 0000000000..a526875314 --- /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 be279b47f7..0000000000 --- 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 0000000000..0af2b289b4 --- /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 bf42c11505..0000000000 --- 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 0000000000..1296d950eb --- /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 6596725af7..0000000000 --- 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 0000000000..dc133506d3 --- /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 4c3dcf6e74..0000000000 --- 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 0000000000..5a509586ca --- /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 290e34877a..0000000000 --- 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 0000000000..5079cdb18e --- /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 b383378db9..0000000000 --- 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 0000000000..259deb0cdd --- /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 1d98da2480..0000000000 --- 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 0000000000..4aaafa2627 --- /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 acaceaa052..0000000000 --- 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 0000000000..6153f7d148 --- /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 4e37f23b7d..0000000000 --- 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 0000000000..00bb73374d --- /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 14b8eed03b..0000000000 --- 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 0000000000..38a45ceeae --- /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 2cdd189e06..0000000000 --- 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 0000000000..6c37b1940c --- /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 23c5128793..0000000000 --- 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 0000000000..36752d7f4b --- /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 026ed3c5d1..0000000000 --- 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 0000000000..bececbfb5d --- /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 e7eb246205..0000000000 --- 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 0000000000..c9303314ef --- /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 a7396bfd16..0000000000 --- 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 0000000000..75a3810821 --- /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 92f01fbcef..0000000000 --- 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 0000000000..3de88c8ed9 --- /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 ca75ff62fe..0000000000 --- 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 0000000000..1adb130385 --- /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 1c03905144..0000000000 --- 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 0000000000..36f289fc46 --- /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 fed614e0c8..0000000000 --- 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 0000000000..4d6e98bd4a --- /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 cf44c04ed7..0000000000 --- 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 0000000000..86c2cc77cb --- /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 d4a9abb4d9..0000000000 --- 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 1f7a85c547..8361ff02ee 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 22449bf754..e759f663af 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" />