Skip to content

Commit

Permalink
#513 fix saturn:zip problem
Browse files Browse the repository at this point in the history
  • Loading branch information
heziai committed Oct 15, 2018
1 parent e72c70f commit 955da86
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private String getSaturnVersion(MavenProject project) throws MojoExecutionExcept
}
}
}
throw new MojoExecutionException("cannot read the saturn-job-core dependency.");
throw new MojoExecutionException("cannot read the saturn-job-api dependency.");
}

private IvyGetArtifact getIvyGetArtifact(MavenProjectUtils mavenProjectUtils) throws MojoExecutionException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private String getSaturnVersion(MavenProject project) throws MojoExecutionExcept
}
}
}
throw new MojoExecutionException("cannot read the saturn-job-core dependency.");
throw new MojoExecutionException("cannot read the saturn-job-api dependency.");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.Enumeration;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
import java.util.zip.ZipOutputStream;

Expand Down Expand Up @@ -74,7 +73,7 @@ public static void zip(List<File> runtimeLibFiles, File saturnContainerDir, File
*/

for (File file : runtimeLibFiles) {
zip(file, "app" + FILE_SEPARATOR + "lib", zos);
zip(file, "app/lib", zos);
}
zos.close();
}
Expand All @@ -83,7 +82,7 @@ private static void zip(File file, String parent, ZipOutputStream zos) throws IO
if (file == null || !file.exists())
return;
if (file.isFile()) {
String entryName = parent == null ? file.getName() : parent + FILE_SEPARATOR + file.getName();
String entryName = parent == null ? file.getName() : parent + "/" + file.getName();
zos.putNextEntry(new ZipEntry(entryName));
try(FileInputStream fis = new FileInputStream(file)) {
int len = -1;
Expand All @@ -93,7 +92,7 @@ private static void zip(File file, String parent, ZipOutputStream zos) throws IO
}
}
} else if (file.isDirectory()) {
String entryName = parent == null ? file.getName() : parent + FILE_SEPARATOR + file.getName();
String entryName = parent == null ? file.getName() : parent + "/" + file.getName();
zos.putNextEntry(new ZipEntry(entryName + "/"));
File[] listFiles = file.listFiles();
if (listFiles != null) {
Expand Down

0 comments on commit 955da86

Please sign in to comment.