public MavenInstallation inferMavenInstallation() { return getMaven(); }
String mavenHome = ((MavenModuleSet) project).getMaven().forNode(buildNode, listener ).getHome(); String settingsPath = mavenHome + "/conf/settings.xml"; remoteSettings = build.getWorkspace().child( settingsPath);
public MavenInstallation inferMavenInstallation() { return getMaven(); }
public MavenInstallation getMavenInstallation(TaskListener log) throws IOException, InterruptedException { MavenInstallation mi = mms.getMaven(); if (mi != null) mi = mi.forNode(getCurrentNode(), log).forEnvironment(envVars); return mi; }
public MavenInstallation getMavenInstallation(TaskListener log) throws IOException, InterruptedException { MavenInstallation mi = mms.getMaven(); if (mi != null) mi = mi.forNode(getCurrentNode(), log).forEnvironment(envVars); return mi; }
public MavenBuildInfoDeployer(BuildInfoAwareConfigurator configurator, ArtifactoryBuildInfoClient client, MavenModuleSetBuild build, TaskListener listener) throws IOException, InterruptedException { super(configurator, build, listener, client); this.configurator = configurator; buildInfo = createBuildInfo("Maven", build.getParent().getMaven().getName(), BuildType.MAVEN); gatherModuleAndDependencyInfo(build); }
private boolean executeSonar(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener, SonarInstallation sonarInstallation) { try { String pomName = getPomName(build, listener); String mavenInstallName = getMavenInstallationName(); if (isMavenBuilder(build.getProject())) { MavenModuleSet mavenModuleSet = getMavenProject(build); if (null != mavenModuleSet.getMaven().getName()) { mavenInstallName = mavenModuleSet.getMaven().getName(); } } // Execute maven return SonarMaven.executeMaven(build, launcher, listener, mavenInstallName, pomName, sonarInstallation, this, getJDK(), getSettings(), getGlobalSettings(), usesPrivateRepository()); } catch (IOException e) { Logger.printFailureMessage(listener); Util.displayIOException(e, listener); Logger.LOG.throwing(this.getClass().getName(), "setValues", e); e.printStackTrace(listener.fatalError("command execution failed")); return false; } catch (InterruptedException e) { Logger.LOG.throwing(this.getClass().getName(), "executeSonar", e); return false; } catch (Exception e) { Logger.printFailureMessage(listener); e.printStackTrace(listener.fatalError("command execution failed")); Logger.LOG.throwing(this.getClass().getName(), "executeSonar", e); return false; } }
/** * Get the {@link hudson.model.EnvironmentSpecific} and {@link hudson.slaves.NodeSpecific} Maven installation. First * get the descriptor from the global Jenkins. Then populate it accordingly from the specific environment node that * the process is currently running in e.g. the MAVEN_HOME variable may be defined only in the remote node and * Jenkins is not persisting it as part of its installations. * * @param build The Maven project build that the maven installation is taken from. * @param vars The build's environment variables. * @param listener The build's event listener * @throws hudson.AbortException If the {@link hudson.tasks.Maven.MavenInstallation} that is taken from the project * is {@code null} then this exception is thrown. */ private static Maven.MavenInstallation getMavenInstallation(MavenModuleSetBuild build, EnvVars vars, TaskListener listener) throws IOException, InterruptedException { MavenModuleSet project = build.getProject(); Maven.MavenInstallation mavenInstallation = project.getMaven(); if (mavenInstallation == null) { throw new AbortException("A Maven installation needs to be available for this project to be built.\n" + "Either your server has no Maven installations defined, or the requested Maven version does not exist."); } return mavenInstallation.forEnvironment(vars).forNode(build.getBuiltOn().toComputer().getNode(), listener); }
/** * Exposes {@code MAVEN_OPTS} to forked processes. * * <p> * See {@link MavenModuleSetBuild#getEnvironment(TaskListener)} for discussion. */ @Override public EnvVars getEnvironment(TaskListener log) throws IOException, InterruptedException { EnvVars envs = super.getEnvironment(log); // We need to add M2_HOME and the mvn binary to the PATH so if Maven // needs to run Maven it will pick the correct one. // This can happen if maven calls ANT which itself calls Maven // or if Maven calls itself e.g. maven-release-plugin MavenInstallation mvn = project.getParent().getMaven(); if (mvn == null) throw new hudson.AbortException(Messages.MavenModuleSetBuild_NoMavenConfigured()); mvn = mvn.forEnvironment(envs).forNode(Computer.currentComputer().getNode(), log); mvn.buildEnvVars(envs); return envs; }
MavenInstallation mvn = getProject().getParent().getMaven();
MavenInstallation mvn = project.getMaven(); if(mvn==null) throw new AbortException(Messages.MavenModuleSetBuild_NoMavenConfigured());
MavenInstallation mvn = getProject().getParent().getMaven();
MavenInstallation mvn = project.getMaven(); if(mvn==null) throw new AbortException("A Maven installation needs to be available for this project to be built.\n"+
MavenInstallation mvn = project.getMaven(); if (mvn == null) throw new AbortException(Messages.MavenModuleSetBuild_NoMavenConfigured());