diff --git a/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java b/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java index 417f17b41..2792652e7 100644 --- a/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java +++ b/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java @@ -297,6 +297,11 @@ public ExecutionResult execute(ClientOutput output, List argv) { return DefaultResult.success(argv); } + // Raw streams + if (Environment.MVND_RAW_STREAMS.removeCommandLineOption(args) != null) { + args.add("-D" + Environment.MVND_RAW_STREAMS.getProperty()); + } + Optional threads = Optional.ofNullable(Environment.MVND_THREADS.removeCommandLineOption(args)); Environment.MVND_THREADS.addCommandLineOption(args, threads.orElseGet(parameters::threads)); diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java b/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java index a7477de03..5ac6185ad 100644 --- a/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java +++ b/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java @@ -285,7 +285,12 @@ public enum Environment { * This pattern will be evaluated against the full path of the dependencies, so it is usually desirable to * start with 'glob:**/' to support any location of the local repository. */ - MVND_PLUGIN_REALM_EVICT_PATTERN("mvnd.pluginRealmEvictPattern", null, "", OptionType.STRING, Flags.OPTIONAL); + MVND_PLUGIN_REALM_EVICT_PATTERN("mvnd.pluginRealmEvictPattern", null, "", OptionType.STRING, Flags.OPTIONAL), + /** + * Whether or not decorate output and error streams + **/ + MVND_RAW_STREAMS("mvnd.rawStreams", null, Boolean.FALSE, OptionType.VOID, Flags.OPTIONAL, "mvnd:--raw-streams"), + ; static Properties properties; diff --git a/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java b/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java index 49be297e2..3ed5e5686 100644 --- a/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java +++ b/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java @@ -139,8 +139,6 @@ public class DaemonMavenCli { public static final String STYLE_COLOR_PROPERTY = "style.color"; - public static final String RESUME = "r"; - public static final String RAW_STREAMS = "raw-streams"; private final Slf4jLoggerManager plexusLoggerManager; @@ -304,14 +302,9 @@ private void help(CliRequest cliRequest) throws Exception { private CLIManager newCLIManager() { CLIManager cliManager = new CLIManager(); - cliManager.options.addOption(Option.builder(RESUME) - .longOpt("resume") - .desc("Resume reactor from " - + "the last failed project, using the resume.properties file in the build directory") - .build()); cliManager.options.addOption(Option.builder() .longOpt(RAW_STREAMS) - .desc("Do not decorate output and " + "error streams") + .desc("Do not decorate output and error streams") .build()); return cliManager; } @@ -399,7 +392,10 @@ void logging(CliRequest cliRequest) { // Ignore // } - } else if (!cliRequest.commandLine.hasOption(RAW_STREAMS)) { + } else if (!Environment.MVND_RAW_STREAMS + .asOptional() + .map(Boolean::parseBoolean) + .orElse(Boolean.FALSE)) { ch.qos.logback.classic.Logger stdout = (ch.qos.logback.classic.Logger) slf4jLoggerFactory.getLogger("stdout"); ch.qos.logback.classic.Logger stderr = diff --git a/dist/src/main/distro/bin/mvnd-bash-completion.bash b/dist/src/main/distro/bin/mvnd-bash-completion.bash index 45ffc0d8c..102a1ef28 100644 --- a/dist/src/main/distro/bin/mvnd-bash-completion.bash +++ b/dist/src/main/distro/bin/mvnd-bash-completion.bash @@ -217,8 +217,8 @@ _mvnd() _get_comp_words_by_ref -n : cur prev local mvnd_opts="-1" - local mvnd_long_opts="--color|--completion|--purge|--serial|--status|--stop" - local mvnd_properties="-Djava.home|-Djdk.java.options|-Dmaven.multiModuleProjectDirectory|-Dmaven.repo.local|-Dmaven.settings|-Dmvnd.buildTime|-Dmvnd.builder|-Dmvnd.daemonStorage|-Dmvnd.debug|-Dmvnd.debug.address|-Dmvnd.duplicateDaemonGracePeriod|-Dmvnd.enableAssertions|-Dmvnd.expirationCheckDelay|-Dmvnd.home|-Dmvnd.idleTimeout|-Dmvnd.jvmArgs|-Dmvnd.keepAlive|-Dmvnd.logPurgePeriod|-Dmvnd.logback|-Dmvnd.maxHeapSize|-Dmvnd.maxLostKeepAlive|-Dmvnd.minHeapSize|-Dmvnd.minThreads|-Dmvnd.noBuffering|-Dmvnd.noDaemon|-Dmvnd.pluginRealmEvictPattern|-Dmvnd.propertiesPath|-Dmvnd.registry|-Dmvnd.rollingWindowSize|-Dmvnd.serial|-Dmvnd.socketFamily|-Dmvnd.threadStackSize|-Dmvnd.threads|-Dstyle.color|-Duser.dir|-Duser.home" + local mvnd_long_opts="--color|--completion|--purge|--raw-streams|--serial|--status|--stop" + local mvnd_properties="-Djava.home|-Djdk.java.options|-Dmaven.multiModuleProjectDirectory|-Dmaven.repo.local|-Dmaven.settings|-Dmvnd.buildTime|-Dmvnd.builder|-Dmvnd.daemonStorage|-Dmvnd.debug|-Dmvnd.debug.address|-Dmvnd.duplicateDaemonGracePeriod|-Dmvnd.enableAssertions|-Dmvnd.expirationCheckDelay|-Dmvnd.home|-Dmvnd.idleTimeout|-Dmvnd.jvmArgs|-Dmvnd.keepAlive|-Dmvnd.logPurgePeriod|-Dmvnd.logback|-Dmvnd.maxHeapSize|-Dmvnd.maxLostKeepAlive|-Dmvnd.minHeapSize|-Dmvnd.minThreads|-Dmvnd.noBuffering|-Dmvnd.noDaemon|-Dmvnd.pluginRealmEvictPattern|-Dmvnd.propertiesPath|-Dmvnd.rawStreams|-Dmvnd.registry|-Dmvnd.rollingWindowSize|-Dmvnd.serial|-Dmvnd.socketFamily|-Dmvnd.threadStackSize|-Dmvnd.threads|-Dstyle.color|-Duser.dir|-Duser.home" local opts="-am|-amd|-B|-C|-c|-cpu|-D|-e|-emp|-ep|-f|-fae|-ff|-fn|-gs|-h|-l|-N|-npr|-npu|-nsu|-o|-P|-pl|-q|-rf|-s|-T|-t|-U|-up|-V|-v|-X|${mvnd_opts}" local long_opts="--also-make|--also-make-dependents|--batch-mode|--strict-checksums|--lax-checksums|--check-plugin-updates|--define|--errors|--encrypt-master-password|--encrypt-password|--file|--fail-at-end|--fail-fast|--fail-never|--global-settings|--help|--log-file|--non-recursive|--no-plugin-registry|--no-plugin-updates|--no-snapshot-updates|--offline|--activate-profiles|--projects|--quiet|--resume-from|--settings|--threads|--toolchains|--update-snapshots|--update-plugins|--show-version|--version|--debug|${mvnd_long_opts}"