码上敲享录 > SpringBoot常见问题详解 > xx-0.0.1-SNAPSHOT.jar中没有主清单属性

xx-0.0.1-SNAPSHOT.jar中没有主清单属性

上一章章节目录 2021-08-09已有1711人阅读 评论(0)

业务需要写了一个javafx桌面程序,

idea打包好的jar 使用cmd命令行,通过java -jar 运行jar包报错xx-0.0.1-SNAPSHOT.jar中没有主清单属性


解决方法:

<build>
       <plugins>
           <plugin>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-maven-plugin</artifactId>
              <!--  -->
               <executions>
                   <execution>
                       <goals>
                           <goal>repackage</goal>
                       </goals>
                   </execution>

               </executions>

                <!--  -->
           </plugin>

           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <configuration>
                   <source>8</source>
                   <target>8</target>
               </configuration>
           </plugin>

       </plugins>
</build>

加上一下内容即可

<executions>

 <execution>

   <goals>

      <goal>repackage</goal>

   </goals>

 </execution>

</executions>


打包后MANIFEST.MF文件如下,和我们盘丝的springboor,maven项目的MANIFEST.MF文件一致

向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti
0

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交