diff --git a/docs/src/docs/snippets/gradle/groovy/build.gradle b/docs/src/docs/snippets/gradle/groovy/build.gradle index 8f2e3dc6f..71da0fd42 100644 --- a/docs/src/docs/snippets/gradle/groovy/build.gradle +++ b/docs/src/docs/snippets/gradle/groovy/build.gradle @@ -99,7 +99,7 @@ graalvmNative { // Copies metadata collected from tasks into the specified directories. metadataCopy { inputTaskNames.add("test") // Tasks previously executed with the agent attached. - outputDirectories.add("src/main/resources/META-INF/native-image") + outputDirectories.add("src/main/resources/META-INF/native-image///") // Replace and with GAV coordinates of your project mergeWithExisting = true // Instead of copying, merge with existing metadata in the output directories. } diff --git a/docs/src/docs/snippets/gradle/kotlin/build.gradle.kts b/docs/src/docs/snippets/gradle/kotlin/build.gradle.kts index d2f8b3611..50a9dfbd4 100644 --- a/docs/src/docs/snippets/gradle/kotlin/build.gradle.kts +++ b/docs/src/docs/snippets/gradle/kotlin/build.gradle.kts @@ -100,7 +100,7 @@ graalvmNative { // Copies metadata collected from tasks into the specified directories. metadataCopy { inputTaskNames.add("test") // Tasks previously executed with the agent attached. - outputDirectories.add("src/main/resources/META-INF/native-image") + outputDirectories.add("src/main/resources/META-INF/native-image///") // Replace and with GAV coordinates of your project mergeWithExisting.set(true) // Instead of copying, merge with existing metadata in the output directories. } diff --git a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/MetadataCopyMojo.java b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/MetadataCopyMojo.java index a4925befb..4797fecda 100644 --- a/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/MetadataCopyMojo.java +++ b/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/MetadataCopyMojo.java @@ -98,7 +98,10 @@ public void execute() throws MojoExecutionException { String buildDirectory = project.getBuild().getDirectory() + "/native/agent-output/"; String destinationDir = config.getOutputDirectory(); if (destinationDir == null) { - destinationDir = project.getBuild().getOutputDirectory() + DEFAULT_OUTPUT_DIRECTORY; + destinationDir = project.getBuild().getOutputDirectory() + .concat(DEFAULT_OUTPUT_DIRECTORY).concat("/") + .concat(project.getGroupId()).concat("/") + .concat(project.getArtifactId()); } if (!Files.isDirectory(Paths.get(destinationDir))) {