diff --git a/maven-plugin/src/main/java/org/jboss/jandex/maven/JandexGoal.java b/maven-plugin/src/main/java/org/jboss/jandex/maven/JandexGoal.java index 8d61ef9c..15b6c8b6 100644 --- a/maven-plugin/src/main/java/org/jboss/jandex/maven/JandexGoal.java +++ b/maven-plugin/src/main/java/org/jboss/jandex/maven/JandexGoal.java @@ -172,7 +172,7 @@ public void execute() throws MojoExecutionException { File indexFile = new File(indexDir, indexName); getLog().info("Saving Jandex index: " + indexFile); try { - Files.createDirectories(indexDir.toPath()); + Files.createDirectories(indexFile.toPath().getParent()); try (OutputStream out = new CachingOutputStream(indexFile)) { IndexWriter writer = new IndexWriter(out); if (indexVersion != null) {