> ## Documentation Index
> Fetch the complete documentation index at: https://bazel-pr-29946.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# JavaInfo

A provider encapsulating information about Java and Java-like targets.

## Members

* [\_neverlink](#_neverlink)
* [annotation\_processing](#annotation_processing)
* [api\_generating\_plugins](#api_generating_plugins)
* [compilation\_info](#compilation_info)
* [compile\_jars](#compile_jars)
* [full\_compile\_jars](#full_compile_jars)
* [header\_compilation\_direct\_deps](#header_compilation_direct_deps)
* [java\_outputs](#java_outputs)
* [module\_flags\_info](#module_flags_info)
* [outputs](#outputs)
* [plugins](#plugins)
* [runtime\_output\_jars](#runtime_output_jars)
* [source\_jars](#source_jars)
* [transitive\_compile\_time\_jars](#transitive_compile_time_jars)
* [transitive\_native\_libraries](#transitive_native_libraries)
* [transitive\_runtime\_jars](#transitive_runtime_jars)
* [transitive\_source\_jars](#transitive_source_jars)

## \_neverlink

```
bool JavaInfo._neverlink
```

Whether this library should be used only for compilation and not at runtime.

## annotation\_processing

```
java_annotation_processing JavaInfo.annotation_processing
```

Returns information about annotation processors applied on this Java/Java-like target.

Deprecated: Please use `plugins` instead (which returns information about annotation processors to be applied by consuming targets).
May return `None`.

## api\_generating\_plugins

```
struct JavaInfo.api_generating_plugins
```

Returns data about API generating plugins defined or exported by this target.

Those annotation processors are applied to a Java target before producing its header jars (which contain method signatures). When no API plugins are present, header jars are generated from the sources, reducing critical path.

The `api_generating_plugins` is a subset of `plugins`.

## compilation\_info

```
java_compilation_info JavaInfo.compilation_info
```

Returns compilation information for this Java/Java-like target.
May return `None`.

## compile\_jars

```
depset JavaInfo.compile_jars
```

Returns the Jars required by this target directly at compile time. They can be interface jars (ijar or hjar), regular jars or both, depending on whether rule implementations chose to create interface jars or not.

## full\_compile\_jars

```
depset JavaInfo.full_compile_jars
```

Returns the regular, full compile time Jars required by this target directly. They can be

* the corresponding regular Jars of the interface Jars returned by `JavaInfo.compile_jars`
* the regular (full) Jars returned by `JavaInfo.compile_jars`

Note: `JavaInfo.compile_jars` can return a mix of interface Jars and regular Jars.

Only use this method if interface Jars don't work with your rule set(s) (e.g. some Scala targets) If you're working with Java-only targets it's preferable to use interface Jars via `JavaInfo.compile_jars`

## header\_compilation\_direct\_deps

```
depset JavaInfo.header_compilation_direct_deps
```

Returns the direct dependencies of the header compilation action.

## java\_outputs

```
list JavaInfo.java_outputs
```

Returns information about outputs of this Java/Java-like target.

## module\_flags\_info

```
JavaModuleFlagsProvider JavaInfo.module_flags_info
```

Returns the Java module flag configuration.

## outputs

```
java_output_jars JavaInfo.outputs
```

Returns information about outputs of this Java/Java-like target. Deprecated: use java\_outputs.
May return `None`.

## plugins

```
struct JavaInfo.plugins
```

Returns data about all plugins that a consuming target should apply.

This is typically either a `java_plugin` itself or a `java_library` exporting one or more plugins.

A `java_library` runs annotation processing with all plugins from this field appearing in `deps` and `plugins` attributes.

## runtime\_output\_jars

```
sequence JavaInfo.runtime_output_jars
```

Returns a list of runtime Jars created by this Java/Java-like target.

## source\_jars

```
sequence JavaInfo.source_jars
```

Returns a list of Jars with all the source files (including those generated by annotations) of the target itself, i.e. NOT including the sources of the transitive dependencies.

## transitive\_compile\_time\_jars

```
depset JavaInfo.transitive_compile_time_jars
```

Returns the transitive set of Jars required to build the target.Note: for binary targets (such as java\_binary and java\_test), this is empty, since such targets
are not intended to be dependencies of other Java targets.

## transitive\_native\_libraries

```
depset JavaInfo.transitive_native_libraries
```

Returns the transitive set of CC native libraries required by the target.

## transitive\_runtime\_jars

```
depset JavaInfo.transitive_runtime_jars
```

Returns a transitive set of Jars required on the target's runtime classpath.Note: for binary targets (such as java\_binary and java\_test), this is empty, since such targets
are not intended to be dependencies of other Java targets.

## transitive\_source\_jars

```
depset JavaInfo.transitive_source_jars
```

Returns the Jars containing source files of the current target and all of its transitive dependencies.
