Nervous animal plugin Maven

I am trying to use the Maven plugin for sniffer to verify that the 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 uses the old version of the org.jvnetplugin. When I try to use the new versionorg.codehaus.mojo

  <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 an error

[INFO] Failed to resolve artifact.

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

Please note that this is an artifact mentioned in the section <signature>, and not the plugin itself. The same artifact is mentioned in both versions, so I do not understand why it was not found when using the new version.

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

Thanks Don

+3
source share
1 answer

Use 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>
+11

Source: https://habr.com/ru/post/1745084/


All Articles