Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/docs/snippets/gradle/groovy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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/<groupId>/<artifactId>/") // Replace <groupId> and <artifactId> with GAV coordinates of your project
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the trailing forward slash correct? We used to not have it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since src/main/resources/META-INF/native-image/<groupId>/<artifactId>/ is directory, I don't see any difference if we use the trailing forward slash or not. It should work in any case, and I think it doesn't change anything. We can remove it if it is necessary

mergeWithExisting = true // Instead of copying, merge with existing metadata in the output directories.
}

Expand Down
2 changes: 1 addition & 1 deletion docs/src/docs/snippets/gradle/kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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/<groupId>/<artifactId>/") // Replace <groupId> and <artifactId> with GAV coordinates of your project
mergeWithExisting.set(true) // Instead of copying, merge with existing metadata in the output directories.
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down