168 lines
5.1 KiB
XML
168 lines
5.1 KiB
XML
<?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-starter-parent</artifactId>
|
|
<version>3.3.2</version>
|
|
<relativePath /> <!-- lookup parent from repository -->
|
|
</parent>
|
|
<groupId>com.example</groupId>
|
|
<artifactId>demo-tomcat</artifactId>
|
|
<version>1.0</version>
|
|
<packaging>war</packaging>
|
|
<name>demo-tomcat</name>
|
|
<description>Demo project for Spring Boot</description>
|
|
<url />
|
|
<licenses>
|
|
<license />
|
|
</licenses>
|
|
<developers>
|
|
<developer />
|
|
</developers>
|
|
<scm>
|
|
<connection />
|
|
<developerConnection />
|
|
<tag />
|
|
<url />
|
|
</scm>
|
|
<properties>
|
|
<java.version>21</java.version>
|
|
<maven.build.timestamp.format>yyyyMMdd-HHmmss</maven.build.timestamp.format>
|
|
</properties>
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-web</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-tomcat</artifactId>
|
|
<scope>provided</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-test</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
</dependencies>
|
|
|
|
<build>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<goals>
|
|
<goal>build-info</goal>
|
|
</goals>
|
|
<configuration>
|
|
<additionalProperties>
|
|
<buildNumber>${buildNumber}</buildNumber>
|
|
<java.version>${java.version}</java.version>
|
|
</additionalProperties>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<!--<plugin>
|
|
<groupId>org.codehaus.mojo</groupId>
|
|
<artifactId>buildnumber-maven-plugin</artifactId>
|
|
<version>3.2.0</version>
|
|
<executions>
|
|
<execution>
|
|
<goals>
|
|
<goal>create-timestamp</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
<configuration>
|
|
<timestampFormat>yyyy-MM-dd-HH-mm-ss</timestampFormat>
|
|
<timestampPropertyName>buildTime</timestampPropertyName>
|
|
<timezone>GMT+8</timezone>
|
|
</configuration>
|
|
</plugin>-->
|
|
|
|
<plugin>
|
|
<groupId>org.codehaus.mojo</groupId>
|
|
<artifactId>build-helper-maven-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>timestamp-property</id>
|
|
<goals>
|
|
<goal>timestamp-property</goal>
|
|
</goals>
|
|
<configuration>
|
|
<name>buildNumber</name>
|
|
<pattern>yyyyMMdd-HHmmss</pattern>
|
|
<timeZone>GMT+8</timeZone>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
|
|
<profiles>
|
|
<profile>
|
|
<id>buildNumber</id>
|
|
<activation>
|
|
<activeByDefault>true</activeByDefault>
|
|
</activation>
|
|
<build>
|
|
<finalName>${project.artifactId}##${buildNumber}</finalName>
|
|
</build>
|
|
</profile>
|
|
|
|
<profile>
|
|
<id>build-docker-image</id>
|
|
<activation>
|
|
<activeByDefault>false</activeByDefault>
|
|
</activation>
|
|
<build>
|
|
<finalName>${project.artifactId}</finalName>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>com.google.cloud.tools</groupId>
|
|
<artifactId>jib-maven-plugin</artifactId>
|
|
<version>3.4.3</version>
|
|
<configuration>
|
|
<skip>false</skip>
|
|
<from>
|
|
<image>tomcat:jdk21-temurin</image>
|
|
</from>
|
|
<container>
|
|
<appRoot>/usr/local/tomcat/webapps/${project.artifactId}</appRoot>
|
|
</container>
|
|
<to>
|
|
<image>svn.youshengyun.com:9923/${project.artifactId}-jib</image>
|
|
<tags>
|
|
<tag>${project.version}-${buildNumber}</tag>
|
|
<tag>latest</tag>
|
|
</tags>
|
|
<auth>
|
|
<username>publisher</username>
|
|
<password>83204585</password>
|
|
</auth>
|
|
</to>
|
|
</configuration>
|
|
<executions>
|
|
<execution>
|
|
<phase>package</phase>
|
|
<goals>
|
|
<goal>build</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
</profile>
|
|
</profiles>
|
|
|
|
</project>
|