假设在我们目录中添加了第三方jar包:
我们要想使用这些jar包,首先需要在pom文件中引用:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.12</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/slf4j-simple.jar</systemPath>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.9.2</version>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-models</artifactId>
<version>3.9.2</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/stanford-corenlp-3.9.2-models.jar</systemPath>
</dependency>
如果我们需要在打jar包时将其一起打到jar包中去,需要在build中添加includeSystemScope,并设置为true
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</plugins>
</build>