简体   繁体   English

如何在没有版本号的情况下编译 spring-boot-maven-plugin?

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

I am trying to generate spring boot executable jar我正在尝试生成 spring boot 可执行 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?我得到了这样的文件“auth_service-0.0.1-SNAPSHOT.jar”,但我需要得到“auth_service.jar”,我该怎么做?

The reference documentation for Spring Boot's Maven plugin contains an example of how to do this: Spring Boot 的 Maven 插件的参考文档包含如何执行此操作的示例

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:如果您需要重新打包的 jar 具有与项目的 artifactId 属性定义的本地名称不同的本地名称,只需使用标准的finalName ,如下例所示:

 <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 .此配置将在target/my-app.jar生成重新打包的工件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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