"Maven is ugly" I think that is the complaint I hear most often: it takes too much XML to do anything. I love Maven, really, but it's difficult to fall in love with, especially for your average developer, because it is so unpretty compared to the slim hotties like Rake or Ant. Despite the face, Maven has a good heart, will stick with you forever, and makes a mean home-made dish - like the old song goes, "If you want to be happy for the rest of your life you got to make an ugly woman your wife..."
But, just like everyone else, I want both - looks and a faithful personality to boot.
So, for example, look at the relatively simple task of creating a project with an integration test and then cleaning it up:
<project xmlns="http://maven.apache.org/POM/4.0.0"66 lines of <XML></XML> Here is the same information as above, in a 15-line pseudo-YAML, truncated form.
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.training.plugins</groupId>
<artifactId>maven-zip-plugin</artifactId>
<packaging>maven-plugin</packaging>
<name>Maven Zip Packaging Plugin</name>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>1.0-alpha-6</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<executions>
<execution>
<id>zip-packaging-test</id>
<phase>integration-test</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>zip-packaging-clean</id>
<phase>pre-clean</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<goals>
<goal>clean</goal>
</goals>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<verbose>true</verbose>
<filesets>
<fileset>
<directory>src/projects</directory>
<includes>
<include>**/build.log</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
</project>
modelVersion=4.0.0Now, don't get me wrong. I'm not going to try and make the POM understand YAML. The point is - and this is an important point - the POM above does a lot of work with very little information. The problem is that Maven doesn't do a good job showing its inner beauty - its true simplicity - because its outside is fugly as hell. Maven's configuration is complex to keep its core simple... almost to a fault. Maven has a beautiful soul and a butt-ugly face. It's time for a teen-movie make-over - no more glasses, no more ponytail.
coordinate=com.training.plugins:maven-zip-plugin:1.0-SNAPSHOT:maven-plugin
name=Maven Zip Packaging Plugin
depends=[
org.apache.maven:maven-plugin-api:2.0.4,
org.codehaus.plexus:plexus-archiver:1.0-alpha-6 ]
build:
invoker:
execute run on integration-test => zip-packaging-test
execute run on pre-clean => zip-packaging-clean
goals=[clean]
clean:
verbose=true
filesets=[{directory=src/projects,includes=[**/build.log]}]
That's my goal for this summer... to make it a little bit more shallow, a little bit more trashy - just enough to turn some heads.