diff --git a/changelog.html b/changelog.html index 955b806bb8dc834272ff5d4a99b9d84376f87274..332d057b5b420f410f84a06b4801735c1622d9cd 100644 --- a/changelog.html +++ b/changelog.html @@ -68,6 +68,9 @@ Upcoming changes
  • Post-build deploy task for Maven jobs : Repositories definitions can now be read from the POMs. (issue 9786) +
  • + Run maven jobs as headless process. on OSX this avoid jumping Dock icon to take focus. + (issue 9785) diff --git a/maven-plugin/src/main/java/hudson/maven/AbstractMavenProcessFactory.java b/maven-plugin/src/main/java/hudson/maven/AbstractMavenProcessFactory.java index 42fe2fcde6c0930a5c70e9770ab005cc25421d1e..8c8c83b57f2052fc20504d69cf661acb7f6eb583 100644 --- a/maven-plugin/src/main/java/hudson/maven/AbstractMavenProcessFactory.java +++ b/maven-plugin/src/main/java/hudson/maven/AbstractMavenProcessFactory.java @@ -1,10 +1,12 @@ 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); } diff --git a/maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java b/maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java index fdd6ac4d02e469f7a1b7be54e10c35d2a2bc0ba5..ec8daec6055cfafb8f62abe567371837d9d22610 100644 --- a/maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java +++ b/maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java @@ -204,6 +204,12 @@ public final class MavenModuleSet extends AbstractMavenProject - + diff --git a/maven-plugin/src/main/resources/hudson/maven/MavenModuleSet/configure-entries_fr.properties b/maven-plugin/src/main/resources/hudson/maven/MavenModuleSet/configure-entries_fr.properties index f960dcf7e28bd700be1a46ea5b2ac014b9f4aaf9..bb43380281025024641e43c84eb8ef75c7e1aca4 100644 --- a/maven-plugin/src/main/resources/hudson/maven/MavenModuleSet/configure-entries_fr.properties +++ b/maven-plugin/src/main/resources/hudson/maven/MavenModuleSet/configure-entries_fr.properties @@ -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 la configuration système. -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 la configuration syst\u00cbme. +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 diff --git a/maven-plugin/src/main/webapp/run-headless.html b/maven-plugin/src/main/webapp/run-headless.html new file mode 100644 index 0000000000000000000000000000000000000000..1bfd81792c6f08602bd4c0a282ed53f7de1857ad --- /dev/null +++ b/maven-plugin/src/main/webapp/run-headless.html @@ -0,0 +1,7 @@ +
    +

    + If build doesn't requires access to desktop (only using command line tools and tests) this option can be checked. +

    + 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. +

    \ No newline at end of file diff --git a/maven-plugin/src/main/webapp/run-headless_fr.html b/maven-plugin/src/main/webapp/run-headless_fr.html new file mode 100644 index 0000000000000000000000000000000000000000..e95e0904a1306079fbf1bf875b3c60f8e3a75abd --- /dev/null +++ b/maven-plugin/src/main/webapp/run-headless_fr.html @@ -0,0 +1,9 @@ +
    +

    + Si le build ne né,cessite pas un accè à l'environnement graphique (s'il n'utilise que des outils + en ligne de commande) cette option peut être activŽe. +

    + Cette option permet à Jenkins de lancer le processus de build en mode 'headless'. Ceci est + particulièrement intéressant sur OSX pour éviter qu'une icône Java prenne le focus en sautillant + dans le Dock. Cette option pourrait à l'avenir servir à sélectionner un esclave adapté. +

    \ No newline at end of file