Introduction

Java 1.2 Runtime Signature excluding vendor specific implementation classes.

Usage

This signature can be used by Animal Sniffer Maven Plugin, Animal Sniffer ANT Tasks or Animal Sniffer Enforcer Rule

Downloading

This signature is hosted on the Maven Central Repository with the following coordinates:

Group Id org.codehaus.mojo.signature
Artifact Id java12
Version 1.0

With Animal Sniffer Maven Plugin

To check your project against this signature using the Animal Sniffer Maven Plugin, include the following configuration in your pom.xml

<project>
  ...
  <build>
    ...
    <plugins>
      ...
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <version>1.3</version>
        ...
        <executions>
          ...
          <execution>
            <id>check-java12</id>
            <phase>test</phase>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <signature>
                <groupId>org.codehaus.mojo.signature</groupId>
                <artifactId>java12</artifactId>
                <version>1.0</version>
              </signature>
            </configuration>
          </execution>
          ...
        <executions>
        ...
      </plugin>
      ...
    </plugins>
    ...
  </build>
  ...
</project>

With Animal Sniffer ANT Tasks

Download the signature from the Maven Central Repository and configure the check-signature task to use the signature, e.g.

<project xmlns:as="antlib:org.codehaus.mojo.animal_sniffer">
  <typedef uri="antlib:org.codehaus.mojo.animal_sniffer">
    <classpath path="lib/animal-sniffer-ant-tasks-1.3.jar"/>
  </typedef>
  <target name="check-java12" depends="compile">
    <as:check-signature signature="java12-1.0.signature">
      <path path="classes"/>
    </as:check-signature>
  </target>
</project>

Alternatively, you can use Maven ANT Tasks to download the signatures for you automatically, e.g.

<project xmlns:as="antlib:org.codehaus.mojo.animal_sniffer" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
  <!-- define Maven ANT Tasks -->
  <typedef uri="antlib:org.apache.maven.artifact.ant">
    <classpath path="lib/maven-ant-tasks-2.0.10.jar"/>
  </typedef>

  <!-- define Animal Sniffer ANT Tasks -->
  <typedef uri="antlib:org.codehaus.mojo.animal_sniffer">
    <classpath path="lib/animal-sniffer-ant-tasks-1.3.jar"/>
  </typedef>

  <!-- define local repository location -->
  <condition property="maven.repo.local" value="${maven.repo.local}" else="${user.home}/.m2/repository">
    <isset property="maven.repo.local"/>
  </condition>

  <!-- configure local repository -->
  <artifact:localRepository id="local.repository" path="${maven.repo.local}"/>

  <!-- declare dependency -->
  <artifact:dependencies filesetId="signatures.fileset">
    <dependency groupId="org.codehaus.mojo.signature" artifactId="java12" version="1.0" type="signature"/>
  </artifact:dependencies>

  <target name="check-java12" depends="compile">
    <as:check-signature signature="${org.codehaus.mojo.signature:java12:signature}">
      <path path="classes"/>
    </as:check-signature>
  </target>
</project>

With Animal Sniffer Enforcer Rule Plugin

To check your project against this signature using the Animal Sniffer Enforcer Rule, include the following configuration in your pom.xml

<project>
  ...
  <build>
    ...
    <plugins>
      ...
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.0-beta-1</version>
        ...
        <dependencies>
            ...
            <dependency>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>animal-sniffer-enforcer-rule</artifactId>
                <version>1.3</version>
            </dependency>
            ...
        </dependencies>
        ...
        <executions>
           ....
          <execution>
            <id>check-java12</id>
            <phase>test</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <checkSignatureRule implementation="org.codehaus.mojo.animal_sniffer.enforcer.CheckSignatureRule">
                  <signature>
                    <groupId>org.codehaus.mojo.signature</groupId>
                    <artifactId>java12</artifactId>
                    <version>1.0</version>
                  </signature>
                </checkSignatureRule>
              </rules>
            </configuration>
          </execution>
          ...
        </executions>            
        ...
      </plugin>
      ...
    </plugins>
    ...
  </build>
  ...
</project>