jfrog / build-info

Artifactory's open integration layer for CI build servers
https://www.buildinfo.org
Apache License 2.0
148 stars 156 forks source link

Self-reference in Maven POM #786

Open cpuzicha opened 8 months ago

cpuzicha commented 8 months ago

Describe the bug Maven POM contains a self reference:

<groupId>org.jfrog.buildinfo</groupId>
<artifactId>build-info-extractor</artifactId>
<version>2.41.14</version>
<name>build-info-extractor</name>
...
<dependency>
  <groupId>org.jfrog.buildinfo</groupId>
  <artifactId>build-info-extractor</artifactId>
  <version>2.41.14</version>
  <scope>compile</scope>
  <optional>true</optional>
</dependency>

Test in IntelliJ IDEA with this as a dependency show the following error message (though there seems to be no actual problem)

Errors occurred while building effective model from /home/cp/.gradle/caches/modules-2/files-2.1/org.jfrog.buildinfo/build-info-extractor/2.41.12/d5ae695415585a1481144ab3d7a59b41af869883/build-info-extractor-2.41.12.pom: 'dependencies.dependency[org.jfrog.buildinfo:build-info-extractor:2.41.12]' for org.jfrog.buildinfo:build-info-extractor:2.41.12 is referencing itself. in org.jfrog.buildinfo:build-info-extractor:2.41.12

To Reproduce Look at https://repo1.maven.org/maven2/org/jfrog/buildinfo/build-info-extractor/2.41.14/build-info-extractor-2.41.14.pom

Expected behavior No self reference.

Additional context We have seen this behavior when using the Gradle Plugin 'test-fixtures' https://github.com/gradle/gradle/issues/14936

Sirmyself commented 5 months ago

I had a similar issue and I was able to avoid the error by removing the dependency

<dependency>
    <groupId>org.jfrog.buildinfo</groupId>
    <artifactId>build-info-extractor</artifactId>
    <version>2.41.12</version>
    <scope>compile</scope>
    <optional>true</optional>
</dependency>

for the file mentioned in the error (in your case, /home/cp/.gradle/caches/modules-2/files-2.1/org.jfrog.buildinfo/build-info-extractor/2.41.12/d5ae695415585a1481144ab3d7a59b41af869883/build-info-extractor-2.41.12.pom)

I'm not sure it's the right solution, but my app seems to be running fine right now and I don't see the error anymore.

gba-foundever commented 5 months ago

exact same error for using gradle plugin build-info-extractor-gradle 5.2.0 because of transitive dep on build-info-extractor 2.41.12