Working on a general-purpose create-web-project.crn script

1 view
Skip to first unread message

Andrew Wills

unread,
Jul 8, 2008, 5:41:53 PM7/8/08
to cernunnos-discussion
Hey folks,

Some of you might remember back to October of last year when I wrote
an article about Cernunnos-based Java portlets:
http://www.unicon.net/node/822

In that article, I described a set of Cernunnos XML files that can
help you set up a new portletApp project. These are hosted in
googlecode SVN at this location:
http://cernunnos.googlecode.com/svn/etc/Portlet/. There are 3 notable
files here:
- create-portlet-app.crn (creates a new project that builds to a
portletApp .war file)
- add-portlet.crn (adds a portlet to your portletApp)
- add-user-attribute.crn (adds a user attribute to your portletApp)

These XML files created an Ant-based Java project based on
cernunnos-1.0-M3 (circa Oct, 2007).

Recently I wanted to use this approach again, but clearly M3 wasn't
going to cut it (M8 is the most recent tagged milestone).

I realized 2 things:
- (1) simply updating the current approach (without overhauling it)
was going to be a lot of work, since the CRN dependencies, which have
changed quite a bit, were included in the WEB-INF/lib/ directory of
the project (as is normal with Ant); also, I'd likely have to go
through this painful process again when M9 becomes available
- (2) in light of the enhancements Andy Gherna is eyeing in the area
of Cernunnos-based servlets, it's likely I'll want an 'add-servlet'
script as well an 'add-portlet' one

In the case of (1), it seems that this is one of the key problems
Maven was created to address. If we change the auto-created projects
over to the maven build system, we'll only have to change 1 line of
XML (e.g. <version>1.0.0-M8</version>) to update the cernunnos
version.

In the case of (2), it seems like a good idea to leave the
portlet-specific language and features off of the file that creates
the project.

So I've put together a new version of these features, and it's located
here: http://cernunnos.googlecode.com/svn/etc/WebProject/

It also provides 3 scripts:
- create-web-project.crn (creates a maven2-based project that builds
to a .war)
- add-portlet.crn (similar to the previous version; portlet.xml is
not added until the first time this file is invoked)
- add-user-attribute.crn (similar to the previous version)

Cheers,

drew wills

Reply all
Reply to author
Forward
0 new messages