From 242a2a8a297166932073a0331faa514785617ebd Mon Sep 17 00:00:00 2001 From: Jakub Stroleny Date: Wed, 27 Sep 2023 16:18:07 +0200 Subject: [PATCH] Fix creation of output directory in packaging mojo (cherry picked from commit 5118b992647ddaa2476501f90eed08156c4ff8e5) --- .../java/org/eclipse/tycho/packaging/PackagePluginMojo.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java index 35ecba1c94..59b3abbc49 100644 --- a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java +++ b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java @@ -201,7 +201,11 @@ private File makeJar(BuildOutputJar jar) throws MojoExecutionException { File jarFile = new File(project.getBasedir(), jarName); JarArchiver archiver = new JarArchiver(); archiver.setDestFile(jarFile); - archiver.addDirectory(jar.getOutputDirectory()); + File outputDirectory = jar.getOutputDirectory(); + if (!outputDirectory.mkdirs() && !outputDirectory.exists()) { + throw new IOException("creating output directory " + outputDirectory.getAbsolutePath() + " failed"); + } + archiver.addDirectory(outputDirectory); if (customManifest != null) { for (File sourceFolder : jar.getSourceFolders()) { File manifestFile = new File(sourceFolder, customManifest);