打包时pom.xml文件中不全的配置(会出现打包成的jar包中的lib下没有将第三方的jar打进)
配置不全的pom.xml文件:
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </build>
修改后,补全的pom.xml文件:
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <includeSystemScope>true</includeSystemScope> </configuration> </plugin> </build>
mawen中需把第三方的jar添加依赖
1、新建lib文件夹,将第三方jar复制进去;
2、在pom.xml文件中进行引入,如:
<dependency> <groupId>com.*</groupId> <artifactId>fastjson</artifactId> <version>1.0-SNAPSHOT</version> <scope>system</scope> <systemPath>${project.basedir}/lib/fastjson-1.1.28.jar</systemPath> </dependency>