Introducing the google-ads-bom to the Google Advertisements API consumer library for Java
We’re excited to announce the discharge of the google-ads-bom for the Google Advertisements API consumer library for Java, now obtainable with v40.0.0 of the google-ads consumer library. This new Invoice of Supplies (BOM) is designed to considerably simplify your dependency administration and improve the steadiness of your Google Advertisements API integrations.
What’s a BOM?
A BOM is a build-time device that gives a centralized, authoritative “rulebook” for managing dependency variations. By importing our BOM, you guarantee your mission makes use of the precise set of appropriate dependency variations that the Google Advertisements consumer was constructed and examined in opposition to. This considerably helps keep away from dependency conflicts with libraries like Guava and GAX, that are additionally utilized by many different frameworks.
Tips on how to incorporate the google-ads-bom into your code
To leverage the advantages of the google-ads-bom, import it into the part of your construct file (e.g., pom.xml for Maven or construct.gradle for Gradle). It’s best to then omit the model specification from the google-ads dependency within the part.
Tips on how to embrace the BOM in your Maven mission:
com.google.api-ads google-ads-bom 40.0.0 pom import com.google.api-ads google-ads
Tips on how to embrace the BOM in your Gradle mission:
// Import the Invoice of Supplies (BOM).
implementation platform('com.google.api-ads:google-ads-bom:40.0.0')
// Add the google-ads dependency, and not using a model. The model is managed by the BOM.
implementation 'com.google.api-ads:google-ads'
Declaring dependencies lined by the google-ads-bom
The BOM routinely manages the variations for a number of frequent libraries–resembling Guava, Protobuf, GAX, and gRPC–to make them appropriate. To keep away from potential dependency conflicts, you shouldn’t specify a model when declaring these dependencies. For instance, in case you are utilizing Guava, you’ll declare it and not using a model:
In Maven:
com.google.guava guava
Or in Gradle:
implementation 'com.google.guava:guava' // NO VERSION SPECIFIED.
To retrieve a listing of constrained dependencies that may be imported utilizing the BOM and not using a declared model, use the listAllDependencyConstraints gradle job.
To study extra about this new google-ads-bom providing and how you can configure your Java consumer, take a look at our getting began information.