Skip to content

Commit

Permalink
Fix creation of output directory in packaging mojo
Browse files Browse the repository at this point in the history
(cherry picked from commit 5118b99)
  • Loading branch information
jstroleny authored and laeubi committed Sep 28, 2023
1 parent 2ee751b commit 242a2a8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 242a2a8

Please sign in to comment.