Closed jglick closed 1 year ago
I'm having the same problem. I was just trying it the exact same way for another (non open source) API.
I could get it to work by adding the jdk base signature as a dependency:
<dependencies>
<dependency>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java16</artifactId>
<type>signature</type>
</dependency>
</dependencies>
Additionally, this seems expected behaviour: http://www.mojohaus.org/animal-sniffer/animal-sniffer-maven-plugin/examples/checking-signatures.html#Referencing_classes_from_dependencies
The documentation claims you can generate signatures of other APIs. I just tried to do so, for
javax.servlet:servlet-api:2.4
. It did not work. If I buildthen I get a reasonable-looking artifact. But if I try to then use it
I get numerous errors:
Now the documentation does say
I do not really want to do this—I am already checking a Java Platform signature separately, and in this check I only want to check Servlet API class usages—but fine, I will include the Java 8 Platform in my signature. Yet when I go to do this
the documentation refers to
which does not exist. (The coordinate
org.codehaus.mojo.animal_sniffer:java:1.0:java-1.4-generic
is wrong too, by the way; I think you meantorg.codehaus.mojo.signature:java15:1.0
?)at check time does not help.
If I give up on referring to a known Java Platform artifact and just delete
then (even though I am running Maven with
…/jdk8/bin/java
) I get an errorreferring to a nonexistent parameter
javaClassPath
; I supposejavaHomeClassPath
was meant. I need to passto the
mvn
command to build the signature. But now when I run thecheck
goal against this, it passes even if I have deliberately inserted a call toHttpServletResponse.getStatus()
into my sources, which was a method added in 3.0.