IDEA spring boot项目插件打包方式jar
一、打包
1.pom.xml中添加插件依赖
<build>
<plugins>
<plugin>
<!--打包成可执行jar-->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<mainClass>com.btw.wydz.WydzApplication</mainClass> <!--此处修改自己项目的启动类-->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
<resources>
<!-- 打包时将jsp文件拷贝到META-INF目录下-->
<resource>
<!-- 项目中要处理的目录-->
<!-- 指定resources插件处理哪个目录下的资源文件 -->
<directory>src/main/webapp</directory>
<!-- 打包之后要放在什么位置-->
<!--注意此次必须要放在此目录下才能被访问到-->
<targetPath>META-INF/resources</targetPath>
<includes>
<include>**/**</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>
2.双击package进行打包

3.当出现build success时,说明打包成功

4.找到target下打包生成的jar包,右键选择Show in Exporer

二、运行
方法一、在弹出的文件夹下按“Shift+鼠标右键”,选择“在此处打开Powershell窗口”,输入: java -jar wydz-0.0.1-SNAPSHOT.jar,(橙色部分修改为自己打包后的jar文件名),即可启动该spring boot项目

方法二、新建一个文件夹,放入jar包。再新建一个run.bat文件,输入:start java -jar wydz-0.0.1-SNAPSHOT.jar,(橙色部分修改为自己打包后的jar文件名)。运行该spring boot项目时直接双击run.bat文件即可。

IDEA spring boot项目插件打包方式jar的更多相关文章
- 将 Spring boot 项目打成可执行Jar包,及相关注意事项(main-class、缺少 xsd、重复打包依赖)
最近在看 spring boot 的东西,觉得很方便,很好用.对于一个简单的REST服务,都不要自己部署Tomcat了,直接在 IDE 里 run 一个包含 main 函数的主类就可以了. 但是,转念 ...
- spring boot项目Intellij 打包
spring boot项目Intellij 打包 学习了:http://blog.csdn.net/hzt_fighting_up/article/details/78174291 在edit con ...
- Spring Boot项目的打包和部署
补充一点:搜索了下别人Spring Boot部署方案,大多都说:①packaging设为war:②要添加Spring Boot的tomcat依赖:③修改output路径,但是使用STS新建Spring ...
- Spring boot 项目导出可执行jar
配置文件中添加插件 <plugin> <groupId>org.springframework.boot</groupId> <artifactId>s ...
- Spring boot项目的打包发布
Eclipse打包发布项目 打包项目 首先需要将项目编译的文件删除,执行[Run As]->[Maven clean] 如果这个时候项目报错,在pom.xml文件中添加以下代码过滤掉单元测试 & ...
- Spring Boot 使用maven打包成jar
1.application.properties加入如下配置 server.port= 2.修改pom.xml <?xml version="1.0" encoding=&q ...
- spring boot项目maven打包可执行JAR
在pom.xml中添加如下配置: <!-- 打包可执行jar包 --> <plugin> <groupId>org.springframework.boot< ...
- spring boot项目编译出来的jar包如何更改端口号
执行的时候更改端口即可 . java -Dserver.port=9999 -jar boot.jar
- meavn项目由打包方式jar改为war报Cannot install Dynamic Web Module 2.5 facet. It is incompatibile with already installed facets: Utility Module. Please modify project configuration.处理方式
找到 \项目名\.setting\文件夹下的 org.eclipse.wst.common.project.facet.core.xml xml文件. 添加或修改 <installed ...
随机推荐
- The Different of Python 2.x and 3.x
为了不给Python3.0带入过多的累赘,Python 3.x没有考虑向下兼容 1,print 函数 print语句没有了,取而代之的是print()函数. Python2.7 print " ...
- 1shell变量的作用域
Shell 局部变量 Shell 全局变量 shell全局变量的易错点 linux shell中./a.sh , sh a.sh , source a.sh, . ./a.sh的区别 Shell 环境 ...
- 【转载】每天一个linux命令(11):nl命令
转载至:http://www.cnblogs.com/peida/archive/2012/11/01/2749048.html nl命令在linux系统中用来计算文件中行号.nl 可以将输出的文件内 ...
- buu signin
一.拖入ida,来静态分析F5大法好 要注意的点: 1._gmz_init_set_str() 这个函数,也是看师傅的wp,学到的,以后还是得多google, 本质上是这个函数: int mpz_in ...
- SECURECRT 连接锐捷交换机CONSOLE
协议选择Serial,端口选择COM1.波特率设置为9600.RTS/CTS要把勾去掉(关闭流控功能)
- C语言:伪代码
伪代码(Pseudocode)是一种算法描述语言.使用伪代码的目的是为了使被描述的算法可以容易地以任何一种编程语言(C, Java, Pascal)实现.因此,伪代码必须结构清晰,代码简单,可读性好, ...
- 国产深度学习框架mindspore-1.3.0 gpu版本无法进行源码编译
官网地址: https://www.mindspore.cn/install 所有依赖环境 进行sudo make install 安装,最终报错: 错误记录信息: cat /tmp/mind ...
- 开源百宝箱《HelloGitHub》第 64 期
兴趣是最好的老师,HelloGitHub 让你对编程感兴趣! 简介 分享 GitHub 上有趣.入门级的开源项目. HelloGitHub 有实战.教程.黑科技.开源书籍.企业级开源项目,涵盖多种编程 ...
- Bootstrap框架--DataTables列表示例--添加判断
一.参考代码 <%@ include file="./include/header.jsp"%> <!-- jquery.dataTables.css --> ...
- 前端基础div(六)
实例 文档中的一个部分会显示为绿色: <div style="color:#00FF00"> <h3>This is a header</h3> ...