eclipse中maven添加本地jar包
2016-10-31 15:33
316 查看
首先,在项目右键-New-Folder,值为lib
之后把需要的jar包放到lib中,在maven的pom.xml中,添加包的内容,如:
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/commons-collections-3.1.jar</systemPath>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.7.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/commons-beanutils-1.7.0.jar</systemPath>
</dependency>
之后右键Maven-Updata project即可。
但只要在生成war包时,没有加入添加的这些jar,只需要在pom.xml中,添加下面:
<plugins>
<plugin>
..
</plugin>
<!-- -zhou start -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>${project.basedir}/lib</directory>
<targetPath>WEB-INF/lib</targetPath>
<filtering>false</filtering>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
<!-- -zhou end -->
</plugins>
之后把需要的jar包放到lib中,在maven的pom.xml中,添加包的内容,如:
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/commons-collections-3.1.jar</systemPath>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.7.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/commons-beanutils-1.7.0.jar</systemPath>
</dependency>
之后右键Maven-Updata project即可。
但只要在生成war包时,没有加入添加的这些jar,只需要在pom.xml中,添加下面:
<plugins>
<plugin>
..
</plugin>
<!-- -zhou start -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>${project.basedir}/lib</directory>
<targetPath>WEB-INF/lib</targetPath>
<filtering>false</filtering>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
<!-- -zhou end -->
</plugins>
相关文章推荐
- eclipse中使用maven---添加本地jar
- 在eclipse中maven项目添加本地jar
- eclipse,idea搜索手动添加到本地maven库的jar
- eclipse,idea搜索手动添加到本地maven库的jar
- eclipse maven添加本地仓库的jar包
- MyEclipse maven 只能从本地库找添加依赖的jar问题解决
- 如何将Jar包添加到本地maven仓库
- Maven 手动添加 JAR 包到本地仓库
- maven添加非官方jar包到本地库(maven: install an external jar into local maven repository)
- Maven如何手动添加依赖的jar文件到本地Maven仓库
- eclipse maven插件 下载/获得jar到本地
- [置顶] Maven如何手动添加依赖的jar文件到本地Maven仓库
- maven添加非官方jar包到本地库(maven: install an external jar into local maven repository)
- Eclipse添加maven依赖找不到maven库中的jar
- 关于maven 添加本地的jar到本地的资源库中的语法
- Maven 手动添加 JAR 包到本地仓库
- [使用心得]maven2之m2eclipse使用手册之五添加新的依赖项目到本地仓库
- Maven 手动添加 JAR 包到本地仓库
- Maven 手动添加 JAR 包到本地仓库
- maven添加非官方jar包到本地库(maven: install an external jar into local maven repository)