Gradle 如何打包 Spring Boot 如何不添加版本代码

在 Gradle 中如何在打包的 Jar 中不包含版本代码?


在 bootJar 中,使用下面的代码进行打包不包含版本代码。

archiveFileName = "${archiveBaseName.get()}.${archiveExtension.get()}"

上面的代码将不会打包版本号码

完整的代码如下:

bootJar {
    archiveFileName = "${archiveBaseName.get()}.${archiveExtension.get()}"
}

原文地址:https://www.cnblogs.com/huyuchengus/p/11697800.html

时间: 2024-07-30 09:24:32

Gradle 如何打包 Spring Boot 如何不添加版本代码的相关文章

Maven使用package打包Spring Boot时出现:Unable to find a single main class from the following candidates的问题解决

问题如下: [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.5.RELEASE:repackage (default) on project information: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.3.5.RELEASE:repackage faile

maven 打包 spring boot 生成docker 镜像

1.所使用材料 ,spring boot 项目 基于maven ,maven 工具, docker工具 ps:为啥使用 docker 公司微服务需要启动太多,有两个优点吧! 1.方便管理,2.减少服务占用内存量 2.上手 a.新建Dockerfile文件如下目录 b.Dockerfile文件内容 FROM openjdk:8-jdk-alpine VOLUME /tmp ARG JAR_FILE COPY ${JAR_FILE} app.jar ENTRYPOINT ["java",&

打包Spring Boot工程

在intellij idea 中,需要在maven中 新建 Run configuration,对应的command-line 为 :clean install spring-boot:repackage Pom.xml代码 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoca

spring boot 2.0添加对fastjson的支持

首先引入fastjson的maven依赖: <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.31</version> </dependency> 然后添加一个配置类: package com.boot.demo; import com.alibaba.fastjson.seria

spring boot 拦截器添加

@Configuration public class WebMvcConfig extends WebMvcConfigurerAdapter { @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new YourInterceptor()).addPathPatterns("/xx/**")//要拦截的请求 .excludePathPattern

spring boot 启动类 添加组件

@SpringBootApplication @EnableEurekaClient @EnableCircuitBreaker @ServletComponentScan public class SaleApp { @Bean @LoadBalanced public RestTemplate getRestTemplate() { return new RestTemplate(); } public static void main(String[] args) { new Spring

spring boot 1.5.6版本整合LCN5.0

最新在更新LCN,由4.0更新到了5.0,这里说说更新遇到的问题,官方在5.0.1版本开始兼容了springboot1.5版本,但是整合的时候还是需要注意一些问题. 1.maven的引包需要改变,本人使用的是最新的5.0.2版本 <-- 下面两个包的版本号最好与springboot版本一致,在txlcn-tc中,引入了这两个包,并且版本号为2.0.5,该操作用于覆盖2.0.5版本的包 --> <dependency> <groupId>org.springframewo

gradle多渠道打包及友盟统计-eclipse版本

亲自测试!! 遇到问题: 1.找不到签名文件的位置 解决方法: 确定后缀为keystore http://www.mamicode.com/info-detail-494186.html

spring boot 添加拦截器

构建一个spring boot项目. 添加拦截器需要添加一个configuration @Configuration @ComponentScan(basePackageClasses = Application.class, useDefaultFilters = true) public class ServletContextConfig extends WebMvcConfigurationSupport { 为了方便扫描位置,我们可以写一个接口或者入口类Application放置于最外