To edit or add content to this Wiki, you can simply create a new account at http://wocommunity.org/account.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 17 Next »

This is the home page for the Maven Plugins space.

WOProject Maven2 Plugins

Getting Started

  • Install Maven2 on a local machine.
  • Add ObjectStyle Maven2 repository to the project POM (we may distribute the plugins via Ibiblio at some point too). E.g.:
pom.xml
<pluginRepositories>
    <pluginRepository>
        <id>objectstyle</id>
        <name>ObjectStyle Public Maven2 repo</name>
        <url>http://objectstyle.org/maven2</url>
        <layout>default</layout>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>daily</updatePolicy>
            <checksumPolicy>ignore</checksumPolicy>
        </snapshots>
        <releases>
            <enabled>true</enabled>
        </releases>
    </pluginRepository>
...
</pluginRepositories>
  • Plugins are bound to the build lifecycle via "project/build/plugins" section of the POM. Here is a general example, for more details see documentation of individual plugins:
pom.xml
<build>
    <plugins>
       <plugin>
            <groupId>org.objectstyle.woproject.maven2</groupId>

            plugin specific information goes here...

        </plugin>
    </plugins>
</build>

Useful Information

By default, Maven will search the groupId org.apache.maven.plugins for prefix-to-artifactId mappings for the plug-ins it needs to perform a given build. However, WOProject maven plug-ins belong to a different group: org.objectstyle.woproject.maven2. Since the Maven project is assumed to have control over the default plug-in groupId, we can configure Maven to search other groupId locations for plugin-prefix mappings.

In the Maven settings file (per-user: ~/.m2/settings.xml; global: $M2_HOME/conf/settings.xml), you can provide a custom pluginGroups section, listing the plugin groupIds you want to search (each groupId goes in its own pluginGroup sub-element). For example, if your projects use a WOProject maven plug-in, you might have the following in your settings:

settings.xml
<settings>
...
  <pluginGroups>
    <pluginGroup>org.objectstyle.woproject.maven2</pluginGroup>
  </pluginGroups>
...
</settings>

Now you can directly execute plug-ins, i.e. mvn woproject:goal instead of mvn org.objectstyle.woproject.maven2:maven-woproject-plugin:goal.

Reference: http://maven.apache.org/guides/introduction/introduction-to-plugin-prefix-mapping.html.

settings.xml ecample settings.xml.
MavenHelloWorldExamples.zip MavenHelloWorldExamples projects.

  • No labels