You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
372 lines
11 KiB
372 lines
11 KiB
/* |
|
* Copyright 2012-present the original author or authors. |
|
* |
|
* Licensed under the Apache License, Version 2.0 (the License); |
|
* you may not use this file except in compliance with the License. |
|
* You may obtain a copy of the License at |
|
* |
|
* https://www.apache.org/licenses/LICENSE-2.0 |
|
* |
|
* Unless required by applicable law or agreed to in writing, software |
|
* distributed under the License is distributed on an "AS IS" BASIS, |
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
* See the License for the specific language governing permissions and |
|
* limitations under the License. |
|
*/ |
|
|
|
plugins { |
|
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"('17') |
|
delegate."resource.delimiter"('@') |
|
delegate."maven.compiler.release"('${java.version}') |
|
delegate."project.build.sourceEncoding"('UTF-8') |
|
delegate."project.reporting.outputEncoding"('UTF-8') |
|
delegate."spring-boot.run.main-class"('${start-class}') |
|
} |
|
} |
|
root.scm.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.apache.maven.plugins') |
|
delegate.artifactId('maven-resources-plugin') |
|
configuration { |
|
delegate.propertiesEncoding('${project.build.sourceEncoding}') |
|
delimiters { |
|
delegate.delimiter('${resource.delimiter}') |
|
} |
|
delegate.useDefaultDelimiters('false') |
|
} |
|
} |
|
plugin { |
|
delegate.groupId('org.graalvm.buildtools') |
|
delegate.artifactId('native-maven-plugin') |
|
delegate.extensions('true') |
|
} |
|
plugin { |
|
delegate.groupId('io.github.git-commit-id') |
|
delegate.artifactId('git-commit-id-maven-plugin') |
|
executions { |
|
execution { |
|
goals { |
|
delegate.goal('revision') |
|
} |
|
} |
|
} |
|
configuration { |
|
delegate.verbose('true') |
|
delegate.generateGitPropertiesFile('true') |
|
delegate.generateGitPropertiesFilename('${project.build.outputDirectory}/git.properties') |
|
} |
|
} |
|
plugin { |
|
delegate.groupId('org.cyclonedx') |
|
delegate.artifactId('cyclonedx-maven-plugin') |
|
executions { |
|
execution { |
|
delegate.phase('generate-resources') |
|
goals { |
|
delegate.goal('makeAggregateBom') |
|
} |
|
configuration { |
|
delegate.projectType('application') |
|
delegate.outputDirectory('${project.build.outputDirectory}/META-INF/sbom') |
|
delegate.outputFormat('json') |
|
delegate.outputName('application.cdx') |
|
} |
|
} |
|
} |
|
} |
|
plugin { |
|
delegate.groupId('org.springframework.boot') |
|
delegate.artifactId('spring-boot-maven-plugin') |
|
executions { |
|
execution { |
|
delegate.id('repackage') |
|
goals { |
|
delegate.goal('repackage') |
|
} |
|
} |
|
} |
|
configuration { |
|
delegate.mainClass('${spring-boot.run.main-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("${project.version}") |
|
} |
|
} |
|
executions { |
|
execution { |
|
delegate.phase('package') |
|
goals { |
|
delegate.goal('shade') |
|
} |
|
configuration { |
|
transformers { |
|
transformer(implementation: 'org.apache.maven.plugins.shade.resource.AppendingTransformer') { |
|
delegate.resource('META-INF/spring.handlers') |
|
} |
|
transformer(implementation: 'org.apache.maven.plugins.shade.resource.AppendingTransformer') { |
|
delegate.resource('META-INF/spring.schemas') |
|
} |
|
transformer(implementation: 'org.apache.maven.plugins.shade.resource.AppendingTransformer') { |
|
delegate.resource('META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports') |
|
} |
|
transformer(implementation: 'org.apache.maven.plugins.shade.resource.AppendingTransformer') { |
|
delegate.resource('META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports') |
|
} |
|
transformer(implementation: 'org.springframework.boot.maven.PropertiesMergingResourceTransformer') { |
|
delegate.resource('META-INF/spring.factories') |
|
} |
|
transformer(implementation: 'org.apache.maven.plugins.shade.resource.ServicesResourceTransformer') |
|
transformer(implementation: 'org.apache.maven.plugins.shade.resource.ManifestResourceTransformer') { |
|
delegate.mainClass('${start-class}') |
|
manifestEntries { |
|
delegate.'Multi-Release'('true') |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
profiles { |
|
profile { |
|
delegate.id("native") |
|
build { |
|
pluginManagement { |
|
plugins { |
|
plugin { |
|
delegate.groupId('org.apache.maven.plugins') |
|
delegate.artifactId('maven-jar-plugin') |
|
configuration { |
|
archive { |
|
manifestEntries { |
|
delegate.'Spring-Boot-Native-Processed'("true") |
|
} |
|
} |
|
} |
|
} |
|
plugin { |
|
delegate.groupId('org.springframework.boot') |
|
delegate.artifactId('spring-boot-maven-plugin') |
|
executions { |
|
execution { |
|
delegate.id('process-aot') |
|
goals { |
|
delegate.goal('process-aot') |
|
} |
|
} |
|
} |
|
} |
|
plugin { |
|
delegate.groupId('org.graalvm.buildtools') |
|
delegate.artifactId('native-maven-plugin') |
|
configuration { |
|
delegate.classesDirectory('${project.build.outputDirectory}') |
|
exclusions { |
|
exclusion { |
|
delegate.groupId('org.springframework.boot') |
|
delegate.artifactId('spring-boot-devtools') |
|
} |
|
} |
|
} |
|
executions { |
|
execution { |
|
delegate.id('add-reachability-metadata') |
|
goals { |
|
delegate.goal('add-reachability-metadata') |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
profile { |
|
delegate.id("nativeTest") |
|
delegate.dependencies { |
|
dependency { |
|
delegate.groupId('org.junit.platform') |
|
delegate.artifactId('junit-platform-launcher') |
|
delegate.scope('test') |
|
} |
|
} |
|
build { |
|
pluginManagement { |
|
plugins { |
|
plugin { |
|
delegate.groupId('org.springframework.boot') |
|
delegate.artifactId('spring-boot-maven-plugin') |
|
executions { |
|
execution { |
|
delegate.id('process-test-aot') |
|
goals { |
|
delegate.goal('process-test-aot') |
|
} |
|
} |
|
} |
|
} |
|
plugin { |
|
delegate.groupId('org.graalvm.buildtools') |
|
delegate.artifactId('native-maven-plugin') |
|
configuration { |
|
delegate.classesDirectory('${project.build.outputDirectory}') |
|
exclusions { |
|
exclusion { |
|
delegate.groupId('org.springframework.boot') |
|
delegate.artifactId('spring-boot-devtools') |
|
} |
|
} |
|
} |
|
executions { |
|
execution { |
|
delegate.id('native-test') |
|
goals { |
|
delegate.goal('test') |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}
|
|
|