我有一个pom.xmlin C:\Users\AArmijos\Desktop\Factura Electronica\MIyT\componentes-1.0.4\sources\pom.xml和我执行:
mvn install:install-file -DgroupId=es.mityc.jumbo.adsi -DartifactId=xmlsec-1.4.2-ADSI -Dversion=1.0 -Dpackaging=jar -Dfile=C:\Users\AArmijos\Desktop\Factura Electronica\MIyT\componentes-1.0.4\core\xmlsec-1.4.2-ADSI-1.0.jar
Run Code Online (Sandbox Code Playgroud)
但是它返回了以下错误:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.310s
[INFO] Finished at: Thu May 02 16:48:29 COT 2013
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM
in this directory (C:\Users\AArmijos). Please verify you invoked Maven from the
correct directory. -> [Help 1]
Run Code Online (Sandbox Code Playgroud)
有人可以解释它失败的原因吗?
Adr*_*ian 161
此链接有助于:https://stackoverflow.com/a/11199865/1307104
我通过为每个参数添加引号来编辑我的命令,如下所示:
mvn install:install-file "-DgroupId=org.mozilla" "-DartifactId=jss" "-Dversion=4.2.5" "-Dpackaging=jar" "-Dfile=C:\Users\AArmijos\workspace\componentes-1.0.4\deps\jss-4.2.5.jar"
它奏效了.
Jos*_*van 34
对于在Windows上遇到此问题并且上述方法都不起作用的任何人,请尝试从cmd.exe运行此命令.通过PowerShell执行这些命令导致安装每次都失败.
J.J*_*van 20
在Windows上,就我而言,你必须用引号括起所有参数.
因此,如果您想创建maven webapp原型,您可以执行以下操作:
先决条件:
如何:
注意:这仅在Windows 10 PowerShell上进行测试
小智 9
完全正确。使用时PowerShell,需要加上引号。
我运行命令并在带点的参数两边加引号,这有效。 您应该
键入,而不是键入。1.4"1.4"
mvn archetype:generate
-DgroupId=com.mycompany.app
-DartifactId=my-app
-DarchetypeArtifactId=maven-archetype-quickstart
-DarchetypeVersion=1.4 -DinteractiveMode=false
Run Code Online (Sandbox Code Playgroud)
Error:
[ERROR] The goal you specified requires a project to execute
but there is no POM in this directory
(C:\Users\jcrojas\OneDrive - Superfinanciera\Personal\Aprendizaje\Maven\test).
Please verify you invoked Maven from the correct directory. -> [Help 1]
Run Code Online (Sandbox Code Playgroud)
mvn archetype:generate
-DgroupId=**"com.mycompany.app"**
-DartifactId=my-app
-DarchetypeArtifactId=maven-archetype-quickstart
-DarchetypeVersion=**"1.4"**
-DinteractiveMode=false
Run Code Online (Sandbox Code Playgroud)
...建立成功...
如果使用 Windows 命令行CMD.
在这种情况下,不需要引号。
为Windows用户添加一个答案.如果这些都解决了问题.
不要在space之前或之后添加=
-DgroupId= com.company.module //Wrong , Watch the space after the equal to
-DgroupId=com.company.module //Right
Run Code Online (Sandbox Code Playgroud)
最好将所有内容放在双引号内,例如"-DgroupId = com .."这将给出确切的错误而不是一些随机错误.
奇怪的是,maven甚至不在文档中提到这一点.
就我而言,这是因为我从浏览器复制粘贴了命令,结果发现破折号不是 ASCII 破折号,只需删除并再次键入破折号即可。
http://www.toptip.ca/2017/04/maven-most-weird-error-causing-failure.html
| 归档时间: |
|
| 查看次数: |
155719 次 |
| 最近记录: |