最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Spring Boot創(chuàng)建非可執(zhí)行jar包的實(shí)例教程

 更新時(shí)間:2018年02月05日 16:32:07   作者:馬軍偉  
這篇文章主要介紹了Spring Boot創(chuàng)建非可執(zhí)行jar包的實(shí)例教程,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧

我們經(jīng)常會(huì)有這種場景,只需要把Spring Boot打成普通的jar包,不包含配置文件,供其他程序應(yīng)用

本文介紹如何使用Maven將Spring Boot應(yīng)用打成普通的非可執(zhí)行jar包。

配置maven-jar-plugin

<build>
  <plugins>
    <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <configuration>
        <classifier>exec</classifier>
      </configuration>
    </plugin>
    <plugin>
      <artifactId>maven-jar-plugin</artifactId>
      <executions>
        <execution>
          <id>exec</id>
          <phase>package</phase>
          <goals>
            <goal>jar</goal>
          </goals>
          <configuration>
            <classifier>exec</classifier>
          </configuration>
        </execution>
        <execution>
          <phase>package</phase>
          <goals>
            <goal>jar</goal>
          </goals>
          <configuration>
            <!-- Need this to ensure application.yml is excluded -->
            <forceCreation>true</forceCreation>
            <excludes>
              <exclude>application.yml</exclude>
            </excludes>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

執(zhí)行mvn clean package打包

localhost:spring-boot-tutorial-non-executable majunwei$ mvn clean package
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.majunwei:spring-boot-tutorial-non-executable:jar:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. @ com.majunwei:spring-boot-tutorial-non-executable:[unknown-version], /Users/majunwei/Documents/work/spring-boot-tutorial/spring-boot-tutorial-non-executable/pom.xml, line 26, column 17
[WARNING] 'build.plugins.plugin.version' for org.springframework.boot:spring-boot-maven-plugin is missing. @ com.majunwei:spring-boot-tutorial-non-executable:[unknown-version], /Users/majunwei/Documents/work/spring-boot-tutorial/spring-boot-tutorial-non-executable/pom.xml, line 19, column 17
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                     
[INFO] ------------------------------------------------------------------------
[INFO] Building spring-boot-tutorial-non-executable 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ spring-boot-tutorial-non-executable ---
[INFO] Deleting /Users/majunwei/Documents/work/spring-boot-tutorial/spring-boot-tutorial-non-executable/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ spring-boot-tutorial-non-executable ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ spring-boot-tutorial-non-executable ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/majunwei/Documents/work/spring-boot-tutorial/spring-boot-tutorial-non-executable/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ spring-boot-tutorial-non-executable ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/majunwei/Documents/work/spring-boot-tutorial/spring-boot-tutorial-non-executable/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ spring-boot-tutorial-non-executable ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ spring-boot-tutorial-non-executable ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ spring-boot-tutorial-non-executable ---
[INFO] Building jar: /Users/majunwei/Documents/work/spring-boot-tutorial/spring-boot-tutorial-non-executable/target/spring-boot-tutorial-non-executable-0.0.1-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (exec) @ spring-boot-tutorial-non-executable ---
[INFO] Building jar: /Users/majunwei/Documents/work/spring-boot-tutorial/spring-boot-tutorial-non-executable/target/spring-boot-tutorial-non-executable-0.0.1-SNAPSHOT-exec.jar
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default) @ spring-boot-tutorial-non-executable ---
[INFO] Building jar: /Users/majunwei/Documents/work/spring-boot-tutorial/spring-boot-tutorial-non-executable/target/spring-boot-tutorial-non-executable-0.0.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.692 s
[INFO] Finished at: 2017-08-07T18:22:50+08:00
[INFO] Final Memory: 17M/174M
[INFO] ------------------------------------------------------------------------

下載實(shí)例源碼

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • 關(guān)于Spring?Cloud的熔斷器監(jiān)控問題

    關(guān)于Spring?Cloud的熔斷器監(jiān)控問題

    Turbine是一個(gè)聚合Hystrix監(jiān)控?cái)?shù)據(jù)的工具,它可將所有相關(guān)/hystrix.stream端點(diǎn)的數(shù)據(jù)聚合到一個(gè)組合的/turbine.stream中,從而讓集群的監(jiān)控更加方便,接下來通過本文給大家介紹Spring?Cloud的熔斷器監(jiān)控,感興趣的朋友一起看看吧
    2022-01-01
  • Maven如何構(gòu)建可執(zhí)行的jar包(包含依賴jar包)

    Maven如何構(gòu)建可執(zhí)行的jar包(包含依賴jar包)

    這篇文章主要介紹了Maven如何構(gòu)建可執(zhí)行的jar包(包含依賴jar包) ,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-11-11
  • spring boot jar部署控制臺(tái)日志亂碼的解決

    spring boot jar部署控制臺(tái)日志亂碼的解決

    這篇文章主要介紹了spring boot jar部署控制臺(tái)日志亂碼的解決方案,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2021-09-09
  • springboot中如何配置LocalDateTime JSON返回時(shí)間戳

    springboot中如何配置LocalDateTime JSON返回時(shí)間戳

    這篇文章主要介紹了springboot中如何配置LocalDateTime JSON返回時(shí)間戳問題。具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-06-06
  • Springboot詳解RocketMQ實(shí)現(xiàn)消息發(fā)送與接收流程

    Springboot詳解RocketMQ實(shí)現(xiàn)消息發(fā)送與接收流程

    這篇文章主要介紹了SpringBoot整合RocketMQ實(shí)現(xiàn)消息發(fā)送和接收功能,我們使用主流的SpringBoot框架整合RocketMQ來講解,使用方便快捷,本文分步驟給大家介紹的非常詳細(xì),需要的朋友可以參考下
    2022-06-06
  • Java常用面板之JScrollPane滾動(dòng)面板實(shí)例詳解

    Java常用面板之JScrollPane滾動(dòng)面板實(shí)例詳解

    這篇文章主要介紹了Java常用面板JScrollPane的簡單介紹和一個(gè)相關(guān)實(shí)例,,需要的朋友可以參考下。
    2017-08-08
  • Java AES加密和解密教程

    Java AES加密和解密教程

    這篇文章主要介紹了Java AES加密和解密的相關(guān)資料,幫助大家更好的理解和學(xué)習(xí)Java,感興趣的朋友可以了解下
    2020-12-12
  • MyBatis是如何實(shí)現(xiàn)日志模塊的詳解

    MyBatis是如何實(shí)現(xiàn)日志模塊的詳解

    這篇文章主要給大家介紹了關(guān)于MyBatis是如何實(shí)現(xiàn)日志模塊的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者使用MyBatis具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-10-10
  • InputStream數(shù)據(jù)結(jié)構(gòu)示例解析

    InputStream數(shù)據(jù)結(jié)構(gòu)示例解析

    這篇文章主要為大家介紹了InputStream數(shù)據(jù)結(jié)構(gòu)示例解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-10-10
  • 基于IntelliJ IDEA的類注釋和方法注釋操作

    基于IntelliJ IDEA的類注釋和方法注釋操作

    這篇文章主要介紹了基于IntelliJ IDEA的類注釋和方法注釋操作,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-09-09

最新評論

甘孜| 乐清市| 策勒县| 丰城市| 教育| 丹凤县| 宁城县| 泰和县| 壶关县| 嘉荫县| 山东省| 滦南县| 同江市| 巴彦淖尔市| 临西县| 永济市| 右玉县| 上杭县| 河南省| 云和县| 海阳市| 比如县| 眉山市| 鞍山市| 衡东县| 郎溪县| 突泉县| 达日县| 凤山县| 江达县| 高尔夫| 宝清县| 青海省| 方城县| 武安市| 休宁县| 鄄城县| 河池市| 曲松县| 新竹县| 那坡县|