assertj-automation icon indicating copy to clipboard operation
assertj-automation copied to clipboard

assertj-error-prone:jar:0.6.0 references unpublished assertj-automation-root:jar:0.6.0

Open vlsi opened this issue 3 years ago • 2 comments

What happened?

I'm adding assertj-error-prone to a Maven project, and Maven fails :(

See the very end of https://repo1.maven.org/maven2/com/palantir/assertj-automation/assertj-error-prone/0.6.0/assertj-error-prone-0.6.0.pom

    <dependency>
      <groupId>com.palantir.assertj-automation</groupId>
      <artifactId>assertj-automation-root</artifactId>
      <version>0.4.0</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>
  </dependencies>
</project>

My configuration:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <configuration combine.children="append">
    <showWarnings>true</showWarnings>
    <compilerArgs>
      <arg>-XDcompilePolicy=simple</arg>
      <arg>
        -Xplugin:ErrorProne \
        -Xep:ClassCanBeStatic:ERROR \
        -Xep:FieldCanBeStatic:ERROR \
        -Xep:MethodCanBeStatic:ERROR
      </arg>
    </compilerArgs>
    <annotationProcessorPaths>
      <path>
        <groupId>com.google.errorprone</groupId>
        <artifactId>error_prone_core</artifactId>
        <version>${error-prone.version}</version>
      </path>
      <path>
        <groupId>com.palantir.assertj-automation</groupId>
        <artifactId>assertj-error-prone</artifactId>
        <version>${assertj-error-prone.version}</version>
      </path>
      <!-- Other annotation processors go here.

      If 'annotationProcessorPaths' is set, processors will no longer be
      discovered on the regular -classpath; see also 'Using Error Prone
      together with other annotation processors' below. -->
    </annotationProcessorPaths>
  </configuration>
</plugin>
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project assertj-core: Resolution of annotationProcessorPath dependencies failed: Missing:
[ERROR] ----------
[ERROR] 1) com.palantir.assertj-automation:assertj-automation-root:jar:0.6.0
[ERROR]
[ERROR]   Try downloading the file manually from the project website.
....
[ERROR]
[ERROR]   Path to dependency:
[ERROR]   	1) com.palantir.assertj-automation:assertj-error-prone:jar:0.6.0
[ERROR]   	2) com.palantir.assertj-automation:assertj-automation-root:jar:0.6.0
[ERROR]
[ERROR] ----------
[ERROR] 1 required artifact is missing.
[ERROR]
[ERROR] for artifact:
[ERROR]   com.palantir.assertj-automation:assertj-error-prone:jar:0.6.0
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR]   central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)

What did you want to happen?

It would be best if assertj-error-prone/pom.xml would not reference assertj-automation-root

vlsi avatar May 30 '22 07:05 vlsi

Same issue here. I think this is coming from settings.gradle (the root project) and is added during conversion from the palantir gradle-external-publish-plugin. But for now it looks like being unusable - at least from maven - without publishing a fixed fork to the company repo.

berlam avatar Jan 11 '23 12:01 berlam

I see that this ticket involves an <optional>true</optional> dependency. The root cause is then likely the same as for palantir/gradle-baseline#2362.

Stephan202 avatar Jan 11 '23 16:01 Stephan202