从命令行创建骨架

苏科托

我正在按照入门指南中的步骤进行操作,并且从Maven(缺少pom.xml文件)中收到MissingProjectException错误。

我已经下载并安装了JavaSE jdk和Maven。我成功地为台式机和html5编译并运行了PlayN演示展示。我修改了演示“ hello”应用程序。

现在,我想从标准的PlayN项目框架开始创建自己的小游戏。如何从命令行执行此操作?(Win7,Java 1.8,Maven 3.2.1)

十年之后,我将返回Java,并且没有Maven的经验,因此我不知道该指南是否具有未声明的先决条件,例如从某个地方复制默认pom.xml文件。

(following successful compilation of playn demo showcase in playn-samples)...
PS C:\dev\playn-samples> cd ..
PS C:\dev>
PS C:\dev> mkdir mygame


Directory: C:\dev


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         6/14/2014   5:41 PM            mygame


PS C:\dev> cd .\mygame

根据入门指南“生成骨架项目”粘贴命令...

PS C:\dev\mygame> mvn archetype:generate -DarchetypeGroupId=com.googlecode.playn -DarchetypeArtifactId=playn-archetype -DarchetypeVersion=1.8
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.276 s
[INFO] Finished at: 2014-06-14T17:41:37+09:00
[INFO] Final Memory: 4M/94M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\dev\mygame). 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/MissingProjectException
PS C:\dev\mygame>

我的Java安装...

PS C:\dev\mygame> javac -version
javac 1.8.0_05

我的Maven安装...

PS C:\dev\mygame> mvn --version
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-15T02:37:52+09:00)
Maven home: C:\Program Files\Apache Software Foundation\apache-maven-3.2.1
Java version: 1.8.0_05, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_05\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
PS C:\dev\mygame>

使用PowerShell似乎是一个问题。尝试使用普通的cmd可执行文件运行它。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章