Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error implementing org.jfrog.build.api.util.Log - Cannot access org.jfrog.filespecs.utils.Log #816

Open
MarkRx opened this issue Jan 24, 2025 · 1 comment
Labels
bug Create a report to help us improve

Comments

@MarkRx
Copy link

MarkRx commented Jan 24, 2025

Describe the bug
It's currently not possible to implement the public interface org.jfrog.build.api.util.Log. This is because the Log interface leaks an implementation class org.jfrog.filespecs.utils.Log. In Gradle all classes and interfaces that come from a library used in a class or method signature should be declared as an api dependency.

Fix:
The build-info-api should explicitly declare org.jfrog.filespecs:file-specs-java as an api dependency here or else here

To Reproduce
With a new Gradle project create and compile the following class:

public class LogAdapter implements org.jfrog.build.api.util.Log {
    // override methods
}

Compiler error:

error: cannot access org.jfrog.filespecs.utils.Log
    public class LogAdapter implements org.jfrog.build.api.util.Log {
           ^
  class file for org.jfrog.filespecs.utils.Log not found

Expected behavior
The org.jfrog.build.api.util.Log interface can be implemented since it is in a public API

Versions

  • org.jfrog.filespecs:file-specs-java:1.1.2
  • org.jfrog.buildinfo:build-info-api:2.41.24

Additional context
The project must be using the Gradle module system (instead of maven pom files). This will happen automatically with newer versions of Gradle.

@MarkRx MarkRx added the bug Create a report to help us improve label Jan 24, 2025
@MarkRx
Copy link
Author

MarkRx commented Jan 24, 2025

The workaround is to manually declare the library in the consuming project:

implementation 'org.jfrog.filespecs:file-specs-java:1.1.2'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Create a report to help us improve
Projects
None yet
Development

No branches or pull requests

1 participant