在Maven项目中,如果需要引入自己的jar包,需要将jar添加到本地Maven仓库
方法一:
假设将包htmlparser.jar放入了项目下的lib目录中 :
-> ${project}/lib/htmlparser.jar pom.xml文件中添加依赖
<dependency>
<groupId>com.htmlparser</groupId>
<artifactId>htmlparser</artifactId>
<version>2.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/htmlparser.jar</systemPath>
</dependency>
方法二:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>3.1.0.RELEASE</version>
</dependency>
Windows cmd命令窗口执行mvn install命令:
mvn install:install-file -Dfile=jar包的位置 -DgroupId=上面的groupId -DartifactId=上面的artifactId -Dversion=上面的version -Dpackaging=jar
示例:
mvn install:install-file
-Dfile=D:\mvn\spring-context-support-3.1.0.RELEASE.jar
-DgroupId=org.springframework
-DartifactId=spring-context-support
-Dversion=3.1.0.RELEASE
-Dpackaging=jar
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)