我对AWS SDK for Java非常陌生。我正在尝试按照这里的文档(https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/get-started.html#get-started-projectsetup)开始使用用于Java2.x的AWS SDK。
但是当我尝试使用下面的命令创建这里提到的项目时
mvn -B archetype:generate \-DarchetypeGroupId=org.apache.maven.archetypes \-DgroupId=com.example.myapp \-DartifactId=myapp
我收到一个错误:
PS C:\Users\robert\Desktop> mvn -B archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.example.myapp -DartifactId=myapp
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.100 s
[INFO] Finished at: 2021-08-09T12:26:24-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\robert\Desktop). Please verify you invoked Maven from
the correct directory. -> [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/MissingProjectExceptio
如何创建maven项目并开始使用aws sdk?
发布于 2021-08-09 17:14:00
命令中是否有/字符。如果是这样,您需要使用以下命令:
mvn -B archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.example.myapp -DartifactId=myapp
我正在使用JDK 1.8,这个命令是成功的。
发布于 2021-08-09 18:07:11
在Powershell中,命令行参数中不能有句点(点或句号)。该页面上的说明缺少这些信息,并假设使用类Unix环境或cmd
环境。你应该运行:
mvn -B archetype:generate "-DarchetypeGroupId=org.apache.maven.archetypes" "-DgroupId=com.example.myapp" -DartifactId=myapp
https://stackoverflow.com/questions/68715871
复制相似问题