diff --git a/src/it/test-java-main-empty/invoker.properties b/src/it/test-java-main-empty/invoker.properties
new file mode 100644
index 00000000..3d041b81
--- /dev/null
+++ b/src/it/test-java-main-empty/invoker.properties
@@ -0,0 +1 @@
+invoker.goals = clean package
diff --git a/src/it/test-java-main-empty/pom.xml b/src/it/test-java-main-empty/pom.xml
new file mode 100644
index 00000000..5a8ca028
--- /dev/null
+++ b/src/it/test-java-main-empty/pom.xml
@@ -0,0 +1,54 @@
+
+
+
+ 4.0.0
+
+ org.example
+ example
+ 0.0.1-SNAPSHOT
+
+
+ 3.25.1
+ UTF-8
+
+
+
+
+
+ ${plugin-group-id}
+ ${plugin-artifact-id}
+ ${plugin-version}
+
+
+ ${protobuf.version}
+
+
+
+
+
+ generate
+
+
+
+
+
+
+
diff --git a/src/it/test-java-test-empty/invoker.properties b/src/it/test-java-test-empty/invoker.properties
new file mode 100644
index 00000000..3d041b81
--- /dev/null
+++ b/src/it/test-java-test-empty/invoker.properties
@@ -0,0 +1 @@
+invoker.goals = clean package
diff --git a/src/it/test-java-test-empty/pom.xml b/src/it/test-java-test-empty/pom.xml
new file mode 100644
index 00000000..27ef851e
--- /dev/null
+++ b/src/it/test-java-test-empty/pom.xml
@@ -0,0 +1,55 @@
+
+
+
+ 4.0.0
+
+ org.example
+ example
+ 0.0.1-SNAPSHOT
+
+
+ 3.25.1
+
+ UTF-8
+
+
+
+
+
+ ${plugin-group-id}
+ ${plugin-artifact-id}
+ ${plugin-version}
+
+
+ ${protobuf.version}
+
+
+
+
+
+ generate-test
+
+
+
+
+
+
+
diff --git a/src/main/java/io/github/ascopes/protobufmavenplugin/source/ProtoSourceResolver.java b/src/main/java/io/github/ascopes/protobufmavenplugin/source/ProtoSourceResolver.java
index 0f019479..5d1a3999 100644
--- a/src/main/java/io/github/ascopes/protobufmavenplugin/source/ProtoSourceResolver.java
+++ b/src/main/java/io/github/ascopes/protobufmavenplugin/source/ProtoSourceResolver.java
@@ -106,6 +106,11 @@ public Collection createProtoFileListings(
}
public Optional createProtoFileListing(Path path) throws IOException {
+ if (!Files.exists(path)) {
+ log.debug("Skipping lookup in path {} as it does not exist", path);
+ return Optional.empty();
+ }
+
if (Files.isRegularFile(path)) {
return protoArchiveExtractor.extractProtoFiles(path);
}