package org.argeo.slc.maven;
package org.argeo.slc.maven;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.SlcException;
import org.codehaus.plexus.PlexusContainer;
/** A Maven execution. */
import org.codehaus.plexus.PlexusContainer;
/** A Maven execution. */
args.add(settings);
}
args.add("-f");
args.add(settings);
}
args.add("-f");
- args.add(basedir + "/pom.xml");
+ args.add(getBasedirFile().getPath() + "/pom.xml");
if (goals != null)
args.addAll(goals);
if (profiles != null)
if (goals != null)
args.addAll(goals);
if (profiles != null)
// Launcher.main(goals);
CustomCli mavenCli = new CustomCli();
// Launcher.main(goals);
CustomCli mavenCli = new CustomCli();
- mavenCli.doMain(args.toArray(new String[args.size()]), basedir,
- System.out, System.err);
+ mavenCli.doMain(args.toArray(new String[args.size()]), getBasedirFile()
+ .getPath(), System.out, System.err);
PlexusContainer plexusContainer = mavenCli.getContainer();
if (log.isDebugEnabled())
PlexusContainer plexusContainer = mavenCli.getContainer();
if (log.isDebugEnabled())
plexusContainer.dispose();
}
plexusContainer.dispose();
}
+ /** Removes 'file:' prefix if present */
+ protected File getBasedirFile() {
+ if (basedir == null)
+ throw new SlcException("basedir not set");
+ File dir;
+ if (basedir.startsWith("file:"))
+ dir = new File(basedir.substring("file:".length()));
+ else
+ dir = new File(basedir);
+ return dir;
+ }
+
public void setBasedir(String basedir) {
this.basedir = basedir;
}
public void setBasedir(String basedir) {
this.basedir = basedir;
}