提交 e004d2ec 编写于 作者: O Olivier Lamy

Merge branch 'master' of github.com:jenkinsci/jenkins

......@@ -68,6 +68,9 @@ Upcoming changes</a>
<li class=rfe>
Post-build deploy task for Maven jobs : Repositories definitions can now be read from the POMs.
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-9786">issue 9786</a>)
<li class=rfe>
Run maven jobs as headless process. on OSX this avoid jumping Dock icon to take focus.
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-9785">issue 9785</a>)
</ul>
</div><!--=TRUNK-END=-->
......
package hudson.maven;
import static hudson.Util.fixNull;
import hudson.AbortException;
import hudson.EnvVars;
import hudson.FilePath;
import hudson.Launcher;
import hudson.Platform;
import hudson.Proc;
import hudson.maven.ProcessCache.NewProcess;
import hudson.model.BuildListener;
......@@ -24,7 +26,6 @@ import hudson.slaves.Channels;
import hudson.tasks.Maven.MavenInstallation;
import hudson.tasks._maven.MavenConsoleAnnotator;
import hudson.util.ArgumentListBuilder;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;
......@@ -37,8 +38,6 @@ import java.net.SocketTimeoutException;
import java.nio.charset.Charset;
import java.nio.charset.UnsupportedCharsetException;
import java.util.Arrays;
import org.jenkinsci.plugins.tokenmacro.TokenMacro;
import org.kohsuke.stapler.framework.io.IOException2;
/*
......@@ -274,7 +273,19 @@ public abstract class AbstractMavenProcessFactory
}
}
if (mms.runHeadless()) {
// Configure headless process
mavenOpts += " -Djava.awt.headless=true";
} else {
if (Platform.isDarwin()) {
// Would be cool to replace the generic Java icon with jenkins logo, but requires
// the file absolute path to be available on slave *before* the process run on it :-/
// Maybe we could enforce this from the DMG installer on OSX
// TODO mavenOpts += " -Xdock:name=Jenkins -Xdock:icon=jenkins.png";
}
}
return envVars.expand(mavenOpts);
}
......
......@@ -204,6 +204,12 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
*/
private int mavenValidationLevel = -1;
/**
* Inform jenkins this build don't use UI code and can run without access to graphical environment. Could be used
* later to select a headless-slave from a pool, but first introduced for JENKINS-9785
*/
private boolean runHeadless = false;
/**
* Reporters configured at {@link MavenModuleSet} level. Applies to all {@link MavenModule} builds.
*/
......@@ -357,6 +363,10 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
return ignoreUpstremChanges;
}
public boolean runHeadless() {
return runHeadless;
}
public boolean isArchivingDisabled() {
return archivingDisabled;
}
......@@ -377,6 +387,10 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
this.ignoreUpstremChanges = ignoreUpstremChanges;
}
public void setRunHeadless(boolean runHeadless) {
this.runHeadless = runHeadless;
}
public void setIsArchivingDisabled(boolean archivingDisabled) {
this.archivingDisabled = archivingDisabled;
}
......@@ -811,6 +825,7 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
aggregatorStyleBuild = !req.hasParameter("maven.perModuleBuild");
usePrivateRepository = req.hasParameter("maven.usePrivateRepository");
ignoreUpstremChanges = !json.has("triggerByDependency");
runHeadless = req.hasParameter("maven.runHeadless");
incrementalBuild = req.hasParameter("maven.incrementalBuild");
archivingDisabled = req.hasParameter("maven.archivingDisabled");
resolveDependencies = req.hasParameter( "maven.resolveDependencies" );
......
......@@ -91,7 +91,9 @@ THE SOFTWARE.
checked="${it.usesPrivateRepository()}" />
<f:optionalBlock name="maven.resolveDependencies" title="${%Resolve Dependencies during Pom parsing}"
checked="${it.isResolveDependencies()}" />
<f:optionalBlock name="maven.processPlugins" title="${%Process Plugins during Pom parsing}"
<f:optionalBlock name="maven.runHeadless" title="${%Run Headless}" help="/plugin/maven-plugin/run-headless.html"
checked="${it.runHeadless()}" />
<f:optionalBlock name="maven.processPlugins" title="${%Process Plugins during Pom parsing}"
checked="${it.isProcessPlugins()}" />
<p:config-customWorkspace />
......
......@@ -21,16 +21,22 @@
# THE SOFTWARE.
Alternate\ settings\ file=Fichier settings alternatif
Block\ build\ when\ dependency\ building=Bloquer le build pendant la construction des d\u00E9pendances
Block\ build\ when\ dependency\ building=Bloquer le build pendant la construction des d\u00e9pendances
Build=Build
Incremental\ build\ -\ only\ build\ changed\ modules=Construction incr\u00E9mentale - ne faire la construction (build) que pour les modules chang\u00E9s
Incremental\ build\ -\ only\ build\ changed\ modules=Construction incr\u00e9mentale - ne faire la construction (build) que pour les modules chang\u00e9s
Maven\ Version=Version de Maven
Root\ POM=POM Racine
Build\ modules\ in\ parallel=Construire les modules en parallèle
Build\ modules\ in\ parallel=Construire les modules en parall\u00eale
Build\ Settings=Configuration du build
Use\ private\ Maven\ repository=Utilise un repository Maven priv\u00E9
Use\ private\ maven\ repository=Utiliser un repository Maven privé
Use\ private\ Maven\ repository=Utilise un repository Maven priv\u00e9
Use\ private\ maven\ repository=Utiliser un repository Maven priv\u00e9
Goals\ and\ options=Goals et options
Maven\ Version.error.1=Jenkins a besoin de savoir où Maven2/3 est installé.
Maven\ Version.error.2=Veuillez le faire dans <a href="{0}/configure" target="_new">la configuration système</a>.
Build\ whenever\ a\ SNAPSHOT\ dependency\ is\ built=Lance un build à chaque fois qu''une dépendance SNAPSHOT est construite
Maven\ Version.error.1=Jenkins a besoin de savoir o\u00f9 Maven2/3 est install\u00c8.
Maven\ Version.error.2=Veuillez le faire dans <a href="{0}/configure" target="_new">la configuration syst\u00cbme</a>.
Build\ whenever\ a\ SNAPSHOT\ dependency\ is\ built=Lance un build \u00e0 chaque fois qu''une d\u00e9pendance SNAPSHOT est construite
Run\ Headless=Ex\u00e9cuter sans environnement graphique
Disable\ automatic\ artifact\ archiving=D\u00e9sactive l'achivage automatique des artefacts
Resolve\ Dependencies\ during\ Pom\ parsing=Effectue la r\u00e9solution de d\u00e9pendances pendant la lecture du POM
Process\ Plugins\ during\ Pom\ parsing=Analyse les plugins pendant la lecture du POM
Maven\ Validation\ Level=Niveau de validation du POM Maven
Goals=Goals
<div>
<p>
If build doesn't requires access to desktop (only using command line tools and tests) this option can be checked.
<p>
This option allow Jenkins to configure the build process in headless mode. Usefull on OSX to avoid boring Dock icon
to take focus, this option may also in future release be used to select slave adequate instance.
</div>
\ No newline at end of file
<div>
<p>
Si le build ne n&eacute,cessite pas un acc&egrave; &agrave; l'environnement graphique (s'il n'utilise que des outils
en ligne de commande) cette option peut &ecirc;tre activŽe.
<p>
Cette option permet &agrave; Jenkins de lancer le processus de build en mode <em>'headless'</em>. Ceci est
particuli&egrave;rement int&eacute;ressant sur OSX pour &eacute;viter qu'une ic&ocirc;ne Java prenne le focus en sautillant
dans le Dock. Cette option pourrait &agrave; l'avenir servir &agrave; s&eacute;lectionner un esclave adapt&eacute;.
</div>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册