我正在尝试将一个本地jar安装到我的maven项目中,我从我的项目文件夹中运行此命令:
mvn install:install-file -Dfile= ~/Downloads/<jar_path> -DgroupId=<groupId> -DartifactId=<artifactId> -Dversion=<version> -Dpackaging=jar -DgeneratePom=false
我收到此错误:
Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project my-project: Error installing artifact 'my-artifact': Failed to install artifact groupId:artifactId:jar:version: /Users/my-project-path (Is a directory) -> [Help 1]
答案 0 :(得分:2)
-Dfile=
之后,您的命令中有一个空格!
mvn install:install-file -Dfile= ~/Downloads/<jar_path> -DgroupId=<groupId> -DartifactId=<artifactId> -Dversion=<version> -Dpackaging=jar -DgeneratePom=false
试
mvn install:install-file -Dfile=~/Downloads/<jar_path> -DgroupId=<groupId> -DartifactId=<artifactId> -Dversion=<version> -Dpackaging=jar -DgeneratePom=false