Skip to content

Generated project pom.xmls should declare more explicit dependencies #389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ljnelson opened this issue Apr 6, 2022 · 0 comments
Open
Labels
SDK Issue pertains to the SDK itself and not specific to any service

Comments

@ljnelson
Copy link
Member

ljnelson commented Apr 6, 2022

(Minor issue; didn't want it to get lost.)

Most of the subprojects in the OCI SDK look to me like they're generated. If so, whatever template it is that makes their pom.xmls should be updated to also include the following explicit dependencies. Here I've also assumed that relevant ones are managed in the root pom.xml's <dependencyManagement> section (which PR #388 implements if I remember right):

<dependency>
  <groupId>com.fasterxml.jackson.core</groupId>
  <artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
  <groupId>com.fasterxml.jackson.core</groupId>
  <artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
  <groupId>com.google.guava</groupId>
  <artifactId>guava</artifactId>
</dependency>
<dependency>
  <groupId>org.glassfish.jersey.connectors</groupId>
  <artifactId>jersey-apache-connector</artifactId>
</dependency>
<dependency>
  <groupId>com.oracle.oci.sdk</groupId>
  <artifactId>oci-java-sdk-circuitbreaker</artifactId>
  <version>${project.version}</version>
</dependency>

Here is an arbitrary place where bmc-circuitbreaker classes are used explicitly:

https://github.com/oracle/oci-java-sdk/blob/v2.22.0/bmc-aivision/src/main/java/com/oracle/bmc/aivision/AIServiceVisionClient.java#L10

Here is an arbitrary place where Jackson classes are used explicitly:

https://github.com/oracle/oci-java-sdk/blob/v2.22.0/bmc-aivision/src/main/java/com/oracle/bmc/aivision/model/AnalyzeImageResult.java#L23

Here is an arbitrary place where Guava is used explicitly (which could easily be replaced by Java 8 constructs):

https://github.com/oracle/oci-java-sdk/blob/v2.22.0/bmc-ailanguage/src/main/java/com/oracle/bmc/ailanguage/AIServiceLanguageAsyncClient.java#L354

Here is an arbitrary place where Jersey Apache connector stuff is used explicitly:

https://github.com/oracle/oci-java-sdk/blob/v2.22.0/bmc-ailanguage/src/main/java/com/oracle/bmc/ailanguage/AIServiceLanguageAsyncClient.java#L44

It's good Maven practice to add an explicit dependency on the containing artifact when you import some class. It makes it clearer to a customer what exactly is being used directly by the project.

I see in the root pom.xml that a few dependencies get inherited by all projects (lombok, slf4j and jakarta.ws.rs-api). It would be better, too, if these were explicitly placed in every pom.xml. Ordinarily this wouldn't be at all worth it because of the sheer number of subprojects, but if they're all generated anyway it strikes me that it shouldn't be a big deal.

@jodoglevy jodoglevy added the SDK Issue pertains to the SDK itself and not specific to any service label Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDK Issue pertains to the SDK itself and not specific to any service
Projects
None yet
Development

No branches or pull requests

2 participants