Hey guys,
I'm getting ready to start writing a (hopefully relatively simple) Maven
2 plugin that basically can copy an existing project directory into a
temporary location, overlay (copy over) files from the src/main
directory into the same relative positions/hierarchy in the temporary
directory, and then call the build in the temporary directory.
The intent (maybe there is a much easier way of doing this) is to be
able to easily modify and repackage existing open-source projects with
local modifications.
I have written a few ant scripts to do similar for other projects in the
past, but for 3 projects that I'm getting ready to work on, I need to
replace files (such as spring and webapp configuration files) and
possibly others, and I'd rather do that in a Maven project and produce
packages that contain the appropriate configuration rather than
modifying those config files on the various servers.
Here is how I think it would work:
* You'd specify the following parameters to the plugin in the pom:
- "originalDirPath" - Path of the directory with the original project
- "tempDirPath" - (optional - if not specified, it uses some default
directory) Path to the temporary directory
- "overlayDirPath" - (optional - if not specified, it uses some default
directory) Path to the directory containing hierarchy of files/dirs to
overlay atop (replace) original files that were copied to temporary
directory
- "dirsAndFilesToRemovePriorToOverlay" - (optional) A list of
files/directories to remove from the temporary directory, prior to
copying overlay files/dirs, possibly optionally being able to specify
them as regular expressions
* When the plugin was called, it would first recursively copy from
"originalDirPath" to "tempDirPath". Then it would delete files and
directories if specified as "dirsAndFilesToRemovePriorToOverlay"
(directories would recursively delete subdirs, etc.). Then it would
recursively copy files and dirs from "overlayDirPath" to "tempDirPath".
It would then call the Maven 2 build in "tempDirPath". Finally it would
copy the target directory from tempDirPath/target to ./target.
I don't really need "dirsAndFilesToRemovePriorToOverlay" other than
possibly to eliminate garbage like "*~" "#*" and svn files, but I
thought it might be helpful for others.
I'd also really like it to call external Ant builds as well (I could use
that for 2 other projects that I was previously using a similar Ant
script to do the same thing), but I probably wouldn't do that in the
first version.
So, my two questions are:
1) If there is a more standard/more widely used way of accomplishing
what I'm trying to accomplish without writing such a plugin, could you
describe it?
2) Assuming this plugin would be useful to others, would anyone be
interested in me hosting this plugin in mojo.codehaus.org after it is
developed?
Thanks!
Gary
--
Gary Weaver
Internet Framework Services
Office of Information Technology
Duke University
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email