Re: Maven (was: WO 5.4 Linux Deployment)
Re: Maven (was: WO 5.4 Linux Deployment)
- Subject: Re: Maven (was: WO 5.4 Linux Deployment)
- From: Jake MacMullin <email@hidden>
- Date: Tue, 25 Mar 2008 22:24:13 -0700
Lachlan,
Ok - I think I know what you mean about a 'shared environment'. I think the easiest way to handle this (if I understand what you're trying to achieve) is to list the repositories you want to use in your projects' poms and make sure they are visible to anyone who needs to build the application.
For example, we've got an internal repository at the BBC containing the WebObjects jars and some other libraries needed to build our applications and the parent-pom for our projects references this repository. This way we just check the pom.xml in to our source control and for a developer to build our WO applications on a new machine all they need to do is make sure Java and Maven are installed, then check out the source code and execute the 'mvn package' goal.
Maven will then download the WO jars (and other libraries) from our local Maven repository.
As for your other question about how to handle WOComponents, EOModels etc. when building a WO framework as a jar, it is really quite simple. As I said I just use the standard Maven 'package' goal. There are only really two 'special' things you need to do to make sure WebObjects recognises the .jar as a framework:
1. WebObjects expects to find any resources (Components, EOModels etc) in a directory at the top level of the .jar called 'Resources' (note the capital 'R'). Maven will merge anything contained in '/src/main/resources' (note the lowercase 'r') to the top of the .jar (along-side the complied classes) - so to get Maven to do the right thing, put your resources in '/src/main/resources/Resources'.
2. WebObjects expects to find an Info.plist - so make sure to include one (just copy one from an existing framework project) in the 'Resources' directory.
That's it. If you build a .jar in this way it magically becomes a 'framework' as far as WebObjects is concerned.
Cheers,
Jake
On Tuesday, March 25, 2008, at 09:54PM, "Lachlan Deck" <email@hidden> wrote:
>Hi Jake,
>
>On 26/03/2008, at 3:40 PM, Jake MacMullin wrote:
>> Lachlan,
>>
>>> would you mind sharing a little more about your use of maven?
>>
>> I'd be happy to.
>
>Great. Much appreciated...
>
>>> Firstly, how does this differ from woproject's maven stuff?
>>> http://wiki.objectstyle.org/confluence/display/WOL/WOProject-Maven2
>>
>> From memory, the WOProject Maven stuff uses a Maven Ant Plug-in to
>> build a WebObjects application as a .woa from Maven. My
>> understanding is that it ends up running the same ant task that you
>> would run from Eclipse - but the Maven plug-in allows you to call it
>> from a Maven build. (My memory might be wrong here - or it may have
>> changed since I last looked at it)
>>
>> In contrast, I'm using Maven to build a WAR and I don't need any
>> plug-ins to do this (as Maven supports building WARs 'out of the
>> box'). The 'wocreator' plug-in I linked to is just a handy shortcut
>> to create a Maven project (Like the WOLips 'new project' wizard) -
>> the actual build process itself doesn't require any special plug-ins.
>
>Okay. Interesting.
>
>>
>>> Is there a remote repository already set up, either at objectstyle or
>>> otherwise, with the relevant plugins available?
>>
>> I believe there is a Maven repository containing the WOProject Maven
>> plug-ins - not sure where though. The main thing you need a
>> repository for though is the WebObjects jars themselves.
>> Unfortunately, Apple don't make the WebObjects jars available in
>> this way - but you can easily extract them from an installed copy of
>> WebObjects (see the scripts on the wocreator site for examples of
>> how to do this).
>
>Sure.
>
>>> - is it possible to set up an additional maven repo (e.g., local to
>>> trunk) that can be checked in/out of svn
>>
>> I'm not really sure what you mean by this - or what you'd be hoping
>> to achieve.
>
>Political ease ;-) er, I mean for a shared environment being able to
>maintain the repo at my end and have it transparently updated for any
>remote users (or build server) whenever they do an svn up.
>
>i.e., this kind of thing but checked in/out of svn:
>http://maven.apache.org/guides/mini/guide-multiple-repositories.html
>
>>> - what's the maven target for building a framework project as a .jar
>>> and/or .framework
>>
>> I build frameworks as .jars using the standard 'mvn package' goal
>> which will create a .jar from your project's source code if your
>> project file (pom.xml) specifies 'jar' as the 'packaging'.
>
>...and the components, resources, EOModels?
>
>> I haven't used Maven to build a .framework so I'm not sure what the
>> goal is - but I believe this is supported by the WOProject Maven
>> plug-ins
>>
>>> - and for a woapp, building as a woa?
>>
>> I haven't used Maven to build a .woa so I'm not sure what the goal
>> is - but I believe this is supported by the WOProject Maven plug-ins
>>
>>> - how do you push a release to a server etc
>>
>> I'm not using the Maven deployment mechanisms at the moment, so I
>> just manually copy the .WAR to a server
>>
>>> Any tutorials you've got for the various parts of usage that are
>>> worth
>>> adding to the wiki would be great.
>>
>> There is a screencast on the wocreator site - perhaps I should add a
>> link to the relevant section of the wiki.
>>
>> Hope this helps,
>
>Thanks. All good to know.
>
>> Jake
>>
>>> Any other sets of how-tos (and real examples) on the net for
>>> practical
>>> usage of maven would be good :-)
>>>
>>> Thanks.
>>>
>>> On 26/03/2008, at 1:59 PM, Jake MacMullin wrote:
>>>> I also deploy on linux using Tomcat (and recently Jetty too), but I
>>>> build my applications using Maven. I've written a simple Maven plug-
>>>> in to create a Maven project to build WebObjects applications as
>>>> WARs if you're interested:
>>>>
>>>> http://wocreator.sourceforge.net/
>
>with regards,
>--
>
>Lachlan Deck
>
>
>
>
>
_______________________________________________
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