Vertispan / j2clmavenplugin

Maven plugin to launch new J2CL compilation
https://vertispan.github.io/j2clmavenplugin/
Apache License 2.0
53 stars 27 forks source link

StackOverflowError on j2cl:build #141

Open xamde opened 2 years ago

xamde commented 2 years ago

I call mvn clean j2cl:build and get this StackOverflowError.

Exception in thread "main" java.lang.StackOverflowError                                  
        at java.base/java.util.Objects.equals(Objects.java:64)                           
        at org.eclipse.aether.artifact.AbstractArtifact.equals(AbstractArtifact.java:203)
        at java.base/java.util.WeakHashMap.matchesKey(WeakHashMap.java:292)
        at java.base/java.util.WeakHashMap.get(WeakHashMap.java:407)
        at org.eclipse.aether.internal.impl.collect.ObjectPool.intern(ObjectPool.java:38)
        at org.eclipse.aether.internal.impl.collect.DataPool.intern(DataPool.java:115)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:444)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:438)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:362)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process(DefaultDependencyCollector.java:349)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:506)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:458)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:362)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process(DefaultDependencyCollector.java:349)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:506)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:458)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:362)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process(DefaultDependencyCollector.java:349)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:506)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:458)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:362)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process(DefaultDependencyCollector.java:349)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.doRecurse(DefaultDependencyCollector.java:506)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:458)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:362)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process(DefaultDependencyCollector.java:349)
        at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:254)
        at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:284)
        at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:170)
        at org.apache.maven.project.DefaultProjectBuilder.resolveDependencies(DefaultProjectBuilder.java:227)
        at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:200)
        at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:342)
        at com.vertispan.j2cl.mojo.AbstractBuildMojo.buildProject(AbstractBuildMojo.java:248)
        at com.vertispan.j2cl.mojo.AbstractBuildMojo.buildProject(AbstractBuildMojo.java:258)

The last line loops forever until the JVM dies.

The dependencies are medium complex:

[INFO] org.xydra:conf:jar:2.0-SNAPSHOT
[INFO] +- org.xydra:index:jar:2.0-SNAPSHOT:compile
[INFO] |  +- org.xydra:annotations:jar:2.0-SNAPSHOT:compile
[INFO] |  +- org.xydra:util:jar:2.0-SNAPSHOT:compile
[INFO] |  |  +- org.gwtproject.http:gwt-http:jar:1.0.0-RC3:compile
[INFO] |  |  +- com.google.elemental2:elemental2-core:jar:1.1.0:compile
[INFO] |  |  \- com.google.elemental2:elemental2-promise:jar:1.1.0:compile
[INFO] |  \- org.xydra:key:jar:2.0-SNAPSHOT:compile
[INFO] +- org.reflections:reflections:jar:0.9.12:compile
[INFO] |  \- org.javassist:javassist:jar:3.26.0-GA:compile
[INFO] +- junit:junit:jar:4.13.1:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] \- de.xam.j2cl:slf4j2cl:jar:0.1.0-SNAPSHOT:compile
[INFO]    \- com.google.elemental2:elemental2-dom:jar:1.1.0:compile
[INFO]       +- com.google.jsinterop:jsinterop-annotations:jar:2.0.0:compile
[INFO]       \- com.google.jsinterop:base:jar:1.0.0:compile

After stripping, org.reflections should no longer be called.

Console output

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.xydra:conf:jar:2.0-SNAPSHOT
[WARNING] 'version' contains an expression but should be a constant. @ org.xydra:conf:${xydra.version}, C:\_data_\_p_\_git\GitHub\xydra2\xydra-conf\pom.xml, line 14, column 11
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] ---------------------------< org.xydra:conf >---------------------------
[INFO] Building Xydra Conf 2.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ conf ---
[INFO] Deleting C:\_data_\_p_\_git\GitHub\xydra2\xydra-conf\target
[INFO] 
[INFO] --- j2cl-maven-plugin:0.19-SNAPSHOT:build (default-cli) @ conf ---
[INFO] Downloading from central: https://repo1.maven.org/maven2/com/vertispan/j2cl/jre/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from maven-central: https://repo.maven.apache.org/maven2/com/vertispan/j2cl/jre/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/com/vertispan/j2cl/jre/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from sonatype-google-snapshots: https://oss.sonatype.org/content/repositories/google-snapshots/com/vertispan/j2cl/jre/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from itmv-feed: https://pkgs.dev.azure.com/itmv/_packaging/itmv-feed/maven/v1/com/vertispan/j2cl/jre/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from github-slf4j2cl: https://maven.pkg.github.com/xamde/slf4j2cl/com/vertispan/j2cl/jre/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/j2cl/jre/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from vertispan-snapshots: https://repo.vertispan.com/gwt-snapshot/com/vertispan/j2cl/jre/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/j2cl/jre/0.10-SNAPSHOT/maven-metadata.xml (1.2 kB at 2.0 kB/s)
[INFO] Downloading from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/j2cl/jre/0.10-SNAPSHOT/jre-0.10-20210827.030749-2.jar
[INFO] Downloaded from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/j2cl/jre/0.10-SNAPSHOT/jre-0.10-20210827.030749-2.jar (691 kB at 700 kB/s)
[INFO] Downloading from maven-central: https://repo.maven.apache.org/maven2/com/vertispan/j2cl/gwt-internal-annotations/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from sonatype-google-snapshots: https://oss.sonatype.org/content/repositories/google-snapshots/com/vertispan/j2cl/gwt-internal-annotations/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/com/vertispan/j2cl/gwt-internal-annotations/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from central: https://repo1.maven.org/maven2/com/vertispan/j2cl/gwt-internal-annotations/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from github-slf4j2cl: https://maven.pkg.github.com/xamde/slf4j2cl/com/vertispan/j2cl/gwt-internal-annotations/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from itmv-feed: https://pkgs.dev.azure.com/itmv/_packaging/itmv-feed/maven/v1/com/vertispan/j2cl/gwt-internal-annotations/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/j2cl/gwt-internal-annotations/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from vertispan-snapshots: https://repo.vertispan.com/gwt-snapshot/com/vertispan/j2cl/gwt-internal-annotations/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/j2cl/gwt-internal-annotations/0.10-SNAPSHOT/maven-metadata.xml (1.0 kB at 3.9 kB/s)
[INFO] Downloading from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/j2cl/gwt-internal-annotations/0.10-SNAPSHOT/gwt-internal-annotations-0.10-20210827.030748-2.jar
[INFO] Downloaded from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/j2cl/gwt-internal-annotations/0.10-SNAPSHOT/gwt-internal-annotations-0.10-20210827.030748-2.jar (5.1 kB at 21 kB/s)
[INFO] Downloading from sonatype-google-snapshots: https://oss.sonatype.org/content/repositories/google-snapshots/com/vertispan/jsinterop/base/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from central: https://repo1.maven.org/maven2/com/vertispan/jsinterop/base/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from maven-central: https://repo.maven.apache.org/maven2/com/vertispan/jsinterop/base/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/com/vertispan/jsinterop/base/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from github-slf4j2cl: https://maven.pkg.github.com/xamde/slf4j2cl/com/vertispan/jsinterop/base/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from itmv-feed: https://pkgs.dev.azure.com/itmv/_packaging/itmv-feed/maven/v1/com/vertispan/jsinterop/base/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/jsinterop/base/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from vertispan-snapshots: https://repo.vertispan.com/gwt-snapshot/com/vertispan/jsinterop/base/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/jsinterop/base/1.0.0-SNAPSHOT/maven-metadata.xml (780 B at 3.1 kB/s)
[INFO] Downloading from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/jsinterop/base/1.0.0-SNAPSHOT/base-1.0.0-20191211.221511-33.jar
[INFO] Downloaded from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/jsinterop/base/1.0.0-SNAPSHOT/base-1.0.0-20191211.221511-33.jar (25 kB at 92 kB/s)
[INFO] Downloading from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/j2cl/jre/0.10-SNAPSHOT/jre-0.10-20210827.030749-2-jszip.zip
[INFO] Downloaded from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/j2cl/jre/0.10-SNAPSHOT/jre-0.10-20210827.030749-2-jszip.zip (1.8 MB at 2.6 MB/s)
[INFO] Downloading from maven-central: https://repo.maven.apache.org/maven2/com/vertispan/j2cl/bootstrap/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from sonatype-google-snapshots: https://oss.sonatype.org/content/repositories/google-snapshots/com/vertispan/j2cl/bootstrap/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/com/vertispan/j2cl/bootstrap/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from central: https://repo1.maven.org/maven2/com/vertispan/j2cl/bootstrap/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from github-slf4j2cl: https://maven.pkg.github.com/xamde/slf4j2cl/com/vertispan/j2cl/bootstrap/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from itmv-feed: https://pkgs.dev.azure.com/itmv/_packaging/itmv-feed/maven/v1/com/vertispan/j2cl/bootstrap/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/j2cl/bootstrap/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from vertispan-snapshots: https://repo.vertispan.com/gwt-snapshot/com/vertispan/j2cl/bootstrap/0.10-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/j2cl/bootstrap/0.10-SNAPSHOT/maven-metadata.xml (813 B at 3.4 kB/s)
[INFO] Downloading from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/j2cl/bootstrap/0.10-SNAPSHOT/bootstrap-0.10-20210827.030751-2-jszip.zip
[INFO] Downloaded from vertispan-releases: https://repo.vertispan.com/j2cl/com/vertispan/j2cl/bootstrap/0.10-SNAPSHOT/bootstrap-0.10-20210827.030751-2-jszip.zip (52 kB at 199 kB/s)
[INFO] Removing dependency com.google.jsinterop:base:jar:1.0.0:compile, replacing with com.vertispan.jsinterop:base:jar:1.0.0-SNAPSHOT
[INFO] Removing dependency com.google.jsinterop:base:jar:1.0.0:compile, replacing with com.vertispan.jsinterop:base:jar:1.0.0-SNAPSHOT
[INFO] Removing dependency com.google.jsinterop:base:jar:1.0.0:compile, replacing with com.vertispan.jsinterop:base:jar:1.0.0-SNAPSHOT
[INFO] Removing dependency com.google.jsinterop:base:jar:1.0.0:compile, replacing with com.vertispan.jsinterop:base:jar:1.0.0-SNAPSHOT
[INFO] Removing dependency com.google.jsinterop:base:jar:1.0.0:compile, replacing with com.vertispan.jsinterop:base:jar:1.0.0-SNAPSHOT
[INFO] Removing dependency com.google.jsinterop:base:jar:1.0.0:runtime, replacing with com.vertispan.jsinterop:base:jar:1.0.0-SNAPSHOT
[INFO] Removing dependency com.google.jsinterop:base:jar:1.0.0:compile, replacing with com.vertispan.jsinterop:base:jar:1.0.0-SNAPSHOT
[INFO] Removing dependency com.google.jsinterop:base:jar:1.0.0:compile, replacing with com.vertispan.jsinterop:base:jar:1.0.0-SNAPSHOT
[INFO] Removing dependency com.google.jsinterop:base:jar:1.0.0:compile, replacing with com.vertispan.jsinterop:base:jar:1.0.0-SNAPSHOT
[WARNING] The artifact xml-apis:xml-apis:jar:2.0.2 has been relocated to xml-apis:xml-apis:jar:1.0.b2
[WARNING] The POM for stax:stax-ri:jar:1.0 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  19.716 s
[INFO] Finished at: 2022-03-06T21:41:56+01:00
[INFO] ------------------------------------------------------------------------
---------------------------------------------------
constituent[0]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/conf/logging/
constituent[1]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/commons-cli-1.4.jar
constituent[2]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/commons-io-2.6.jar
constituent[3]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/commons-lang3-3.8.1.jar
constituent[4]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/guava-25.1-android.jar
constituent[5]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/guice-4.2.2-no_aop.jar
constituent[6]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/jansi-2.4.0.jar
constituent[7]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/javax.annotation-api-1.2.jar
constituent[8]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/javax.inject-1.jar
constituent[9]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/jcl-over-slf4j-1.7.32.jar
constituent[10]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-artifact-3.8.4.jar
constituent[11]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-builder-support-3.8.4.jar
constituent[12]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-compat-3.8.4.jar
constituent[13]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-core-3.8.4.jar
constituent[14]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-embedder-3.8.4.jar
constituent[15]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-model-3.8.4.jar
constituent[16]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-model-builder-3.8.4.jar
constituent[17]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-plugin-api-3.8.4.jar
constituent[18]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-repository-metadata-3.8.4.jar
constituent[19]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-resolver-api-1.6.3.jar
constituent[20]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-resolver-connector-basic-1.6.3.jar
constituent[21]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-resolver-impl-1.6.3.jar
constituent[22]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-resolver-provider-3.8.4.jar
constituent[23]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-resolver-spi-1.6.3.jar
constituent[24]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-resolver-transport-wagon-1.6.3.jar
constituent[25]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-resolver-util-1.6.3.jar
constituent[26]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-settings-3.8.4.jar
constituent[27]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-settings-builder-3.8.4.jar
constituent[28]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-shared-utils-3.3.4.jar
constituent[29]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/maven-slf4j-provider-3.8.4.jar
constituent[30]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/org.eclipse.sisu.inject-0.3.5.jar
constituent[31]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/org.eclipse.sisu.plexus-0.3.5.jar
constituent[32]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/plexus-cipher-2.0.jar
constituent[33]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/plexus-component-annotations-2.1.0.jar
constituent[34]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/plexus-interpolation-1.26.jar
constituent[35]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/plexus-sec-dispatcher-2.0.jar
constituent[36]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/plexus-utils-3.3.0.jar
constituent[37]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/slf4j-api-1.7.32.jar
constituent[38]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/wagon-file-3.4.3.jar
constituent[39]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/wagon-http-3.4.3-shaded.jar
constituent[40]: file:/C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.4/lib/wagon-provider-api-3.4.3.jar
---------------------------------------------------
xamde commented 2 years ago

Adding some more logging gives us a little bit more insight:

[INFO] Recurse into org.reflections:reflections:0.9.12 =http://github.com/ronmamo/reflections
[INFO] Recurse into org.javassist:javassist:3.26.0-GA =http://www.javassist.org/
[INFO] Recurse into org.slf4j:slf4j-api:1.7.30 =http://www.slf4j.org
[INFO] Recurse into org.dom4j:dom4j:2.1.1 =http://dom4j.github.io/
[WARNING] The artifact xml-apis:xml-apis:jar:2.0.2 has been relocated to xml-apis:xml-apis:jar:1.0.b2
[INFO] Recurse into jaxen:jaxen:1.1.6 =http://jaxen.codehaus.org/
[WARNING] The POM for stax:stax-ri:jar:1.0 is missing, no dependency information available
[INFO] Recurse into dom4j:dom4j:1.6.1 =http://dom4j.org
[INFO] Recurse into jaxme:jaxme-api:0.3 =null
[INFO] Recurse into jaxen:jaxen:1.1-beta-6 =http://jaxen.codehaus.org/
[INFO] Recurse into dom4j:dom4j:1.5.2 =http://dom4j.org
[INFO] Recurse into jaxen:jaxen:1.1-beta-4 =http://jaxen.codehaus.org/
[INFO] Recurse into dom4j:dom4j:1.5.2 =http://dom4j.org
[INFO] Recurse into jaxen:jaxen:1.1-beta-4 =http://jaxen.codehaus.org/
[INFO] Recurse into dom4j:dom4j:1.5.2 =http://dom4j.org
[INFO] Recurse into jaxen:jaxen:1.1-beta-4 =http://jaxen.codehaus.org/
[INFO] Recurse into dom4j:dom4j:1.5.2 =http://dom4j.org
[INFO] Recurse into jaxen:jaxen:1.1-beta-4 =http://jaxen.codehaus.org/
[INFO] Recurse into dom4j:dom4j:1.5.2 =http://dom4j.org
[INFO] Recurse into jaxen:jaxen:1.1-beta-4 =http://jaxen.codehaus.org/
[INFO] Recurse into dom4j:dom4j:1.5.2 =http://dom4j.org

(These two repeating over and over)

xamde commented 2 years ago

Indeed in the POMs of this stone age old jaxen and dom4j they depend on each other

https://repo1.maven.org/maven2/jaxen/jaxen/1.1-beta-4/jaxen-1.1-beta-4.pom https://repo1.maven.org/maven2/dom4j/dom4j/1.5.2/dom4j-1.5.2.pom

niloc132 commented 2 years ago

Well that's terrible, thanks for digging in. In other places where this kind of thing has occurred, we've tried to remove the dependency entirely.

Without diminishing the impact of broken poms already published somewhere, can you comment on where in your dependency tree you get to dom4j/jaxen to begin with, and how that dependency makes sense (they don't appear in your tree at all)?

We can probably guard against this by testing a bit earlier in the AbstractBuildMojo.buildProject loop if the dependency has been seen before, even if not been completed, but I don't know what the "correct" answer is - do we "succeed" and somehow build this terrible classpath? How should the build tool react in general if there are two projects that mutually depend on each other and one changes, do we rebuild that one, then rebuild the dependent, and then the original again to make sure it is steady-state? I'm not enjoying the idea of building that into the plugin...

I would much prefer to just fail as "sorry, this is absurd, and I won't do it" than account for clearly broken project structure. As a workaround for projects that need these dependencies, I assume these either don't actually belong in your client code, or that these are deliberate dependencies for an annotation processor? If it is for an annotation processor, I would suggest shading either (as an external project) the processor itself or making a shaded jar to correct this mess and contain these broken dependencies. Note that shading a processor can have other important benefits, such as preventing two different processors from having conflicting dependencies that a downstream developer isn't going to want to deal with.

xamde commented 2 years ago

I got it via an older version of org.reflections. The current version has the same issue. However, the dom4j is marked as "optional" and excluding it works fine for me.

Now that I found out the poms are really the cause, even just dying is fine for me. Certainly not support that! Maybe keep a set of built projects when recursing and print an error when descending into a known project. At most.

niloc132 commented 2 years ago

We do actually keep a set of built projects as you suggest, and use that to avoid creating duplicates - the problem is that while actively building a single project, we don't consider it built, as we're still building its dependencies. Only once we have the dependencies etc can we call a project built, and then we register it.

I'll mark this for follow up after this release process is complete, thanks for your insights.

xamde commented 2 years ago

Upon further investigation: The j2cl maven plugin seems to ignore the Maven POM exclusions. Still get an infinite loop. mvn dependency:tree no longer shows the dom4j & jaxen dependencies.

niloc132 commented 2 years ago

Yes, that's by design - each dependency in the graph should be built as it was written, so that it can be shared in multiple places of the build, even if they have slightly different results of dependencyManagement+excludes. Shading is probably your best bet, either just a single dependency to paper over that subsection of the ... well, the not-tree, or shading the entire processor.

xamde commented 2 years ago

Thanks for explaining in more detail @niloc132 , I'll summarize here for other readers:

IF your projects depends weirdly enough on a dependency A which in turn depends on B and C, but B and C depend on each other (or more complex variations of this theme), THEN you can use the maven shade plugin to create one single uber-jar in which A, B and C are included. THEN use that uber jar in your build and j2cl maven plugin wont even try to download/compile multiple things.