bazel-contrib / bazel-contrib/rules_jvm

Please document using `#gazelle:java_annotation_processor_plugin` with `java_plugin`

Open
#441 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
54
Forks
98
Avg merge
6d 2h
Merged PRs (30d)
7

Description

Currently the examples and documentation around using the java plugins assumes you are using the plugin code directly from your maven repository:

for example, this annotation :

```
# gazelle:java_annotation_processor_plugin com.google.auto.value.AutoValue com.google.auto.value.processor.AutoValueProcessor
```

generates this build file attribute:

```
plugins = ["@maven//:com_google_auto_value_auto_value__java_plugin__com_google_auto_value_processor_AutoValueProcessor"],
```

However, the `rules_java` includes a `java_plugin` rule, which allows for better configuration of the plugin and a simpler way to reference it (e.g. `//path/to:my_java_compiler_plugin`).

I don't think this is possible with the existing code, so this may require a fix, but at minimum a clear piece of documentation on how to make this work would be useful.

Contributor guide

Open the contributing guide

Research direction

Start by reading the examples and documentation for `#gazelle:java_annotation_processor_plugin`, then inspect how `java_plugin` labels are referenced in the existing rules. Done means the supported configuration is either clearly documented with a `//path/to:my_java_compiler_plugin` example or the limitation and required change are explicitly identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.