码迷,mamicode.com
首页 > 编程语言 > 详细

spingboot打jar包

时间:2018-11-23 23:27:58      阅读:207      评论:0      收藏:0      [点我收藏+]

标签:als   ram   cat   add   beta   xml文件   jar   XML   pom.xml文件   

pom.xml文件中packaging为jar

    <packaging>jar</packaging>  

安装插件

<plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <fork>true</fork>
                    <mainClass>com.ysusoft.nowidwatcher.NowidwatcherApplication</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.2-beta-5</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <!--<mainClass>com.bms.Main.Main</mainClass>-->
                            <mainClass>com.ysusoft.nowidwatcher.NowidwatcherApplication</mainClass>
                        </manifest>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
                <executions>
                    <execution>
                        <id>assemble-all</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

用idea开发工具,点击右侧【maven project】先clean,然后再package,就会把jar包打进target目录中

 技术分享图片

 

spingboot打jar包

标签:als   ram   cat   add   beta   xml文件   jar   XML   pom.xml文件   

原文地址:https://www.cnblogs.com/javaddd/p/10010084.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!