google-cloud-java icon indicating copy to clipboard operation
google-cloud-java copied to clipboard

split package issue with google.cloud.vision java 11

Open ashishchopra opened this issue 6 years ago • 9 comments

Environment details

  1. Specify the API at the beginning of the title : google.cloud.vision, com.google.api.grpc
  2. OS type and version: Ubuntu 16.04
  3. Java version: Java11
  4. google-cloud-vision version(s): 1.82.0

Steps to reproduce

  1. Create a spring boot project
  2. Change the project SDK to Java 9 or above. I use Java 11 (Amazon Cornetto OpenJDK) 3, Add google-cloud-vision in pom.xml
  3. Add requires google.cloud.vision; and requires proto.google.cloud.vision.v1; in module.java
  4. Run the spring boot application.
  5. Following errors pop up

Stack trace

[ERROR] module lombok reads package com.google.cloud.vision.v1 from both proto.google.cloud.vision.v1 and google.cloud.vision
[ERROR] the unnamed module reads package com.google.cloud.vision.v1 from both proto.google.cloud.vision.v1 and google.cloud.vision
[ERROR] module fuzzywuzzy reads package com.google.cloud.vision.v1 from both proto.google.cloud.vision.v1 and google.cloud.vision
[ERROR] module protobuf.java reads package com.google.cloud.vision.v1 from both proto.google.cloud.vision.v1 and google.cloud.vision
[ERROR] module spring.core reads package com.google.cloud.vision.v1 from both proto.google.cloud.vision.v1 and google.cloud.vision
[ERROR] module org.hibernate.orm.envers reads package com.google.cloud.vision.v1 from both proto.google.cloud.vision.v1 and google.cloud.vision
[ERROR] module java.persistence reads package com.google.cloud.vision.v1 from both proto.google.cloud.vision.v1 and google.cloud.vision
[ERROR] module graphql.java.tools reads package com.google.cloud.vision.v1 from both proto.google.cloud.vision.v1 and google.cloud.vision
[ERROR] module spring.data.commons reads package com.google.cloud.vision.v1 from both proto.google.cloud.vision.v1 and google.cloud.vision
[ERROR] module spring.beans reads package com.google.cloud.vision.v1 from both proto.google.cloud.vision.v1 and google.cloud.vision
[ERROR] module spring.web reads package com.google.cloud.vision.v1 from both proto.google.cloud.vision.v1 and google.cloud.vision
[ERROR] module spring.context reads package com.google.cloud.vision.v1 from both proto.google.cloud.vision.v1 and google.cloud.vision
[ERROR] module org.mapstruct.processor reads package com.google.cloud.vision.v1 from both proto.google.cloud.vision.v1 and google.cloud.vision
[ERROR] module google.cloud.vision reads package com.google.cloud.vision.v1 from both proto.google.cloud.vision.v1 and google.cloud.vision
[ERROR] module proto.google.cloud.vision.v1 reads package com.google.cloud.vision.v1 from both google.cloud.vision and proto.google.cloud.vision.v1
[ERROR] module spring.boot reads package com.google.cloud.vision.v1 from both proto.google.cloud.vision.v1 and google.cloud.vision

Thanks!

ashishchopra avatar Jul 17 '19 10:07 ashishchopra

Do we have any update on this?

ashishchopra avatar Jul 19 '19 10:07 ashishchopra

@ashishchopra can you please share your list of dependencies and module.java.

athakor avatar Jul 19 '19 10:07 athakor

Dependencies:

<dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>3.9.0-rc-1</version>
</dependency>
<dependency>
            <groupId>com.google.cloud</groupId>
            <artifactId>google-cloud-vision</artifactId>
            <version>1.82.0</version>
</dependency>

module.java:

requires google.cloud.vision;
requires proto.google.cloud.vision.v1;

ashishchopra avatar Jul 19 '19 12:07 ashishchopra

This looks like an issue with how we have our packages split up into (at least) 3 artifacts. For the vision example, we create distinct classes in the com.google.cloud.vision.v1 package in proto-google-cloud-vision-v1, grpc-google-cloud-vision-v1 and google-cloud-vision.

This setup has been around for a few years and will be non-trivial to fix without potentially causing other dependency issues in the ecosystem and not breaking the interface.

chingor13 avatar Jul 19 '19 15:07 chingor13

HI @chingor13 Do you foresee any timeline for this change and do you have a suggestion on an alternative way to make it work meanwhile?

ashishchopra avatar Jul 20 '19 06:07 ashishchopra

I think the least painful way forward is to ship a new single artifact that repackages everything into a new package com.google.cloud.vision.v2. Clients will have to change their source code to import the new package instead of com.google.cloud.vision.v1. However that's a straight-forward search and replace.

Alternately, we could keep three Maven artifacts and use three new packages.

elharo avatar Jul 20 '19 13:07 elharo

Hi, @chingor13 It will be very helpful if you can give us some timeline for this fix. A very important functionality our application depends on this fix.

ashishchopra avatar Jul 22 '19 10:07 ashishchopra

We don't have a timeline on a fix for this right now. If you have a support contract, then please submit an additional ticket to help us prioritize.

As for the current status, we are currently starting discussions about how to go about fixing this.

chingor13 avatar Jul 22 '19 16:07 chingor13

We are working on a plan for module support, but for now, this is blocked (grpc also has this issue)

chingor13 avatar Jan 15 '20 17:01 chingor13

Obsolete.

meltsufin avatar Sep 24 '22 15:09 meltsufin

same issue. is there a fix yet?

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project GraphitiAppMaven: Compilation failure: Compilation failure:
[ERROR] the unnamed module reads package com.google.cloud.vision.v1 from both google.cloud.vision and proto.google.cloud.vision.v1 [ERROR] module com.google.protobuf reads package com.google.cloud.vision.v1 from both google.cloud.vision and proto.google.cloud.vision.v1 [ERROR] module proto.google.cloud.vision.v1 reads package com.google.cloud.vision.v1 from both google.cloud.vision and proto.google.cloud.vision.v1 [ERROR] module google.cloud.vision reads package com.google.cloud.vision.v1 from both google.cloud.vision and proto.google.cloud.vision.v1 [ERROR] module gax reads package com.google.cloud.vision.v1 from both google.cloud.vision and proto.google.cloud.vision.v1 [ERROR] module com.google.auth.oauth2 reads package com.google.cloud.vision.v1 from both google.cloud.vision and proto.google.cloud.vision.v1 [ERROR] /C:/Users/smart/IdeaProjects/GraphitiAppMaven/src/main/java/module-info.java:[1,1] module com.graphitiapp.graphitiappmaven reads package com.google.cloud.vision.v1 from both google.cloud.vision and proto.google.cloud.vision.v1

dependencies:

com.google.cloud google-cloud-vision 3.18.0 com.google.auth google-auth-library-oauth2-http 0.22.0 io.grpc grpc-netty-shaded 1.42.0 com.google.protobuf protobuf-java 3.18.0 com.fazecast jSerialComm 2.6.0 com.google.cloud libraries-bom 26.16.0 pom import com.google.code.gson gson 2.8.8 org.openjfx javafx-controls 17.0.6 org.openjfx javafx-fxml 17.0.6
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
    </dependency>
</dependencies>

DhruvAjayToshniwal avatar Jun 29 '23 16:06 DhruvAjayToshniwal