Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven animal sniffer plugin from codehouse can not find org.jvnet signatures

Tags:

java

maven-2

I'm trying to use the animal sniffer Maven plugin to verify that code is compatible with JDK1.4. The following configuration works:

  <plugin>
    <groupId>org.jvnet</groupId>
    <artifactId>animal-sniffer</artifactId>
    <version>1.2</version>
    <configuration>
      <signature>
        <groupId>org.jvnet.animal-sniffer</groupId>
        <artifactId>java1.4</artifactId>
        <version>1.0</version>
      </signature>
    </configuration>
  </plugin>

However this is using the old org.jvnet version of the plugin. When I try to use the new org.codehaus.mojo version

  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>animal-sniffer-maven-plugin</artifactId>
    <version>1.5</version>
    <configuration>
      <signature>
        <groupId>org.jvnet.animal-sniffer</groupId>
        <artifactId>java1.4</artifactId>
        <version>1.0</version>
      </signature>
    </configuration>
  </plugin>

I get the error

[INFO] Failed to resolve artifact.

GroupId: org.codehaus.mojo.animal-sniffer
ArtifactId: java1.4
Version: 1.0

Notice that this is the artifact referred to in the <signature> section, not the plugin itself. This same artifact is referenced in both versions, so I don't understand why it's not found when using the new version.

Has anyone successfully configured this plugin to work when using the new version?

like image 214
Dónal Avatar asked Dec 18 '22 00:12

Dónal


1 Answers

Use the signature from CodeHaus:

<build>
  <plugins>
    <plugin>
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
        <source>1.4</source>
        <target>1.4</target>
      </configuration>
    </plugin>
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>animal-sniffer-maven-plugin</artifactId>
      <version>1.5</version>
      <executions>
        <execution>
          <id>check-java-version</id>
          <phase>verify</phase>
          <goals>
            <goal>check</goal>
          </goals>
          <configuration>
            <signature>
              <groupId>org.codehaus.mojo.signature</groupId>
              <artifactId>java14</artifactId>
              <version>1.0</version>
            </signature>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>
like image 90
Pascal Thivent Avatar answered Dec 21 '22 10:12

Pascal Thivent