Empty settings is considered as null
authorMathieu Baudier <mbaudier@argeo.org>
Mon, 13 Feb 2012 10:57:18 +0000 (10:57 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Mon, 13 Feb 2012 10:57:18 +0000 (10:57 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@5061 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

runtime/org.argeo.slc.support.maven/src/main/java/org/argeo/slc/maven/MavenCall.java

index d85067ebbfbc2d4d1220e7692cad78809fc3a2f0..f32ec3bc8c067715e2431e21fae4144ef338c6cc 100644 (file)
@@ -22,12 +22,14 @@ public class MavenCall implements Runnable {
        private List<String> profiles;
        private Map<String, String> properties;
 
+       private Boolean success = null;
+
        public void run() {
                Thread.currentThread().setContextClassLoader(
                                getClass().getClassLoader());
                List<String> args = new ArrayList<String>();
                args.add("-e");
-               if (settings != null) {
+               if (settings != null && !settings.trim().equals("")) {
                        args.add("--settings");
                        args.add(settings);
                }
@@ -62,6 +64,10 @@ public class MavenCall implements Runnable {
                                getBasedirFile().getPath(), System.out, System.err);
                if (log.isDebugEnabled())
                        log.debug("Maven exit code: " + exitCode);
+               if (exitCode == 0)
+                       success = true;
+               else
+                       success = false;
 
                PlexusContainer plexusContainer = mavenCli.getContainer();
                if (log.isDebugEnabled())
@@ -105,4 +111,8 @@ public class MavenCall implements Runnable {
                this.cl = cl;
        }
 
+       public Boolean getSuccess() {
+               return success == null ? false : success;
+       }
+
 }