idea的打包问题
问题
我执行打包命令后生成一个jar,但是在执行 java -jar 命令之后出现了一下的情况
打开jar包里面的MANIFEST.MF
里面是这样的
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Built-By: WX
Created-By: Apache Maven 3.8.1
Build-Jdk: 1.8.0_77
明显少东西
而且我jar包打开连lib的文件都没有
怎么解决
添加如下内容
xml
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
我完整的打包语句
xml
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<configuration>
<executable>true</executable>
<!-- 指定该Main Class为全局的唯一入口 -->
<mainClass>com.example.lesscode.LessCodeApplication</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<excludes>
<exclude>application-prod.properties</exclude>
<exclude>application-xxljob.properties</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
解决后的样子
1、打开后的jar包是包含lib的
2、打开文件 MANIFEST.MF