maven打包可执行jar含依赖lib

修改pom.xml

 <build>
   <plugins>
     <plugin>
       <groupId>org.springframework.bootgroupId>
       <artifactId>spring-boot-maven-pluginartifactId>
       
       <version>2.3.7.RELEASEversion>
       <executions>
         <execution>
            <goals>
               <goal>repackagegoal>
            goals>
            <configuration>
  			
               <mainClass>com.example.MainApplicationmainClass>
            configuration>
          execution>
       executions>
    plugin>
  plugins>
   build>

成功后jar包结构:

maven打包可执行jar含依赖lib_第1张图片
BOOT-INF里面有classes和依赖的lib:

maven打包可执行jar含依赖lib_第2张图片

META-INF/MANIFEST.MF内容:

maven打包可执行jar含依赖lib_第3张图片

你可能感兴趣的:(学习记录,maven,jar,java)