On Jun 2, 2008, at 10:06 AM, [EMAIL PROTECTED] wrote:
Alan Gutierrez schrieb:
Related question:
In most of my projects I create command line tools. To get them up
and
running quickly, I use Ant and all the classpath configuration
that is
already defined in my build.xml.
I've seen that you're supposed to use Profiles to switch out plugin
configurations, so I could use different profiles to change my antrun
tasks, effectively creating targets.
But, is that the best practice? I assume that there are one of three
choices. (Because, I explored making Maven switchable without writing
plugins, and was told that profiles where it.)
So I would recommend keeping maven for build tasks, and doing all the
other stuff that is, as you say, "only tangentially part of the build
process" separate, eg shell-script, perl, or ant. If it isn't part
of a
build lifecycle, then shoe-horning it into Maven will always be
awkward.
This thread started with someone asking how to set up maven to
effectively act like
ant runSomeArbitraryProcessing
and I think this is exactly the sort of thing that should NOT be
pushed
into a pom file. There is no reason why everything needs to be done
via
Maven.
Simon
I'm happy to leave Maven focused on a build and deployment. The Ant
task looks like it will be the method by which I implement command
line utilities, without duplicating path management.
However, it seems like it would be best to create a convention for
the shell script / batch file pair. Maybe utility that builds these
utilities for you. If you name a utility such as database-export and
create a class com.software.DatabaseExport.java, a Maven plugin can
generate a database-export.sh and a database-export.bat that will
know how to find libraries given an layout convention. The code for
launching Ant or Groovy, those shell scripts and batch files, can be
used as jumping off point for a convention.
Writing Java command line programs is easy using args4j. It's
launching them and deploying them that is a problem.
This would be my preferred way of creating this utilities, since it
would lead me to develop generally useful utilities, rather than one
off Ant monsters.
Alan
--
Alan Gutierrez | [EMAIL PROTECTED] | http://blogometer.com/ | 504
717 1428
Think New Orleans | http://thinknola.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]