zoukankan      html  css  js  c++  java
  • zbb20190408 spring-boot-maven-plugin 插件的作用详解

    添加了spring-boot-maven-plugin插件后,当运行maven打包的命令,项目会被打包成一个可以直接运行的jar包,使用"java -jar"可以直接运行。
    当项目中有两个启动类时,需要制定要执行的类,如果不指定,启动会报错。
    指定启动类有两种情况需要区分
    一:pom文件继承自spring-boot-starter-parent
    1
    2
    3
    <properties>
      <start-class>com.xx.xx</start-class>
    </properties>
    二:pom文件不是继承自spring-boot-starter-parent
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    <build>
    <plugins>
    <plugin>
    <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-maven-plugin</artifactId>
         <version>2.0.5.RELEASE</version>
         <configuration>
          <mainClass>com.xx.xx</mainClass>
         </configuration>
         <executions>
          <execution>
          <goals>
            <goal>repackage</goal>
          </goals>
          </execution>
         </executions>
    </plugin>
    </plugins>
    </build>
     
  • 相关阅读:
    AcWing 826. 单链表
    AcWing 803. 区间合并
    codeforces Codeforces Round #597 (Div. 2) D. Shichikuji and Power Grid
    球球大作战.exe
    RGB MIXER三原色混色器的制作
    125. 验证回文串
    110. 平衡二叉树
    112. 路径总和
    111. 二叉树的最小深度
    100. 相同的树
  • 原文地址:https://www.cnblogs.com/super-admin/p/10668624.html
Copyright © 2011-2022 走看看