Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add special handling for .tar.gz and .tar.bz2 extensions ( #21 )

  • Loading branch information...
commit 8ffb5dd76381486a93fc25493b035155675ebd62 1 parent 550ca37
@jdillon jdillon authored
View
21 install4j-maven-plugin/src/main/java/org/sonatype/install4j/maven/CompileMojo.java
@@ -12,12 +12,6 @@
*/
package org.sonatype.install4j.maven;
-import org.apache.maven.plugins.annotations.Component;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.project.MavenProjectHelper;
-import org.apache.tools.ant.taskdefs.ExecTask;
-
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
@@ -28,6 +22,12 @@
import java.util.Map.Entry;
import java.util.Properties;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.MavenProjectHelper;
+import org.apache.tools.ant.taskdefs.ExecTask;
+
/**
* Compile installers (via install4jc).
*
@@ -285,6 +285,15 @@ private AttachedFile(final String path, final String classifier) {
private static String getType(final File file) {
String path = file.getAbsolutePath();
+
+ // special case for compound '.' extensions
+ if (path.endsWith(".tar.gz")) {
+ return "tar.gz";
+ }
+ else if (path.endsWith(".tar.bz2")) {
+ return "tar.bz2";
+ }
+
int i = path.lastIndexOf(".");
return path.substring(i + 1, path.length());
}
Please sign in to comment.
Something went wrong with that request. Please try again.