Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Maven-DlocalRepositoryPath未使用,而是使用默认的本地存储库位置_Java_Maven 2_Repository_Dependency Management - Fatal编程技术网

Java Maven-DlocalRepositoryPath未使用,而是使用默认的本地存储库位置

Java Maven-DlocalRepositoryPath未使用,而是使用默认的本地存储库位置,java,maven-2,repository,dependency-management,Java,Maven 2,Repository,Dependency Management,我正在使用以下命令在我的项目中创建一个本地存储库(在许多系统上使用),因此我尝试在我的项目文件夹中使用一个本地maven存储库来存储在任何在线存储库中都找不到的外部JAR): 这是从Windows命令行运行的。不知何故,即使使用-DlocalRepositoryPath,它仍然将jar安装到默认的本地存储库中(C:\Users\someone\.m2\,等等)。我做错了什么?我尝试了libs路径的不同变体,如/libs、/libs/、full path,使用了“”,但没有任何效果。为什么-Dlo

我正在使用以下命令在我的项目中创建一个本地存储库(在许多系统上使用),因此我尝试在我的项目文件夹中使用一个本地maven存储库来存储在任何在线存储库中都找不到的外部JAR):


这是从Windows命令行运行的。不知何故,即使使用-DlocalRepositoryPath,它仍然将jar安装到默认的本地存储库中(C:\Users\someone\.m2\,等等)。我做错了什么?我尝试了libs路径的不同变体,如/libs、/libs/、full path,使用了“”,但没有任何效果。为什么-DlocalRepositoryPath参数在这里不起作用?我使用的是Maven 2.2.1。

在使用插件2.2版时,install:install file选项忽略localRepositoryPath。但是,它适用于2.3及更高版本

此外,请尝试使用插件的完全限定名来指定版本:

mvn org.apache.maven.plugins:maven-install-plugin:2.3.1:install-file \
                         -Dfile=<path-to-your-file> -DgroupId=<myGroup> \ 
                         -DartifactId=<myArtifactId> -Dversion=<myVersion> \
                         -Dpackaging=<myPackaging> -DlocalRepositoryPath=<path>
mvn org.apache.maven.plugins:maven安装插件:2.3.1:install文件\
-Dfile=-DgroupId=\
-DartifactId=-Dversion=\
-dpackage=-DlocalRepositoryPath=

您遇到了什么错误?还是它建造得很好?
mvn org.apache.maven.plugins:maven-install-plugin:2.3.1:install-file \
                         -Dfile=<path-to-your-file> -DgroupId=<myGroup> \ 
                         -DartifactId=<myArtifactId> -Dversion=<myVersion> \
                         -Dpackaging=<myPackaging> -DlocalRepositoryPath=<path>