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

Springboot 打包部署

时间:2020-01-11 09:27:20      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:ati   XML   des   ram   prope   col   compile   snapshot   bsp   

 

  1. 先打成war包或者jar包
  2. 使用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 打包部署

标签:ati   XML   des   ram   prope   col   compile   snapshot   bsp   

原文地址:https://www.cnblogs.com/royal6/p/12178899.html

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