Google Ads API BOM(Bill of Materials)
은 종속 항목 버전 관리를 통해 다른 프레임워크에서도 사용되는
Guava 및 GAX와 같은 라이브러리와의 종속 항목 충돌을 방지합니다. BOM은 Google Ads 클라이언트 라이브러리로 테스트된 이러한 종속 항목의 정확한 버전을 사용하도록 보장합니다.
클라이언트 라이브러리 아티팩트를 사용하는 것이 좋습니다.
Maven 구성 {#maven-configuration}
Maven 종속 항목은 다음과 같습니다.
<!-- Import the Bill of Materials (BOM) to ensure you're using compatible
versions of all google-ads libraries. -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.api-ads</groupId>
<artifactId>google-ads-bom</artifactId>
<version>44.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!-- Add the google-ads dependency, without a version. The version is
managed by the BOM. -->
<dependency>
<groupId>com.google.api-ads</groupId>
<artifactId>google-ads</artifactId>
</dependency>
Gradle 구성
Gradle 종속 항목은 다음과 같습니다.
// Import the Bill of Materials (BOM).
implementation platform('com.google.api-ads:google-ads-bom:44.0.0')
// Add the google-ads dependency, without a version.
implementation 'com.google.api-ads:google-ads'
BOM에서 다루는 종속 항목 선언
Google Ads API
BOM
에는 Guava,
Protobuf, GAX, gRPC와 같은 여러 일반적인 라이브러리의 버전 관리가 포함되어 있습니다. 잠재적인 종속 항목 충돌을 방지하려면 BOM에서 다루는 종속 항목을 선언할 때 버전을 지정하지 않아야 합니다.
BOM은 이러한 라이브러리의 버전을 자동으로 관리하여 호환성을 보장합니다.
예를 들어 Maven에서 Guava 종속 항목을 선언하려면 다음을 사용합니다.
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<!-- NO VERSION SPECIFIED -->
</dependency>
Gradle의 경우:
implementation 'com.google.guava:guava' // NO VERSION SPECIFIED
버전을 생략하면 BOM에서 버전을 관리할 수 있으므로 호환되지 않는 종속 항목 버전으로 인해 발생하는 문제를 방지할 수 있습니다. 종속 항목 충돌의 일반적인 지표로는 NoSuchMethodError 또는 ClassNotFoundException이 있으며, 이는 모든 BOM 관리 종속 항목에 버전이 지정되지 않도록 하여 해결할 수 있는 경우가 많습니다.