如何在我的eclipse中添加用户定义的库作为maven依赖项。我只需要添加一堆罐子来创建一个webapp。所以我刚刚创建了一个自定义库
答案 0 :(得分:0)
您可以直接在pom中添加依赖项
<dependency>
<groupId>sample</groupId>
<artifactId>com.sample</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/yourJar.jar</systemPath>
</dependency>
或者您可以将jar安装到maven存储库
mvn install:install-file
-Dfile=<path-to-file>
-DgroupId=<group-id>
-DartifactId=<artifact-id>
-Dversion=<version>
-Dpackaging=<packaging>
-DgeneratePom=true
Where: <path-to-file> the path to the file to load
<group-id> the group that the file should be registered under
<artifact-id> the artifact name for the file
<version> the version of the file
<packaging> the packaging of the file e.g. jar
然后将依赖项添加到jar中。