Skip to content

Commit 43ff5f2

Browse files
raytnetdpb
authored andcommitted
AutoValue annotation can be provided scope.
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=321258257
1 parent b484417 commit 43ff5f2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

value/userguide/index.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,23 @@ For `auto-value-annotations`, you can write this in `pom.xml`:
9292
</dependencies>
9393
```
9494

95+
Some AutoValue annotations have CLASS retention. This is mostly of use for
96+
compile-time tools, such as AutoValue itself. If you are creating
97+
a library, the end user rarely needs to know the original AutoValue annotations.
98+
In that case, you can set the scope to `provided`, so that the user of your
99+
library does not have `auto-value-annotations` as a transitive dependency.
100+
101+
```xml
102+
<dependencies>
103+
<dependency>
104+
<groupId>com.google.auto.value</groupId>
105+
<artifactId>auto-value-annotations</artifactId>
106+
<version>${auto-value.version}</version>
107+
<scope>provided</scope>
108+
</dependency>
109+
</dependencies>
110+
```
111+
95112
For `auto-value` (the annotation processor), you can write this:
96113

97114
```xml

0 commit comments

Comments
 (0)