Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Monday, April 13, 2009

Google App Engine / Java and Maven

When first creating a project with the elipse google plugin, your presented with a project with gwt and gae/j ( google app engine / java) support. The first question I asked is how to get this all working with maven. The best archetype I have found is here gae-mvn-archetype. Instructions as followed:

1 create GAE/J project from maven archetype, artifactId is the app id.
> mvn archetype:generate -DarchetypeCatalog=http://www.mvnsearch.org/maven2
maven2
2 Build project
> mvn package
3 Test
> dev_appserver target\app-name
4 Deploy
> appcfg update target\app-name

But better to go here for specific details Maven for Google Appengine
Two things I've found from first use. First I was receiving ResourceDoesNotExistException: Unable to locate resource in repository. To get around this, in your settings.xml, usually found in /Users/.m2 .. there's a node called interactiveMode. Just comment this line out. As to the exact details I haven't looked into it yet. Second the META-INF directory is created in the resources directory. I would move this to the webapps, directory so the files jdoconfig.xml and persistence.xml are included in final build. Now in the google groups in the posting found here GAE/J Maven Support there's an alternative that doesn't rely on ant or google app engine SDK. I've tried this one out as well but found it to be not as easy to follow or use. I guess its a matter of what happens in the future on support and features, as to which one will be the better choice.

GWT support:
There were two maven plugins I found for this found here : gwt-maven google code and here : Google Web toolkit plugin. Long story short, the contributors from the google code hosted project will now be contributing to the Gwt plugin found on codehaus.org. So using this plugin Google Web toolkit plugin, should be good. The issues I've found is most of the documentation found on the site, refer to version 1.1. Using their plugin repository there was no 1.1 at the time of this post only 1.0 is found on there plugin repository So the solution is to use there sandbox repository found here Sandbox repository. Here you will be able to find the 1.1 release of GWT maven plugin.

Wednesday, August 27, 2008

Flex and Java and Me - Getting Started

The technology stack I'm going to use is flex, actionscript 3 .. using pure mvc, mate, or caingorm ( this requires another writeup) for the front end. Back end will be using java - spring , hibernate. So now that the easy stuff is out of the way, I'm going to setup the frame for the project using maven to manage dependencies, and builds. I went through this tutorial Flex, Spring and BlazeDS full Stack, and it was very good to get a good start running on the build and management tools. I will build and expand on this tutorial, to organize and manage everything easier.

Adobe released Flex Builder Linux. Im using alpha 4 currently. Start with getting eclise 3.3 as I issues with ganymede 3.4 and Flex Builder alpha 3, but may have been resolved with alpha 4. Also I'm using Q for Eclipse plugin.

Refer back to the original tutorial I followed for most examples.
So to start first thing to do is create a root project. This is where all modules will be placed under. In eclipse or maven directly create a project archetype quick-start.
1. delete the "src" directory, its not necessary.
2. Edit pom.xml change packaging to "pom" instead of "jar"
3. create a maven module for your flex for example projname-ria.

Creating a Flex Module
Create a maven module under the root project. The archetype is the maven-archetype-flex.
To have maven handle the adobe flex dependencies and to compile, I am currently using the - flex mojos - project. Some really excellent work is being done on this project. Refer to my writeup here - flex-mojo - getting started

Creating - Java
Next I wil create a core module - maven-archetype-quickstart and a web module - maven-archetype-webapp. The only thing I would consider is creating a commons project. If you intend on creating library reusable classes, then its probably good to create it as a separate project. Refactor later.
Now for dependencies, add Spring 2.5.5 , and hibernate 3.2.6.ga as these are pretty much the middle tier and persistence tier frameworks we will be working with.

Now pretty much follow the tutorial for the configuration module, and the plugins to put everything together. The only other catch is in the mxml files refer to the full namespace


<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"



and in the article they just refer to /2006/mxml and you will get compile errors.