我想把我的项目和
Google Vision API
以下是maven依赖项,供您检查我尝试与之集成的客户端版本:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-vision</artifactId>
<version>1.51.0</version>
</dependency>
Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the
file path of the JSON file that contains your service account key
我知道以前的客户版本
1.22
有可能做到以下几点:
def credentialFile = this.class.classLoader
.getResource(grailsApplication.config.credentialsFile)
GoogleCredential credential =
GoogleCredential.fromStream(credentialFile.openStream())
.createScoped(grailsApplication.config.googleScope)
Vision vision = new
Vision.Builder(GoogleNetHttpTransport.newTrustedTransport(),
jsonFactory, credential).build()