Unable to create skeleton PlayN project in Eclipse

蓝咒 提交于 2019-12-19 07:39:29

问题


I'm getting to the point where I've almost given up trying to use PlayN. I've tried PlayN's Getting Started guide here, as well as GamesFromScratch's updated guide here, with no luck. Every time I try and create a New->Other->"Maven Project" with the code.googlecode.playn 1.3.1 archetype, I get this error message:

'Creating playn-archetype' has encountered a problem

Unable to create project from archetype [com.googlecode.playn:playn-archetype:1.3.1] The defined artifact is not an archetype

I wonder if I'm doing anything wrong? I've read that Eclipse ships with Maven version 3.0.2 (I'm using Eclipse Juno), so I installed Maven 3.0.4, though I don't know how to upgrade Eclipse's version (or if it makes any difference).

Many Thanks for your time,


回答1:


Eclipse Juno comes embedded with Maven 3.0.4, so that was not the problem.

Here is a solution I came up with:

  1. Download apache-maven-3.0.x from Apache
  2. (On Windows) Add the location of the bin folder in apache-maven-3.0.x to your PATH environment variable (Click on edit, add a semicolon and the path to the bin folder to the end)
  3. Generate a new project with Maven (not Eclipse):

    mvn archetype:generate -DarchetypeGroupId=com.googlecode.playn -DarchetypeArtifactId=playn-archetype -DarchetypeVersion=1.3.1

  4. (In Eclipse) File->Import->Existing Maven Project; browse to where you generated the project (probably your user folder) and import.
  5. To run the project, run as "Maven test" on gameName, edit gameName-core
Cheers!


回答2:


You have to add the Maven runtime to the Window/Preferences/Maven/Installations. After this -in case you have previous Maven Run Configurations- you might have to update those too, to use this new Maven.



来源:https://stackoverflow.com/questions/11357237/unable-to-create-skeleton-playn-project-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!