Trygve Laugst�l <[EMAIL PROTECTED]> wrote on 03/05/2004
08:43:15 PM:
[snip]
> I relly don't thinkt this is so bad. Most of the plugins are much more
than
> one liners and as you can see the overhead for each file here is 4
lines.
4 lines, and it's not as functional. The Maven2 clean plugin is over 100
lines of java. The jelly version is just over 10. We're talking orders of
magnitude more code, and the Ant codebase is well tested, as evidenced by
the copying of bizarre code from it into Maven2.
> On the upside the plugins will be much easier to test and will run fast
as
> hell.
Definitely, but this doesn't help people write them first time.
> There are quite a bit of very good file handing methods in commons-io
but
> I totally agree with you. We might wan't to create a maven-plugin-utils
> library for making plugin development easier.
commons-io is painfully thin on the sort of code you could use in a build
tool. And plexus FileUtils is pretty much just a copy of Ant's code.
Take the jar plugin in Maven2. It's 164 lines of java code.
Compare it to the one in Maven1. It's 295 lines of Jelly.
The Maven2 plugin simply creates a jar file of the current directory
excluding package.html files. It is functionally equivalent to
<jar destfile="${outputDirectory}/${jarName}.jar" basedir="${basedir}"
excludes="**/package.html"/>
For the extra 131 lines of code in the Maven1 plugin, you get an
incredible amount more including goals to deploy the artifact (deploy,
deploy-snapshot, install, install-snapshot) and a whole lot of
customisation. Let's compare apples to apples.
If someone gave me the choice between 1 line of Ant and 164 lines of
custom Java code with throws Exception throughout and a whole load of
empty catch blocks I know which I'd choose.
--
dIon
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]