I use gRPC to generate java code '@javax.annotation.Generated' and it reports 'Error:(20,18) java: cannot find symbol'. How to solve it?

陈黎栋John :

I use gRPC to generate code '@javax.annotation.Generated' like below picture.

![enter image description here

Then I use maven to build the project, and it reports 'Error:(20,18) java: cannot find symbol' like below picture.

enter image description here

How to solve it?

creamsoup :

you can add javax.annotation-api dependencies to you maven pom.xml to resolve the annotation.

<dependency>
    <groupId>javax.annotation</groupId>
    <artifactId>javax.annotation-api</artifactId>
    <version>1.2</version>
</dependency>

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=385030&siteId=1