After some investigation I suspect the JDK & version in use might affect if IT tests run.
I tried create a local build of the project. mvn clean install.
You wouldn't believe what happened next.
[DEBUG] Writing tracking file C:\somedir\.m2\repository\com\vertispan\javascript\closure-compiler-main\0.3-SNAPSHOT\resolver-status.properties
[DEBUG] Could not find metadata com.vertispan.javascript:closure-compiler-main:0.3-SNAPSHOT/maven-metadata.xml in maven-central (https://repo.maven.apache.org/maven2/)
[DEBUG] Could not find metadata com.vertispan.javascript:closure-compiler-main:0.3-SNAPSHOT/maven-metadata.xml in sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots)
[DEBUG] Could not find metadata com.vertispan.javascript:closure-compiler-main:0.3-SNAPSHOT/maven-metadata.xml in sonatype-google-snapshots (https://oss.sonatype.org/content/repositories/google-snapshots/)
[DEBUG] Could not find metadata com.vertispan.javascript:closure-compiler-main:0.3-SNAPSHOT/maven-metadata.xml in central (https://repo1.maven.org/maven2)
[DEBUG] Could not find metadata com.vertispan.javascript:closure-compiler-main:0.3-SNAPSHOT/maven-metadata.xml in github-slf4j2cl (https://maven.pkg.github.com/xamde/slf4j2cl)
[DEBUG] Could not find metadata com.vertispan.javascript:closure-compiler-main:0.3-SNAPSHOT/maven-metadata.xml in sonatype-snapshots-repo (https://oss.sonatype.org/content/repositories/snapshots)
[DEBUG] Could not find metadata com.vertispan.javascript:closure-compiler-parent:0.3-SNAPSHOT/maven-metadata.xml in local (C:\somedir\.m2\repository)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.972 s
[INFO] Finished at: 2022-03-02T07:45:36+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Malformed \uxxxx encoding.
java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
at java.util.Properties.loadConvert (Properties.java:662)
at java.util.Properties.load0 (Properties.java:455)
at java.util.Properties.load (Properties.java:408)
at org.eclipse.aether.internal.impl.TrackingFileManager.read (TrackingFileManager.java:56)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.read (DefaultUpdateCheckManager.java:511)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkMetadata (DefaultUpdateCheckManager.java:250)
at org.eclipse.aether.internal.impl.DefaultMetadataResolver.resolve (DefaultMetadataResolver.java:302)
at org.eclipse.aether.internal.impl.DefaultMetadataResolver.resolveMetadata (DefaultMetadataResolver.java:181)
at org.apache.maven.repository.internal.DefaultVersionResolver.resolveVersion (DefaultVersionResolver.java:213)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:282)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:229)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:207)
at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel (DefaultModelResolver.java:172)
at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel (DefaultModelResolver.java:222)
at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally (DefaultModelBuilder.java:1077)
at org.apache.maven.model.building.DefaultModelBuilder.readParent (DefaultModelBuilder.java:853)
at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:344)
at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:252)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom (DefaultArtifactDescriptorReader.java:297)
Looking into C:\somedir\.m2\repository\com\vertispan\javascript\closure-compiler-main\0.3-SNAPSHOT\resolver-status.properties reveals
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Wed Mar 02 07:45:36 CET 2022
maven-metadata-sonatype-snapshots-plugins.xml.lastUpdated=1643210259565
maven-metadata-sonatype-google-snapshots.xml.lastUpdated=1646203536205
maven-metadata-sonatype-snapshots-repo.xml.lastUpdated=1646203536221
maven-metadata-vertispan-releases.xml.lastUpdated=1646203536218
maven-metadata-sonatype-nexus-snapshots.xml.lastUpdated=1646203536200
maven-metadata-vertispan-snapshots.xml.error=
maven-metadata-maven-central.xml.lastUpdated=1646203536200
maven-metadata-sonatype-snapshots-repo.xml.error=
maven-metadata-github-slf4j2cl.xml.lastUpdated=1646203536214
maven-metadata-central.xml.error=
maven-metadata-vertispan-j2cl.xml.lastUpdated=163869177\u0000\u0000\u0000\u0000\u0000\u0000
maven-metadata-vertispan-snapshots.xml.lastUpdated=1645339659712
maven-\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
maven-metadata-sonatype-google-snapshots.xml.error=
maven-metadata-sonatype-snapshots-plugins.xml.error=
maven-metadata-google-snapshots.xml.error=
maven-metadata-google-snapshots.xml.lastUpdated=1645339659295
maven-metadata-sonatype-nexus-snapshots.xml.error=
maven-metadata-vertispan-releases-plugin.xml.lastUpdated=1643210259564
maven-metadata-github-slf4j2cl.xml.error=
maven-metadata-central.xml.lastUpdated=1646203536209
maven-metadata-maven-central.xml.error=
Where does such a crap comes from?
[INFO] Downloaded from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/javascript/closure-compiler-main/0.3-SNAPSHOT/maven-metadata.xml (618 B at 2.6 kB/s)
which was happily downloaded into the it-repo (this version is not present in my local main maven repo).
No idea why that dependency was not found.
But the build keeps going on and finally fails with 1) Error injecting constructor, java.lang.ExceptionInInitializerError: Cannot access defaults field of Properties.
See next error for details on this one.
Let's check the next build.log and look for patterns. Here is \j2cl-maven-plugin\target\it-tests\dependency-replacements\build.log.
[WARNING] Error injecting: org.apache.maven.plugin.war.WarMojo
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error injecting constructor, java.lang.ExceptionInInitializerError: Cannot access defaults field of Properties
at org.apache.maven.plugin.war.WarMojo.<init>(Unknown Source)
while locating org.apache.maven.plugin.war.WarMojo
...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project app: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.2:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.2' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Cannot access defaults field of Properties
According to Stackoverflow, this is related to a Java version mismatch with versions of maven war plugin version.
I'm running this
openjdk 17 2021-09-14
OpenJDK Runtime Environment (build 17+35-2724)
OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)
\j2cl-maven-plugin\target\it-tests\hello-world-reactor\build.log reports the same ProvisionException.
\j2cl-maven-plugin\target\it-tests\hello-world-single\build.log is ProvisionException as well.
\j2cl-maven-plugin\target\it-tests\top-level-source-file\build.log is ProvisionException as well.
\j2cl-maven-plugin\target\it-tests\transitive-dependencies\build.log same story.
Summary
So we seem to have one issue, most likely a basic version mismatch with the Java version. Write once, run anywhere? ;-)
After some investigation I suspect the JDK & version in use might affect if IT tests run.
I tried create a local build of the project.
mvn clean install
. You wouldn't believe what happened next.Looking into
C:\somedir\.m2\repository\com\vertispan\javascript\closure-compiler-main\0.3-SNAPSHOT\resolver-status.properties
revealsWhere does such a crap comes from?
Manually downloading with a browser gives us
Is my hard disk dying? Lenovos full disk scan says everything looks OK.
Maybe that was a Maven race condition writing crap (e.g. running from IntelliJ and another one from the command line)?
I delete from my local Maven repo all of
/com/vertispan
and retrymvn clean install -e -X
. We get thiswith details
Lets look into the individual logs then. We start with
\j2cl-maven-plugin\target\it-tests\annotation-processor-in-reactor\build.log
.It seems
annotation-processor-in-reactor\processor\pom.xml
depends onwhich was happily downloaded into the it-repo (this version is not present in my local main maven repo). No idea why that dependency was not found. But the build keeps going on and finally fails with
1) Error injecting constructor, java.lang.ExceptionInInitializerError: Cannot access defaults field of Properties
. See next error for details on this one.Let's check the next build.log and look for patterns. Here is
\j2cl-maven-plugin\target\it-tests\dependency-replacements\build.log
.According to Stackoverflow, this is related to a Java version mismatch with versions of maven war plugin version. I'm running this
\j2cl-maven-plugin\target\it-tests\hello-world-reactor\build.log
reports the sameProvisionException
.\j2cl-maven-plugin\target\it-tests\hello-world-single\build.log
isProvisionException
as well.\j2cl-maven-plugin\target\it-tests\top-level-source-file\build.log
isProvisionException
as well.\j2cl-maven-plugin\target\it-tests\transitive-dependencies\build.log
same story.Summary
So we seem to have one issue, most likely a basic version mismatch with the Java version. Write once, run anywhere? ;-)