Springboot打包部署代码怎么写

这篇文章给大家介绍Springboot打包部署代码怎么写,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

创新互联公司专注于企业全网营销推广、网站重做改版、城关网站定制设计、自适应品牌网站建设、H5场景定制商城网站建设、集团公司官网建设、成都外贸网站制作、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为城关等各大城市提供网站开发制作服务。

先打成war包或者jar包  使用java -jar test1-0.0.1-SNAPSHOT.jar 运行即可

常用依赖

<build>  <plugins>    <plugin>      <groupId>org.apache.maven.plugins</groupId>      <artifactId>maven-compiler-plugin</artifactId>      <configuration>        <source>1.8</source>        <target>1.8</target>        <encoding>utf-8</encoding>      </configuration>    </plugin>    <plugin>      <groupId>org.springframework.boot</groupId>      <artifactId>spring-boot-maven-plugin</artifactId>      <configuration>        <mainClass>com.royal.app.App</mainClass>      </configuration>      <executions>        <execution>          <goals>            <goal>repackage</goal>          </goals>        </execution>      </executions>    </plugin>  </plugins>    <resources>   <resource>    <directory>src/main/java</directory>    <includes>     <include>**/*.xml</include>    </includes>   </resource>   <resource>    <directory>src/main/resources</directory>    <includes>     <include>**/*.*</include>    </includes>   </resource>  </resources></build>

或使用如下代码指定jdk版本

<properties>  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  <maven.compiler.source>1.8</maven.compiler.source>  <maven.compiler.target>1.8</maven.compiler.target> </properties>

关于Springboot打包部署代码怎么写就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

分享标题:Springboot打包部署代码怎么写
URL分享:https://www.cdcxhl.com/article14/ghcgge.html

成都网站建设公司_创新互联,为您提供建站公司云服务器企业网站制作网站改版全网营销推广

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

手机网站建设