maven项目添加libs下的jar

一.怎么在pom.xml中添加项目中libs下的jar呢,而不是从本地仓库中添加?

1、首先将要添加的jar包复制到项目中的libs文件夹下

2.然后在pom.xml中添加如下代码:例如 htmlunit-2.21-OSGi.jar

<dependency>
  <groupId>htmlunit</groupId>
  <artifactId>htmlunit</artifactId>
  <version>2.21-OSGi</version>
  <scope>system</scope>
  <systemPath>${project.basedir}/libs/htmlunit-2.21-OSGi.jar</systemPath>
</dependency>

猜你喜欢

转载自www.cnblogs.com/wds128/p/10887974.html
今日推荐