You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Mattox <mi...@verideon.com> on 2005/03/09 11:18:35 UTC

Jars & Resources For Development, synchronizing with Maven

On my last project I came up with a method of using maven to copy the jars
and filter the resources for the developers during the development phase. 
I think maybe there is a better method (I hope).  So I'd like to describe
what I did and see if any of you have a better idea.

To avoid putting our jars into CVS, and to assure that the developers are
using the same jars that are in the maven project.xml, I created a goal
"copy-jars" in the maven.xml which copies all the jar dependencies to the
project's lib directory.  Then the jars at added to the project inside
eclipse.  What I liked is eclipse & the project.xml were always in sync. 
I tried the maven plugin for eclipse but it wasn't working (I filed JIRA
issues) this was about 6-8 months ago, so maybe the situation has
improved.

Second issue is the resource files.  For our builds I used the filtering
feature (we use @someproperty@ and then filter it out).  We have a set of
filters for dev & a set for the integration environment.  So I created a
maven goal "copy-resources" which copies the resources from src/conf to
src/conf.dev, applying the filters from the dev-env.properties.  This
worked, but the problem is everytime a resource file was modified, the
script must be run.  Not so bad, but the problem is when someone else
modifies the resource file and you don't know.  Your code stops working
and you don't know that you need to run the copy-resources goal.

A further hack on this one, was that I wrote a maven goal to copy all the
resources for dependent projects into a src/conf.dep.  That way we don't
have the same conf files in every project.  So the steps are:

copy all resources from dependent projects to src/conf.dep
copy resources from src/conf.dep to src/conf.dev applying filters
copy resources from src/conf to src/conf.dev applying filters

The last step allows overriding a resource file in another project because
the file will be overwritten with the last copy.  This was a pretty cool
feature and allowed us to greatly reduce the number of resource files in
our workspace.  But is there a better way?

Thanks for reading, if you have any ideas on how to improve on this
procedure I'd be very interested.  I'm integrating Maven on a new project
and I don't want to blindly do what I did before.  i'd like to improve it
as much as possible.  But at the same time, the schedule is extremely
short so I'm tempted to go with what I know works.

Regards,
Michael Mattox

PS: Please CC me in replies as I'm subscribed to the daily digest.  Thanks!




--
This E-mail is confidential.  It may also be legally privileged.  If you are
not the addressee you may not copy, forward, disclose or use any part of it.
If you have received this message in error, please delete it and all copies
from your system and notify the sender immediately by return E-mail.
Internet communications cannot be guaranteed to be timely, secure, error or
virus-free.  The sender does not accept liability for any errors or omissions.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org