打包時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>