Home

Awesome

Google API Extensions for Java

Build Status

🚌 In January 2023, this library has moved to gapic-generator-java/gax-java. This repository will be archived in the future. Future releases will appear in the new repository (https://github.com/googleapis/gapic-generator-java/releases). The Maven artifact coordinates (com.google.api:gax) remain the same.

Google API Extensions for Java (GAX Java) is a library which aids in the development of client libraries for server APIs, based on GRPC and Google API conventions.

Application code will rarely need to use most of the classes within this library directly, but code generated automatically from the API definition files can use services such as paged list iteration, request batching, and polling of long-running operations to provide a more convenient and idiomatic API surface to callers.

Currently, this library shouldn't be used independently from google-cloud-java, otherwise there is a high risk of diamond dependency problems, because google-cloud-java uses beta features from this library which can change in breaking ways between versions. See VERSIONING for more information.

For new and existing Developers/ Contributors:

In December 2022, gax-java's build tool has been migrated from gradle to maven. Gradle related files are no longer being maintained and will be eventually removed.

The artifact coordinates in Maven Central ({{ group_id }}:{{ artifact_id }}) remain the same.

Quickstart

If you are using Maven, add this to your pom.xml file

<dependency>
  <groupId>com.google.api</groupId>
  <artifactId>gax</artifactId>
  <version>2.8.1</version>
</dependency>
<dependency>
  <groupId>com.google.api</groupId>
  <artifactId>gax-grpc</artifactId>
  <version>2.8.1</version>
</dependency>

If you are using Gradle, add this to your dependencies

compile 'com.google.api:gax:2.8.1',
  'com.google.api:gax-grpc:2.8.1'

If you are using SBT, add this to your dependencies

libraryDependencies += "com.google.api" % "gax" % "2.8.1"
libraryDependencies += "com.google.api" % "gax-grpc" % "2.8.1"

Java Versions

Java 8 or above is required for using this library.

To build this project, JDK 11 or above is required. The build produces Java bytecode targeted for Java 8.

The project uses Gradle to build while it also provides Bazel build.

If you build this project in Bazel, it requires Bazel 4 and basic UNIX commands (e.g., cat).

Contributing

Contributions to this library are always welcome and highly encouraged.

See the CONTRIBUTING documentation for more information on how to get started.

Versioning

This library follows Semantic Versioning, but with some additional qualifications:

  1. Components marked with @BetaApi are considered to be "0.x" features inside a "1.x" library. This means they can change between minor and patch releases in incompatible ways. These features should not be used by any library "B" that itself has consumers, unless the components of library B that use @BetaApi features are also marked with @BetaApi. Features marked as @BetaApi are on a path to eventually become "1.x" features with the marker removed.

    Special exception for google-cloud-java: google-cloud-java is allowed to depend on @BetaApi features without declaring the consuming code @BetaApi, because gax-java and google-cloud-java move in step with each other. For this reason, gax-java should not be used independently of google-cloud-java.

  2. Components marked with @InternalApi are technically public, but are only public for technical reasons, because of the limitations of Java's access modifiers. For the purposes of semver, they should be considered private.

  3. Components marked with @InternalExtensionOnly are stable for usage, but not for extension. Thus, methods will not be removed from interfaces marked with this annotation, but methods can be added, thus breaking any code implementing the interface. See the javadocs for more details on other consequences of this annotation.

Submodule notes

Feature notes

Repository Structure

This repository contains the following java packages.

gax

gax-grpc

gax-httpjson

License

BSD - See LICENSE for more information.