springboot-jar

1、pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.9.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.ebc</groupId>
<artifactId>demo</artifactId>
<version>1.0</version>
<name>demo</name> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency> <dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency> <dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.6.4</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.60</version>
</dependency>
</dependencies> <build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build> </project>
2、application.yml
spring:
profiles:
active: dev
application-dev.yml
server:
port: 8081
spring:
devtools:
restart:
enabled: true
3、DemoApplication
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication
public class DemoApplication { public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
} }
4、DemoApplicationTests
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class)
@SpringBootTest
public class DemoApplicationTests { @Test
public void contextLoads() {
} }
springboot-jar的更多相关文章
- XJar: Spring-Boot JAR 包加/解密工具,避免源码泄露以及反编译
XJar: Spring-Boot JAR 包加/解密工具,避免源码泄露以及反编译 <?xml version="1.0" encoding="UTF-8" ...
- Linux下 SpringBoot jar项目后台运行、查看、停用
运行java jar: nohup java -jar **-0.0.1-SNAPSHOT.jar & 查看进程: 采用top或者ps aux命令.一般 如果后台是springboot,jar ...
- linux环境下,springboot jar启动方式
linux环境下,springboot jar启动方式 一.前台启动(ctrl+c会关掉进程) java -jar application.jar 二.后台启动(ctrl+c不会关闭) java -j ...
- 解决SpringBoot jar包太大的问题
转载 2017年09月18日 09:21:53 577 SpringBoot的web应用一般都添加了spring-boot-maven-plugin插件. Maven xml代码 <buil ...
- Linux编辑启动停止重启springboot jar包脚本
springboot的配置文件中,配置文件的名字都有各自的意义跟用途 dev 开发环境 prod 生产环境(默认) test 测试环境 加载指定配置文件 --spring.profiles.activ ...
- linux下SpringBoot Jar包自启脚本配置
今天整理服务器上SpringBoot项目发现是自启的,于是想看看实现.翻看离职同事的交接文档发现一个***.service文件内容如下 [Unit] Description=sgfront After ...
- 170803、springboot jar包启动提示没有主清单属性
问题:SpringBoot打包成jar后运行提示没有主清单属性 解决: 补全maven中的bulid信息 <plugin> <groupId>org.springframewo ...
- SpringBoot jar包不支持jsp
官方原文如下: When running a Spring Boot application that uses an embedded servlet container (and is packa ...
- 使用winsw将spring-boot jar包注册成windows服务
背景:最近的项目中使用spring-boot, https://github.com/kohsuke/winsw/releases <service> <id>YJPSS< ...
- 彻底透析SpringBoot jar可执行原理
文章篇幅较长,但是包含了SpringBoot 可执行jar包从头到尾的原理,请读者耐心观看.同时文章是基于SpringBoot-2.1.3进行分析.涉及的知识点主要包括Maven的生命周期以及自定 ...
随机推荐
- 使用Ghidra分析phpStudy后门
一.工具和平台 主要工具: Kali Linux Ghidra 9.0.4 010Editor 9.0.2 样本环境: Windows7 phpStudy 20180211 二 .分析过程 先在 Wi ...
- python format使用方法
#使用format 方法进行格式化 print("The number {1:} in hex is: {1:#x}, the number {0:} in oct is {0:o}&quo ...
- 微信小程序—添加背景音乐
问题: 想在打开小程序时就自动播放背景音乐(循环) 解决方法: 1.思路:写一个函数,在 onLoad()中调用 2. //index.js //获取应用实例 const back = wx.get ...
- 051、Java中使用while循环实现1~100的累加
01.代码如下: package TIANPAN; /** * 此处为文档注释 * * @author 田攀 微信382477247 */ public class TestDemo { public ...
- 解决datagridview 横向的scrollbar不显示
下午遇到这个问题.看到了网上各种解决办法.都没搞定. 新建了一个datagridview.发现是没问题了.仔细对比了一下它们的属性. 在Columns的属性中,有一项:Frozen, 把这个值改顺默认 ...
- Netty 模型
Demo代码 使用Maven的话请在pom.xml中注入netty依赖 <!-- https://mvnrepository.com/artifact/io.netty/netty-all -- ...
- redis改配置
命令行: 暂时生效,适合于做测试,或者线上马上服务修改,重启失效 CONFIG set stop-writes-on-bgsave-error no OK CONFIG get stop-writes ...
- python --- 日志模块 logging
1.日志的使用 import logging class CommonLog(object): def _common_log(self,level,message): # 设定收集器,再设定收集的级 ...
- 51nod 1423:最大二“货”
1423 最大二"货" 题目来源: CodeForces 基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 取消关注 白克喜欢找一个序列 ...
- cf749 D. Leaving Auction
#include<bits/stdc++.h> #define lowbit(x) x&(-x) #define LL long long #define N 200005 #de ...