根据maven的官方教程将一个外部jar安装到本地存储库,但是失败

时间:2019-04-08 16:40:04

标签: maven maven-3 maven-plugin

我使用的命令(根据maven的官方教程:maven):

mvn install:install-file -Dfile=algs4-1.0.4.jar -DgroupID=edu.princeton.cs -DartifactID=algs4 -Dversion=1.0.4 -Dpackaging=jar

缺少告诉groupIDartifactID的错误信息,因此我尝试修改命令:

mvn install:install-file -Dfile=algs4-1.0.4.jar -groupID=edu.princeton.cs -artifactID=algs4 -Dversion=1.0.4 -Dpackaging=jar

你知道,那更糟。

我还在这里尝试一些答案,但它们也不起作用。


  • 预期结果是,安装了jar。
  • 实际结果是:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.460 s
[INFO] Finished at: 2019-04-09T00:23:39+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project standalone-pom: The artifact information is incomplete or not valid:
[ERROR]   [0]  'groupId' is missing.
[ERROR]   [1]  'artifactId' is missing.
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

1 个答案:

答案 0 :(得分:0)

您将groupIdartifactId拼错为groupIDartifactID