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

Gradle plugin does not seem to take platform projects into account (as runtime dependencies) #533

Open
sschuberth opened this issue Oct 30, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@sschuberth
Copy link

Describe the bug

In our ORT project we use Gradle's Java Platform Plugin to "bundle" ServiceLoader-based plugin projects. The CLI frontend of our application does not have a "hard" / compile-time dependency on those plugins, but in order to make the distribution created by Gradle's Application Plugin include the plugins, we extend the runtimeClasspath from the custom pluginClasspath.

This approach works to include the plugin JARs into the distribution and to put them on the runtime classpath of the application when running it via the start scripts generated by Gradle's Application Plugin.

I'd expect that the same approach also works when compiling the CLI frontend to a Native Image, but the created binary does not seems to include / ship with any of the plugins.

To Reproduce

  1. Clone https://github.com/oss-review-toolkit/ort.git.
  2. Configure https://github.com/graalvm/graalvm-ce-dev-builds/releases/tag/24.0.0-dev-20231026_1919 to be used by the Gradle build.
  3. Execute ./gradlew :cli:nativeCompile.
  4. Run ./cli/build/native/nativeCompile/ort --help.
  5. Observe that only the root command's help is shown, but that no subcommands are available:
Usage: ort [<options>]

Options:
  -c, --config=<value>                   The path to a configuration file. (default: /home/sebastian/.ort/config/config.yml)
  --error, --warn, --info, --debug       Set the verbosity level of log output. (default: WARN)
  --stacktrace                           Print out the stacktrace for all exceptions.
  -P=<value>                             Override a key-value pair in the configuration file. For example: -P
                                         ort.scanner.storages.postgres.connection.schema=testSchema
  --help-all                             Display help for all subcommands.
  --generate-completion=(bash|zsh|fish)
  -v, --version                          Show the version and exit.
  -h, --help                             Show this message and exit

 • denotes required options.

Expected behavior

The same output as for running via the Application Plugin's start scripts is shown:

  1. Execute ./gradlew :cli:installDist.
  2. Run ./cli/build/install/ort/bin/ort --help.
  3. Observe that help for subcommands is shown:
Usage: ort [<options>] <command> [<args>]...

Options:
  -c, --config=<value>                   The path to a configuration file. (default: /home/sebastian/.ort/config/config.yml)
  --error, --warn, --info, --debug       Set the verbosity level of log output. (default: WARN)
  --stacktrace                           Print out the stacktrace for all exceptions.
  -P=<value>                             Override a key-value pair in the configuration file. For example: -P
                                         ort.scanner.storages.postgres.connection.schema=testSchema
  --help-all                             Display help for all subcommands.
  --generate-completion=(bash|zsh|fish)
  -v, --version                          Show the version and exit.
  -h, --help                             Show this message and exit

Commands:
  advise                     Check dependencies for security vulnerabilities.
  analyze                    Determine dependencies of a software project.
  compare                    Compare two ORT results with various methods.
  config                     Show different ORT configurations.
  download                   Fetch source code from a remote location.
  evaluate                   Evaluate ORT result files against policy rules.
  migrate                    Assist with migrating ORT configuration to newer ORT versions.
  notify                     Create notifications based on an ORT result.
  report                     Present Analyzer, Scanner and Evaluator results in various formats.
  requirements               Check for the command line tools required by ORT.
  scan                       Run external license / copyright scanners.
  upload-curations           Upload ORT package curations to ClearlyDefined.
  upload-result-to-postgres  Upload an ORT result to a PostgreSQL database.
  upload-result-to-sw360     Upload an ORT result to SW360.

 • denotes required options.

System Info (please complete the following information):

  • OS: Fedora Linux 38
  • GraalVM Version: 21.0.1+12-jvmci-23.1-b22
  • Java Version: 20
  • Plugin version: native-gradle-plugin:0.9.28
@sschuberth sschuberth added the bug Something isn't working label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant