Anyway, I use your pom.xml and I reproduce the problem with Oracle java 8 (maybe it depends on the order of class load):
System.out.println(ModifierType.CONSISTENCY);
}
}
$ mvn exec:java -Dexec.mainClass="JGModifierTypeIssue"
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< org.example:jgquestion >-----------------------
[INFO] Building jgquestion 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- exec-maven-plugin:3.0.0:java (default-cli) @ jgquestion ---
[WARNING]
java.lang.ExceptionInInitializerError
at org.janusgraph.graphdb.database.management.ModifierType.<clinit> (ModifierType.java:23)
at JGModifierTypeIssue.main (JGModifierTypeIssue.java:8)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
at java.lang.Thread.run (Thread.java:748)
Caused by: java.lang.NullPointerException
at org.janusgraph.graphdb.database.management.ModifierType.values (ModifierType.java:22)
at org.janusgraph.graphdb.types.TypeDefinitionCategory.<clinit> (TypeDefinitionCategory.java:84)
at org.janusgraph.graphdb.database.management.ModifierType.<clinit> (ModifierType.java:23)
at JGModifierTypeIssue.main (JGModifierTypeIssue.java:8)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
at java.lang.Thread.run (Thread.java:748)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.682 s
[INFO] Finished at: 2020-09-01T08:05:43+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java (default-cli) on project jgquestion: An exception occured while executing the Java class. null: ExceptionInInitializerError: NullPointerException -> [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:
$ java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
Regards,
Toom.