idea打包生成的jar包 提示报错:没有主清单属性

在idea中按照顺序打好jar包后,出现问题

jar中没有主清单属性【解决办法】:

在maven的pom文件下的plugin中加入以下插件:

        
        
            org.springframework.boot
            spring-boot-maven-plugin
        

        
        
            org.apache.maven.plugins
            maven-surefire-plugin
            
                
                true
            
        

即可解决。
2021-03-14 13:38:44.879 INFO 2216 — [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-03-14 13:38:44.880 INFO 2216 — [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.43]
2021-03-14 13:38:44.950 INFO 2216 — [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-03-14 13:38:44.951 INFO 2216 — [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 638 ms
2021-03-14 13:38:45.070 INFO 2216 — [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService ‘applicationTaskExecutor’
2021-03-14 13:38:45.222 INFO 2216 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path ‘’
2021-03-14 13:38:45.229 INFO 2216 — [ main] com.example.demo.HelloSpringApplication : Started HelloSpringApplication in 1.256 seconds (JVM running for 1.912)

你可能感兴趣的:(springboot,maven,jar,tomcat,java,plugin)