简体   繁体   中英

how to compile spring-boot-maven-plugin without version number?

I am trying to generate spring boot executable jar

        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <executable>true</executable>
            </configuration>
        </plugin>

And I am getting files like this one "auth_service-0.0.1-SNAPSHOT.jar", but I need to get "auth_service.jar", how can I do this?

The reference documentation for Spring Boot's Maven plugin contains an example of how to do this:

If you need the repackaged jar to have a different local name than the one defined by the artifactId attribute of the project, simply use the standard finalName as shown in the following example:

 <project> ... <build> <finalName>my-app</finalName> <plugins> ... <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>2.2.3.RELEASE</version> <executions> <execution> <id>repackage</id> <goals> <goal>repackage</goal> </goals> </execution> </executions> ... </plugin> ... </plugins> ... </build> ... </project>

This configuration will generate the repackaged artifact in target/my-app.jar .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM