/** * 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 = project.getMaven(); if(mvn==null) throw new AbortException(Messages.MavenModuleSetBuild_NoMavenConfigured());
throw new AbortException(Messages.MavenModuleSetBuild_NoMavenConfigured());