pholser/junit-quickcheck

mvn compile and mvn compile not working?

rebcabin opened this issue · 2 comments

First of all, let me thank you for creating junit-quickcheck. I am quite
familiar with quickcheck variants in other languages (Python, Clojure, C++,
Scheme), and I can't imagine embarking on a new project without it. It's the
first thing I reach for.

I am starting a new project in Java. I apologize for having no measurable
experience diagnosing Java build problems, and I am quite blocked. I hope this
is easy and just due to my ignorance.

I do a fresh "git pull" of this repository and try "mvn compile" getting the
error messages below. It looks like it's trying (and failing) to build version
0.10-SNAPSHOT, and that doesn't sound right because the current version is 0.90.
I tried "git checkout junit-quickcheck-0.90" just in case "master" is hosed, and
get similar errors. I also get similar errors when I try "mvn test." The rest of
the error output is impenetrable to me. I tried running things in IntelliJ with
no better results, just more moving parts to add to the list of suspects.

I would be very grateful for advice as I am unable to proceed at all.

I am running Java 11:

~/Documents/GitHub/junit-quickcheck$ java -version
openjdk version "11.0.3" 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu218.04.1)
OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu218.04.1, mixed mode, sharing)

Here is the error output:

~/Documents/GitHub/junit-quickcheck$ mvn compile
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] junit-quickcheck [pom]
[INFO] junit-quickcheck-core [jar]
[INFO] junit-quickcheck-generators [jar]
[INFO] junit-quickcheck-guava [jar]
[INFO] junit-quickcheck-examples [jar]
[INFO]
[INFO] --------------------< com.pholser:junit-quickcheck >--------------------
[INFO] Building junit-quickcheck 0.10-SNAPSHOT [1/5]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-maven) @ junit-quickcheck ---
[INFO]
[INFO] -----------------< com.pholser:junit-quickcheck-core >------------------
[INFO] Building junit-quickcheck-core 0.10-SNAPSHOT [2/5]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-maven) @ junit-quickcheck-core ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.6.201602180812:prepare-agent (default-prepare-agent) @ junit-quickcheck-core ---
[INFO] argLine set to -javaagent:/home/rebcabin/.m2/repository/org/jacoco/org.jacoco.agent/0.7.6.201602180812/org.jacoco.agent-0.7.6.201602180812-runtime.jar=destfile=/home/rebcabin/Documents/GitHub/junit-quickcheck/core/target/jacoco.exec
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ junit-quickcheck-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ junit-quickcheck-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 72 source files to /home/rebcabin/Documents/GitHub/junit-quickcheck/core/target/classes
[INFO] /home/rebcabin/Documents/GitHub/junit-quickcheck/core/src/main/java/com/pholser/junit/quickcheck/internal/generator/EnumGenerator.java: Some input files use or override a deprecated API.
[INFO] /home/rebcabin/Documents/GitHub/junit-quickcheck/core/src/main/java/com/pholser/junit/quickcheck/internal/generator/EnumGenerator.java: Recompile with -Xlint:deprecation for details.
[INFO] /home/rebcabin/Documents/GitHub/junit-quickcheck/core/src/main/java/com/pholser/junit/quickcheck/generator/Generators.java: /home/rebcabin/Documents/GitHub/junit-quickcheck/core/src/main/java/com/pholser/junit/quickcheck/generator/Generators.java uses unchecked or unsafe operations.
[INFO] /home/rebcabin/Documents/GitHub/junit-quickcheck/core/src/main/java/com/pholser/junit/quickcheck/generator/Generators.java: Recompile with -Xlint:unchecked for details.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/rebcabin/Documents/GitHub/junit-quickcheck/core/src/main/java/com/pholser/junit/quickcheck/internal/FakeAnnotatedTypeFactory.java:[50,26] com.pholser.junit.quickcheck.internal.FakeAnnotatedTypeFactory.FakeAnnotatedArrayType is not abstract and does not override abstract method getAnnotatedOwnerType() in java.lang.reflect.AnnotatedArrayType
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for junit-quickcheck 0.10-SNAPSHOT:
[INFO]
[INFO] junit-quickcheck ................................... SUCCESS [ 0.184 s]
[INFO] junit-quickcheck-core .............................. FAILURE [ 1.703 s]
[INFO] junit-quickcheck-generators ........................ SKIPPED
[INFO] junit-quickcheck-guava ............................. SKIPPED
[INFO] junit-quickcheck-examples .......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.023 s
[INFO] Finished at: 2019-06-15T20:13:50-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project junit-quickcheck-core: Compilation failure
[ERROR] /home/rebcabin/Documents/GitHub/junit-quickcheck/core/src/main/java/com/pholser/junit/quickcheck/internal/FakeAnnotatedTypeFactory.java:[50,26] com.pholser.junit.quickcheck.internal.FakeAnnotatedTypeFactory.FakeAnnotatedArrayType is not abstract and does not override abstract method getAnnotatedOwnerType() in java.lang.reflect.AnnotatedArrayType
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :junit-quickcheck-core

Thanks for this! I haven't observed the problem, but then again I don't think I've tried building junit-quickcheck using OpenJDK 11. I'll look into it.

@rebcabin After further review, it appears that the method in question on j.l.r.AnnotatedArrayType was added in JDK 9. I'd been building on JDK 8, so when you build junit-quickcheck using a JDK >=9 you'll get the error you described above. To correct this, you'll want to build using JDK 8.