spring-boot分环境打包为jar包
1.pom配置
<!-- 多环境打包 start -->
<profiles>
<!-- 开发环境配置 -->
<profile>
<id>dev</id>
<properties>
<profiles.active>dev</profiles.active>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<!-- 测试环境配置 -->
<profile>
<id>test</id>
<properties>
<profiles.active>test</profiles.active>
</properties>
</profile>
<!-- 正式环境 -->
<profile>
<id>online</id>
<properties>
<profiles.active>online</profiles.active>
</properties>
</profile>
</profiles>
<!-- 多环境打包 end --> <build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.class</include>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>*.xml</include>
<include>*.properties</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources/conf/${profiles.active}</directory>
</resource>
</resources>
</build>
2.打包命令
mvn clean package -Dmaven.test.skip=true -Ptest
3.启动命令
nohup java -jar demo.jar > /dev/null 2>&1 &
spring-boot分环境打包为jar包的更多相关文章
- 将 Spring boot 项目打成可执行Jar包,及相关注意事项(main-class、缺少 xsd、重复打包依赖)
最近在看 spring boot 的东西,觉得很方便,很好用.对于一个简单的REST服务,都不要自己部署Tomcat了,直接在 IDE 里 run 一个包含 main 函数的主类就可以了. 但是,转念 ...
- spring boot mybatis 打成可执行jar包后启动UnsatisfiedDependencyException异常
我的spring boot + mybatis项目在idea里面执行正常,但发布测试环境打成可执行jar包后就启动失败,提示错误如下: [ ERROR] [2018-08-30 17:23:48] o ...
- Spring boot 分环境部署
一.如果配置文件为:application.properties时 1.application.properties用于填些公共文件 以下为不同环境的配置文件需要单独配置 application-de ...
- spring boot:多模块项目生成jar包(spring boot 2.3.3)
一,多模块项目的优点: 1,为什么要使用多模块项目? 相比传统的单体工程,使用Maven的多模块配置, 有如下优点: 帮助项目划分模块,鼓励重用, 防止POM变得过于庞大, 方便某个模块的构建,而不用 ...
- IDEA spring boot项目插件打包方式jar
一.打包 1.pom.xml中添加插件依赖 <build> <plugins> <plugin> <!--打包成可执行jar--> <groupI ...
- Spring Boot 使用maven打包成jar
1.application.properties加入如下配置 server.port= 2.修改pom.xml <?xml version="1.0" encoding=&q ...
- spring-boot分环境打包为war包
1.启动类修改 @EnableSwagger2 @SpringBootApplication public class CustWebAcApplication extends SpringBootS ...
- spring Boot打可执行的jar包
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://mave ...
- spring-boot分环境打包为tar包
1.pom配置 <!-- 多环境打包 start --> <profiles> <!-- 开发环境配置 --> <profile> <id> ...
随机推荐
- 服务器安全策略之《启用Windows 防火墙情况下配置允许SQL Server远程连接》
为了服务器的安全,通常情况下我们需要启用Windows 防火墙,然而在启用了Windows 防火墙后会发现会引发一系列的问题,比如无法通过本地远程服务器桌面.无法在本地远程连接SQL Server等, ...
- The Difference Between Big Data and a Lot of Data
The Difference Between Big Data and a Lot of Data The term “big data” has been around for a while no ...
- Table of Contents - Python 2.x
异常 异常类的继承关系 日志 标准日志模块 Hello World Logging Configuration
- PHP 神盾解密工具
前两天分析了神盾的解密过程所用到的知识点,昨晚我把工具整理了下,顺便用神盾加密了.这都是昨天说好的,下面看下调用方法吧. 先下载 decryption.zip然后解压放到一个文件夹里,把你要解密的文件 ...
- soj1001. Alphacode
1001. Alphacode Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description Alice and Bob need t ...
- c++刷题(9/100):链表
题目一:https://www.nowcoder.com/practice/d0267f7f55b3412ba93bd35cfa8e8035?tpId=13&tqId=11156&tP ...
- php empty()与isset()
empty() : 检查一个变量是否为空. 判断一个变量是否被认为是空的.当一个变量并不存在,或者它的值等同于FALSE,那么它会被认为不存在.如果变量不存在的话,empty()并不会产生警告. em ...
- python之追溯函数调用及错误日志详细打印
一.函数调用追溯 1.1 原因 在打印日志时,为实现日志分层打印,将打印日志的语句封装到了print_log_info以及print_log_error中.但是如果在上述函数中直接通过logger.* ...
- 如何更方便的查看Linux内核代码的更新记录【转】
转自:http://blog.csdn.net/lee244868149/article/details/44302819 Linux内核的更新非常的快,如何快速的了解这些更新呢?最一般的办法就是把新 ...
- 使用Netcat进行攻击
https://www.freebuf.com/column/135007.html 在网上找到了一个开启了ftp服务的服务: http://static.vhdong.com/Upload/Temp ...