zoukankan      html  css  js  c++  java
  • idea打jar包,提示 jar包中没有主清单属性

    1.是 repackage起了作用,内容如下:

    <build>
        <plugins>
          <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <version>${springboot.version}</version>
            
           <!--插件中添加如下内容:executions-->
           <executions>
              <execution>
                <goals>
                  <goal>repackage</goal>
                </goals>
              </execution>
            </executions>
    
          </plugin>
        </plugins>
      </build>
    

    2.执行maven的clean 和 package方法

    备注:查看jar解压后的MANIFEST.MF包含下面的内容,就可以了

    Main-Class: org.springframework.boot.loader.JarLauncher
    Start-Class: com.kevin.test.package.Application
    

    参考文档:https://www.cnblogs.com/sunshinekevin/p/12701330.html

    mvn clean package依次执行了clean、resources、compile、testResources、testCompile、test、jar(打包)等7个阶段。
    mvn clean install依次执行了clean、resources、compile、testResources、testCompile、test、jar(打包)、install等8个阶段。
    mvn clean deploy依次执行了clean、resources、compile、testResources、testCompile、test、jar(打包)、install、deploy等9个阶段。
    由上面的分析可知主要区别如下,

    package命令完成了项目编译、单元测试、打包功能,但没有把打好的可执行jar包(war包或其它形式的包)布署到本地maven仓库和远程maven私服仓库
    install命令完成了项目编译、单元测试、打包功能,同时把打好的可执行jar包(war包或其它形式的包)布署到本地maven仓库,但没有布署到远程maven私服仓库
    deploy命令完成了项目编译、单元测试、打包功能,同时把打好的可执行jar包(war包或其它形式的包)布署到本地maven仓库和远程maven私服仓库
    ————————————————
    原文链接:https://blog.csdn.net/zhaojianting/article/details/80324533

    I can feel you forgetting me。。 有一种默契叫做我不理你,你就不理我

  • 相关阅读:
    洛谷 题解 P5595 【【XR-4】歌唱比赛】
    洛谷 题解 CF1151D 【Stas and the Queue at the Buffet】
    洛谷 题解 CF299A 【Ksusha and Array】
    仙人掌找环
    2-SAT
    带花树
    帮我背单词
    csp2019退役祭
    P5284 [十二省联考2019]字符串问题 题解
    【网络流24题】魔术球问题
  • 原文地址:https://www.cnblogs.com/weidaijie/p/15383943.html
Copyright © 2011-2022 走看看