我想在/ info中访问我的提交信息。事实是,它可以在IDE中工作,但是在打包工件时似乎出现了问题,文件META-INF/build-info.properties
没有打包到jar中!有什么提示吗?
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-info</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
<configuration>
<additionalProperties>
<number>${buildNumber}</number>
<job>${buildJob}</job>
</additionalProperties>
</configuration>
</plugin>
答案 0 :(得分:0)
从执行中删除<phase>package</phase>
,现在执行mvn clean install
。它应该生成META-INF/build-info.properties
文件
答案 1 :(得分:0)
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<configuration>
<mainClass>${start-class}</mainClass>
<executable>true</executable>
</configuration>
<executions>
<execution>
<goals>
<goal>build-info</goal>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>