diff --git a/private/tools/java/com/github/bazelbuild/rules_jvm_external/maven/MavenPublisher.java b/private/tools/java/com/github/bazelbuild/rules_jvm_external/maven/MavenPublisher.java
--- a/private/tools/java/com/github/bazelbuild/rules_jvm_external/maven/MavenPublisher.java
+++ b/private/tools/java/com/github/bazelbuild/rules_jvm_external/maven/MavenPublisher.java
@@ -174,16 +174,18 @@
     Path pom = Paths.get(pomPath);

     List<CompletableFuture<Void>> futures = new ArrayList<>();
     futures.add(upload(repo, credentials, coords, ".pom", pom, signingMetadata, executor));

-    futures.add(
-        upload(
-            repo,
-            credentials,
-            coords,
-            "." + getFileExtension(mainArtifactPath),
-            Paths.get(mainArtifactPath),
-            signingMetadata,
-            executor));
-
+    if (!mainArtifactPath.isEmpty()) {
+      futures.add(
+          upload(
+              repo,
+              credentials,
+              coords,
+              "." + getFileExtension(mainArtifactPath),
+              Paths.get(mainArtifactPath),
+              signingMetadata,
+              executor));
+    }
+
     if (!Strings.isNullOrEmpty(extraArtifacts)) {
