demo-tomcat/pom.xml

168 lines
5.1 KiB
XML
Raw Normal View History

2024-07-31 12:06:16 +08:00
<?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>
2024-07-31 22:01:30 +08:00
<maven.build.timestamp.format>yyyyMMdd-HHmmss</maven.build.timestamp.format>
2024-07-31 12:06:16 +08:00
</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>
2024-07-31 22:01:30 +08:00
<executions>
<execution>
<goals>
<goal>build-info</goal>
</goals>
<configuration>
<additionalProperties>
2024-08-01 08:13:31 +08:00
<buildNumber>${buildNumber}</buildNumber>
2024-07-31 22:01:30 +08:00
<java.version>${java.version}</java.version>
</additionalProperties>
</configuration>
</execution>
</executions>
2024-07-31 12:06:16 +08:00
</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>
2024-07-31 22:01:30 +08:00
<name>buildNumber</name>
2024-07-31 12:06:16 +08:00
<pattern>yyyyMMdd-HHmmss</pattern>
2024-08-01 08:13:31 +08:00
<timeZone>GMT+8</timeZone>
2024-07-31 12:06:16 +08:00
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
2024-07-31 22:01:30 +08:00
<profiles>
2024-08-01 08:13:31 +08:00
<profile>
<id>buildNumber</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<finalName>${project.artifactId}##${buildNumber}</finalName>
</build>
</profile>
2024-07-31 22:01:30 +08:00
<profile>
<id>build-docker-image</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
2024-08-01 08:13:31 +08:00
<finalName>${project.artifactId}</finalName>
2024-07-31 22:01:30 +08:00
<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>
2024-08-01 08:13:31 +08:00
<tag>${project.version}-${buildNumber}</tag>
2024-07-31 22:01:30 +08:00
<tag>latest</tag>
</tags>
<auth>
<username>publisher</username>
<password>83204585</password>
</auth>
</to>
</configuration>
<executions>
<execution>
2024-08-01 08:13:31 +08:00
<phase>package</phase>
2024-07-31 22:01:30 +08:00
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
2024-07-31 12:06:16 +08:00
</project>