We are excited to announce the release of the google-ads-bom for the Google Ads API client library for Java, now available with v40.0.0 of the google-ads client library. This Bill of Materials (BOM) simplifies dependency management and enhances the stability of Google Ads API integrations.
What is a BOM?
A BOM is a build-time tool that provides a centralized "rulebook" for managing dependency versions. Importing the BOM ensures your project uses compatible dependency versions that the Google Ads client was built and tested against, helping to avoid conflicts with libraries like Guava and GAX.
How to incorporate the google-ads-bom into your code
To use the google-ads-bom, import it into the dependency management section of your build file (e.g., pom.xml for Maven or build.gradle for Gradle) and omit the version specification from the google-ads dependency.
Maven Example:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.api-ads</groupId>
<artifactId>google-ads-bom</artifactId>
<version>40.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.api-ads</groupId>
<artifactId>google-ads</artifactId>
</dependency>
</dependencies>
Gradle Example:
// Import the Bill of Materials (BOM).
implementation platform('com.google.api-ads:google-ads-bom:40.0.0')
// Add the google-ads dependency, without a version.
implementation 'com.google.api-ads:google-ads'
Declaring dependencies covered by the google-ads-bom
The BOM manages versions for libraries like Guava, Protobuf, GAX, and gRPC. To avoid conflicts, do not specify a version when declaring these dependencies.
Maven Example:
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
Gradle Example:
implementation 'com.google.guava:guava' // NO VERSION SPECIFIED.
To retrieve a list of constrained dependencies that can be imported using the BOM without a declared version, use the listAllDependencyConstraints Gradle task. For more information on the google-ads-bom and configuring your Java client, refer to the getting started guide.










