简体   繁体   English

目标 org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file 的参数“文件”丢失或无效

[英]The parameters 'file' for goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file are missing or invalid

I am using STS version 3.9.我正在使用 STS 3.9 版。 I am trying to add external dependency for ojdbc7.jar to local maven repository.我正在尝试将 ojdbc7.jar 的外部依赖项添加到本地 maven 存储库。 I have downloaded ojbdc7.jar from oracle site.我已经从 oracle 站点下载了ojbdc7.jar Through configuration window I have set goal as - install:install-file通过配置 window 我将目标设置为 - install:install-file

Parameters as -参数为 -

-Dfile={Path/to/your/ojdbc7.jar} -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0 -Dpackaging=jar

While running this, I am getting below error.运行此程序时,我遇到了错误。

Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file (default-cli) on project .The parameters 'file' for goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file are missing or invalid

Thanks in advance.提前致谢。

You should update the value of your param:您应该更新参数的值:

-Dfile={Path/to/your/ojdbc7.jar}

to the exact location of the jar you've downloaded -到您下载的 jar 的确切位置 -

-Dfile={/Users/user/Downloads/ojdbc7.jar}

Note : It must be a valid path in your system which you can get by looking at the properties/info of the downloaded jar.注意:它必须是您系统中的有效路径,您可以通过查看下载的 jar 的属性/信息来获取该路径。

您缺少文件路径和双引号:

mvinstall:install-file -Dfile="path/file.jar" -DgroupId="com.oracle" -DartifactId=ojdbc7 -Dversion="12.1.0" -Dpackaging=jar

Wrap all the parameters in the single quotes.将所有参数括在单引号中。 shell is expanding it in unacceptable ways to maven. shell 正在以不可接受的方式将其扩展到 maven。

mvn install:install-file -Dfile='/path/library.jar' -DgroupId='groupid' \
  -DartifactId='' -Dversion='' -Dpackaging='jar'

In my case I forgot to add the backslash like so:就我而言,我忘记像这样添加反斜杠:

mvn install:install-file \
-Dfile='some-file.jar' \
-DgroupId='com.something' \
-DartifactId='artifactId' \
-Dversion='version' \
-Dpackaging='packaging' \
-DgeneratePom=true

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 插件 org.apache.maven.plugins:maven-install-plugin:2.4 或其依赖项之一无法解析 - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved 无法读取工件 org.apache.maven.plugins:maven-install-plugin:maven-plugin:2.4:runtime 的生命周期映射元数据 - Cannot read lifecycle mapping metadata for artifact org.apache.maven.plugins:maven-install-plugin:maven-plugin:2.4:runtime Maven:无法执行目标 org.apache.maven.plugins:maven-resources-plugin:2.7:resources - Maven:Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.7:resources 无法执行目标org.apache.maven.plugins:maven-compiler-plugin:3.1:compile - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile 无法执行目标org.apache.maven.plugins:maven-compiler-plugin等 - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin AND more 未能执行目标 org.apache.maven.plugins:maven-resources-plugin:2.5:resources - Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources 无法执行目标org.apache.maven.plugins:maven-jar-plugin:2.4:jar - Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.4:jar 无法执行目标org.apache.maven.plugins:maven-antrun-plugin - Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin 无法执行目标org.apache.maven.plugins:maven-clean-plugin:2.4.1 - Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1 Spring Boot 无法执行目标 org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test - Spring Boot Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM