Skip to content

Commit

Permalink
Merge pull request #99 from seraphy/ensureobjdir
Browse files Browse the repository at this point in the history
Create parent directory of obj file
  • Loading branch information
lukaszlenart authored Dec 29, 2018
2 parents 4bc90e9 + 9d921d0 commit 88ede40
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions src/main/java/com/akathist/maven/plugins/launch4j/Launch4jMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,21 @@
*/
package com.akathist.maven.plugins.launch4j;

import net.sf.launch4j.Builder;
import net.sf.launch4j.BuilderException;
import net.sf.launch4j.config.Config;
import net.sf.launch4j.config.ConfigPersister;
import net.sf.launch4j.config.ConfigPersisterException;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.ArrayList;
import java.util.Date;
import java.util.Enumeration;
import java.util.List;
import java.util.Set;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.repository.ArtifactRepository;
Expand All @@ -39,20 +49,11 @@
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.ArrayList;
import java.util.Date;
import java.util.Enumeration;
import java.util.List;
import java.util.Set;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import net.sf.launch4j.Builder;
import net.sf.launch4j.BuilderException;
import net.sf.launch4j.config.Config;
import net.sf.launch4j.config.ConfigPersister;
import net.sf.launch4j.config.ConfigPersisterException;

/**
* Wraps a jar in a Windows executable.
Expand Down Expand Up @@ -582,6 +583,7 @@ private List<String> relativizeAndCopy(File workdir, List<String> paths) throws

if (Files.exists(source)) {
try {
Files.createDirectories(dest.getParent());
Path target = Files.copy(source, dest, StandardCopyOption.REPLACE_EXISTING);
result.add(workdir.toPath().relativize(target).toString());
} catch (IOException e) {
Expand Down

0 comments on commit 88ede40

Please sign in to comment.