Plugin Documentation

Goals available for this plugin:

Goal Description
cougar-codegen:process A plugin which is responsible for generating Cougar-based services. This encompasses a number of code- and file-generation steps, as well as validation. The intention is for this mojo to do everything needed, keeping the plugins/plugin section of a Cougar service's pom as simple as possible.

NOTE: idd dependencies

IDDs can be read from the file system or as resources. The IDD is expected to be named after the service (see services param), suffixed with .xml for the service and -Extensions.xml for the extensions definition. If you're using an IDD file then it should be in /src/main/resources. Switch between the two modes using the iddAsResource flag.

A gotcha exists when accessing IDDs as resources. Since the IDDs are not required at run-time, it would make sense to include the relevant IDD project (jar) as a plugin dependency (ie. in project/plugins/plugin/dependencies as opposed to a project dependency of project/dependencies). You can do this unless your service is built as part of a larger project tree, in which multiple services are built. Maven resolves dependencies for the plugin once, so you can't have projectA relying on projectA-idd and project B relying on projectB-idd respectively - you end up with both projects relying on (say) projectA-idd. To work around this, you have to include the IDD as part of the project dependencies.

TODO If there's an easy way to fix this, we should do so (maven-savvy volunteers welcome)

System Requirements

The following specifies the minimum requirements to run this Maven plugin:

Maven 2.0
JDK 1.7
Memory No minimum requirement.
Disk Space No minimum requirement.

Usage

You should specify the version in your project's plugin configuration:

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.betfair.cougar</groupId>
          <artifactId>cougar-codegen-plugin</artifactId>
          <version>3.3-SNAPSHOT</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>com.betfair.cougar</groupId>
        <artifactId>cougar-codegen-plugin</artifactId>
        <version>3.3-SNAPSHOT</version>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

For more information, see "Guide to Configuring Plug-ins"