Am I setting this up correctly?

27 views
Skip to first unread message

Steven Stark

unread,
May 13, 2013, 7:06:18 PM5/13/13
to jangaro...@googlegroups.com
Up until now, I have been solely concerned with getting the compiler to work, that I hadn't even looked at the web app.

Today was all about getting the WAR properly compiled and deployed, and it didn't follow my assumptions and expectations, and I can't help but think that this is because I have my setup slightly wrong.

Let's start with the runtime and artifacts, like jooflash and my custom artifacts,

I would expect that mvn install would explode these items into the snapshot. They are, in fact, included.. but as JAR's. I had to extract these and then copy the js into my webapp dir, but what happens if these ever change? My custom artifacts change quire frequently, making this step take some time.

now on every compile or install, I need to also copy into the snapshot folder the contents of jangaroo-output/

So now, after some trial and error, I have an app up and running.. ( almost, it's throwing legitimate errors )

I guess my question is this. Is all this manual copying necessary, or am I making things harder than they need to be here?

Steven Stark

unread,
May 14, 2013, 3:43:04 PM5/14/13
to jangaro...@googlegroups.com
I'll answer my own question, no I was no setting things up correctly at all. This would explain a lot of issues. ;)

I will reply with a recap of what I've learned so far.

-Steven

Steven Stark

unread,
May 14, 2013, 6:49:49 PM5/14/13
to jangaro...@googlegroups.com

Ok so I learnt a lot this past week. Here are my notes, I hope they can help someone else just starting out.

* Reference the quick start heavily, diverting from this structure is bad.

The app is split into multiple sections, I will refer to as:


* project

* web app

* libs ( multiple )


Each section will have it's own .pom file.


PROJECT

* the project .pom will be quite simple, mostly just referencing other modules. from the quickstart:

    <modules>

        <module>my-joo-lib</module>

        <module>my-joo-app</module>

    </modules>

* it's packaging must be pom

* no dependancies or plugins here.


WEB APP

* The web app pom has a little more information, but still quite light:


* it's packaging must be war


* include jangaroo-maven-plugin and maven-war-plugin

* dependancies would be jangaroo-browser and your custom libs, both of type jangaroo

* The app needs a main constructor class, with a static constructor. This is very important. I wasted a lot of time here because my main class' constructor was public, not static.

* in the web app's .html file, reference your main class. Note that the 2nd param is an array of arguments, which I do not require for my example. Quick start will look different. :    

       joo.classLoader.run("com.test.Main");


LIBS


* The most complicated .pom file

* it's packaging must be jangaroo

* This file may include repositories

* do not need to include maven-war-plugin, but do need jangaroo-maven-plugin

* dependancies include all extended libs, for me this was: jangaroo-runtime, jooflash, jooflexframework, playerglobal (swc)


GLOBAL


* I found it best to stick to version 0.9.7 for all things Jangaroo ( runtime, plugin, dependencies )

* when running maven commands, you will need to install each individual lib. From there you can clean / compile / install from the root ( the pom file with just the modules )

* you never need to extract a jar or copy and dependancy files.



( if anyone has anything to add to my notes, please share. Jangaroo is my first exposure to maven )


Steven Stark

unread,
May 14, 2013, 6:57:39 PM5/14/13
to jangaro...@googlegroups.com
update:

I have set the jangaroo-maven-plugin to 0.9.7 and everything else to 1.0.1, to stay at the current code base. ( as per Frank's suggestion in another thread )

Steven Stark

unread,
May 15, 2013, 1:47:53 PM5/15/13
to jangaro...@googlegroups.com
correction:

Do not need to have a static main function, just need to set things up better in the html, mainly this:


  joo.classLoader.run("joo.flash.Run", "myDiv", "com.acme.Main" );


notice the complete path to the Main class, not just 'Main'. Also, it's in the 3rd parameter and not the first.
Reply all
Reply to author
Forward
0 new messages