Search code examples
javamavenplayn

Create skeleton from commandline


I am following the steps in the Getting Started Guide and am getting a MissingProjectException error from Maven (missing pom.xml file).

I have downloaded and installed the JavaSE jdk and Maven. I successfully compiled and ran the PlayN demo showcase for both desktop and html5. I tinkered with the demo "hello" app.

Now I want to create my own little game starting from a standard PlayN project skeleton. How do I do that from the commandline? (Win7, Java 1.8, Maven 3.2.1)

I am returning to Java after a decade and have no experience with Maven so I do not know if the guide has unstated prerequisites like copying a default pom.xml file from someplace.

(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

Paste in the command as per the Getting Started Guide "Generating a skeleton project"...

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>

My Java install...

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

My Maven install...

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>

Solution

  • It seems an issue using PowerShell. Try running this using normal the cmd executable.