Re: [ANN] Maven WOCreator Plug-in
Re: [ANN] Maven WOCreator Plug-in
- Subject: Re: [ANN] Maven WOCreator Plug-in
- From: Jake MacMullin <email@hidden>
- Date: Tue, 14 Aug 2007 15:42:47 +0100
Johan,
See my answers inline below:
On 14 Aug 2007, at 11:24, Johan Henselmans wrote:
On Aug 9, 2007, at 1:48 PM, Jake MacMullin wrote:
Introducing WOCreator
WOCreator is a Maven plug-in that can be used to create initial
Maven project templates for J2EE WebObjects applications.
Who might want to use this plug-in (or who might want to use Maven)?
Jake,
Thanks for making the code (and the screencast) available. Nice
preparation to make that even before the WOWODC07 (or was it
because the recording somehow failed on the meeting? ;-)
I do have some questions.
The screencast download gives problems. the downloads stalled every
time in the browsers I used.
People using Safari are then prevented from seeing the complete
podcast, because the second time the partial download will be in
the Quicktime cache. You might add a warning to remove the
quicktime cache (in Library/Caches/Quicktime) before one tries to
redownload the screencast if the download stalled. Firefox does try
a complete reload.
I ended up using:
curl -C - -O --retry 10 http://wocreator.sourceforge.net/wocreator-
large.mov
several times to get it.
Thanks for pointing this out - I'll have a look at what's going on...
I noticed the hsqlb.java. What was that? A webobjects plugin? It
so, it would be nice to add it to the Wonder database plugins?
I wanted to have something that was self-contained for the
demonstration I did for WOWODC so I could upload a single artifact
(WAR) and not have to worry about creating a database separately, so
I investigated using the embedded HSQLDB. When I first tried to use
HSQLDB I found that EOF was not successfully generating primary keys,
so I wrote a simple JDBCPlugIn. The only method I actually
implemented was newPrimaryKeys and I wrote a very naive
implementation that just returned UUIDs. It worked - but I wouldn't
want to use it for anything real. I'm happy to send you the code off-
list if you think it'd be useful.
How did you make the screencast?
I used iShowU to capture the screen of a virtual machine that was
running Ubuntu.
Then, I wonder if wocreator is also running in Eclipse?
I'm not sure what you're asking here. In my screencast (and during
the WOWODC presentation) I did not use Eclipse at all. I used the
WOCreator plug-in to create a Maven project and then I used the Maven
command-line tool to build my application as a WAR. Finally, I used
the Maven Jetty plug-in to run my application (which had been built
as a WAR) within the Jetty container.
I did not use Eclipse for my presentation because I wanted to show
that it is possible to use Maven to build WebObjects applications as
WARs independent of any IDE. However, in real-world development, I do
use Eclipse / WOLips.
Once I've created my Maven project, I use the Maven Eclipse plug-in
(mvn eclipse:eclipse) to generate an Eclipse project descriptor and I
then import my project into Eclipse (as a Java project) where I edit
my components using the WOLips Component Editor and my EOModels using
Entity Modeller. However, I don't use WOLips to build or run my
applications at the moment. Instead, I use the 'External Tools'
feature of Eclipse to execute a Maven build and I attach the Eclipse
debugger to my application once it is running in a container.
I noticed you used a different file structure as that Eclipse is
doing if one creates a WebObjects application. Is that because of
the specific demands of the j2ee/war structure? Are these things
incompatible?
There are two reasons I used a different file structure. The first is
that Maven uses the concept of "convention over configuration" and
expects java sources and other resources to be laid out according to
the Maven convention. If you lay your files out the way it expects,
you don't have to configure as much.
Secondly, WebObjects applications built as WARs are almost completely
'plain WARs'. That is, they're almost exactly the same as any other
J2EE WAR. There are a couple of notable differences:
1). From what I can tell, when you deploy a WebObjects application as
a WAR - it must contain a 'main application bundle'. That is, while
most WARs include some Java classes in WEB-INF/classes and any
libraries in WEB-INF/lib, WebObjects requires that your application
be built as a 'JAR bundle' and contained in the WEB-INF/lib
directory. This is why the layout created by the WOCreator plug-in is
for a two-module project (one module for the main application & one
module for the WAR).
2). Related to the first difference, WebObjects has the concepts of
'bundles'. Your application is contained in the 'main application
bundle' and any shared frameworks / libraries are contained in
'framework bundles'. There are two ways to create 'bundles'. The
'traditional' approach is to use a '.framework' directory laid out in
a particular way. The second way is to create a .jar. According to
the following from the NSBundle javadoc, this is now the preferred
approach:
"At this point, JAR files are the preferred storage mechanism for
NSBundles."
- http://developer.apple.com/documentation/WebObjects/Reference/API/
com/webobjects/foundation/NSBundle.html
Again, JARs that are also 'bundles' are almost exactly the same as a
'plain JAR'. However, whilst plain JARs might include resources at
the top-level of the JAR, alongside java sources, WebObjects expects
to find resources in a 'directory' called 'Resources' at the top-
level of a JAR. It is the combination of NSBundle expecting to find a
directory called 'Resources' within the JAR coupled with Maven's
convention of merging anything contained within a 'resources'
directory in to the top-level of a JAR that has led to my layout
having a somewhat strange structure of storing WOComponents etc in
src/main/resources/Resources.
This structure is not incompatible with Eclipse. If you use the Maven
Eclipse plug-in you can generate an Eclipse project descriptor and
import the project into Eclipse and everything works fine.
However, it is currently incompatible with the WOLips incremental
builder and ant build (although you may be able to tweak these to get
it to work). This means that if you use this project layout - you can
use Maven to build your project as a WAR, but you can't use WOLips at
the same time to build a .woa (although you can use WOLips to edit
your components / EOModels).
I also was wondering if this approach could be used in a standard
wotaskd environment.
The WOCreator plug-in creates a Maven project that produces a WAR.
There are other Maven plug-ins that you can use to produce different
artifact types. WOProject includes some Maven plug-ins to
produce .WOAs, but as I currently deploy my applications as WARs I
have not used them.
People who want to deploy WebObjects applications to a standard
Java application server (without requiring WebObjects to be
installed). This plug-in creates Maven project templates that will
build WebObjects applications as stand-alone J2EE Web Application
Archives (WARs) containing your applications and all the required
frameworks. If you want to deploy your applications to JBoss,
Tomcat, Jetty etc then you may be interested in using this plug-in.
People who want to develop WebObjects applications using their
choice of Integrated Development Environment (IDE) and Operating
System. Using Maven to build WebObjects applications does not
require a particular IDE or Operating System. Once you have a
Maven project, you can use other Maven plug-ins to generate
project files for a range of popular IDEs (including Eclipse,
NetBeans, JBuilder and IntelliJ IDEA).
People who are interested in using Maven to build WebObjects
applications. If you already use Maven, or are interested in using
Maven, you may be interested in using this plug-in.
Who probably won’t want to use this plug-in?
This plug-in creates Maven project templates that will produce
WARs. If you want to deploy your applications as .WOAs then you
probably won’t want to use this plug-in.
This plug-in is not required to use Maven to build WebObjects
applications. It simply automates the creation of the initial
Maven project structure. If you are already using Maven and are
happy creating the initial project structure then you probably
won’t want to use this plug-in.
More Information
You can find more information about the WOCreator plug-in
(including a screen cast showing the use of the plug-in) at the
project web site:
http://wocreator.sourceforge.net
In order to use the WOCreator plug-in you need Maven 2. You can
find Maven at:
http://maven.apache.org
Regards,
Jake MacMullin
http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain
personal views which are not the views of the BBC unless
specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in
reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40netsense.nl
This email sent to email@hidden
Regards,
Johan Henselmans
http://www.netsense.nl
Tel: +31-20-6267538
Fax: +31-20-6273852
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
@bbc.co.uk
This email sent to email@hidden
Regards,
Jake MacMullin
http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden