Maven 依赖项已下载但构建失败并出现 StackOverflowError

Maven Dependencies downloaded but build is failing with StackOverflowError

我正在尝试将现有的多模块 Ant 项目迁移到 Maven。我已经成功生成了相关的 POM 文件并添加了正确的依赖项。但是对于特定模块,构建始终因 WhosebugError 而失败。 我的项目结构是:

OALSCMProdDataSync
|
---Properties
|
---Utilities
|
---Model
|
---RESTClient
|
---RESTServices
|
---EARModule

在此,Properties 和 Utilities jar 已正确构建,但模型构建始终失败并出现此错误:

Exception in thread "main" java.lang.WhosebugError
    at java.util.IdentityHashMap.hash(IdentityHashMap.java:294)
    at java.util.IdentityHashMap.get(IdentityHashMap.java:328)
    at org.eclipse.aether.util.graph.transformer.ConflictResolver$ConflictContext.isIncluded(ConflictResolver.java:1062)
    at org.eclipse.aether.util.graph.transformer.NearestVersionSelector.accept(NearestVersionSelector.java:145)
    at org.eclipse.aether.util.graph.visitor.PathRecordingDependencyVisitor.visitEnter(PathRecordingDependencyVisitor.java:93)
    at org.eclipse.aether.graph.DefaultDependencyNode.accept(DefaultDependencyNode.java:334)

注意:模型模块所需的依赖项已正确下载到我的 .m2 存储库中。

如有任何建议,我们将不胜感激。添加3个模块的POM文件。

属性的 POM(已成功构建):

<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
  <modelVersion>4.0.0</modelVersion>
  <groupId>OALSCMProdDataSync</groupId>
  <artifactId>Properties</artifactId>
  <version>1.0-SNAPSHOT</version>
  <description>Generated POM from JDeveloper for project Properties</description>
  <dependencies>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
      <version>2.6.1</version>
      <!--<type>pom</type>-->
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>2.6.1</version>
      <!--<type>pom</type>-->
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>oal.util.logger</groupId>
      <artifactId>LoggerApp</artifactId>
      <version>16.4</version>
    </dependency>
  </dependencies>
  <repositories>


      <repository>
          <id>lib_rel</id>
          <name>lib_rel</name>
          <url>https://artifactory-slc.oraclecorp.com/artifactory/libs-release</url>
      </repository>


  </repositories>
  <build>
    <sourceDirectory>src/</sourceDirectory>
    <resources>
      <resource>
        <directory>${basedir}</directory>
        <includes>
          <include>*</include>
        </includes>
      </resource>
    </resources>
    <outputDirectory>classes/</outputDirectory>
  </build>
</project>

用于实用程序的 POM(已成功构建):

<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
  <modelVersion>4.0.0</modelVersion>
  <groupId>OALSCMProdDataSync</groupId>
  <artifactId>Utilities</artifactId>
  <version>1.0-SNAPSHOT</version>
  <description>Generated POM from JDeveloper for project Utilities</description>
  <dependencies>
    <dependency>
      <groupId>OALSCMProdDataSync</groupId>
      <artifactId>Properties</artifactId>
      <version>1.0-SNAPSHOT</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.json</groupId>
      <artifactId>json</artifactId>
      <version>20170516</version>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>Java-EE</artifactId>
      <version>12.2.1-2-0</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
      <version>2.6.1</version>
      <!--<type>pom</type>-->
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>2.6.1</version>
      <!--<type>pom</type>-->
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>oal.util.logger</groupId>
      <artifactId>LoggerApp</artifactId>
      <version>16.4</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.9</version>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>JAX-RS-Jersey-2.x-Client</artifactId>
      <version>12.2.1-2-0</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>com.oracle.em</groupId>
      <artifactId>jps-api</artifactId>
      <version>12.2.1-2-0</version>
    </dependency>
  </dependencies>
  <repositories>


      <repository>
          <id>lib_rel</id>
          <name>lib_rel</name>
          <url>https://artifactory-slc.oraclecorp.com/artifactory/libs-release</url>
      </repository>


  </repositories>
  <build>
    <sourceDirectory>src/</sourceDirectory>
    <resources>
      <resource>
        <directory>${basedir}</directory>
        <includes>
          <include>*</include>
        </includes>
      </resource>
    </resources>
    <outputDirectory>classes/</outputDirectory>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

模型的 POM(因 WhosebugError 而失败):

<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
  <modelVersion>4.0.0</modelVersion>
  <groupId>OALSCMProdDataSync</groupId>
  <artifactId>Model</artifactId>
  <version>1.0-SNAPSHOT</version>
  <description>Generated POM from JDeveloper for project Model</description>
  <dependencies>
    <dependency>
      <groupId>OALSCMProdDataSync</groupId>
      <artifactId>Utilities</artifactId>
      <version>1.0-SNAPSHOT</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>OALSCMProdDataSync</groupId>
      <artifactId>Properties</artifactId>
      <version>1.0-SNAPSHOT</version>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>TopLink</artifactId>
      <version>12.2.1-2-0</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>Oracle-XML-Parser-v2</artifactId>
      <version>12.2.1-2-0</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>BC4J-Runtime</artifactId>
      <version>12.2.1-2-0</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>ADF-Model-Runtime</artifactId>
      <version>12.2.1-2-0</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>MDS-Runtime</artifactId>
      <version>12.2.1-2-0</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>MDS-Runtime-Dependencies</artifactId>
      <version>12.2.1-2-0</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>BC4J-Security</artifactId>
      <version>12.2.1-2-0</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>Oracle-JDBC</artifactId>
      <version>12.2.1-2-0</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>BC4J-Oracle-Domains</artifactId>
      <version>12.2.1-2-0</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>Java-EE</artifactId>
      <version>12.2.1-2-0</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>EJB</artifactId>
      <version>12.2.1-2-0</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>ADF-Common-Runtime</artifactId>
      <version>12.2.1-2-0</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>org.json</groupId>
      <artifactId>json</artifactId>
      <version>20170516</version>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
      <version>2.6.1</version>
      <!--<type>pom</type>-->
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>2.6.1</version>
      <!--<type>pom</type>-->
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>oal.util.logger</groupId>
      <artifactId>LoggerApp</artifactId>
      <version>16.4</version>
    </dependency>
  </dependencies>
  <repositories>


      <repository>
          <id>lib_rel</id>
          <name>lib_rel</name>
          <url>https://artifactory-slc.oraclecorp.com/artifactory/libs-release</url>
      </repository>


  </repositories>
  <build>
    <sourceDirectory>src/</sourceDirectory>
    <resources>
      <resource>
        <directory>${basedir}</directory>
        <includes>
          <include>*</include>
        </includes>
      </resource>
    </resources>
    <outputDirectory>classes/</outputDirectory>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

问题已解决。 2 个不同的远程存储库中的特定工件有相同的路径,运行 进入堆栈溢出错误。删除其中一个并解决了问题。