Q:

Spring boot META-INF/build-info.properties not in artifact

I would like to access my commit info in /info. Thing is, it works in IDE but there seems to be a problem while packaging the artifact, the file META-INF/build-info.properties is not packaged into jar! Any hint why?
    <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>

A:

     <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>

A:

Remove <phase>package</phase> from your execution and now do a mvn clean install. It should generate META-INF/build-info.properties file

