Port the build to Gradle
Closes gh-19609 Closes gh-19608
This commit is contained in:
@@ -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}')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,297 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../../spring-boot-dependencies</relativePath>
|
||||
</parent>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Spring Boot Starter Parent</name>
|
||||
<description>Parent pom providing dependency and plugin management for applications
|
||||
built with Maven</description>
|
||||
<properties>
|
||||
<main.basedir>${basedir}/../../..</main.basedir>
|
||||
<java.version>1.8</java.version>
|
||||
<resource.delimiter>@</resource.delimiter> <!-- delimiter that doesn't clash with Spring ${} placeholders -->
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
</properties>
|
||||
<build>
|
||||
<!-- Turn on filtering by default for application properties -->
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${basedir}/src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>**/application*.yml</include>
|
||||
<include>**/application*.yaml</include>
|
||||
<include>**/application*.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${basedir}/src/main/resources</directory>
|
||||
<excludes>
|
||||
<exclude>**/application*.yml</exclude>
|
||||
<exclude>**/application*.yaml</exclude>
|
||||
<exclude>**/application*.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<!-- Apply more sensible defaults for user projects -->
|
||||
<plugin>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
<configuration>
|
||||
<jvmTarget>${java.version}</jvmTarget>
|
||||
<javaParameters>true</javaParameters>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>compile</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-compile</id>
|
||||
<phase>test-compile</phase>
|
||||
<goals>
|
||||
<goal>test-compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<parameters>true</parameters>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>integration-test</goal>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>${start-class}</mainClass>
|
||||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>${start-class}</mainClass>
|
||||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<mainClass>${start-class}</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<configuration>
|
||||
<delimiters>
|
||||
<delimiter>${resource.delimiter}</delimiter>
|
||||
</delimiters>
|
||||
<useDefaultDelimiters>false</useDefaultDelimiters>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>pl.project13.maven</groupId>
|
||||
<artifactId>git-commit-id-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>revision</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<verbose>true</verbose>
|
||||
<dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
|
||||
<generateGitPropertiesFile>true</generateGitPropertiesFile>
|
||||
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Support our own plugin -->
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>repackage</id>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<mainClass>${start-class}</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Support shade packaging (if the user does not want to use our plugin) -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<configuration>
|
||||
<keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
|
||||
<createDependencyReducedPom>true</createDependencyReducedPom>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<transformers>
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/spring.handlers</resource>
|
||||
</transformer>
|
||||
<transformer
|
||||
implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
|
||||
<resource>META-INF/spring.factories</resource>
|
||||
</transformer>
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/spring.schemas</resource>
|
||||
</transformer>
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>${start-class}</mainClass>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>flatten-maven-plugin</artifactId>
|
||||
<inherited>false</inherited>
|
||||
<executions>
|
||||
<execution>
|
||||
<!-- Flatten and simplify our own POM for install/deploy -->
|
||||
<id>flatten</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>flatten</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<updatePomFile>true</updatePomFile>
|
||||
<pomElements>
|
||||
<parent>expand</parent>
|
||||
<name>keep</name>
|
||||
<description>keep</description>
|
||||
<url>expand</url>
|
||||
<properties>keep</properties>
|
||||
<pluginManagement>keep</pluginManagement>
|
||||
<dependencyManagement>keep</dependencyManagement>
|
||||
<build>keep</build>
|
||||
</pomElements>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>flatten-clean</id>
|
||||
<phase>clean</phase>
|
||||
<goals>
|
||||
<goal>clean</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>xml-maven-plugin</artifactId>
|
||||
<inherited>false</inherited>
|
||||
<executions>
|
||||
<execution>
|
||||
<!-- Cleanup the flattened project POM -->
|
||||
<id>post-process-flattened-pom</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>transform</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<transformationSets>
|
||||
<transformationSet>
|
||||
<dir>${project.basedir}</dir>
|
||||
<outputDir>${project.basedir}</outputDir>
|
||||
<includes>.flattened-pom.xml</includes>
|
||||
<stylesheet>src/main/xslt/post-process-flattened-pom.xsl</stylesheet>
|
||||
<outputProperties>
|
||||
<outputProperty>
|
||||
<name>indent</name>
|
||||
<value>yes</value>
|
||||
</outputProperty>
|
||||
</outputProperties>
|
||||
</transformationSet>
|
||||
</transformationSets>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
Reference in New Issue
Block a user