From 09f3a0efba93e31c8a1e450c9e775af5a207a2b4 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Tue, 28 Nov 2023 20:11:00 -0500 Subject: [PATCH] add main function --- .github/workflows/unmanaged_dependency_check.yaml | 0 .../unmanaged-dependency-check/action.yaml | 0 .../java/com/google/cloud/UnmanagedDependencyCheck.java | 8 ++++++++ 3 files changed, 8 insertions(+) create mode 100644 .github/workflows/unmanaged_dependency_check.yaml create mode 100644 java-shared-dependencies/unmanaged-dependency-check/action.yaml diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/java-shared-dependencies/unmanaged-dependency-check/action.yaml b/java-shared-dependencies/unmanaged-dependency-check/action.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/java-shared-dependencies/unmanaged-dependency-check/src/main/java/com/google/cloud/UnmanagedDependencyCheck.java b/java-shared-dependencies/unmanaged-dependency-check/src/main/java/com/google/cloud/UnmanagedDependencyCheck.java index aa7cbaa526..43b8d72489 100644 --- a/java-shared-dependencies/unmanaged-dependency-check/src/main/java/com/google/cloud/UnmanagedDependencyCheck.java +++ b/java-shared-dependencies/unmanaged-dependency-check/src/main/java/com/google/cloud/UnmanagedDependencyCheck.java @@ -1,5 +1,7 @@ package com.google.cloud; +import static com.google.common.base.Preconditions.checkArgument; + import com.google.cloud.tools.opensource.dependencies.Bom; import com.google.cloud.tools.opensource.dependencies.MavenRepositoryException; import java.nio.file.Paths; @@ -10,6 +12,12 @@ public class UnmanagedDependencyCheck { + public static void main(String[] args) + throws MavenRepositoryException, ArtifactDescriptorException { + checkArgument(args.length == 2, "The length of the inputs should be 2"); + System.out.println(getUnmanagedDependencies(args[0], args[1])); + } + /** * Returns dependency coordinates that are not managed by shared dependency BOM. *