@Override public String call() throws IOException { File[] jars = new File(getHomeDir(), "lib").listFiles(); if (jars != null) { // be defensive for (File jar : jars) { if (jar.getName().startsWith("maven-")) { JarFile jf = null; try { jf = new JarFile(jar); Manifest manifest = jf.getManifest(); String version = manifest.getMainAttributes().getValue(Attributes.Name.IMPLEMENTATION_VERSION); if (version != null) { return version; } } finally { if (jf != null) { jf.close(); } } } } } return ""; } }
public String call() throws IOException { File[] jars = new File(getHomeDir(),"lib").listFiles(); if(jars!=null) { // be defensive for (File jar : jars) { if (jar.getName().endsWith("-uber.jar") && jar.getName().startsWith("maven-")) { return jar.getName(); } } } return ""; } });
public String call() throws IOException { File[] jars = new File(getHomeDir(), "lib").listFiles(); if (jars != null) { // be defensive for (File jar : jars) { if (jar.getName().endsWith("-uber.jar") && jar.getName().startsWith("maven-")) { return jar.getName(); } } } return ""; } });
MavenEmbedderRequest mer = new MavenEmbedderRequest( listener, mavenHome.getHomeDir(), profiles, properties, privateRepository, settingsLoc );
MavenEmbedderRequest mavenEmbedderRequest = new MavenEmbedderRequest( listener, mavenHome.getHomeDir(), profiles, properties, privateRepository, settingsLoc );
m!=null?m.getHomeDir():null, profiles, systemProperties,
m!=null?m.getHomeDir():null, profiles, systemProperties,
m!=null?m.getHomeDir():null, profiles, systemProperties,
public String call() throws IOException { File[] jars = new File(getHomeDir(),"lib").listFiles(); if(jars!=null) { // be defensive for (File jar : jars) { if (jar.getName().startsWith("maven-")) { JarFile jf = null; try { jf = new JarFile(jar); Manifest manifest = jf.getManifest(); String version = manifest.getMainAttributes().getValue(Attributes.Name.IMPLEMENTATION_VERSION); if(version != null) return version; } finally { if(jf != null) jf.close(); } } } } return ""; } });
/** * This version tries to infer mavenHome by looking at a project. * * @see #createEmbedder(TaskListener, File, String) */ public static MavenEmbedder createEmbedder(TaskListener listener, AbstractProject<?,?> project, String profiles) throws MavenEmbedderException, IOException, InterruptedException { MavenInstallation m=null; if (project instanceof ProjectWithMaven) m = ((ProjectWithMaven) project).inferMavenInstallation().forNode(Jenkins.getInstance(),listener); return createEmbedder(listener,m!=null?m.getHomeDir():null,profiles); }
@Override protected String getMavenAgentClassPath(MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) throws IOException, InterruptedException { String classWorldsJar = getLauncher().getChannel().call(new Maven3ProcessFactory.GetClassWorldsJar(mvn.getHome(),listener)); String path = classPathEntry(slaveRoot, Maven32Main.class, "maven32-agent", listener) + (getLauncher().isUnix()?":":";")+classWorldsJar; // TODO this configurable?? path += (getLauncher().isUnix()?":":";")+mvn.getHomeDir().getPath()+"/conf/logging"; return path; }
public String call() throws IOException { File[] jars = new File(getHomeDir(),"lib").listFiles(); if(jars!=null) { // be defensive for (File jar : jars) { if (jar.getName().endsWith("-uber.jar") && jar.getName().startsWith("maven-")) { return jar.getName(); } } } return ""; } });
@Override protected String getMavenAgentClassPath(MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) throws IOException, InterruptedException { String classWorldsJar = getLauncher().getChannel().call(new GetClassWorldsJar(mvn.getHome(),listener)); String path = classPathEntry(slaveRoot, Maven33Main.class, "maven33-agent", listener) + (getLauncher().isUnix()?":":";")+classWorldsJar; // TODO this configurable?? path += (getLauncher().isUnix()?":":";")+mvn.getHomeDir().getPath()+"/conf/logging"; return path; }
/** * This version tries to infer mavenHome by looking at a project. * * @see #createEmbedder(TaskListener, File, String) */ public static MavenEmbedder createEmbedder(TaskListener listener, AbstractProject<?,?> project, String profiles) throws MavenEmbedderException, IOException, InterruptedException { MavenInstallation m=null; if (project instanceof ProjectWithMaven) m = ((ProjectWithMaven) project).inferMavenInstallation().forNode(Hudson.getInstance(),listener); return createEmbedder(listener,m!=null?m.getHomeDir():null,profiles); }
public String call() throws IOException { File[] jars = new File(getHomeDir(),"lib").listFiles(); if(jars!=null) { // be defensive for (File jar : jars) { if (jar.getName().endsWith("-uber.jar") && jar.getName().startsWith("maven-")) { return jar.getName(); } } } return ""; } });
@Override protected String getMavenAgentClassPath(MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) throws IOException, InterruptedException { String classWorldsJar = getLauncher().getChannel().call(new Maven3ProcessFactory.GetClassWorldsJar(mvn.getHome(),listener)); String path = classPathEntry(slaveRoot, Maven31Main.class, "maven31-agent", listener) + (getLauncher().isUnix()?":":";")+classWorldsJar; // TODO this configurable?? path += (getLauncher().isUnix()?":":";")+mvn.getHomeDir().getPath()+"/conf/logging"; return path; }
@Override protected String getMavenAgentClassPath(MavenInstallation mvn, FilePath slaveRoot, BuildListener listener) throws IOException, InterruptedException { String classWorldsJar = getLauncher().getChannel().call(new GetClassWorldsJar(mvn.getHome(),listener)); String path = classPathEntry(slaveRoot, Maven35Main.class, "maven35-agent", listener) + (getLauncher().isUnix()?":":";")+classWorldsJar; // TODO this configurable?? path += (getLauncher().isUnix()?":":";")+mvn.getHomeDir().getPath()+"/conf/logging"; return path; }