本地存储的Mvn依赖解析

时间:2016-06-10 15:52:41

标签: java maven

我正在尝试将一个本地存储库添加到由maven管理的项目中。 我执行了以下步骤将本地存储库添加到maven

mvn install:install-file -DgroupId=com.example.somename -DartifactId=somefile.jar -Dversion=1.0 -Dfile=C:\Users\username\mvn_respos\somefile.jar

然后我在我的pom.xml上添加了dependecy

现在我收到以下错误。

The container 'Maven Dependencies' references non existing library 'C:\Users\username\.m2\repository\com\example\sonename\somefile\1.0\somefile-1.0.jar'

但是,当我导航到特定目录时,该文件确实存在。 我在这做错了什么。

1 个答案:

答案 0 :(得分:1)

试试这个

mvn install:install-file -Dfile=sonfile.jar -DgroupId=com.example.somename -DartifactId=sonfile -Dversion=0.1 -Dpackaging=jar

在jar的同一目录下执行命令,所以你不能在Dfile中写下所有的路径