diff --git a/src/main/java/org/spootnik/LeiningenBuilder.java b/src/main/java/org/spootnik/LeiningenBuilder.java
index 54129c8..b4384a6 100644
--- a/src/main/java/org/spootnik/LeiningenBuilder.java
+++ b/src/main/java/org/spootnik/LeiningenBuilder.java
@@ -44,12 +44,15 @@ public class LeiningenBuilder extends Builder {
private final String task;
private String subdirPath;
+ private String jvmOpts;
+
// Fields in config.jelly must match the parameter names in the "DataBoundConstructor"
@DataBoundConstructor
- public LeiningenBuilder(String task, String subdirPath) {
+ public LeiningenBuilder(String task, String subdirPath, String jvmOpts) {
this.task = task;
this.subdirPath = subdirPath;
+ this.jvmOpts = jvmOpts;
}
/**
@@ -63,6 +66,11 @@ public String getSubdirPath() {
return subdirPath;
}
+ public String getJvmOpts() {
+ return jvmOpts;
+ }
+
+
@Override
public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) {
// This is where you 'build' the project.
@@ -138,9 +146,17 @@ private ArgumentListBuilder getLeinCommand(AbstractBuild build, Launcher launche
args.add("-client");
args.add("-XX:+TieredCompilation");
args.add("-Xbootclasspath/a:" + descriptor.getJarPath());
+
+ // TODO: handle also spaces within the options, like '-Dvalue="some string"'
+ for(String jo : jvmOpts.split(" ")) {
+ if(! "".equals(jo)) {
+ args.add(jo);
+ }
+ }
+
args.add("-Dfile.encoding=UTF-8");
args.add("-Dmaven.wagon.http.ssl.easy=false");
- args.add("-Dleiningen.original.pwd=" + workDir);
+ args.add("-Dleiningen.original.pwd=" + workDir);
args.add("-cp");
args.add(jarPath);
args.add("clojure.main");
@@ -223,7 +239,7 @@ public FormValidation doCheckJarPath(@QueryParameter String value)
}
public boolean isApplicable(Class extends AbstractProject> aClass) {
- // Indicates that this builder can be used with all kinds of project types
+ // Indicates that this builder can be used with all kinds of project types
return true;
}
@@ -246,4 +262,3 @@ public boolean configure(StaplerRequest req, JSONObject formData) throws FormExc
}
}
}
-
diff --git a/src/main/resources/org/spootnik/LeiningenBuilder/config.jelly b/src/main/resources/org/spootnik/LeiningenBuilder/config.jelly
index 2ec2ba8..b6cbbe4 100644
--- a/src/main/resources/org/spootnik/LeiningenBuilder/config.jelly
+++ b/src/main/resources/org/spootnik/LeiningenBuilder/config.jelly
@@ -3,10 +3,13 @@