struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Germuska <>
Subject Re: Struts and Maven
Date Sat, 03 May 2003 19:17:17 GMT
At 8:01 PM +0200 5/3/03, Graham Leggett wrote:
>Hi all,
>I notice the struts v1.1-rc1 jars are included in the maven 
>repository at
>Does anyone have any instructions on using maven to include struts 
>into a maven driven project?
>I need to know what dependancies I must include in the project.xml, 
>and what is to be done with the nightly build dependancies that are 
>currently outstanding (in the case of commons-logging, there is no 
>snapshot jar available, so in theory the struts.jar could never work 
>as the dependancy could never be satisfied).

This actually turns out not to be a big deal, especially since all of 
the Commons projects are "mavenized".  Here's what you do:

Check out the jakarta-commons and jakarta-commons-sandbox modules 
from the Apache CVS repository.  (See for details.)

Then, in any Commons subdirectory, type "maven jar:install".  This 
will build the JAR and put it in $MAVEN_HOME/repository for you. 
Then, unless your dependency is on version SNAPSHOT, Maven won't even 
go to iBiblio to look for it.

If you work with a team, a more complete solution would be to set up 
a local web server as an alternative repository.  If you were 
planning on deploying Maven generated documentation of your projects 
to a server, that's a natural place to also put a repository.  To get 
your Maven to check more than one repository for JARs, set this Maven 


I've found it most appropriate to set it in the local 
"" file, but you can define it anywhere Maven will 
find it, including on the command line with "-D".   Putting it in and putting that into CVS makes it easy for your 
whole team to keep in sync with JARs.

I seeded the local server with an exact copy of my 
$MAVEN_HOME/repository, and then added JARs as needed.  This is a 
handy way to deal with Sun's licensing restrictions on things like 
JavaMail too -- whether or not it's within the technical letter of 
the licensing agreement, if your local server is not open to the 
world, I doubt they'll give you a headache about redistributing those 

If you have the local repository, then instead of copying your JARs 
manually from $MAVEN_HOME/repository, you can deploy them directly 
with "maven jar:deploy"  Just set these two additional properties 
(again, I like to put them in

This generally assumes that you can SSH to ""  I'm 
pretty sure the "deploy" subgoal of "jar" has a filesystem 
alternative to SSH, but I haven't used it.

I've been working on a "genstruts" plugin along the lines of the 
"genapp" plugin which is distributed with Maven.  It prepares a local 
project directory, including a project.xml with the many Struts 
dependencies already defined, plus sets up good default copies of 
web.xml, struts-config.xml with the validator and tiles plugins 
already there, and of course copies of the TLDs and DTDs, etc.  It 
promises to save a bunch of time setting up a new project once we get 
it rolling.  Before you ask for my copy -- like I said, it's not 
ready yet.  But if you look at the src for the "genapp" plugin and if 
you understand Ant at all, you should find it pretty easy to adapt to 
your local needs.

Hope this helps.  We're finding Maven very helpful in getting our 
teams organized, and it makes it much easier for developers to use 
the IDE of their choice without needing to spend a lot of time 
setting up project files, since Maven can automatically generate 
JBuilder , Eclipse and IDEA project files as well as ANT build 

Joe Germuska       
"If nature worked that way, the universe would crash all the time." 
	--Jaron Lanier

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message