Skip to content

Commit 6847489

Browse files
authored
chore: add custom artifacts (#2377)
* chore: add custom artifacts in handwritten libraries * change comments. * consolidate hw pom into one
1 parent 49d94d9 commit 6847489

File tree

5 files changed

+94
-132
lines changed

5 files changed

+94
-132
lines changed

java-shared-dependencies/unmanaged-dependency-check/src/main/java/com/google/cloud/UnmanagedDependencyCheck.java

+8-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@
1818
* A utility class to check unmanaged dependencies in BOM.
1919
*/
2020
public class UnmanagedDependencyCheck {
21-
// regex of handwritten artifacts
22-
private final static String downstreamArtifact = "(com.google.cloud:google-.*)|(com.google.api.grpc:(grpc|proto)-google-.*)";
23-
21+
// Regex of handwritten artifacts.
22+
// There are customized artifacts defined in some handwritten libraries, e.g., firestore and
23+
// datastore, add entries in regex to exclude these artifacts.
24+
private final static String downstreamArtifact =
25+
"(com.google.cloud:google-.*)|"
26+
+ "(com.google.api.grpc:(grpc|proto)-google-.*)|"
27+
+ "(com.google.cloud:proto-google-cloud-firestore-bundle-.*)|"
28+
+ "(com.google.cloud.datastore:datastore-.*-proto-client)";
2429

2530
/**
2631
* @param args An array with two elements.<p> The first string is the path of Java shared

java-shared-dependencies/unmanaged-dependency-check/src/test/java/com/google/cloud/UnmanagedDependencyCheckTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ public void getUnmanagedDependencyFromHWBomTest()
2424
throws MavenRepositoryException, InvalidVersionSpecificationException {
2525
List<String> unManagedDependencies =
2626
UnmanagedDependencyCheck.getUnmanagedDependencies(
27-
"src/test/resources/shared-dependency-3.18.0-pom.xml", "src/test/resources/bigtable-pom.xml");
27+
"src/test/resources/shared-dependency-3.18.0-pom.xml",
28+
"src/test/resources/google-internal-artifact-test-case-pom.xml");
2829
assertTrue(unManagedDependencies.isEmpty());
2930
}
3031

java-shared-dependencies/unmanaged-dependency-check/src/test/resources/bigtable-pom.xml

-127
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.google.cloud</groupId>
5+
<artifactId>google-internal-artifact</artifactId>
6+
<version>0.0.1-SNAPSHOT</version>
7+
<packaging>pom</packaging>
8+
<parent>
9+
<groupId>com.google.cloud</groupId>
10+
<artifactId>google-cloud-shared-config</artifactId>
11+
<version>1.6.0</version>
12+
<relativePath/>
13+
</parent>
14+
15+
<name>Google Cloud Internal Artifact for testing</name>
16+
<url>https://github.com/googleapis/java-bigtable</url>
17+
<description>
18+
BOM for Google Cloud Internal Artifact for testing
19+
</description>
20+
21+
<organization>
22+
<name>Google LLC</name>
23+
</organization>
24+
25+
<licenses>
26+
<license>
27+
<name>The Apache Software License, Version 2.0</name>
28+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
29+
<distribution>repo</distribution>
30+
</license>
31+
</licenses>
32+
33+
<dependencyManagement>
34+
<dependencies>
35+
<!-- this artifact contains com.google.cloud.datastore:datastore-v1-proto-client -->
36+
<dependency>
37+
<groupId>com.google.cloud</groupId>
38+
<artifactId>google-cloud-datastore-bom</artifactId>
39+
<version>2.17.4</version>
40+
<scope>import</scope>
41+
<type>pom</type>
42+
</dependency>
43+
<!-- this artifact contains com.google.cloud:proto-google-cloud-firestore-bundle-v1 -->
44+
<dependency>
45+
<groupId>com.google.cloud</groupId>
46+
<artifactId>google-cloud-firestore-bom</artifactId>
47+
<version>3.15.2</version>
48+
<scope>import</scope>
49+
<type>pom</type>
50+
</dependency>
51+
<dependency>
52+
<groupId>com.google.cloud</groupId>
53+
<artifactId>google-cloud-bigtable-bom</artifactId>
54+
<version>2.29.0</version>
55+
<scope>import</scope>
56+
<type>pom</type>
57+
</dependency>
58+
</dependencies>
59+
</dependencyManagement>
60+
61+
<build>
62+
<plugins>
63+
<plugin>
64+
<groupId>org.apache.maven.plugins</groupId>
65+
<artifactId>maven-checkstyle-plugin</artifactId>
66+
<configuration>
67+
<skip>true</skip>
68+
</configuration>
69+
</plugin>
70+
71+
<!-- Using maven site plugin only as a hook for javadoc:aggregate, don't need the reports -->
72+
<plugin>
73+
<groupId>org.apache.maven.plugins</groupId>
74+
<artifactId>maven-site-plugin</artifactId>
75+
76+
<configuration>
77+
<generateReports>false</generateReports>
78+
</configuration>
79+
</plugin>
80+
</plugins>
81+
</build>
82+
</project>

java-shared-dependencies/unmanaged-dependency-check/src/test/resources/local-install.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
mvn install -f shared-dependency-3.18.0-pom.xml
44
mvn install -f gax-example-pom.xml
55
mvn install -f nested-dependency-pom.xml
6-
mvn install -f transitive-dependency-pom.xml
6+
mvn install -f transitive-dependency-pom.xml
7+
mvn install -f google-internal-artifact-test-case-pom.xml

0 commit comments

Comments
 (0)