Getting started Eclipse Maven Project Import

2,941 views
Skip to first unread message

Dave LeCompte

unread,
Sep 6, 2011, 12:35:05 AM9/6/11
to pl...@googlegroups.com
I take no joy in starting another thread on getting started issues, and yet, here I am.

I'm using Eclipse 3.7 (Indigo) on Linux (Fedora 15 x86_64).

I've gone through the steps here http://code.google.com/p/playn/wiki/CheckoutReviewCommit (as an aside, for a long time, I didn't think that this page was relevant to me, because I don't plan to work on the innards of PlayN - much), particularly the


step, and then I did File / Import / Maven / Existing Maven Projects. The "projects" tree view populated with a bunch of PlayN projects. I clicked "Next", and I see a dialog saying "Setup Maven plugin connectors", with 4 items:

(green check) Packaging war    Resolve Later
(green check) maven-android-plugin:3.0.0-alpha-2:generate-sources    Resolve Later
(green check) maven-android-plugin:3.0.0-alpha-2:unpack    Resolve Later
(RED X) maven-antrun-plugin:1.3:3(3 errors)    Resolve Later

When I click on the maven-antrun-plugin line, the Description field says:
"No marketplace entries found to handle maven-antrun-plugin:1.3:run in Eclipse. Please see Help for more information."

I've tried the Eclipse help, I've looked through the Install New Software area for ant plugins. I've googled for more information on "maven-antrun-plugin" and "No marketplace entries found" and variations thereof, but have not found anything useful.


At this point, I can click "Finish", and it warns me "Continuing with import will result in projects with build errors, please see help for more information" (but there's no help button handy, and it's a modal dialog, so I'm uncertain what I'm being told to do.

I can cancel, or I can go on. If I click "OK", my package explorer gets filled with new projects (is there a way that I could group all these new projects into a single group? Is that what an Eclipse Working Set is? I wasn't able to get that to do what I wanted, either.) but trying run one of the sample projects according to the instructions fails in two ways:

* the directions refers to playn-peaphysics, which I don't see, certainly at the toplevel.
* going to the various other samples gets confusing. I clicked on, for example, playn-hello. I see android, core, flash and html folders. I don't see a "src" folder, as mentioned in the instructions, and I don't see a java folder, to go along with the other deployment platforms. I click on "core", ah, there's a "src", which holds a "playn" folder (what?), which holds a "sample" folder (this rabbit hole goes deep), which holds a "hello" folder (Yo, dawg, I heard you like recursive samples, so I put a recursive sample in your hello, so you could open folders while you open folders), which holds "core", "java", and "resources". Opening the Java folder, I see HelloGameJava.java, which at this point seems like the best analog to the thing that I might want to right click on. Right Click, Run As..., and the popup menu that I see is a single item: "Run Configurations..."


I'm willing to believe that most everything after clicking on "Finish", after being warned about build errors, is my fault. None of them seem to be build errors, but I can believe that a bad import led to unworkable projects.

So - what's up with the antrun thing? Is that maybe a byproduct of some misbehaving Eclipse plugin interfering with the import?

Thanks,
Dave LeCompte

Michael Bayne

unread,
Sep 6, 2011, 12:11:08 PM9/6/11
to pl...@googlegroups.com
On Mon, Sep 5, 2011 at 9:35 PM, Dave LeCompte <tsma...@gmail.com> wrote:
> I've gone through the steps
> here http://code.google.com/p/playn/wiki/CheckoutReviewCommit (as an aside,
> for a long time, I didn't think that this page was relevant to me, because I
> don't plan to work on the innards of PlayN - much)

I agree that we need to have a separate GettingStarted page that just
shows how to run the demos and set up your own skeleton project.

We are a hair's width away from being able to ship a proper release
and publish it to Maven Central, at which point no one will have to
check out the PlayN code and compile it in order to build a project
based on it.

I also need to update the CheckoutReviewCommit page as well, since
things have changed a bit with the project reorganizations.

> "projects" tree view populated with a bunch of PlayN projects. I clicked
> "Next", and I see a dialog saying "Setup Maven plugin connectors", with 4

> items:..."


> I've tried the Eclipse help, I've looked through the Install New Software
> area for ant plugins. I've googled for more information on
> "maven-antrun-plugin" and "No marketplace entries found" and variations
> thereof, but have not found anything useful.

This is an annoying m2eclipse problem which can be ignored, but looks
very scary when you see it. I need to write a custom plugin for Maven
to allow us to chmod files, because that's what the antrun plugin is
being used for, but for whatever inane reason, m2eclipse doesn't
support antrun.

> At this point, I can click "Finish", and it warns me "Continuing with import
> will result in projects with build errors, please see help for more
> information" (but there's no help button handy, and it's a modal dialog, so
> I'm uncertain what I'm being told to do.

This is also ignorable, but will go away when I write the custom Maven
plugin. Sigh. I hate Maven for exactly these sorts of reasons, but
unfortunately it's the only viable way to have a complex project that
can be built from multiple different IDEs and the command line without
maintaining N separate build systems. It's also the best way to
automatically manage dependencies.

> I can cancel, or I can go on. If I click "OK", my package explorer gets
> filled with new projects (is there a way that I could group all these new
> projects into a single group?

Unfortunately not, AFAIK Eclipse has no way to group projects in a
single workspace.

> Is that what an Eclipse Working Set is? I
> wasn't able to get that to do what I wanted, either.)

I'm not super familiar with an Eclipse Working Set, but I would guess
that it's meant to allow something like this. What I do is to create
an entirely separate Eclipse Workspace for PlayN and related projects.
This is suboptimal, because Eclipse insists on completely ignoring all
of your global preferences when you create a new workspace (like key
bindings), and you have to manually export those from your old
workspace and import them into your new one. But it also allows you to
isolate a project and its associated libraries, which is nice since
Eclipse starts to get painfully slow when you add too much code to it.

> * the directions refers to playn-peaphysics, which I don't see, certainly at
> the toplevel.

These directions are out of date.

> * going to the various other samples gets confusing. I clicked on, for
> example, playn-hello.

This is the meta project, you don't want to try to run things from
there. I would hide that project from Eclipse if I could, because it's
completely meaningless to Eclipse, but I can't (at least not without
writing yet another custom Maven or Eclipse plugin, which is absurd
overkill).

You want to run from playn-hello-core. You can right click on the
playn-hello-core project and select Run As -> Java Application, then
double click on HelloGameJava in the list that pops up, and it will
run the hello demo.

Because each target platform requires a separate set of dependencies
and a separate build mechanism, there is a separate sub-project for
each target platform (e.g. foo-core, foo-flash, foo-html,
foo-android). Each subproject can be used to build your game for the
platform in question. It's complex, but building a game for N
platforms is not something that can be made simple. It's frankly a
small miracle that it's possible to do all of this with the moderate
level of complexity that we have.

-- m...@samskivert.com

Michael Bayne

unread,
Sep 6, 2011, 1:17:50 PM9/6/11
to pl...@googlegroups.com
On Tue, Sep 6, 2011 at 9:11 AM, Michael Bayne <m...@samskivert.com> wrote:
> This is an annoying m2eclipse problem which can be ignored, but looks
> very scary when you see it. I need to write a custom plugin for Maven
> to allow us to chmod files, because that's what the antrun plugin is
> being used for, but for whatever inane reason, m2eclipse doesn't
> support antrun.

It turns out I was able to configure m2eclipse to ignore the use of
antrun and unpack, so it should be possible to do a clean import of
the latest PlayN with no warnings or errors.

Annoyingly, once the import is complete, the -android projects still
report an error, which goes away if you refresh those projects.
Remedying this problem will likely require an upstream fix to the
Eclipse Android plugin.

-- m...@samskivert.com

Dave LeCompte

unread,
Sep 6, 2011, 1:19:22 PM9/6/11
to pl...@googlegroups.com
My snarky asides in my email should not be read as a lack of appreciation of the work that's been done, and is ongoing - I know this is a work in progress, and I'm encouraged to know that this is nearly ready for heavier use.

I've worked on the magic of making 4 wildly different systems work from the same codebase before, it's not the most fun part of making games. :)

On Tue, Sep 6, 2011 at 9:11 AM, Michael Bayne <m...@samskivert.com> wrote:

DanMendes

unread,
Sep 13, 2011, 7:14:15 PM9/13/11
to PlayN
The Android projects do indeed get fixed with F5/Refresh, but I am
having issues with the flash and html projects

ERRORS

Description Resource Path Location Type
WAR source directory /playn-cute-flash/src/main/webapp is missing
playn-cute-flash Unknown Google Web App Problem
WAR source directory /playn-cute-html/src/main/webapp is missing playn-
cute-html Unknown Google Web App Problem
WAR source directory /playn-hello-flash/src/main/webapp is missing
playn-hello-flash Unknown Google Web App Problem
WAR source directory /playn-hello-html/src/main/webapp is missing
playn-hello-html Unknown Google Web App Problem
WAR source directory /playn-showcase-flash/src/main/webapp is missing
playn-showcase-flash Unknown Google Web App Problem
WAR source directory /playn-showcase-html/src/main/webapp is missing
playn-showcase-html Unknown Google Web App Problem

WARNINGS over 600
Description Resource Path Location Type
Attribute minSdkVersion (6) is lower than the project target API level
(11) AndroidManifest.xml /playn-cute-android line 1 Android ADT
Problem
Attribute minSdkVersion (6) is lower than the project target API level
(11) AndroidManifest.xml /playn-hello-android line 1 Android ADT
Problem
Attribute minSdkVersion (6) is lower than the project target API level
(11) AndroidManifest.xml /playn-showcase-android line 1 Android ADT
Problem
Dead code FastSort.java /playn-jbox2d/src/org/jbox2d/common line 10
Java Problem
Dead code FastSort.java /playn-jbox2d/src/org/jbox2d/common line 18
Java Problem
Element (u) is obsolete. Its use is discouraged in HTML5 documents.
playerapplet.html /playn-core/lib/JLayer1.0.1 line 18 HTML Problem
Invalid character used in text string (
          Feed a bitstring to the crc calculation (0 < length <=
32).). Crc16.html /playn-core/lib/JLayer1.0.1/doc/javazoom/jl/decoder
line 139 HTML Problem
Invalid character used in text string (Feed a bitstring to the crc
calculation (0 < length <= 32).
). Crc16.html /playn-core/lib/JLayer1.0.1/doc/javazoom/jl/decoder line
197 HTML Problem
Invalid character used in text string (Feed a bitstring to the crc
calculation (0 < length <= 32).
). index-all.html /playn-core/lib/JLayer1.0.1/doc line 82 HTML Problem
Invalid character used in text string (Read bits from buffer into the
lower bits of an unsigned int.
The LSB contains the latest read bit of the stream.
(1 <= number_of_bits <= 16)
). Bitstream.html /playn-core/lib/JLayer1.0.1/doc/javazoom/jl/decoder
line 530 HTML Problem
Invalid location of tag (A). constant-values.html /playn-core/lib/
JLayer1.0.1/doc line 101 HTML Problem
Invalid location of tag (A). constant-values.html /playn-core/lib/
JLayer1.0.1/doc line 107 HTML Problem
Invalid location of tag (A). constant-values.html /playn-core/lib/
JLayer1.0.1/doc line 113 HTML Problem
Invalid location of tag (A). constant-values.html /playn-core/lib/
JLayer1.0.1/doc line 119 HTML Problem
Invalid location of tag (A). constant-values.html /playn-core/lib/
JLayer1.0.1/doc line 125 HTML Problem
Invalid location of tag (A). constant-values.html /playn-core/lib/
JLayer1.0.1/doc line 143 HTML Problem
Invalid location of tag (A). constant-values.html /playn-core/lib/
JLayer1.0.1/doc line 149 HTML Problem
Invalid location of tag (A). constant-values.html /playn-core/lib/
JLayer1.0.1/doc line 167 HTML Problem
Invalid location of tag (A). constant-values.html /playn-core/lib/
JLayer1.0.1/doc line 173 HTML Problem
Invalid location of tag (A). constant-values.html /playn-core/lib/
JLayer1.0.1/doc line 179 HTML Problem
Invalid location of tag (A). constant-values.html /playn-core/lib/
JLayer1.0.1/doc line 185 HTML Problem
Invalid location of tag (A). constant-values.html /playn-core/lib/
JLayer1.0.1/doc line 191 HTML Problem

Am I missing something here? Looks like most are related to HTML...

I did a clean install to give playn a try. Not that the errors that I
am getting are an issue, using mvn cmd I can build the projects.
Reply all
Reply to author
Forward
0 new messages