]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.agent/src/main/java/org/argeo/slc/cli/SlcMain.java
Improve auto-detection of Spring beans.
[gpl/argeo-slc.git] / org.argeo.slc.agent / src / main / java / org / argeo / slc / cli / SlcMain.java
index a2ffd17efe939d88e5862c34fabfba4f6f158fbb..10636f3d4191815a8a97d102dce1e10d8598828e 100644 (file)
@@ -1,6 +1,5 @@
 package org.argeo.slc.cli;
 
-import java.io.File;
 import java.util.Properties;
 
 import org.apache.commons.cli.CommandLine;
@@ -15,9 +14,6 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.argeo.slc.core.SlcException;
 import org.argeo.slc.logging.Log4jUtils;
-import org.springframework.core.io.DefaultResourceLoader;
-import org.springframework.core.io.FileSystemResource;
-import org.springframework.core.io.Resource;
 
 public class SlcMain {
        public enum Mode {
@@ -138,17 +134,9 @@ public class SlcMain {
 
                // Execution
                if (mode.equals(Mode.single)) {
-                       Resource scriptRes;
-                       if (new File(script).exists()) {
-                               scriptRes = new FileSystemResource(script);
-                       } else {
-                               scriptRes = new DefaultResourceLoader(SlcMain.class
-                                               .getClassLoader()).getResource(script);
-                       }
-
                        DefaultSlcRuntime runtime = new DefaultSlcRuntime();
-                       runtime.executeScript(runtimeStr, scriptRes, targets, properties,
-                                       null);
+                       runtime.executeScript(runtimeStr, script, targets, properties,
+                                       null, null);
                }
        }