Maven2 Compilers


Here’s one for the road. I’ve been constantly trying to figure out how to customize the M2 compiler plugin. It promises to be easily customizable for plugging in your own compiler but I can’t, for the life of me, figure out how to do that. I tried once with Groovy and now it looks like I’ll be at it again wiXSLT. I want to compile my stylesheets as part of my build and I’m thinking this is the plugin for the job. If you have a clue, leave me one… Keep Banging…

2 thoughts on “Maven2 Compilers

  1. Hi,

    Usually, in this situation I look under the “hood” – in your local repository locate compiler plugin jar file:

    ${local.repository}\org\apache\maven\plugins\maven-compiler-plugin\2.0.1\maven-compiler-plugin-2.0.1.jar

    Then, inside the archive there is a file:

    META-INF\maven\plugin.xml

    This file contains all the properties, supported goals, default configuration.

    It has 2 goalsL compile, testCompile.
    It also has different properties and you can override them when you specify plugin in pom.xml file.

    Hope it’ll help.

    Alexander Shvets.

  2. Alex,

    I haven’t had time to look at it but I’ll revisit the topic soon. My personal experience with Maven shows that the config options allow only limited customizability and are applicable to the languages for which there are available compilers. As I understand, the compiler plugin can be extended through plugin code to allow compilation of a particular language. (That’s the part I’m trying to learn.) I vaguely remember the docs and reading through the code seeing particular implementations for different languages. I also remember something about Plexus. The more I think about it the more curious I become. Thanx for the tip!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s