• 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。。 有一种默契叫做我不理你,你就不理我

  • 相关阅读:
    2407: C语言习题 整数转换成字符串
    2484: 字母图形
    1658: Easier Done Than Said?
    Easier Done Than Said?(应用到的知识)
    1653: Champion of the Swordsmanship
    1614: 五位以内的对称素数
    1612: 最小公倍数
    $ vs $()
    数学
    计算机科学与技术课程
  • 原文地址:https://www.cnblogs.com/weidaijie/p/15383943.html
Copyright © 2020-2023  润新知