print buildNumber
This commit is contained in:
parent
f6578802ff
commit
ae89854b88
20
pom.xml
20
pom.xml
|
@ -51,7 +51,6 @@
|
|||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}##${buildNumber}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -63,7 +62,7 @@
|
|||
</goals>
|
||||
<configuration>
|
||||
<additionalProperties>
|
||||
<build.timestamp>${buildNumber}</build.timestamp>
|
||||
<buildNumber>${buildNumber}</buildNumber>
|
||||
<java.version>${java.version}</java.version>
|
||||
</additionalProperties>
|
||||
</configuration>
|
||||
|
@ -100,7 +99,7 @@
|
|||
<configuration>
|
||||
<name>buildNumber</name>
|
||||
<pattern>yyyyMMdd-HHmmss</pattern>
|
||||
<timeZone>GMT+08:00</timeZone>
|
||||
<timeZone>GMT+8</timeZone>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
@ -109,12 +108,23 @@
|
|||
</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>
|
||||
|
@ -131,7 +141,7 @@
|
|||
<to>
|
||||
<image>svn.youshengyun.com:9923/${project.artifactId}-jib</image>
|
||||
<tags>
|
||||
<tag>${project.version}</tag>
|
||||
<tag>${project.version}-${buildNumber}</tag>
|
||||
<tag>latest</tag>
|
||||
</tags>
|
||||
<auth>
|
||||
|
@ -142,7 +152,7 @@
|
|||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>install</phase>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
</goals>
|
||||
|
|
|
@ -14,6 +14,6 @@ public class MainController {
|
|||
|
||||
@GetMapping({ "", "/" })
|
||||
public String index(HttpServletRequest request) {
|
||||
return "hello demo-tomcat " + buildProperties.get("build.timestamp");
|
||||
return "hello demo-tomcat! buildNumber = " + buildProperties.get("buildNumber");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue