You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by gn...@apache.org on 2023/01/06 13:41:57 UTC
[maven-mvnd] branch mvnd-0.9.x updated (e50eedf0 -> e5f94f0f)
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a change to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
from e50eedf0 Sync entry scripts with maven 3.8.6 (#711)
new 7be6bd00 Upgrade to groovy 4 to allow building on recent JDK (#735)
new 6e2ba24e Upgrade maven-shade-plugin to 3.4.1
new af189641 Upgrade parent pom to 38
new e95bd93d Reformat
new fbf6dd16 Ignore reformat commit in git blame
new bbffbd36 Fix possible NullPointerException
new 790830da Switch graalvm to 22.3.0
new 0d04291d Fix usage of the wrong groovy plugin
new 3443ce32 Clean up and upgrade dependencies/plugins versions (#741)
new 60de2a84 Update ITs to recent maven plugins (#744)
new 3be23259 Reset system properties after calling event syps (#729)
new 21383df3 Add more discriminating properties to the daemon
new f2117ccf Fix daemon JVM start options (follow-up to #749) (#751)
new 5af94b59 Clean up some warnings during the build (#750)
new 1ab67841 Build mostly static native image, loose linux glibc requirement to 2.12 (#730)
new 724d1fec Display plugin's goal prefix and version instead of artifactId (#748)
new c9dec667 Support redirecting input from client to daemon, #541 (#581)
new 2220b012 Fixup #716 Calculate java home from java command (#721)
new ee43e50b Improve the README file (#734)
new b81c8568 Use muti-release jar to fallback mvnd-client to original maven (#722)
new 740f9140 Fix the common jar not being built with the multi-release flag
new 5eebb89d Add an option to specify the debug address and display info when starting (fixes #737) (#753)
new 852e4e55 Move signal handling into its own class (#754)
new 91f377d7 Add a mvnd.rawStreams property (#719)
new 4e6a1e83 Upgrade to maven parent 39 and reformat accordingly
new e9fd7ee0 Typo
new a31a0809 Upgrade to maven 3.8.7
new e5f94f0f Upgrade to maven resolver 1.8.2
The 28 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../build.properties => .git-blame-ignore-revs | 8 +-
.github/workflows/early-access.yaml | 19 +-
.github/workflows/release.yaml | 21 +-
README.adoc | 2 +-
agent/pom.xml | 110 +-
.../main/java/org/mvndaemon/mvnd/agent/Agent.java | 40 +-
build-plugin/pom.xml | 164 +--
.../org/mvndaemon/mvnd/plugin/doc/DocMojo.java | 47 +-
build/eclipse-formatter-config.xml | 281 -----
client/pom.xml | 374 ++++---
.../org/mvndaemon/mvnd/client/DefaultClient.java | 37 +
.../org/mvndaemon/mvnd/client/DefaultClient.java | 124 ++-
.../org/mvndaemon/mvnd/client/BuildProperties.java | 25 +-
.../java/org/mvndaemon/mvnd/client/Client.java | 27 +-
.../java/org/mvndaemon/mvnd/client/Completion.java | 26 +-
.../mvnd/client/DaemonClientConnection.java | 40 +-
.../org/mvndaemon/mvnd/client/DaemonConnector.java | 205 ++--
.../mvndaemon/mvnd/client/DaemonDiagnostics.java | 67 +-
.../mvndaemon/mvnd/client/DaemonParameters.java | 135 +--
.../org/mvndaemon/mvnd/client/ExecutionResult.java | 26 +-
.../mvnd/client/svm/ReflectionRegistration.java | 25 +-
.../client/svm/StaticMDCBinderSubstitution.java | 26 +-
.../mvnd/client/CompletionGeneratorTest.java | 32 +-
.../mvndaemon/mvnd/client/DaemonConnectorTest.java | 25 +-
.../org/mvndaemon/mvnd/client/EnvironmentTest.java | 57 +-
.../org/mvndaemon/mvnd/client/OsUtilsTest.java | 25 +-
common/pom.xml | 340 +++---
.../org/mvndaemon/mvnd/common/BufferCaster.java | 26 +-
.../org/mvndaemon/mvnd/common/BufferHelper.java | 35 +-
.../mvndaemon/mvnd/common/ByteChannelWrapper.java | 25 +-
.../mvnd/common/DaemonCompatibilitySpec.java | 35 +-
.../mvndaemon/mvnd/common/DaemonConnection.java | 33 +-
.../org/mvndaemon/mvnd/common/DaemonException.java | 26 +-
.../mvnd/common/DaemonExpirationStatus.java | 25 +-
.../java/org/mvndaemon/mvnd/common/DaemonInfo.java | 71 +-
.../org/mvndaemon/mvnd/common/DaemonRegistry.java | 66 +-
.../org/mvndaemon/mvnd/common/DaemonState.java | 26 +-
.../org/mvndaemon/mvnd/common/DaemonStopEvent.java | 33 +-
.../org/mvndaemon/mvnd/common/Environment.java | 102 +-
.../mvndaemon/mvnd/common/InterpolationHelper.java | 53 +-
.../java/org/mvndaemon/mvnd/common/IoUtils.java | 31 +-
.../org/mvndaemon/mvnd/common/JavaVersion.java | 25 +-
.../org/mvndaemon/mvnd/common/MavenDaemon.java | 61 +-
.../java/org/mvndaemon/mvnd/common/Message.java | 540 ++++++----
.../java/org/mvndaemon/mvnd/common/OptionType.java | 26 +-
.../main/java/org/mvndaemon/mvnd/common/Os.java | 29 +-
.../java/org/mvndaemon/mvnd/common/OsUtils.java | 83 +-
.../org/mvndaemon/mvnd/common/ProcessHelper.java | 29 +-
.../org/mvndaemon/mvnd/common/SignalHelper.java | 32 +
.../org/mvndaemon/mvnd/common/SocketFamily.java | 88 +-
.../org/mvndaemon/mvnd/common/SocketHelper.java | 25 +-
.../java/org/mvndaemon/mvnd/common/TimeUtils.java | 46 +-
.../mvnd/common/logging/ClientOutput.java | 26 +-
.../mvnd/common/logging/TerminalOutput.java | 578 ++++++-----
.../mvndaemon/mvnd/common/DaemonRegistryTest.java | 101 +-
.../org/mvndaemon/mvnd/common/MessageTest.java | 26 +-
.../org/mvndaemon/mvnd/common/OsUtilsTest.java | 31 +-
.../mvndaemon/mvnd/common/SocketFamilyTest.java | 33 +-
.../org/mvndaemon/mvnd/common/TimeUtilsTest.java | 30 +-
daemon/pom.xml | 210 ++--
.../mvnd/logging/internal/SimpleAppender.java | 69 ++
.../maven/classrealm/MvndClassRealmManager.java | 114 +-
.../java/org/apache/maven/cli/DaemonMavenCli.java | 249 +++--
.../org/apache/maven/cli/MvndHelpFormatter.java | 171 ++-
.../maven/project/CachingProjectBuilder.java | 267 +++--
.../apache/maven/project/SnapshotModelCache.java | 28 +-
.../mvndaemon/mvnd/builder/DependencyGraph.java | 112 +-
.../mvndaemon/mvnd/builder/ProjectComparator.java | 56 +-
.../mvnd/builder/ProjectExecutorService.java | 68 +-
.../mvndaemon/mvnd/builder/ReactorBuildQueue.java | 30 +-
.../mvndaemon/mvnd/builder/ReactorBuildStats.java | 49 +-
.../org/mvndaemon/mvnd/builder/SmartBuilder.java | 59 +-
.../mvndaemon/mvnd/builder/SmartBuilderImpl.java | 55 +-
.../main/java/org/mvndaemon/mvnd/cache/Cache.java | 26 +-
.../org/mvndaemon/mvnd/cache/CacheFactory.java | 26 +-
.../java/org/mvndaemon/mvnd/cache/CacheRecord.java | 26 +-
.../mvnd/cache/impl/DefaultCacheFactory.java | 27 +-
.../mvnd/cache/impl/TimestampCacheFactory.java | 73 +-
.../mvnd/cache/impl/WatchServiceCacheFactory.java | 43 +-
.../InvalidatingExtensionRealmCache.java | 44 +-
.../InvalidatingPluginArtifactsCache.java | 40 +-
.../InvalidatingPluginDescriptorCache.java | 41 +-
.../invalidating/InvalidatingPluginRealmCache.java | 40 +-
.../InvalidatingProjectArtifactsCache.java | 74 +-
.../InvalidatingRealmCacheEventSpy.java | 63 +-
.../java/org/mvndaemon/mvnd/cli/EnvHelper.java | 38 +-
.../mvndaemon/mvnd/daemon/ClientDispatcher.java | 130 ++-
.../java/org/mvndaemon/mvnd/daemon/Connection.java | 27 +-
.../mvndaemon/mvnd/daemon/DaemonExpiration.java | 107 +-
.../mvndaemon/mvnd/daemon/DaemonMemoryStatus.java | 52 +-
.../java/org/mvndaemon/mvnd/daemon/Server.java | 272 +++--
.../mvnd/execution/BuildResumptionAnalyzer.java | 28 +-
.../mvnd/execution/BuildResumptionData.java | 28 +-
.../execution/BuildResumptionDataRepository.java | 30 +-
.../BuildResumptionPersistenceException.java | 27 +-
.../execution/DefaultBuildResumptionAnalyzer.java | 36 +-
.../DefaultBuildResumptionDataRepository.java | 34 +-
.../mvnd/interactivity/DaemonPrompter.java | 37 +-
.../logging/internal/MvndSlf4jConfiguration.java | 46 +-
.../mvnd/logging/internal/SimpleAppender.java | 68 --
.../mvnd/logging/internal/Slf4jLogger.java | 7 +-
.../mvnd/logging/internal/Slf4jLoggerManager.java | 16 +-
.../mvnd/logging/smart/BuildEventListener.java | 58 +-
.../logging/smart/LoggingExecutionListener.java | 48 +-
.../mvnd/logging/smart/LoggingOutputStream.java | 25 +-
.../logging/smart/ProjectBuildLogAppender.java | 44 +-
.../mvnd/plugin/CachingPluginVersionResolver.java | 41 +-
.../mvnd/plugin/CliMavenPluginManager.java | 142 +--
.../plugin/ValidatingConfigurationListener.java | 8 +-
.../syncontext/DaemonNamedLockFactorySelector.java | 61 --
.../mvndaemon/mvnd/timing/BuildTimeEventSpy.java | 107 +-
.../mvnd/transfer/DaemonMavenTransferListener.java | 25 +-
.../mvnd/builder/AbstractSmartBuilderTest.java | 27 +-
.../org/mvndaemon/mvnd/builder/DagWidthTest.java | 79 +-
.../mvnd/builder/ProjectComparatorTest.java | 27 +-
.../mvnd/builder/ProjectExecutorServiceTest.java | 35 +-
.../mvnd/builder/ReactorBuildQueueTest.java | 25 +-
.../mvnd/builder/TestProjectDependencyGraph.java | 30 +-
.../mvnd/cache/impl/CacheFactoryTest.java | 32 +-
.../java/org/mvndaemon/mvnd/cli/EnvHelperTest.java | 30 +-
.../mvnd/daemon/ClientDispatcherTest.java | 26 +-
.../java/org/mvndaemon/mvnd/daemon/ServerTest.java | 26 +-
dist/pom.xml | 108 +-
dist/src/main/distro/{mvn => }/bin/m2.conf | 11 +-
dist/src/main/distro/bin/mvnd-bash-completion.bash | 4 +-
dist/src/main/distro/bin/mvnd.cmd | 100 +-
dist/src/main/distro/bin/mvnd.sh | 48 +-
dist/src/main/distro/conf/mvnd.properties | 4 +-
dist/src/main/distro/mvn/bin/mvn | 2 -
dist/src/main/distro/mvn/bin/mvn.cmd | 2 -
dist/src/main/provisio/maven-distro.xml | 5 +-
helper/pom.xml | 22 +-
.../java/org/mvndaemon/mvnd/pump/AgentHelper.java | 31 +-
integration-tests/pom.xml | 322 +++---
.../mvnd/assertj/MatchInOrderAmongOthers.java | 31 +-
.../mvndaemon/mvnd/assertj/TestClientOutput.java | 36 +-
.../mvnd/it/AttachedArtifactResolutionTest.java | 27 +-
.../org/mvndaemon/mvnd/it/BootstrapPluginTest.java | 32 +-
.../org/mvndaemon/mvnd/it/CompletionNativeIT.java | 29 +-
.../java/org/mvndaemon/mvnd/it/CompletionTest.java | 28 +-
.../mvndaemon/mvnd/it/ConcurrentDownloadsTest.java | 33 +-
.../org/mvndaemon/mvnd/it/DaemonCrashTest.java | 38 +-
.../org/mvndaemon/mvnd/it/DeleteRepoNativeIT.java | 33 +-
.../java/org/mvndaemon/mvnd/it/DeleteRepoTest.java | 29 +-
.../test/java/org/mvndaemon/mvnd/it/DistroIT.java | 45 +-
.../test/java/org/mvndaemon/mvnd/it/DupGATest.java | 29 +-
.../org/mvndaemon/mvnd/it/EnvironmentTest.java | 46 +-
.../java/org/mvndaemon/mvnd/it/ExecOutputTest.java | 33 +-
.../org/mvndaemon/mvnd/it/ExtensionsNativeIT.java | 33 +-
.../java/org/mvndaemon/mvnd/it/ExtensionsTest.java | 29 +-
.../java/org/mvndaemon/mvnd/it/ForkedTest.java | 37 +-
.../org/mvndaemon/mvnd/it/InteractiveTest.java | 36 +-
.../org/mvndaemon/mvnd/it/InvokerNativeIT.java | 36 +-
.../java/org/mvndaemon/mvnd/it/InvokerTest.java | 29 +-
.../org/mvndaemon/mvnd/it/JUnitPlatformTest.java | 27 +-
.../org/mvndaemon/mvnd/it/MavenConfNativeIT.java | 45 +-
.../java/org/mvndaemon/mvnd/it/MavenConfTest.java | 29 +-
.../org/mvndaemon/mvnd/it/MaxHeapNativeIT.java | 64 +-
.../java/org/mvndaemon/mvnd/it/MaxHeapTest.java | 38 +-
.../mvndaemon/mvnd/it/ModuleAndPluginNativeIT.java | 61 +-
.../org/mvndaemon/mvnd/it/ModuleAndPluginTest.java | 29 +-
.../org/mvndaemon/mvnd/it/MultiLookupTest.java | 38 +-
.../org/mvndaemon/mvnd/it/MultiModuleTest.java | 74 +-
.../java/org/mvndaemon/mvnd/it/MvndTestUtil.java | 30 +-
.../mvnd/it/NewManagedModuleNativeIT.java | 32 +-
.../mvndaemon/mvnd/it/NewManagedModuleTest.java | 29 +-
.../mvndaemon/mvnd/it/ParentWithPropertyTest.java | 29 +-
.../java/org/mvndaemon/mvnd/it/RawStreamsTest.java | 35 +-
.../mvndaemon/mvnd/it/ResidentExtensionsTest.java | 44 +-
.../mvndaemon/mvnd/it/SingleModuleNativeIT.java | 37 +-
.../org/mvndaemon/mvnd/it/SingleModuleTest.java | 41 +-
.../mvndaemon/mvnd/it/SpecificFileNativeIT.java | 62 +-
.../java/org/mvndaemon/mvnd/it/StopStatusTest.java | 33 +-
.../mvndaemon/mvnd/it/ThreadOptionNativeIT.java | 29 +-
.../org/mvndaemon/mvnd/it/ThreadOptionTest.java | 25 +-
.../org/mvndaemon/mvnd/it/TypeDescriptionTest.java | 29 +-
.../mvndaemon/mvnd/it/UpgradesInBomNativeIT.java | 44 +-
.../org/mvndaemon/mvnd/it/UpgradesInBomTest.java | 28 +-
.../org/mvndaemon/mvnd/it/VersionNativeIT.java | 33 +-
.../java/org/mvndaemon/mvnd/it/VersionTest.java | 26 +-
.../org/mvndaemon/mvnd/junit/ClientFactory.java | 25 +-
.../org/mvndaemon/mvnd/junit/JvmTestClient.java | 31 +-
.../org/mvndaemon/mvnd/junit/MvndNativeTest.java | 26 +-
.../java/org/mvndaemon/mvnd/junit/MvndTest.java | 26 +-
.../mvndaemon/mvnd/junit/MvndTestExtension.java | 128 ++-
.../org/mvndaemon/mvnd/junit/NativeTestClient.java | 35 +-
.../org/mvndaemon/mvnd/junit/TestParameters.java | 46 +-
.../org/mvndaemon/mvnd/junit/TestRegistry.java | 37 +-
.../java/org/mvndaemon/mvnd/junit/TestUtils.java | 26 +-
.../src/test/projects/concurrent-downloads/pom.xml | 10 +-
.../src/test/projects/daemon-crash/pom.xml | 10 +-
.../src/test/projects/delete-repo/pom.xml | 10 +-
integration-tests/src/test/projects/dup-ga/pom.xml | 10 +-
.../src/test/projects/exec-output/pom.xml | 12 +-
integration-tests/src/test/projects/forked/pom.xml | 10 +-
.../src/test/projects/invoker/pom.xml | 10 +-
.../projects/invoker/src/it/invoke-hello/pom.xml | 10 +-
.../src/test/projects/junit-platform/pom.xml | 12 +-
.../src/test/projects/module-and-plugin/pom.xml | 10 +-
.../src/test/projects/multi-lookup/pom.xml | 10 +-
.../src/test/projects/multi-module/pom.xml | 10 +-
.../projects/new-managed-module/changes/pom.xml | 10 +-
.../projects/new-managed-module/parent/pom.xml | 10 +-
.../src/test/projects/raw-streams/pom.xml | 20 +-
.../projects/resident-extensions/project1/pom.xml | 10 +-
.../projects/resident-extensions/project2/pom.xml | 10 +-
.../src/test/projects/single-module/pom.xml | 10 +-
.../src/test/projects/type-description/pom.xml | 16 +-
.../projects/upgrades-in-bom/hello-0.0.1/pom.xml | 10 +-
.../upgrades-in-bom/hello-0.0.2-SNAPSHOT/pom.xml | 10 +-
.../test/projects/upgrades-in-bom/parent/pom.xml | 10 +-
native/pom.xml | 178 ++--
.../java/org/mvndaemon/mvnd/nativ/CLibrary.java | 26 +-
.../org/mvndaemon/mvnd/nativ/MvndNativeLoader.java | 57 +-
.../main/java/org/mvndaemon/mvnd/nativ/OSInfo.java | 35 +-
.../org/mvndaemon/mvnd/nativ/CLibraryTest.java | 26 +-
.../mvndaemon/mvnd/nativ/MvndNativeLoaderTest.java | 25 +-
pom.xml | 1094 +++++++++-----------
218 files changed, 7075 insertions(+), 5948 deletions(-)
copy client/src/main/resources/org/mvndaemon/mvnd/client/build.properties => .git-blame-ignore-revs (86%)
delete mode 100644 build/eclipse-formatter-config.xml
create mode 100644 client/src/main/java-fallback/org/mvndaemon/mvnd/client/DefaultClient.java
rename client/src/main/{java => java-mvnd}/org/mvndaemon/mvnd/client/DefaultClient.java (81%)
create mode 100644 common/src/main/java/org/mvndaemon/mvnd/common/SignalHelper.java
create mode 100644 daemon/src/main/java-fallback/org/mvndaemon/mvnd/logging/internal/SimpleAppender.java
delete mode 100644 daemon/src/main/java/org/mvndaemon/mvnd/logging/internal/SimpleAppender.java
delete mode 100644 daemon/src/main/java/org/mvndaemon/mvnd/syncontext/DaemonNamedLockFactorySelector.java
copy dist/src/main/distro/{mvn => }/bin/m2.conf (69%)
[maven-mvnd] 13/28: Fix daemon JVM start options (follow-up to #749) (#751)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit f2117ccfffac53141f80bca40c839e6a6e3b9bcc
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Fri Dec 9 23:58:13 2022 +0100
Fix daemon JVM start options (follow-up to #749) (#751)
---
.../org/mvndaemon/mvnd/client/DaemonConnector.java | 27 ++++++++++++++--------
.../mvndaemon/mvnd/client/DaemonParameters.java | 4 ++--
.../org/mvndaemon/mvnd/common/Environment.java | 4 ++++
3 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java
index 70d3d933..05558d13 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java
@@ -29,6 +29,7 @@ import java.nio.channels.SocketChannel;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
+import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -378,33 +379,39 @@ public class DaemonConnector {
args.add("-Xss" + threadStackSize);
}
- Environment.MVND_HOME.addCommandLineOption(args, mvndHome.toString());
+ Environment.MVND_HOME.addSystemProperty(args, mvndHome.toString());
args.add("-Dmaven.home=" + mvndHome.resolve("mvn"));
args.add("-Dmaven.conf=" + mvndHome.resolve("mvn/conf"));
- Environment.MVND_JAVA_HOME.addCommandLineOption(
+ Environment.MVND_JAVA_HOME.addSystemProperty(
args, parameters.javaHome().toString());
- Environment.LOGBACK_CONFIGURATION_FILE.addCommandLineOption(
+ Environment.LOGBACK_CONFIGURATION_FILE.addSystemProperty(
args, parameters.logbackConfigurationPath().toString());
- Environment.MVND_ID.addCommandLineOption(args, daemonId);
- Environment.MVND_DAEMON_STORAGE.addCommandLineOption(
+ Environment.MVND_ID.addSystemProperty(args, daemonId);
+ Environment.MVND_DAEMON_STORAGE.addSystemProperty(
args, parameters.daemonStorage().toString());
- Environment.MVND_REGISTRY.addCommandLineOption(
+ Environment.MVND_REGISTRY.addSystemProperty(
args, parameters.registry().toString());
- Environment.MVND_SOCKET_FAMILY.addCommandLineOption(
+ Environment.MVND_SOCKET_FAMILY.addSystemProperty(
args,
parameters
.socketFamily()
.orElseGet(() -> getJavaVersion() >= 16.0f ? SocketFamily.unix : SocketFamily.inet)
.toString());
- parameters.discriminatingCommandLineOptions(args);
+ parameters.discriminatingSystemProperties(args);
args.add(MavenDaemon.class.getName());
command = String.join(" ", args);
LOGGER.debug(
"Starting daemon process: id = {}, workingDir = {}, daemonArgs: {}", daemonId, workingDir, command);
- ProcessBuilder.Redirect redirect = ProcessBuilder.Redirect.appendTo(
- parameters.daemonOutLog(daemonId).toFile());
+ Path daemonOutLog = parameters.daemonOutLog(daemonId);
+ Files.writeString(
+ daemonOutLog,
+ "Starting daemon process: id = " + daemonId + ", workingDir = " + workingDir + ", daemonArgs: "
+ + command,
+ StandardOpenOption.CREATE,
+ StandardOpenOption.APPEND);
+ ProcessBuilder.Redirect redirect = ProcessBuilder.Redirect.appendTo(daemonOutLog.toFile());
ProcessBuilder processBuilder = new ProcessBuilder();
processBuilder
.environment()
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java
index e0fc8b98..858975e5 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java
@@ -96,8 +96,8 @@ public class DaemonParameters {
.filter(EnvValue::isSet);
}
- public void discriminatingCommandLineOptions(List<String> args) {
- discriminatingValues().forEach(envValue -> envValue.envKey.addCommandLineOption(args, envValue.asString()));
+ public void discriminatingSystemProperties(List<String> args) {
+ discriminatingValues().forEach(envValue -> envValue.envKey.addSystemProperty(args, envValue.asString()));
}
public Path mvndHome() {
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 9149eb8f..95cd046e 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java
@@ -420,6 +420,10 @@ public enum Environment {
return property + "=" + type.normalize(value);
}
+ public void addSystemProperty(Collection<String> args, String value) {
+ args.add("-D" + property + "=" + type.normalize(value));
+ }
+
public void addCommandLineOption(Collection<String> args, String value) {
if (!options.isEmpty()) {
args.add(options.keySet().iterator().next());
[maven-mvnd] 14/28: Clean up some warnings during the build (#750)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 5af94b596ec101027f1ec659170176cead215af8
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Tue Dec 13 23:00:11 2022 +0100
Clean up some warnings during the build (#750)
---
.../mvndaemon/mvnd/common/DaemonRegistryTest.java | 19 ++++++
.../maven/project/CachingProjectBuilder.java | 2 +-
.../mvndaemon/mvnd/builder/DependencyGraph.java | 11 +++-
.../org/mvndaemon/mvnd/builder/SmartBuilder.java | 3 +-
.../mvndaemon/mvnd/daemon/ClientDispatcher.java | 1 -
.../mvnd/interactivity/DaemonPrompter.java | 1 +
pom.xml | 77 ++--------------------
7 files changed, 35 insertions(+), 79 deletions(-)
diff --git a/common/src/test/java/org/mvndaemon/mvnd/common/DaemonRegistryTest.java b/common/src/test/java/org/mvndaemon/mvnd/common/DaemonRegistryTest.java
index 4f50732a..6ec7ef81 100644
--- a/common/src/test/java/org/mvndaemon/mvnd/common/DaemonRegistryTest.java
+++ b/common/src/test/java/org/mvndaemon/mvnd/common/DaemonRegistryTest.java
@@ -22,8 +22,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
+import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
+import java.io.PrintStream;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
@@ -34,10 +36,27 @@ import java.util.List;
import java.util.Locale;
import java.util.Random;
import java.util.UUID;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class DaemonRegistryTest {
+ private PrintStream oldSysErr;
+ private PrintStream newSysErr;
+
+ @BeforeEach
+ void setup() {
+ oldSysErr = System.err;
+ newSysErr = new PrintStream(new ByteArrayOutputStream());
+ System.setErr(newSysErr);
+ }
+
+ @AfterEach
+ void tearDown() {
+ System.setErr(oldSysErr);
+ }
+
@Test
public void testReadWrite() throws IOException {
Path temp = File.createTempFile("reg", ".data").toPath();
diff --git a/daemon/src/main/java/org/apache/maven/project/CachingProjectBuilder.java b/daemon/src/main/java/org/apache/maven/project/CachingProjectBuilder.java
index bf3725d6..7b6610c8 100644
--- a/daemon/src/main/java/org/apache/maven/project/CachingProjectBuilder.java
+++ b/daemon/src/main/java/org/apache/maven/project/CachingProjectBuilder.java
@@ -644,7 +644,7 @@ public class CachingProjectBuilder implements ProjectBuilder {
return noErrors;
}
- @SuppressWarnings("checkstyle:methodlength")
+ @SuppressWarnings({"checkstyle:methodlength", "deprecation"})
private void initProject(
MavenProject project,
Map<String, MavenProject> projects,
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/DependencyGraph.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/DependencyGraph.java
index a8d7ad2f..e20aaf58 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/DependencyGraph.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/DependencyGraph.java
@@ -49,10 +49,15 @@ public class DependencyGraph<K> {
private final Map<K, Set<K>> transitiveUpstreams;
private final Map<K, List<K>> downstreams;
+ @SuppressWarnings("unchecked")
public static DependencyGraph<MavenProject> fromMaven(MavenSession session) {
-
- final ProjectDependencyGraph graph = session.getProjectDependencyGraph();
- return fromMaven(graph);
+ Map<String, Object> data = session.getRequest().getData();
+ DependencyGraph<MavenProject> graph = (DependencyGraph<MavenProject>) data.get(DependencyGraph.class.getName());
+ if (graph == null) {
+ graph = fromMaven(session.getProjectDependencyGraph());
+ data.put(DependencyGraph.class.getName(), graph);
+ }
+ return graph;
}
static DependencyGraph<MavenProject> fromMaven(ProjectDependencyGraph graph) {
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilder.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilder.java
index f6410f6f..fad26e32 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilder.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilder.java
@@ -99,8 +99,7 @@ public class SmartBuilder implements Builder {
session.getRepositorySession().getData().set(ReactorBuildStatus.class, reactorBuildStatus);
- DependencyGraph<MavenProject> graph =
- (DependencyGraph<MavenProject>) session.getRequest().getData().get(DependencyGraph.class.getName());
+ DependencyGraph<MavenProject> graph = DependencyGraph.fromMaven(session);
// log overall build info
final int degreeOfConcurrency = session.getRequest().getDegreeOfConcurrency();
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java
index eda1c5cd..b44289a0 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java
@@ -53,7 +53,6 @@ public class ClientDispatcher extends BuildEventListener {
final MavenSession session = event.getSession();
final int degreeOfConcurrency = session.getRequest().getDegreeOfConcurrency();
final DependencyGraph<MavenProject> dependencyGraph = DependencyGraph.fromMaven(session);
- session.getRequest().getData().put(DependencyGraph.class.getName(), dependencyGraph);
final int maxThreads =
degreeOfConcurrency == 1 ? 1 : dependencyGraph.computeMaxWidth(degreeOfConcurrency, 1000);
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/interactivity/DaemonPrompter.java b/daemon/src/main/java/org/mvndaemon/mvnd/interactivity/DaemonPrompter.java
index 75aa0d3f..f763a6d2 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/interactivity/DaemonPrompter.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/interactivity/DaemonPrompter.java
@@ -61,6 +61,7 @@ public class DaemonPrompter extends AbstractInputHandler implements Prompter, In
}
@Override
+ @SuppressWarnings("unchecked")
public String prompt(String message, List possibleValues, String defaultReply) throws PrompterException {
return doPrompt(message, possibleValues, defaultReply, false);
}
diff --git a/pom.xml b/pom.xml
index 736d8672..5689db3d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -92,7 +92,6 @@
<buildnumber-maven-plugin.version>3.0.0</buildnumber-maven-plugin.version>
<compiler.version>3.10.1</compiler.version>
<groovy-maven-plugin.version>2.1.0</groovy-maven-plugin.version>
- <license-maven-plugin.version>4.2.rc3</license-maven-plugin.version>
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
<maven-install-plugin.version>3.1.0</maven-install-plugin.version>
<maven-shade-plugin.version>3.4.1</maven-shade-plugin.version>
@@ -335,65 +334,6 @@
</excludes>
</configuration>
</plugin>
- <plugin>
- <groupId>com.mycila</groupId>
- <artifactId>license-maven-plugin</artifactId>
- <version>${license-maven-plugin.version}</version>
- <configuration>
- <inlineHeader>Copyright ${project.inceptionYear} the original author or authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.</inlineHeader>
- <excludes>
- <exclude>**/*.adoc</exclude>
- <exclude>**/README.*</exclude>
- <exclude>**/.cache/**</exclude>
- <exclude>**/.gitkeep</exclude>
- <exclude>**/mvnd.properties.template</exclude>
- <exclude>**/m2.conf</exclude>
- <exclude>**/mvnd</exclude>
- <exclude>**/mvnDebug</exclude>
- <exclude>**/.mvn/maven.config</exclude>
- <exclude>**/.mvn/jvm.config</exclude>
- <exclude>.gitattributes/</exclude>
- <exclude>.git-blame-ignore-revs</exclude>
- <exclude>.mvn/maven.config</exclude>
- <exclude>.mvn/wrapper/</exclude>
- <exclude>LICENSE.txt</exclude>
- <exclude>NOTICE.txt</exclude>
- <exclude>mvnw</exclude>
- <exclude>mvnw.cmd</exclude>
- <exclude>pom.xml.versionsBackup</exclude>
- <exclude>**/*.so</exclude>
- <exclude>**/*.dll</exclude>
- <exclude>**/*.jnilib</exclude>
- <exclude>**/Makefile*</exclude>
- <exclude>**/docker/**</exclude>
- <exclude>**/*.tpl</exclude>
- </excludes>
- <mapping>
- <bash>SCRIPT_STYLE</bash>
- <groovy>SLASHSTAR_STYLE</groovy>
- <java>SLASHSTAR_STYLE</java>
- <mvn>SCRIPT_STYLE</mvn>
- <mvnd.sh>SCRIPT_STYLE</mvnd.sh>
- <mvns>SCRIPT_STYLE</mvns>
- <vbs>APOSTROPHE_STYLE</vbs>
- </mapping>
- <skipExistingHeaders>true</skipExistingHeaders>
- <!-- we want to keep third party license headers -->
- <failIfUnknown>true</failIfUnknown>
- </configuration>
- </plugin>
<plugin>
<groupId>ca.vanzyl.provisio.maven.plugins</groupId>
<artifactId>provisio-maven-plugin</artifactId>
@@ -474,6 +414,11 @@ limitations under the License.</inlineHeader>
<tagNameFormat>@{project.version}</tagNameFormat>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.12.1</version>
+ </plugin>
</plugins>
</pluginManagement>
@@ -488,18 +433,6 @@ limitations under the License.</inlineHeader>
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>com.mycila</groupId>
- <artifactId>license-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>format</goal>
- </goals>
- <phase>process-sources</phase>
- </execution>
- </executions>
- </plugin>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
[maven-mvnd] 20/28: Use muti-release jar to fallback mvnd-client to original maven (#722)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit b81c8568a82725c9ffc20c3ea019ae3cb5616e40
Author: James Z.M. Gao <ga...@360.cn>
AuthorDate: Thu Dec 15 00:41:02 2022 +0800
Use muti-release jar to fallback mvnd-client to original maven (#722)
* Use muti-release jar to fallback mvnd-client to original maven
The mvnd-client is built to a muti-release jar. The default version of
DefaultClient is compiled against the same target version as the
embedded maven (4.x, so JDK 1.8) which only invoke the MavenCli.main().
The java-11 version is the full qualified mvnd-client.
* update cmd scripts
* embedded maven now works under JDK 1.8
Build SimpleAppender for JDK 1.8 since it is the log appender only
for the embedded maven
Co-authored-by: Guillaume Nodet <gn...@gmail.com>
# Conflicts:
# pom.xml
---
client/pom.xml | 49 ++++++++--
.../org/mvndaemon/mvnd/client/DefaultClient.java | 37 ++++++++
.../org/mvndaemon/mvnd/client/DefaultClient.java | 2 +
common/pom.xml | 4 +-
daemon/pom.xml | 23 +++++
.../mvnd/logging/internal/SimpleAppender.java | 0
.../syncontext/DaemonNamedLockFactorySelector.java | 45 ----------
dist/src/main/distro/bin/m2.conf | 27 ++++++
dist/src/main/distro/bin/mvnd.cmd | 100 +++++++++++++++++++--
dist/src/main/distro/bin/mvnd.sh | 48 +++++++---
dist/src/main/distro/mvn/bin/mvn | 2 -
dist/src/main/distro/mvn/bin/mvn.cmd | 2 -
pom.xml | 24 ++++-
13 files changed, 283 insertions(+), 80 deletions(-)
diff --git a/client/pom.xml b/client/pom.xml
index 2c370fb2..0bf6ed9f 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -31,8 +31,7 @@
<name>Maven Daemon - Client</name>
<properties>
- <maven.compiler.target>11</maven.compiler.target>
- <maven.compiler.source>11</maven.compiler.source>
+ <maven.compiler.release>11</maven.compiler.release>
<graalvm-native-static-opt/>
<graalvm-native-glibc-opt/>
</properties>
@@ -88,6 +87,7 @@
<configuration>
<rules>
<enforceBytecodeVersion>
+ <maxJdkVersion>${maven.compiler.release}</maxJdkVersion>
<excludes>
<exclude>org.graalvm.nativeimage:svm</exclude>
</excludes>
@@ -115,11 +115,48 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-compile</id>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>fallback-main</id>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <release>${maven-dist.required.jdk}</release>
+ <compileSourceRoots>
+ <root>${project.basedir}/src/main/java-fallback</root>
+ </compileSourceRoots>
+ </configuration>
+ </execution>
+ <execution>
+ <id>mvnd-main</id>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <multiReleaseOutput>true</multiReleaseOutput>
+ <compileSourceRoots>
+ <root>${project.basedir}/src/main/java-mvnd</root>
+ </compileSourceRoots>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
<configuration>
- <compilerArgs>
- <arg>--add-exports=java.base/sun.nio.ch=ALL-UNNAMED</arg>
- <arg>--add-exports=java.base/jdk.internal.module=ALL-UNNAMED</arg>
- </compilerArgs>
+ <archive>
+ <manifestEntries>
+ <Multi-Release>true</Multi-Release>
+ </manifestEntries>
+ </archive>
</configuration>
</plugin>
<plugin>
diff --git a/client/src/main/java-fallback/org/mvndaemon/mvnd/client/DefaultClient.java b/client/src/main/java-fallback/org/mvndaemon/mvnd/client/DefaultClient.java
new file mode 100644
index 00000000..f50419aa
--- /dev/null
+++ b/client/src/main/java-fallback/org/mvndaemon/mvnd/client/DefaultClient.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.mvndaemon.mvnd.client;
+
+import org.apache.maven.cli.MavenCli;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class DefaultClient {
+ public static void main(String[] argv) throws Exception {
+ final String logbackConfFallback = System.getProperty("logback.configurationFile.fallback");
+ if (null != logbackConfFallback && !"".equals(logbackConfFallback)) {
+ System.setProperty("logback.configurationFile", logbackConfFallback);
+ System.clearProperty("logback.configurationFile.fallback");
+ }
+
+ final Logger LOGGER = LoggerFactory.getLogger(DefaultClient.class);
+ LOGGER.warn("Found old JDK, fallback to the embedded maven!");
+ LOGGER.warn("Use JDK 11+ to run maven-mvnd client!");
+
+ MavenCli.main(argv);
+ }
+}
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/DefaultClient.java b/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java
similarity index 99%
rename from client/src/main/java/org/mvndaemon/mvnd/client/DefaultClient.java
rename to client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java
index 9c4774da..417f17b4 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/DefaultClient.java
+++ b/client/src/main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java
@@ -68,6 +68,8 @@ public class DefaultClient implements Client {
private final DaemonParameters parameters;
public static void main(String[] argv) throws Exception {
+ System.clearProperty("logback.configurationFile.fallback");
+
final List<String> args = new ArrayList<>(Arrays.asList(argv));
// Log file
diff --git a/common/pom.xml b/common/pom.xml
index 9d040397..2aaf4a14 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -88,7 +88,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
- <id>default</id>
+ <id>default-compile</id>
<goals>
<goal>compile</goal>
</goals>
@@ -143,7 +143,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
- <id>default</id>
+ <id>default-compile</id>
<goals>
<goal>compile</goal>
</goals>
diff --git a/daemon/pom.xml b/daemon/pom.xml
index cbf0700c..52d51b76 100644
--- a/daemon/pom.xml
+++ b/daemon/pom.xml
@@ -99,6 +99,29 @@
</resource>
</resources>
<plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-compile</id>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>fallback</id>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <release>${maven-dist.required.jdk}</release>
+ <compileSourceRoots>
+ <root>${project.basedir}/src/main/java-fallback</root>
+ </compileSourceRoots>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/logging/internal/SimpleAppender.java b/daemon/src/main/java-fallback/org/mvndaemon/mvnd/logging/internal/SimpleAppender.java
similarity index 100%
rename from daemon/src/main/java/org/mvndaemon/mvnd/logging/internal/SimpleAppender.java
rename to daemon/src/main/java-fallback/org/mvndaemon/mvnd/logging/internal/SimpleAppender.java
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/syncontext/DaemonNamedLockFactorySelector.java b/daemon/src/main/java/org/mvndaemon/mvnd/syncontext/DaemonNamedLockFactorySelector.java
deleted file mode 100644
index c6f73bac..00000000
--- a/daemon/src/main/java/org/mvndaemon/mvnd/syncontext/DaemonNamedLockFactorySelector.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.mvndaemon.mvnd.syncontext;
-
-import java.util.Map;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
-import org.eclipse.aether.internal.impl.synccontext.named.FileGAVNameMapper;
-import org.eclipse.aether.internal.impl.synccontext.named.NameMapper;
-import org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactorySelectorSupport;
-import org.eclipse.aether.named.NamedLockFactory;
-import org.eclipse.aether.named.providers.FileLockNamedLockFactory;
-import org.eclipse.sisu.Priority;
-
-/**
- * Mvnd selector implementation: it differs from
- * {@link org.eclipse.aether.internal.impl.synccontext.named.SimpleNamedLockFactorySelector} only by default values.
- */
-@Singleton
-@Named
-@Priority(10)
-public final class DaemonNamedLockFactorySelector extends NamedLockFactorySelectorSupport {
- @Inject
- public DaemonNamedLockFactorySelector(
- final Map<String, NamedLockFactory> factories, final Map<String, NameMapper> nameMappers) {
- super(factories, FileLockNamedLockFactory.NAME, nameMappers, FileGAVNameMapper.NAME);
- }
-}
diff --git a/dist/src/main/distro/bin/m2.conf b/dist/src/main/distro/bin/m2.conf
new file mode 100644
index 00000000..1f7aa818
--- /dev/null
+++ b/dist/src/main/distro/bin/m2.conf
@@ -0,0 +1,27 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+main is org.mvndaemon.mvnd.client.DefaultClient from plexus.core
+
+set maven.home default ${mvnd.home}/mvn
+set maven.conf default ${maven.home}/conf
+set logback.configurationFile default ${mvnd.home}/conf/logback-client.xml
+set logback.configurationFile.fallback default ${maven.conf}/logging/logback.xml
+
+[plexus.core]
+load ${maven.conf}/logging
+load ${maven.home}/lib/ext/*.jar
+load ${maven.home}/lib/*.jar
diff --git a/dist/src/main/distro/bin/mvnd.cmd b/dist/src/main/distro/bin/mvnd.cmd
index 060d08e7..62d29d49 100644
--- a/dist/src/main/distro/bin/mvnd.cmd
+++ b/dist/src/main/distro/bin/mvnd.cmd
@@ -73,22 +73,106 @@ goto error
set MAVEN_CMD_LINE_ARGS=%*
+@REM Find the project basedir, i.e., the directory that contains the directory ".mvn".
+@REM Fallback to current working directory if not found.
+
+set "EXEC_DIR=%CD%"
+set "WDIR=%EXEC_DIR%"
+
+@REM Look for the --file switch and start the search for the .mvn directory from the specified
+@REM POM location, if supplied.
+
+set FILE_ARG=
+:arg_loop
+if "%~1" == "-f" (
+ set "FILE_ARG=%~2"
+ shift
+ goto process_file_arg
+)
+if "%~1" == "--file" (
+ set "FILE_ARG=%~2"
+ shift
+ goto process_file_arg
+)
+@REM If none of the above, skip the argument
+shift
+if not "%~1" == "" (
+ goto arg_loop
+) else (
+ goto findBaseDir
+)
+
+:process_file_arg
+if "%FILE_ARG%" == "" (
+ goto findBaseDir
+)
+if not exist "%FILE_ARG%" (
+ echo POM file "%FILE_ARG%" specified the -f/--file command-line argument does not exist >&2
+ goto error
+)
+if exist "%FILE_ARG%\*" (
+ set "POM_DIR=%FILE_ARG%"
+) else (
+ call :get_directory_from_file "%FILE_ARG%"
+)
+if not exist "%POM_DIR%" (
+ echo Directory "%POM_DIR%" extracted from the -f/--file command-line argument "%FILE_ARG%" does not exist >&2
+ goto error
+)
+set "WDIR=%POM_DIR%"
+goto findBaseDir
+
+:get_directory_from_file
+set "POM_DIR=%~dp1"
+:stripPomDir
+if not "_%POM_DIR:~-1%"=="_\" goto pomDirStripped
+set "POM_DIR=%POM_DIR:~0,-1%"
+goto stripPomDir
+:pomDirStripped
+exit /b
+
+:findBaseDir
+cd /d "%WDIR%"
+:findBaseDirLoop
+if exist "%WDIR%\.mvn" goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set "WDIR=%CD%"
+goto findBaseDirLoop
+
+:baseDirFound
+set "MAVEN_PROJECTBASEDIR=%WDIR%"
+cd /d "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+if "_%EXEC_DIR:~-1%"=="_\" set "EXEC_DIR=%EXEC_DIR:~0,-1%"
+set "MAVEN_PROJECTBASEDIR=%EXEC_DIR%"
+cd /d "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+set "jvmConfig=\.mvn\jvm.config"
+if not exist "%MAVEN_PROJECTBASEDIR%%jvmConfig%" goto endReadAdditionalConfig
+
@setlocal EnableExtensions EnableDelayedExpansion
-for %%i in ("%MVND_HOME%"\mvn\boot\*.jar "%MVND_HOME%"\mvn\lib\ext\*.jar "%MVND_HOME%"\mvn\lib\*.jar) do set DAEMON_JAR=!DAEMON_JAR!;%%i
-@endlocal & set DAEMON_JAR="%DAEMON_JAR%"
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
-set DAEMON_LAUNCHER=org.mvndaemon.mvnd.client.DefaultClient
+for %%i in ("%MVND_HOME%"\mvn\boot\plexus-classworlds-*) do set CLASSWORLDS_JAR="%%i"
+set CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
"%JAVACMD%" ^
%JVM_CONFIG_MAVEN_PROPS% ^
%MAVEN_OPTS% ^
%MAVEN_DEBUG_OPTS% ^
- -classpath %DAEMON_JAR% ^
- "-Dlogback.configurationFile=%MVND_HOME%\conf\logback-client.xml" ^
+ -classpath %CLASSWORLDS_JAR% ^
+ "-Dclassworlds.conf=%MVND_HOME%\bin\m2.conf"
"-Dmvnd.home=%MVND_HOME%" ^
- "-Dmaven.home=%MVND_HOME%\mvn" ^
- "-Dlibrary.jansi.path=%MVND_HOME%\mvn\lib\jansi-native" ^
- %DAEMON_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
+ "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
+ %CLASSWORLDS_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
if ERRORLEVEL 1 goto error
goto end
diff --git a/dist/src/main/distro/bin/mvnd.sh b/dist/src/main/distro/bin/mvnd.sh
index 89352082..df821112 100755
--- a/dist/src/main/distro/bin/mvnd.sh
+++ b/dist/src/main/distro/bin/mvnd.sh
@@ -101,9 +101,8 @@ if [ ! -x "$JAVACMD" ] ; then
exit 1
fi
-DAEMON_JAR=`echo "${MVND_HOME}"/mvn/boot/*.jar "${MVND_HOME}"/mvn/lib/ext/*.jar "${MVND_HOME}"/mvn/lib/*.jar`
-DAEMON_JAR=$(echo $DAEMON_JAR | sed -e 's/ /:/g')
-DAEMON_LAUNCHER=org.mvndaemon.mvnd.client.DefaultClient
+CLASSWORLDS_JAR=`echo "${MVND_HOME}"/mvn/boot/plexus-classworlds-*.jar`
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
@@ -113,10 +112,27 @@ if $cygwin ; then
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
- [ -n "$DAEMON_JAR" ] &&
- DAEMON_JAR=`cygpath --path --windows "$DAEMON_JAR"`
+ [ -n "$CLASSWORLDS_JAR" ] &&
+ CLASSWORLDS_JAR=`cygpath --path --windows "$CLASSWORLDS_JAR"`
fi
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+(
+ basedir=`find_file_argument_basedir "$@"`
+ wdir="${basedir}"
+ while [ "$wdir" != '/' ] ; do
+ if [ -d "$wdir"/.mvn ] ; then
+ basedir=$wdir
+ break
+ fi
+ wdir=`cd "$wdir/.."; pwd`
+ done
+ echo "${basedir}"
+)
+}
+
find_file_argument_basedir() {
(
basedir=`pwd`
@@ -154,17 +170,21 @@ concat_lines() {
fi
}
-# Provide a "standardized" way to retrieve the CLI args that will
-# work with both Windows and non-Windows executions.
-MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
-export MAVEN_CMD_LINE_ARGS
+MAVEN_PROJECTBASEDIR=`find_maven_basedir "$@"`
+MAVEN_OPTS="`concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config"` $MAVEN_OPTS"
+
+# For Cygwin, switch project base directory path to Windows format before
+# executing Maven otherwise this will cause Maven not to consider it.
+if $cygwin ; then
+ [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+ MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
+fi
exec "$JAVACMD" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
- -classpath "${DAEMON_JAR}" \
- "-Dlogback.configurationFile=${MVND_HOME}/conf/logback-client.xml" \
+ -classpath "${CLASSWORLDS_JAR}" \
+ "-Dclassworlds.conf=${MVND_HOME}/bin/m2.conf" \
"-Dmvnd.home=${MVND_HOME}" \
- "-Dmaven.home=${MVND_HOME}/mvn" \
- "-Dlibrary.jansi.path=${MVND_HOME}/mvn/lib/jansi-native" \
- ${DAEMON_LAUNCHER} "$@"
+ "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+ ${CLASSWORLDS_LAUNCHER} "$@"
diff --git a/dist/src/main/distro/mvn/bin/mvn b/dist/src/main/distro/mvn/bin/mvn
index f23e7bb7..97363a1e 100755
--- a/dist/src/main/distro/mvn/bin/mvn
+++ b/dist/src/main/distro/mvn/bin/mvn
@@ -193,8 +193,6 @@ exec "$JAVACMD" \
-classpath "${CLASSWORLDS_JAR}" \
"-Dlogback.configurationFile=${MAVEN_HOME}/conf/logging/logback.xml" \
"-Dclassworlds.conf=${MAVEN_HOME}/bin/m2.conf" \
- "-Dmvnd.home=${MAVEN_HOME}" \
"-Dmaven.home=${MAVEN_HOME}" \
- "-Dlibrary.jansi.path=${MAVEN_HOME}/lib/jansi-native" \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${CLASSWORLDS_LAUNCHER} "$@"
diff --git a/dist/src/main/distro/mvn/bin/mvn.cmd b/dist/src/main/distro/mvn/bin/mvn.cmd
index b08e9461..17cb1cb7 100644
--- a/dist/src/main/distro/mvn/bin/mvn.cmd
+++ b/dist/src/main/distro/mvn/bin/mvn.cmd
@@ -174,9 +174,7 @@ set CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
-classpath %CLASSWORLDS_JAR% ^
"-Dlogback.configurationFile=%MAVEN_HOME%\conf\logging\logback.xml" ^
"-Dclassworlds.conf=%MAVEN_HOME%\bin\m2.conf" ^
- "-Dmvnd.home=%MAVEN_HOME%" ^
"-Dmaven.home=%MAVEN_HOME%" ^
- "-Dlibrary.jansi.path=%MAVEN_HOME%\lib\jansi-native" ^
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
%CLASSWORLDS_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
if ERRORLEVEL 1 goto error
diff --git a/pom.xml b/pom.xml
index 5689db3d..b9427503 100644
--- a/pom.xml
+++ b/pom.xml
@@ -66,7 +66,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <project.build.outputTimestamp>2022-10-04T07:06:02Z</project.build.outputTimestamp>
+ <maven-dist.required.jdk>8</maven-dist.required.jdk>
+ <project.build.outputTimestamp>2022-11-19T15:16:03Z</project.build.outputTimestamp>
<trimStackTrace>false</trimStackTrace>
<project.github.repository>apache/maven-mvnd</project.github.repository>
<repository.url>github.com:${project.github.repository}</repository.url>
@@ -476,6 +477,27 @@
<id>source-distribution</id>
<build>
<plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <inherited>false</inherited>
+ <executions>
+ <execution>
+ <id>build-with-jdk11+</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <phase>validate</phase>
+ <configuration>
+ <rules>
+ <requireJavaVersion>
+ <version>[11,)</version>
+ </requireJavaVersion>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
[maven-mvnd] 22/28: Add an option to specify the debug address and display info when starting (fixes #737) (#753)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 5eebb89d8272a7bd0caec67976499b834c1f918e
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Fri Dec 16 08:39:39 2022 +0100
Add an option to specify the debug address and display info when starting (fixes #737) (#753)
---
.../org/mvndaemon/mvnd/client/DaemonConnector.java | 37 +++++++++++++++++++---
.../org/mvndaemon/mvnd/common/Environment.java | 7 ++++
dist/src/main/distro/bin/mvnd-bash-completion.bash | 2 +-
3 files changed, 40 insertions(+), 6 deletions(-)
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java
index 05558d13..8b867176 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java
@@ -23,8 +23,10 @@ import static org.mvndaemon.mvnd.common.DaemonState.Canceled;
import java.io.File;
import java.io.IOException;
+import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.ByteBuffer;
+import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
@@ -122,7 +124,7 @@ public class DaemonConnector {
final String daemonId = newId();
String message = handleStopEvents(daemonId, idleDaemons, busyDaemons);
output.accept(Message.buildStatus(message));
- return startDaemon(daemonId);
+ return startDaemon(daemonId, output);
}
private DaemonClientConnection connectNoDaemon() {
@@ -297,8 +299,8 @@ public class DaemonConnector {
return null;
}
- public DaemonClientConnection startDaemon(String daemonId) {
- final Process process = startDaemonProcess(daemonId);
+ public DaemonClientConnection startDaemon(String daemonId, ClientOutput output) {
+ final Process process = startDaemonProcess(daemonId, output);
LOGGER.debug("Started Maven daemon {}", daemonId);
long start = System.currentTimeMillis();
do {
@@ -321,7 +323,7 @@ public class DaemonConnector {
return String.format("%08x", new Random().nextInt());
}
- private Process startDaemonProcess(String daemonId) {
+ private Process startDaemonProcess(String daemonId, ClientOutput output) {
final Path mvndHome = parameters.mvndHome();
final Path workingDir = parameters.userDir();
String command = "";
@@ -354,7 +356,32 @@ public class DaemonConnector {
args.add("-javaagent:" + mvndAgentPath);
// debug options
if (parameters.property(Environment.MVND_DEBUG).asBoolean()) {
- args.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000");
+ String address =
+ parameters.property(Environment.MVND_DEBUG_ADDRESS).asString();
+ String host;
+ String port;
+ int column = address.indexOf(':');
+ if (column >= 0) {
+ host = address.substring(0, column);
+ port = address.substring(column + 1);
+ } else {
+ host = "localhost";
+ port = address;
+ }
+ if (!port.matches("[0-9]+")) {
+ throw new IllegalArgumentException("Wrong debug address syntax: " + address);
+ }
+ int iPort = Integer.parseInt(port);
+ if (iPort == 0) {
+ try (ServerSocketChannel channel = SocketFamily.inet.openServerSocket()) {
+ iPort = ((InetSocketAddress) channel.getLocalAddress()).getPort();
+ } catch (IOException e) {
+ throw new IllegalStateException("Unable to find a free debug port", e);
+ }
+ }
+ address = host + ":" + iPort;
+ output.accept(Message.buildStatus("Daemon listening for debugger on address: " + address));
+ args.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=" + address);
}
// jvm args
String jvmArgs = parameters.jvmArgs();
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 95cd046e..a7477de0 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java
@@ -169,6 +169,13 @@ public enum Environment {
* not passed to the daemon.
*/
MVND_DEBUG("mvnd.debug", null, Boolean.FALSE, OptionType.BOOLEAN, Flags.DISCRIMINATING),
+ /**
+ * The tcp address used to launch the debug mode. Defaults to <code>8000</code>, which is similar to
+ * <code>localhost:8000</code>. In order to remote debug from a different computer, you need to allow
+ * remote connections using <code>*:8000</code> for example. Use a port with a value of <code>0</code>
+ * to have <code>mvnd</code> to choose one.
+ */
+ MVND_DEBUG_ADDRESS("mvnd.debug.address", null, "8000", OptionType.STRING, Flags.DISCRIMINATING),
/**
* A time period after which an unused daemon will terminate by itself.
*/
diff --git a/dist/src/main/distro/bin/mvnd-bash-completion.bash b/dist/src/main/distro/bin/mvnd-bash-completion.bash
index 4b90feab..45ffc0d8 100644
--- a/dist/src/main/distro/bin/mvnd-bash-completion.bash
+++ b/dist/src/main/distro/bin/mvnd-bash-completion.bash
@@ -218,7 +218,7 @@ _mvnd()
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.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.noDa [...]
+ 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.no [...]
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-v [...]
[maven-mvnd] 18/28: Fixup #716 Calculate java home from java command (#721)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 2220b012074e17db4dcac739b21a74ccb1ef3dd8
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Wed Dec 14 00:35:10 2022 +0100
Fixup #716 Calculate java home from java command (#721)
* Add a test
* Simplify the stream processing
Co-authored-by: Guillaume Nodet <gn...@gmail.com>
---
.../mvndaemon/mvnd/client/DaemonParameters.java | 11 +++++++---
.../java/org/mvndaemon/mvnd/common/OsUtils.java | 25 ++++++++++++++--------
.../org/mvndaemon/mvnd/common/OsUtilsTest.java | 7 ++++++
3 files changed, 31 insertions(+), 12 deletions(-)
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java
index 858975e5..e81335e7 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java
@@ -139,7 +139,8 @@ public class DaemonParameters {
.orLocalProperty(provider, globalPropertiesPath())
.orSystemProperty()
.orEnvironmentVariable()
- .or(new ValueSource(description -> description.append("java command"), this::javaHomeFromPath))
+ .or(new ValueSource(
+ description -> description.append("java command"), DaemonParameters::javaHomeFromPath))
.orFail()
.asPath();
try {
@@ -149,8 +150,12 @@ public class DaemonParameters {
}
}
- private String javaHomeFromPath() {
- final String jHome = OsUtils.findJavaHomeFromPath();
+ private static String javaHomeFromPath() {
+ LOG.warn(
+ "Falling back to finding JAVA_HOME by running java executable available in PATH."
+ + " You may want to avoid this time consumig task by setting JAVA_HOME environment variable"
+ + " or by passing java.home system property through command line or in one of mvnd configuration files.");
+ final String jHome = OsUtils.findJavaHomeFromJavaExecutable("java");
if (null != jHome) {
System.setProperty(Environment.JAVA_HOME.getProperty(), jHome);
}
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/OsUtils.java b/common/src/main/java/org/mvndaemon/mvnd/common/OsUtils.java
index eb0569db..45ae8826 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/OsUtils.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/OsUtils.java
@@ -111,16 +111,23 @@ public class OsUtils {
}
}
- public static String findJavaHomeFromPath() {
- String[] cmd = {"java", "-XshowSettings:properties", "-version"};
- final List<String> output = new ArrayList<String>(1);
+ /**
+ * Executes the given {@code javaExecutable} with {@code -XshowSettings:properties -version} parameters and extracts
+ * the value of {@code java.home} from the output.
+ *
+ * @param javaExecutable pass {@code "java"} to get {@code java} binary available in {@code PATH} environment
+ * variable or pass an absolute path to a {@code "java"} executable
+ * @return a {@code java.home} value or null
+ */
+ public static String findJavaHomeFromJavaExecutable(String javaExecutable) {
+ String[] cmd = {javaExecutable, "-XshowSettings:properties", "-version"};
+ final List<String> output = new ArrayList<String>();
exec(cmd, output);
- List<String> javaHomeLines =
- output.stream().filter(l -> l.contains(" java.home = ")).collect(Collectors.toList());
- if (javaHomeLines.size() == 1) {
- return javaHomeLines.get(0).trim().replaceFirst("java.home = ", "");
- }
- return null;
+ return output.stream()
+ .filter(l -> l.contains(" java.home = "))
+ .map(l -> l.substring(l.indexOf('=') + 1).trim())
+ .findFirst()
+ .orElse(null);
}
private static void exec(String[] cmd, final List<String> output) {
diff --git a/common/src/test/java/org/mvndaemon/mvnd/common/OsUtilsTest.java b/common/src/test/java/org/mvndaemon/mvnd/common/OsUtilsTest.java
index 41cb71bd..dd8eac32 100644
--- a/common/src/test/java/org/mvndaemon/mvnd/common/OsUtilsTest.java
+++ b/common/src/test/java/org/mvndaemon/mvnd/common/OsUtilsTest.java
@@ -31,4 +31,11 @@ public class OsUtilsTest {
Assertions.assertEquals("1g", OsUtils.kbTohumanReadable(1024 * 1024));
Assertions.assertEquals("1t", OsUtils.kbTohumanReadable(1024 * 1024 * 1024));
}
+
+ @Test
+ void findJavaHomeFromPath() {
+ final String expectedJavaHome = System.getProperty("java.home");
+ Assertions.assertEquals(
+ expectedJavaHome, OsUtils.findJavaHomeFromJavaExecutable(expectedJavaHome + "/bin/java"));
+ }
}
[maven-mvnd] 08/28: Fix usage of the wrong groovy plugin
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 0d04291df0597ffd5aea4c5473c59b5c4519db4e
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Wed Nov 23 11:22:23 2022 +0100
Fix usage of the wrong groovy plugin
---
pom.xml | 42 ++++++++++++++++++++++--------------------
1 file changed, 22 insertions(+), 20 deletions(-)
diff --git a/pom.xml b/pom.xml
index f8f6059d..2162a332 100644
--- a/pom.xml
+++ b/pom.xml
@@ -487,8 +487,8 @@ limitations under the License.</inlineHeader>
</executions>
</plugin>
<plugin>
- <groupId>org.codehaus.gmaven</groupId>
- <artifactId>groovy-maven-plugin</artifactId>
+ <groupId>org.codehaus.gmavenplus</groupId>
+ <artifactId>gmavenplus-plugin</artifactId>
<executions>
<execution>
<id>set-platform-properties</id>
@@ -497,24 +497,26 @@ limitations under the License.</inlineHeader>
</goals>
<phase>generate-sources</phase>
<configuration>
- <source>// Naming conventions coined by GraalVM
- // https://github.com/graalvm/graalvm-ce-builds/releases/
- String osName = System.getProperty('os.name').toLowerCase(Locale.ROOT)
- if (osName.startsWith('windows')) {
- project.properties['os.detected.name'] = 'windows'
- } else if (osName.startsWith('linux')) {
- project.properties['os.detected.name'] = 'linux'
- } else if (osName.startsWith('osx') || osName.startsWith('mac os x')) {
- project.properties['os.detected.name'] = 'darwin'
- } else {
- project.properties['os.detected.name'] = osName
- }
- String osArch = System.getProperty('os.arch').toLowerCase(Locale.ROOT)
- if (osArch.equals('amd64') || osArch.equals('x86_64')) {
- project.properties['os.detected.arch'] = 'amd64'
- } else {
- project.properties['os.detected.arch'] = osArch
- }</source>
+ <scripts>
+ <script>// Naming conventions coined by GraalVM
+ // https://github.com/graalvm/graalvm-ce-builds/releases/
+ String osName = System.getProperty('os.name').toLowerCase(Locale.ROOT)
+ if (osName.startsWith('windows')) {
+ project.properties['os.detected.name'] = 'windows'
+ } else if (osName.startsWith('linux')) {
+ project.properties['os.detected.name'] = 'linux'
+ } else if (osName.startsWith('osx') || osName.startsWith('mac os x')) {
+ project.properties['os.detected.name'] = 'darwin'
+ } else {
+ project.properties['os.detected.name'] = osName
+ }
+ String osArch = System.getProperty('os.arch').toLowerCase(Locale.ROOT)
+ if (osArch.equals('amd64') || osArch.equals('x86_64')) {
+ project.properties['os.detected.arch'] = 'amd64'
+ } else {
+ project.properties['os.detected.arch'] = osArch
+ }</script>
+ </scripts>
</configuration>
</execution>
</executions>
[maven-mvnd] 21/28: Fix the common jar not being built with the multi-release flag
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 740f91409875e04b950bf3e4078f0a8d59f80cb6
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Wed Dec 14 17:28:28 2022 +0100
Fix the common jar not being built with the multi-release flag
---
common/pom.xml | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/common/pom.xml b/common/pom.xml
index 2aaf4a14..e5f252a6 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -73,6 +73,17 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Multi-Release>true</Multi-Release>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
</plugins>
</build>
@@ -118,17 +129,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestEntries>
- <Multi-Release>true</Multi-Release>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
</plugins>
</build>
</profile>
[maven-mvnd] 16/28: Display plugin's goal prefix and version instead of artifactId (#748)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 724d1fec21de6512706c95d868210552bcc438ca
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Tue Dec 13 23:58:58 2022 +0100
Display plugin's goal prefix and version instead of artifactId (#748)
* Display plugin's goal prefix and version instead of artifactId
* Default to groupId:artifactId if goalPrefix is not present
---
.../java/org/mvndaemon/mvnd/common/Message.java | 31 +++++++++++++++-------
.../mvnd/common/logging/TerminalOutput.java | 10 +++++--
.../mvndaemon/mvnd/daemon/ClientDispatcher.java | 2 ++
.../org/mvndaemon/mvnd/it/SingleModuleTest.java | 1 +
4 files changed, 33 insertions(+), 11 deletions(-)
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/Message.java b/common/src/main/java/org/mvndaemon/mvnd/common/Message.java
index e983b321..10b641e5 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/Message.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/Message.java
@@ -510,6 +510,7 @@ public abstract class Message {
final String artifactId;
final String pluginGroupId;
final String pluginArtifactId;
+ final String pluginGoalPrefix;
final String pluginVersion;
final String mojo;
final String executionId;
@@ -518,16 +519,19 @@ public abstract class Message {
final String artifactId = readUTF(input);
final String pluginGroupId = readUTF(input);
final String pluginArtifactId = readUTF(input);
+ final String pluginGoalPrefix = readUTF(input);
final String pluginVersion = readUTF(input);
final String mojo = readUTF(input);
final String executionId = readUTF(input);
- return new MojoStartedEvent(artifactId, pluginGroupId, pluginArtifactId, pluginVersion, mojo, executionId);
+ return new MojoStartedEvent(
+ artifactId, pluginGroupId, pluginArtifactId, pluginGoalPrefix, pluginVersion, mojo, executionId);
}
public MojoStartedEvent(
String artifactId,
String pluginGroupId,
String pluginArtifactId,
+ String pluginGoalPrefix,
String pluginVersion,
String mojo,
String executionId) {
@@ -535,6 +539,7 @@ public abstract class Message {
this.artifactId = Objects.requireNonNull(artifactId, "artifactId cannot be null");
this.pluginGroupId = Objects.requireNonNull(pluginGroupId, "pluginGroupId cannot be null");
this.pluginArtifactId = Objects.requireNonNull(pluginArtifactId, "pluginArtifactId cannot be null");
+ this.pluginGoalPrefix = Objects.requireNonNull(pluginGoalPrefix, "pluginGoalPrefix cannot be null");
this.pluginVersion = Objects.requireNonNull(pluginVersion, "pluginVersion cannot be null");
this.mojo = Objects.requireNonNull(mojo, "mojo cannot be null");
this.executionId = Objects.requireNonNull(executionId, "executionId cannot be null");
@@ -552,6 +557,10 @@ public abstract class Message {
return pluginArtifactId;
}
+ public String getPluginGoalPrefix() {
+ return pluginGoalPrefix;
+ }
+
public String getPluginVersion() {
return pluginVersion;
}
@@ -566,13 +575,14 @@ public abstract class Message {
@Override
public String toString() {
- return "MojoStarted{" + "artifactId='"
- + artifactId + '\'' + ", pluginGroupId='"
- + pluginGroupId + '\'' + ", pluginArtifactId='"
- + pluginArtifactId + '\'' + ", pluginVersion='"
- + pluginVersion + '\'' + ", mojo='"
- + mojo + '\'' + ", executionId='"
- + executionId + '\'' + '}';
+ return "MojoStarted{"
+ + "artifactId='" + artifactId + '\'' + ", "
+ + "pluginGroupId='" + pluginGroupId + '\'' + ", "
+ + "pluginArtifactId='" + pluginArtifactId + '\'' + ", "
+ + "pluginGoalPrefix='" + pluginGoalPrefix + '\'' + ", "
+ + "pluginVersion='" + pluginVersion + '\'' + ", "
+ + "mojo='" + mojo + '\'' + ", "
+ + "executionId='" + executionId + '\'' + '}';
}
@Override
@@ -581,6 +591,7 @@ public abstract class Message {
writeUTF(output, artifactId);
writeUTF(output, pluginGroupId);
writeUTF(output, pluginArtifactId);
+ writeUTF(output, pluginGoalPrefix);
writeUTF(output, pluginVersion);
writeUTF(output, mojo);
writeUTF(output, executionId);
@@ -1073,10 +1084,12 @@ public abstract class Message {
String artifactId,
String pluginGroupId,
String pluginArtifactId,
+ String pluginGoalPrefix,
String pluginVersion,
String mojo,
String executionId) {
- return new MojoStartedEvent(artifactId, pluginGroupId, pluginArtifactId, pluginVersion, mojo, executionId);
+ return new MojoStartedEvent(
+ artifactId, pluginGroupId, pluginArtifactId, pluginGoalPrefix, pluginVersion, mojo, executionId);
}
public static ProjectEvent display(String projectId, String message) {
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java b/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java
index d5393cb7..e5e5edaf 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java
@@ -785,8 +785,14 @@ public class TerminalOutput implements ClientOutput {
asb.append(':')
.style(CYAN_FOREGROUND)
.append(String.format(artifactIdFormat, prj.id))
- .style(GREEN_FOREGROUND)
- .append(execution.getPluginArtifactId())
+ .style(GREEN_FOREGROUND);
+ if (execution.getPluginGoalPrefix().isEmpty()) {
+ asb.append(execution.getPluginGroupId()).append(':').append(execution.getPluginArtifactId());
+ } else {
+ asb.append(execution.getPluginGoalPrefix());
+ }
+ asb.append(':')
+ .append(execution.getPluginVersion())
.append(':')
.append(execution.getMojo())
.append(' ')
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java
index b44289a0..743ea7a9 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java
@@ -118,10 +118,12 @@ public class ClientDispatcher extends BuildEventListener {
public void mojoStarted(ExecutionEvent event) {
final MojoExecution execution = event.getMojoExecution();
+ String goalPrefix = execution.getMojoDescriptor().getPluginDescriptor().getGoalPrefix();
queue.add(Message.mojoStarted(
event.getProject().getArtifactId(),
execution.getGroupId(),
execution.getArtifactId(),
+ goalPrefix != null ? goalPrefix : "",
execution.getVersion(),
execution.getGoal(),
execution.getExecutionId()));
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SingleModuleTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SingleModuleTest.java
index b807ba0a..4662b2a6 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SingleModuleTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SingleModuleTest.java
@@ -53,6 +53,7 @@ public class SingleModuleTest extends SingleModuleNativeIT {
"single-module",
"org.apache.maven.plugins",
pluginArtifactId,
+ pluginArtifactId.replace("maven-", "").replace("-plugin", ""),
props.getProperty(pluginArtifactId + ".version"),
mojo,
executionId)
[maven-mvnd] 01/28: Upgrade to groovy 4 to allow building on recent JDK (#735)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 7be6bd004d0abed2266242000dbd2804839ac262
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Sat Nov 19 00:18:28 2022 +0100
Upgrade to groovy 4 to allow building on recent JDK (#735)
---
.../src/test/projects/raw-streams/pom.xml | 20 +++++++++++++++-----
pom.xml | 19 ++++++-------------
2 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/integration-tests/src/test/projects/raw-streams/pom.xml b/integration-tests/src/test/projects/raw-streams/pom.xml
index b8ad56d5..5855affa 100644
--- a/integration-tests/src/test/projects/raw-streams/pom.xml
+++ b/integration-tests/src/test/projects/raw-streams/pom.xml
@@ -27,9 +27,9 @@
<build>
<plugins>
<plugin>
- <groupId>org.codehaus.gmaven</groupId>
- <artifactId>groovy-maven-plugin</artifactId>
- <version>2.1.1</version>
+ <groupId>org.codehaus.gmavenplus</groupId>
+ <artifactId>gmavenplus-plugin</artifactId>
+ <version>2.1.0</version>
<executions>
<execution>
<phase>validate</phase>
@@ -37,12 +37,22 @@
<goal>execute</goal>
</goals>
<configuration>
- <source>
+ <scripts>
+ <script><![CDATA[
println 'Hello'
- </source>
+ ]]></script>
+ </scripts>
</configuration>
</execution>
</executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ <version>4.0.6</version>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
</plugin>
</plugins>
</build>
diff --git a/pom.xml b/pom.xml
index 18ffd30c..8d2ffec1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -58,7 +58,7 @@
<commons-compress.version>1.21</commons-compress.version>
<graalvm.version>22.2.0</graalvm.version>
<graalvm.plugin.version>0.9.13</graalvm.plugin.version>
- <groovy.version>3.0.9</groovy.version>
+ <groovy.version>4.0.6</groovy.version>
<jakarta.inject.version>1.0</jakarta.inject.version>
<jansi.version>2.4.0</jansi.version>
<jline.version>3.21.0</jline.version>
@@ -73,7 +73,7 @@
<buildnumber-maven-plugin.version>1.4</buildnumber-maven-plugin.version>
<compiler.version>3.8.1</compiler.version>
<formatter-maven-plugin.version>2.15.0</formatter-maven-plugin.version>
- <groovy-maven-plugin.version>2.1.1</groovy-maven-plugin.version>
+ <groovy-maven-plugin.version>2.1.0</groovy-maven-plugin.version>
<impsort-maven-plugin.version>1.6.0</impsort-maven-plugin.version>
<license-maven-plugin.version>3.0</license-maven-plugin.version>
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
@@ -140,7 +140,7 @@
</dependency>
<dependency>
- <groupId>org.codehaus.groovy</groupId>
+ <groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
<version>${groovy.version}</version>
</dependency>
@@ -444,22 +444,15 @@ limitations under the License.</inlineHeader>
<version>${maven-shade-plugin.version}</version>
</plugin>
<plugin>
- <groupId>org.codehaus.gmaven</groupId>
- <artifactId>groovy-maven-plugin</artifactId>
+ <groupId>org.codehaus.gmavenplus</groupId>
+ <artifactId>gmavenplus-plugin</artifactId>
<version>${groovy-maven-plugin.version}</version>
<dependencies>
<dependency>
- <groupId>org.codehaus.groovy</groupId>
+ <groupId>org.apache.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>${groovy.version}</version>
<type>pom</type>
- <exclusions>
- <exclusion>
- <!-- groovy-testng depends on testng 7.2.0 wich is not on maven central -->
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy-testng</artifactId>
- </exclusion>
- </exclusions>
</dependency>
</dependencies>
</plugin>
[maven-mvnd] 28/28: Upgrade to maven resolver 1.8.2
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit e5f94f0f2c4455e85c96e50b9dddf27ceb908890
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Fri Jan 6 14:30:08 2023 +0100
Upgrade to maven resolver 1.8.2
---
dist/src/main/provisio/maven-distro.xml | 3 ++-
pom.xml | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dist/src/main/provisio/maven-distro.xml b/dist/src/main/provisio/maven-distro.xml
index 56c8b68d..77cf3bec 100644
--- a/dist/src/main/provisio/maven-distro.xml
+++ b/dist/src/main/provisio/maven-distro.xml
@@ -32,6 +32,7 @@
<artifact id="org.apache.maven.resolver:maven-resolver-util"/>
<artifact id="org.apache.maven.resolver:maven-resolver-connector-basic"/>
<artifact id="org.apache.maven.resolver:maven-resolver-transport-wagon"/>
+ <artifact id="org.apache.maven.wagon:wagon-provider-api:${maven.wagon.version}"/>
</artifactSet>
<artifactSet to="/mvn/lib/ext">
@@ -65,10 +66,10 @@
<exclusion id="*:org.eclipse.sisu.inject"/>
<exclusion id="*:org.eclipse.sisu.plexus"/>
<exclusion id="*:plexus-cipher"/>
+ <exclusion id="*:plexus-utils"/>
<exclusion id="*:plexus-component-annotations"/>
<exclusion id="*:plexus-interpolation"/>
<exclusion id="*:plexus-sec-dispatcher"/>
- <exclusion id="*:plexus-utils"/>
<exclusion id="*:plexus-container-default"/>
</artifact>
<artifact id="org.apache.maven.daemon:mvnd-client:${project.version}">
diff --git a/pom.xml b/pom.xml
index c4a0201e..2f678d7c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,7 +85,8 @@
<junit.jupiter.version>5.9.1</junit.jupiter.version>
<logback.version>1.2.10</logback.version>
<maven.version>3.8.7</maven.version>
- <maven.resolver.version>1.7.3</maven.resolver.version>
+ <maven.resolver.version>1.8.2</maven.resolver.version>
+ <maven.wagon.version>3.5.3</maven.wagon.version>
<slf4j.version>1.7.35</slf4j.version>
<sisu.version>0.3.5</sisu.version>
[maven-mvnd] 27/28: Upgrade to maven 3.8.7
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit a31a080948790473d27dd41c36d653b8f89df61f
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Fri Jan 6 14:10:24 2023 +0100
Upgrade to maven 3.8.7
---
dist/src/main/provisio/maven-distro.xml | 2 +-
pom.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dist/src/main/provisio/maven-distro.xml b/dist/src/main/provisio/maven-distro.xml
index 06b42810..56c8b68d 100644
--- a/dist/src/main/provisio/maven-distro.xml
+++ b/dist/src/main/provisio/maven-distro.xml
@@ -20,7 +20,7 @@
<artifactSet to="/mvn">
<artifact id="org.apache.maven:apache-maven:tar.gz:bin">
<unpack useRoot="false"
- excludes="lib/*slf4j*,conf/logging/*,lib/maven-slf4j-provider*,bin/mvn*,lib/jansi-*.jar,lib/jansi-native/*,lib/maven-resolver-api-*,lib/maven-resolver-impl-*,lib/maven-resolver-spi-*,lib/maven-resolver-util-*,lib/maven-resolver-connector-*,lib/maven-resolver-transport-*"/>
+ excludes="lib/*slf4j*,conf/logging/*,lib/maven-slf4j-provider*,bin/mvn*,lib/jansi-*.jar,lib/jansi-native/*,lib/maven-resolver-api-*,lib/maven-resolver-impl-*,lib/maven-resolver-spi-*,lib/maven-resolver-util-*,lib/maven-resolver-connector-*,lib/maven-resolver-transport-*,lib/plexus-utils-*,lib/wagon-provider-api-*"/>
</artifact>
</artifactSet>
diff --git a/pom.xml b/pom.xml
index 0057b0ad..c4a0201e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,7 +84,7 @@
<jline.version>3.21.0</jline.version>
<junit.jupiter.version>5.9.1</junit.jupiter.version>
<logback.version>1.2.10</logback.version>
- <maven.version>3.8.6</maven.version>
+ <maven.version>3.8.7</maven.version>
<maven.resolver.version>1.7.3</maven.resolver.version>
<slf4j.version>1.7.35</slf4j.version>
<sisu.version>0.3.5</sisu.version>
[maven-mvnd] 10/28: Update ITs to recent maven plugins (#744)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 60de2a84b99b098e81430f3e8db059b04af92343
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Wed Nov 23 14:49:28 2022 +0100
Update ITs to recent maven plugins (#744)
* Switch ITs to surefire 3.0.0-M7
* Upgrade other plugins in ITs
* Upgrade quarkus and jandex
---
.../src/test/projects/concurrent-downloads/pom.xml | 10 +++++-----
integration-tests/src/test/projects/daemon-crash/pom.xml | 10 +++++-----
integration-tests/src/test/projects/delete-repo/pom.xml | 10 +++++-----
integration-tests/src/test/projects/dup-ga/pom.xml | 10 +++++-----
integration-tests/src/test/projects/exec-output/pom.xml | 12 ++++++------
integration-tests/src/test/projects/forked/pom.xml | 10 +++++-----
integration-tests/src/test/projects/invoker/pom.xml | 10 +++++-----
.../test/projects/invoker/src/it/invoke-hello/pom.xml | 10 +++++-----
.../src/test/projects/junit-platform/pom.xml | 12 ++++++------
.../src/test/projects/module-and-plugin/pom.xml | 10 +++++-----
integration-tests/src/test/projects/multi-lookup/pom.xml | 10 +++++-----
integration-tests/src/test/projects/multi-module/pom.xml | 10 +++++-----
.../src/test/projects/new-managed-module/changes/pom.xml | 10 +++++-----
.../src/test/projects/new-managed-module/parent/pom.xml | 10 +++++-----
.../test/projects/resident-extensions/project1/pom.xml | 10 +++++-----
.../test/projects/resident-extensions/project2/pom.xml | 10 +++++-----
.../src/test/projects/single-module/pom.xml | 10 +++++-----
.../src/test/projects/type-description/pom.xml | 16 ++++++++--------
.../test/projects/upgrades-in-bom/hello-0.0.1/pom.xml | 10 +++++-----
.../upgrades-in-bom/hello-0.0.2-SNAPSHOT/pom.xml | 10 +++++-----
.../src/test/projects/upgrades-in-bom/parent/pom.xml | 10 +++++-----
21 files changed, 110 insertions(+), 110 deletions(-)
diff --git a/integration-tests/src/test/projects/concurrent-downloads/pom.xml b/integration-tests/src/test/projects/concurrent-downloads/pom.xml
index d2cdfbbb..69a30802 100644
--- a/integration-tests/src/test/projects/concurrent-downloads/pom.xml
+++ b/integration-tests/src/test/projects/concurrent-downloads/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<modules>
diff --git a/integration-tests/src/test/projects/daemon-crash/pom.xml b/integration-tests/src/test/projects/daemon-crash/pom.xml
index 173b6efa..a5171c31 100644
--- a/integration-tests/src/test/projects/daemon-crash/pom.xml
+++ b/integration-tests/src/test/projects/daemon-crash/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<modules>
diff --git a/integration-tests/src/test/projects/delete-repo/pom.xml b/integration-tests/src/test/projects/delete-repo/pom.xml
index 879cf5db..72fa980e 100644
--- a/integration-tests/src/test/projects/delete-repo/pom.xml
+++ b/integration-tests/src/test/projects/delete-repo/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<dependencies>
diff --git a/integration-tests/src/test/projects/dup-ga/pom.xml b/integration-tests/src/test/projects/dup-ga/pom.xml
index f2583c3f..9e925126 100644
--- a/integration-tests/src/test/projects/dup-ga/pom.xml
+++ b/integration-tests/src/test/projects/dup-ga/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<modules>
diff --git a/integration-tests/src/test/projects/exec-output/pom.xml b/integration-tests/src/test/projects/exec-output/pom.xml
index a669f075..13d0a7f0 100644
--- a/integration-tests/src/test/projects/exec-output/pom.xml
+++ b/integration-tests/src/test/projects/exec-output/pom.xml
@@ -29,12 +29,12 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
- <exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
+ <exec-maven-plugin.version>3.1.0</exec-maven-plugin.version>
</properties>
<build>
diff --git a/integration-tests/src/test/projects/forked/pom.xml b/integration-tests/src/test/projects/forked/pom.xml
index 6fe5e08e..07429469 100644
--- a/integration-tests/src/test/projects/forked/pom.xml
+++ b/integration-tests/src/test/projects/forked/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<modules>
diff --git a/integration-tests/src/test/projects/invoker/pom.xml b/integration-tests/src/test/projects/invoker/pom.xml
index c3442cec..f65cc1a1 100644
--- a/integration-tests/src/test/projects/invoker/pom.xml
+++ b/integration-tests/src/test/projects/invoker/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<dependencies>
diff --git a/integration-tests/src/test/projects/invoker/src/it/invoke-hello/pom.xml b/integration-tests/src/test/projects/invoker/src/it/invoke-hello/pom.xml
index c70ef80b..bb7d67e5 100644
--- a/integration-tests/src/test/projects/invoker/src/it/invoke-hello/pom.xml
+++ b/integration-tests/src/test/projects/invoker/src/it/invoke-hello/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<dependencies>
diff --git a/integration-tests/src/test/projects/junit-platform/pom.xml b/integration-tests/src/test/projects/junit-platform/pom.xml
index f54bac2b..b107ad75 100644
--- a/integration-tests/src/test/projects/junit-platform/pom.xml
+++ b/integration-tests/src/test/projects/junit-platform/pom.xml
@@ -29,12 +29,12 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
- <exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
+ <exec-maven-plugin.version>3.1.0</exec-maven-plugin.version>
</properties>
<dependencies>
diff --git a/integration-tests/src/test/projects/module-and-plugin/pom.xml b/integration-tests/src/test/projects/module-and-plugin/pom.xml
index 4f27874a..de27a98c 100644
--- a/integration-tests/src/test/projects/module-and-plugin/pom.xml
+++ b/integration-tests/src/test/projects/module-and-plugin/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<modules>
diff --git a/integration-tests/src/test/projects/multi-lookup/pom.xml b/integration-tests/src/test/projects/multi-lookup/pom.xml
index df279514..df286222 100644
--- a/integration-tests/src/test/projects/multi-lookup/pom.xml
+++ b/integration-tests/src/test/projects/multi-lookup/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<modules>
diff --git a/integration-tests/src/test/projects/multi-module/pom.xml b/integration-tests/src/test/projects/multi-module/pom.xml
index 2d3dd872..d90de1e1 100644
--- a/integration-tests/src/test/projects/multi-module/pom.xml
+++ b/integration-tests/src/test/projects/multi-module/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<modules>
diff --git a/integration-tests/src/test/projects/new-managed-module/changes/pom.xml b/integration-tests/src/test/projects/new-managed-module/changes/pom.xml
index 50440e9a..ffbac13e 100644
--- a/integration-tests/src/test/projects/new-managed-module/changes/pom.xml
+++ b/integration-tests/src/test/projects/new-managed-module/changes/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<modules>
diff --git a/integration-tests/src/test/projects/new-managed-module/parent/pom.xml b/integration-tests/src/test/projects/new-managed-module/parent/pom.xml
index 1a25cce5..2a8da6b7 100644
--- a/integration-tests/src/test/projects/new-managed-module/parent/pom.xml
+++ b/integration-tests/src/test/projects/new-managed-module/parent/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<modules>
diff --git a/integration-tests/src/test/projects/resident-extensions/project1/pom.xml b/integration-tests/src/test/projects/resident-extensions/project1/pom.xml
index d207a037..bc0c4d73 100644
--- a/integration-tests/src/test/projects/resident-extensions/project1/pom.xml
+++ b/integration-tests/src/test/projects/resident-extensions/project1/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<dependencies>
diff --git a/integration-tests/src/test/projects/resident-extensions/project2/pom.xml b/integration-tests/src/test/projects/resident-extensions/project2/pom.xml
index 7b4a1a90..3ba5e460 100644
--- a/integration-tests/src/test/projects/resident-extensions/project2/pom.xml
+++ b/integration-tests/src/test/projects/resident-extensions/project2/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<dependencies>
diff --git a/integration-tests/src/test/projects/single-module/pom.xml b/integration-tests/src/test/projects/single-module/pom.xml
index a0615543..7046a1fb 100644
--- a/integration-tests/src/test/projects/single-module/pom.xml
+++ b/integration-tests/src/test/projects/single-module/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<dependencies>
diff --git a/integration-tests/src/test/projects/type-description/pom.xml b/integration-tests/src/test/projects/type-description/pom.xml
index 4db4e744..07d27599 100644
--- a/integration-tests/src/test/projects/type-description/pom.xml
+++ b/integration-tests/src/test/projects/type-description/pom.xml
@@ -42,17 +42,17 @@
<tar.long.file.mode>gnu</tar.long.file.mode>
<!-- Quarkus Version -->
- <quarkus.version>2.3.1.Final</quarkus.version>
+ <quarkus.version>2.14.1.Final</quarkus.version>
<!-- Jandex -->
- <jandex.version>1.0.8</jandex.version>
+ <jandex.version>3.0.3</jandex.version>
<!-- Plugin Versions -->
- <version.compiler.plugin>3.8.1</version.compiler.plugin>
- <version.surefire.plugin>2.22.2</version.surefire.plugin>
- <version.dependency.plugin>3.1.2</version.dependency.plugin>
- <version.assembly.plugin>3.3.0</version.assembly.plugin>
- <version.resources.plugin>3.2.0</version.resources.plugin>
+ <version.compiler.plugin>3.10.1</version.compiler.plugin>
+ <version.surefire.plugin>3.0.0-M7</version.surefire.plugin>
+ <version.dependency.plugin>3.3.0</version.dependency.plugin>
+ <version.assembly.plugin>3.4.2</version.assembly.plugin>
+ <version.resources.plugin>3.3.0</version.resources.plugin>
</properties>
<dependencyManagement>
@@ -85,7 +85,7 @@
<version>${version.surefire.plugin}</version>
</plugin>
<plugin>
- <groupId>org.jboss.jandex</groupId>
+ <groupId>io.smallrye</groupId>
<artifactId>jandex-maven-plugin</artifactId>
<version>${jandex.version}</version>
<executions>
diff --git a/integration-tests/src/test/projects/upgrades-in-bom/hello-0.0.1/pom.xml b/integration-tests/src/test/projects/upgrades-in-bom/hello-0.0.1/pom.xml
index d9e84977..bd4018dc 100644
--- a/integration-tests/src/test/projects/upgrades-in-bom/hello-0.0.1/pom.xml
+++ b/integration-tests/src/test/projects/upgrades-in-bom/hello-0.0.1/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<build>
diff --git a/integration-tests/src/test/projects/upgrades-in-bom/hello-0.0.2-SNAPSHOT/pom.xml b/integration-tests/src/test/projects/upgrades-in-bom/hello-0.0.2-SNAPSHOT/pom.xml
index 3ce3c836..0011085e 100644
--- a/integration-tests/src/test/projects/upgrades-in-bom/hello-0.0.2-SNAPSHOT/pom.xml
+++ b/integration-tests/src/test/projects/upgrades-in-bom/hello-0.0.2-SNAPSHOT/pom.xml
@@ -29,11 +29,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<build>
diff --git a/integration-tests/src/test/projects/upgrades-in-bom/parent/pom.xml b/integration-tests/src/test/projects/upgrades-in-bom/parent/pom.xml
index f4fe8692..56139d7a 100644
--- a/integration-tests/src/test/projects/upgrades-in-bom/parent/pom.xml
+++ b/integration-tests/src/test/projects/upgrades-in-bom/parent/pom.xml
@@ -30,11 +30,11 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
- <maven-clean-plugin.version>2.5</maven-clean-plugin.version>
- <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
- <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
+ <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
+ <maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
</properties>
<modules>
[maven-mvnd] 15/28: Build mostly static native image, loose linux glibc requirement to 2.12 (#730)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 1ab67841d20d390801c3427dfbf5a9a0b7949d2b
Author: James Z.M. Gao <ga...@360.cn>
AuthorDate: Wed Dec 14 06:01:31 2022 +0800
Build mostly static native image, loose linux glibc requirement to 2.12 (#730)
---
.github/workflows/early-access.yaml | 19 ++++++++++++++-
.github/workflows/release.yaml | 19 ++++++++++++++-
client/pom.xml | 47 ++++++++++++++++++++++++++++++-------
3 files changed, 75 insertions(+), 10 deletions(-)
diff --git a/.github/workflows/early-access.yaml b/.github/workflows/early-access.yaml
index 3715c969..865331c8 100644
--- a/.github/workflows/early-access.yaml
+++ b/.github/workflows/early-access.yaml
@@ -57,8 +57,25 @@ jobs:
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
+ - name: 'Maven clean'
+ run: ./mvnw clean -Dmrm=false -B -ntp -e
+
+ - name: 'Patch Graal libs for only requiring glibc 2.12'
+ shell: bash
+ run: |
+ if [[ $OS == linux ]] && [[ $GRAALVM_HOME ]] && [[ -d "$GRAALVM_HOME/lib/static/linux-amd64/glibc" ]]; then
+ mkdir -p client/target/graalvm-libs-for-glibc-2.12
+ echo "memcpy memcpy@GLIBC_2.2.5" >client/target/glibc.redef
+ echo "posix_spawn posix_spawn@GLIBC_2.2.5" >>client/target/glibc.redef
+ find "$GRAALVM_HOME/lib/static/linux-amd64/glibc" -name '*.a' | while IFS= read -r input; do
+ output="client/target/graalvm-libs-for-glibc-2.12/$(basename -- "$input")"
+ objcopy --redefine-syms=client/target/glibc.redef -- "$input" "$output" 2>/dev/null
+ done
+ find /usr/lib -name libz.a | xargs -r -I {} objcopy --redefine-syms=client/target/glibc.redef {} client/target/graalvm-libs-for-glibc-2.12/libz.a
+ fi
+
- name: 'Build native distribution'
- run: ./mvnw clean verify -Pnative -Dmrm=false -B -ntp -e
+ run: ./mvnw verify -Pnative -Dmrm=false -B -ntp -e
- name: 'Upload daemon test logs'
if: always()
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 6b1c9063..3e0590e1 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -58,8 +58,25 @@ jobs:
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
+ - name: 'Maven clean'
+ run: ./mvnw clean -Dmrm=false -B -ntp -e
+
+ - name: 'Patch Graal libs for only requiring glibc 2.12'
+ shell: bash
+ run: |
+ if [[ $OS == linux ]] && [[ $GRAALVM_HOME ]] && [[ -d "$GRAALVM_HOME/lib/static/linux-amd64/glibc" ]]; then
+ mkdir -p client/target/graalvm-libs-for-glibc-2.12
+ echo "memcpy memcpy@GLIBC_2.2.5" >client/target/glibc.redef
+ echo "posix_spawn posix_spawn@GLIBC_2.2.5" >>client/target/glibc.redef
+ find "$GRAALVM_HOME/lib/static/linux-amd64/glibc" -name '*.a' | while IFS= read -r input; do
+ output="client/target/graalvm-libs-for-glibc-2.12/$(basename -- "$input")"
+ objcopy --redefine-syms=client/target/glibc.redef -- "$input" "$output" 2>/dev/null
+ done
+ find /usr/lib -name libz.a | xargs -r -I {} objcopy --redefine-syms=client/target/glibc.redef {} client/target/graalvm-libs-for-glibc-2.12/libz.a
+ fi
+
- name: 'Build native distribution'
- run: ./mvnw clean verify -Pnative -Dmrm=false -B -ntp -e -DskipTests
+ run: ./mvnw verify -Pnative -Dmrm=false -B -ntp -e -DskipTests
- name: 'Upload artifact'
uses: actions/upload-artifact@v2
diff --git a/client/pom.xml b/client/pom.xml
index efc003a5..2c370fb2 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -33,6 +33,8 @@
<properties>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
+ <graalvm-native-static-opt/>
+ <graalvm-native-glibc-opt/>
</properties>
<dependencies>
@@ -134,8 +136,34 @@
<profiles>
<profile>
- <id>native</id>
+ <id>enable-partial-static-native</id>
+ <activation>
+ <os>
+ <family>!mac</family>
+ </os>
+ </activation>
+ <properties>
+ <graalvm-native-static-opt>-H:+StaticExecutableWithDynamicLibC</graalvm-native-static-opt>
+ </properties>
+ </profile>
+ <profile>
+ <id>linux-image-only-require-glibc-2.12</id>
+ <activation>
+ <os>
+ <family>linux</family>
+ </os>
+ <file>
+ <exists>target/graalvm-libs-for-glibc-2.12</exists>
+ </file>
+ </activation>
+ <properties>
+ <graalvm-native-glibc-opt>-H:CLibraryPath=${project.build.directory}/graalvm-libs-for-glibc-2.12</graalvm-native-glibc-opt>
+ </properties>
+ </profile>
+
+ <profile>
+ <id>native</id>
<build>
<plugins>
<plugin>
@@ -146,13 +174,16 @@
<mainClass>org.mvndaemon.mvnd.client.DefaultClient</mainClass>
<imageName>mvnd</imageName>
<buildArgs>--no-server
- --no-fallback
- --allow-incomplete-classpath
- -H:IncludeResources=org/mvndaemon/mvnd/.*
- -H:IncludeResources=mvnd-bash-completion.bash
- -H:-ParseRuntimeOptions
- -H:+AddAllCharsets
- -ea</buildArgs>
+ --no-fallback
+ --allow-incomplete-classpath
+ ${graalvm-native-static-opt}
+ ${graalvm-native-glibc-opt}
+ -H:IncludeResources=org/mvndaemon/mvnd/.*
+ -H:IncludeResources=mvnd-bash-completion.bash
+ -H:-ParseRuntimeOptions
+ -H:+AddAllCharsets
+ -H:+ReportExceptionStackTraces
+ -ea</buildArgs>
</configuration>
<executions>
<execution>
[maven-mvnd] 26/28: Typo
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit e9fd7ee0328e04cac6c0c752ed1357835a2638d2
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Fri Jan 6 13:22:11 2023 +0100
Typo
---
dist/src/main/distro/conf/mvnd.properties | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dist/src/main/distro/conf/mvnd.properties b/dist/src/main/distro/conf/mvnd.properties
index 9504b098..d528002e 100644
--- a/dist/src/main/distro/conf/mvnd.properties
+++ b/dist/src/main/distro/conf/mvnd.properties
@@ -53,7 +53,7 @@
# MVND_LOG_PURGE_PERIOD
# The automatic log purge period.
#
-#mvnd.logPurgePeriod = 7d
+# mvnd.logPurgePeriod = 7d
# MVND_NO_DAEMON
# Property to disable using a daemon (usefull for debugging, and only available in non native mode).
@@ -67,7 +67,7 @@
# mvnd.debug = false
# MVND_IDLE_TIMEOUT
-# Duration after which an usused daemon will shut down.
+# Duration after which an unused daemon will shut down.
#
# mvnd.idleTimeout = 3 hours
[maven-mvnd] 25/28: Upgrade to maven parent 39 and reformat accordingly
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 4e6a1e837c920ddd98d81bc919e27f9743075c12
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Fri Jan 6 13:56:26 2023 +0100
Upgrade to maven parent 39 and reformat accordingly
# Conflicts:
# daemon/src/main/java/org/apache/maven/project/CachingProjectBuilder.java
# daemon/src/main/java/org/mvndaemon/mvnd/plugin/CachingPluginVersionResolver.java
# daemon/src/main/java/org/mvndaemon/mvnd/syncontext/DaemonNamedLockFactoryAdapterFactoryImpl.java
---
.../main/java/org/mvndaemon/mvnd/plugin/doc/DocMojo.java | 1 +
client/pom.xml | 4 ++--
.../src/main/java/org/mvndaemon/mvnd/client/Client.java | 1 +
.../mvndaemon/mvnd/client/DaemonClientConnection.java | 1 +
.../java/org/mvndaemon/mvnd/client/DaemonConnector.java | 7 ++++---
.../java/org/mvndaemon/mvnd/client/DaemonParameters.java | 1 +
.../mvndaemon/mvnd/client/CompletionGeneratorTest.java | 1 +
.../org/mvndaemon/mvnd/client/DaemonConnectorTest.java | 4 ++--
.../java/org/mvndaemon/mvnd/client/EnvironmentTest.java | 5 +++--
.../java/org/mvndaemon/mvnd/common/DaemonConnection.java | 1 +
.../main/java/org/mvndaemon/mvnd/common/DaemonInfo.java | 4 ++--
.../java/org/mvndaemon/mvnd/common/DaemonRegistry.java | 7 ++++---
.../main/java/org/mvndaemon/mvnd/common/OptionType.java | 1 +
.../src/main/java/org/mvndaemon/mvnd/common/OsUtils.java | 1 +
.../org/mvndaemon/mvnd/common/logging/ClientOutput.java | 1 +
.../mvndaemon/mvnd/common/logging/TerminalOutput.java | 1 +
.../org/mvndaemon/mvnd/common/DaemonRegistryTest.java | 9 +++++----
.../test/java/org/mvndaemon/mvnd/common/MessageTest.java | 9 +++++----
.../java/org/mvndaemon/mvnd/common/SocketFamilyTest.java | 5 +++--
.../java/org/mvndaemon/mvnd/common/TimeUtilsTest.java | 5 +++--
.../apache/maven/classrealm/MvndClassRealmManager.java | 8 +++++---
.../main/java/org/apache/maven/cli/DaemonMavenCli.java | 9 +++++----
.../java/org/apache/maven/cli/MvndHelpFormatter.java | 1 +
.../org/apache/maven/project/CachingProjectBuilder.java | 8 +++++---
.../java/org/mvndaemon/mvnd/builder/DependencyGraph.java | 1 +
.../org/mvndaemon/mvnd/builder/ProjectComparator.java | 1 +
.../mvndaemon/mvnd/builder/ProjectExecutorService.java | 1 +
.../org/mvndaemon/mvnd/builder/ReactorBuildQueue.java | 1 +
.../org/mvndaemon/mvnd/builder/ReactorBuildStats.java | 3 ++-
.../java/org/mvndaemon/mvnd/builder/SmartBuilder.java | 8 +++++---
.../org/mvndaemon/mvnd/builder/SmartBuilderImpl.java | 1 +
.../mvndaemon/mvnd/cache/impl/DefaultCacheFactory.java | 1 +
.../mvndaemon/mvnd/cache/impl/TimestampCacheFactory.java | 1 +
.../mvnd/cache/impl/WatchServiceCacheFactory.java | 1 +
.../invalidating/InvalidatingExtensionRealmCache.java | 8 +++++---
.../invalidating/InvalidatingPluginArtifactsCache.java | 8 +++++---
.../invalidating/InvalidatingPluginDescriptorCache.java | 8 +++++---
.../cache/invalidating/InvalidatingPluginRealmCache.java | 8 +++++---
.../invalidating/InvalidatingProjectArtifactsCache.java | 8 +++++---
.../invalidating/InvalidatingRealmCacheEventSpy.java | 8 +++++---
.../src/main/java/org/mvndaemon/mvnd/cli/EnvHelper.java | 1 +
.../java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java | 1 +
.../main/java/org/mvndaemon/mvnd/daemon/Connection.java | 1 +
.../java/org/mvndaemon/mvnd/daemon/DaemonExpiration.java | 16 +++++++++-------
.../src/main/java/org/mvndaemon/mvnd/daemon/Server.java | 13 +++++++------
.../mvnd/execution/BuildResumptionAnalyzer.java | 1 +
.../mvnd/execution/DefaultBuildResumptionAnalyzer.java | 6 ++++--
.../execution/DefaultBuildResumptionDataRepository.java | 6 ++++--
.../org/mvndaemon/mvnd/interactivity/DaemonPrompter.java | 4 +++-
.../mvnd/logging/smart/LoggingExecutionListener.java | 1 +
.../mvnd/logging/smart/ProjectBuildLogAppender.java | 3 ++-
.../mvnd/plugin/CachingPluginVersionResolver.java | 6 ++++--
.../org/mvndaemon/mvnd/plugin/CliMavenPluginManager.java | 8 +++++---
.../mvnd/plugin/ValidatingConfigurationListener.java | 1 +
.../org/mvndaemon/mvnd/timing/BuildTimeEventSpy.java | 6 ++++--
.../mvndaemon/mvnd/builder/AbstractSmartBuilderTest.java | 1 +
.../java/org/mvndaemon/mvnd/builder/DagWidthTest.java | 5 +++--
.../mvndaemon/mvnd/builder/ProjectComparatorTest.java | 5 +++--
.../mvnd/builder/ProjectExecutorServiceTest.java | 7 ++++---
.../mvnd/builder/TestProjectDependencyGraph.java | 5 +++--
.../org/mvndaemon/mvnd/cache/impl/CacheFactoryTest.java | 1 +
.../test/java/org/mvndaemon/mvnd/cli/EnvHelperTest.java | 7 ++++---
.../test/java/org/mvndaemon/mvnd/daemon/ServerTest.java | 5 +++--
.../mvndaemon/mvnd/assertj/MatchInOrderAmongOthers.java | 1 +
.../org/mvndaemon/mvnd/assertj/TestClientOutput.java | 1 +
.../mvnd/it/AttachedArtifactResolutionTest.java | 1 +
.../java/org/mvndaemon/mvnd/it/BootstrapPluginTest.java | 6 ++++--
.../java/org/mvndaemon/mvnd/it/CompletionNativeIT.java | 4 +++-
.../org/mvndaemon/mvnd/it/ConcurrentDownloadsTest.java | 6 ++++--
.../test/java/org/mvndaemon/mvnd/it/DaemonCrashTest.java | 6 ++++--
.../java/org/mvndaemon/mvnd/it/DeleteRepoNativeIT.java | 4 +++-
.../src/test/java/org/mvndaemon/mvnd/it/DistroIT.java | 1 +
.../src/test/java/org/mvndaemon/mvnd/it/DupGATest.java | 4 +++-
.../test/java/org/mvndaemon/mvnd/it/EnvironmentTest.java | 6 ++++--
.../test/java/org/mvndaemon/mvnd/it/ExecOutputTest.java | 6 ++++--
.../java/org/mvndaemon/mvnd/it/ExtensionsNativeIT.java | 6 ++++--
.../src/test/java/org/mvndaemon/mvnd/it/ForkedTest.java | 6 ++++--
.../test/java/org/mvndaemon/mvnd/it/InteractiveTest.java | 4 +++-
.../test/java/org/mvndaemon/mvnd/it/InvokerNativeIT.java | 4 +++-
.../java/org/mvndaemon/mvnd/it/JUnitPlatformTest.java | 5 +++--
.../java/org/mvndaemon/mvnd/it/MavenConfNativeIT.java | 6 ++++--
.../test/java/org/mvndaemon/mvnd/it/MaxHeapNativeIT.java | 5 +++--
.../org/mvndaemon/mvnd/it/ModuleAndPluginNativeIT.java | 4 +++-
.../test/java/org/mvndaemon/mvnd/it/MultiLookupTest.java | 4 +++-
.../test/java/org/mvndaemon/mvnd/it/MultiModuleTest.java | 4 +++-
.../test/java/org/mvndaemon/mvnd/it/MvndTestUtil.java | 1 +
.../org/mvndaemon/mvnd/it/NewManagedModuleNativeIT.java | 4 +++-
.../org/mvndaemon/mvnd/it/ParentWithPropertyTest.java | 4 +++-
.../test/java/org/mvndaemon/mvnd/it/RawStreamsTest.java | 6 ++++--
.../org/mvndaemon/mvnd/it/ResidentExtensionsTest.java | 8 +++++---
.../java/org/mvndaemon/mvnd/it/SingleModuleNativeIT.java | 4 +++-
.../java/org/mvndaemon/mvnd/it/SingleModuleTest.java | 1 +
.../java/org/mvndaemon/mvnd/it/SpecificFileNativeIT.java | 6 ++++--
.../test/java/org/mvndaemon/mvnd/it/StopStatusTest.java | 4 +++-
.../java/org/mvndaemon/mvnd/it/ThreadOptionNativeIT.java | 4 +++-
.../java/org/mvndaemon/mvnd/it/TypeDescriptionTest.java | 4 +++-
.../org/mvndaemon/mvnd/it/UpgradesInBomNativeIT.java | 4 +++-
.../test/java/org/mvndaemon/mvnd/it/VersionNativeIT.java | 4 +++-
.../java/org/mvndaemon/mvnd/junit/JvmTestClient.java | 1 +
.../java/org/mvndaemon/mvnd/junit/MvndNativeTest.java | 1 +
.../src/test/java/org/mvndaemon/mvnd/junit/MvndTest.java | 1 +
.../java/org/mvndaemon/mvnd/junit/MvndTestExtension.java | 5 +++--
.../java/org/mvndaemon/mvnd/junit/NativeTestClient.java | 1 +
.../java/org/mvndaemon/mvnd/junit/TestParameters.java | 1 +
.../test/java/org/mvndaemon/mvnd/junit/TestRegistry.java | 1 +
.../test/java/org/mvndaemon/mvnd/nativ/CLibraryTest.java | 7 ++++---
pom.xml | 4 ++--
107 files changed, 294 insertions(+), 148 deletions(-)
diff --git a/build-plugin/src/main/java/org/mvndaemon/mvnd/plugin/doc/DocMojo.java b/build-plugin/src/main/java/org/mvndaemon/mvnd/plugin/doc/DocMojo.java
index 5a660b8a..891e9d82 100644
--- a/build-plugin/src/main/java/org/mvndaemon/mvnd/plugin/doc/DocMojo.java
+++ b/build-plugin/src/main/java/org/mvndaemon/mvnd/plugin/doc/DocMojo.java
@@ -33,6 +33,7 @@ import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
+
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
diff --git a/client/pom.xml b/client/pom.xml
index 0bf6ed9f..b34f3f2f 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -32,8 +32,8 @@
<properties>
<maven.compiler.release>11</maven.compiler.release>
- <graalvm-native-static-opt/>
- <graalvm-native-glibc-opt/>
+ <graalvm-native-static-opt />
+ <graalvm-native-glibc-opt />
</properties>
<dependencies>
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/Client.java b/client/src/main/java/org/mvndaemon/mvnd/client/Client.java
index 8f82b4e0..15b2f97d 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/Client.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/Client.java
@@ -20,6 +20,7 @@ package org.mvndaemon.mvnd.client;
import java.util.Arrays;
import java.util.List;
+
import org.mvndaemon.mvnd.common.logging.ClientOutput;
public interface Client {
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonClientConnection.java b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonClientConnection.java
index 24e5875e..5ae288c7 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonClientConnection.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonClientConnection.java
@@ -29,6 +29,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
+
import org.mvndaemon.mvnd.common.DaemonConnection;
import org.mvndaemon.mvnd.common.DaemonException;
import org.mvndaemon.mvnd.common.DaemonException.ConnectException;
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java
index 8b867176..cd5f416d 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java
@@ -18,9 +18,6 @@
*/
package org.mvndaemon.mvnd.client;
-import static java.lang.Thread.sleep;
-import static org.mvndaemon.mvnd.common.DaemonState.Canceled;
-
import java.io.File;
import java.io.IOException;
import java.net.InetSocketAddress;
@@ -45,6 +42,7 @@ import java.util.Scanner;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
+
import org.mvndaemon.mvnd.common.DaemonCompatibilitySpec;
import org.mvndaemon.mvnd.common.DaemonCompatibilitySpec.Result;
import org.mvndaemon.mvnd.common.DaemonConnection;
@@ -62,6 +60,9 @@ import org.mvndaemon.mvnd.common.logging.ClientOutput;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static java.lang.Thread.sleep;
+import static org.mvndaemon.mvnd.common.DaemonState.Canceled;
+
/**
* File origin:
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/client/DefaultDaemonConnector.java
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java
index e81335e7..e6c6a4ec 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java
@@ -40,6 +40,7 @@ import java.util.function.IntUnaryOperator;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+
import org.apache.maven.cli.internal.extension.model.CoreExtension;
import org.apache.maven.cli.internal.extension.model.io.xpp3.CoreExtensionsXpp3Reader;
import org.codehaus.plexus.util.StringUtils;
diff --git a/client/src/test/java/org/mvndaemon/mvnd/client/CompletionGeneratorTest.java b/client/src/test/java/org/mvndaemon/mvnd/client/CompletionGeneratorTest.java
index 1f5f4afb..a6f3c567 100644
--- a/client/src/test/java/org/mvndaemon/mvnd/client/CompletionGeneratorTest.java
+++ b/client/src/test/java/org/mvndaemon/mvnd/client/CompletionGeneratorTest.java
@@ -27,6 +27,7 @@ import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.common.Environment;
import org.mvndaemon.mvnd.common.Environment.OptionOrigin;
diff --git a/client/src/test/java/org/mvndaemon/mvnd/client/DaemonConnectorTest.java b/client/src/test/java/org/mvndaemon/mvnd/client/DaemonConnectorTest.java
index 2e28d084..d7b74c30 100644
--- a/client/src/test/java/org/mvndaemon/mvnd/client/DaemonConnectorTest.java
+++ b/client/src/test/java/org/mvndaemon/mvnd/client/DaemonConnectorTest.java
@@ -18,11 +18,11 @@
*/
package org.mvndaemon.mvnd.client;
+import org.junit.jupiter.api.Test;
+
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
-import org.junit.jupiter.api.Test;
-
public class DaemonConnectorTest {
@Test
diff --git a/client/src/test/java/org/mvndaemon/mvnd/client/EnvironmentTest.java b/client/src/test/java/org/mvndaemon/mvnd/client/EnvironmentTest.java
index 0d14670d..31de5b1a 100644
--- a/client/src/test/java/org/mvndaemon/mvnd/client/EnvironmentTest.java
+++ b/client/src/test/java/org/mvndaemon/mvnd/client/EnvironmentTest.java
@@ -18,8 +18,6 @@
*/
package org.mvndaemon.mvnd.client;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
@@ -27,12 +25,15 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
+
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.client.DaemonParameters.EnvValue;
import org.mvndaemon.mvnd.client.DaemonParameters.ValueSource;
import org.mvndaemon.mvnd.common.Environment;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
public class EnvironmentTest {
@Test
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonConnection.java b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonConnection.java
index ba79896e..80e61db4 100755
--- a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonConnection.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonConnection.java
@@ -34,6 +34,7 @@ import java.nio.channels.SocketChannel;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonInfo.java b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonInfo.java
index 3d435a97..eb86ef45 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonInfo.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonInfo.java
@@ -18,11 +18,11 @@
*/
package org.mvndaemon.mvnd.common;
+import java.util.List;
+
import static org.mvndaemon.mvnd.common.DaemonState.Busy;
import static org.mvndaemon.mvnd.common.DaemonState.Idle;
-import java.util.List;
-
/**
* File origin:
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/registry/DaemonInfo.java
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonRegistry.java b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonRegistry.java
index 449e3f1a..4b81f8ce 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonRegistry.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonRegistry.java
@@ -18,9 +18,6 @@
*/
package org.mvndaemon.mvnd.common;
-import static org.mvndaemon.mvnd.common.DaemonState.Canceled;
-import static org.mvndaemon.mvnd.common.DaemonState.Idle;
-
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.nio.BufferOverflowException;
@@ -42,9 +39,13 @@ import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static org.mvndaemon.mvnd.common.DaemonState.Canceled;
+import static org.mvndaemon.mvnd.common.DaemonState.Idle;
+
/**
* Access to daemon registry files. Useful also for testing.
*
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/OptionType.java b/common/src/main/java/org/mvndaemon/mvnd/common/OptionType.java
index 9f73fdec..717f0587 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/OptionType.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/OptionType.java
@@ -23,6 +23,7 @@ import java.io.InputStream;
import java.util.Comparator;
import java.util.Properties;
import java.util.stream.Stream;
+
import org.mvndaemon.mvnd.common.Environment.DocumentedEnumEntry;
public enum OptionType {
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/OsUtils.java b/common/src/main/java/org/mvndaemon/mvnd/common/OsUtils.java
index 45ae8826..39d685f1 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/OsUtils.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/OsUtils.java
@@ -29,6 +29,7 @@ import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/logging/ClientOutput.java b/common/src/main/java/org/mvndaemon/mvnd/common/logging/ClientOutput.java
index 0d1425a4..04119ef5 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/logging/ClientOutput.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/logging/ClientOutput.java
@@ -20,6 +20,7 @@ package org.mvndaemon.mvnd.common.logging;
import java.util.List;
import java.util.function.Consumer;
+
import org.mvndaemon.mvnd.common.Message;
/**
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java b/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java
index a7e024ef..85ad87d2 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java
@@ -38,6 +38,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.function.Consumer;
import java.util.stream.Collector;
import java.util.stream.Collectors;
+
import org.fusesource.jansi.internal.CLibrary;
import org.jline.terminal.Size;
import org.jline.terminal.Terminal;
diff --git a/common/src/test/java/org/mvndaemon/mvnd/common/DaemonRegistryTest.java b/common/src/test/java/org/mvndaemon/mvnd/common/DaemonRegistryTest.java
index 6ec7ef81..f6984e44 100644
--- a/common/src/test/java/org/mvndaemon/mvnd/common/DaemonRegistryTest.java
+++ b/common/src/test/java/org/mvndaemon/mvnd/common/DaemonRegistryTest.java
@@ -18,10 +18,6 @@
*/
package org.mvndaemon.mvnd.common;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
@@ -36,10 +32,15 @@ import java.util.List;
import java.util.Locale;
import java.util.Random;
import java.util.UUID;
+
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
public class DaemonRegistryTest {
private PrintStream oldSysErr;
diff --git a/common/src/test/java/org/mvndaemon/mvnd/common/MessageTest.java b/common/src/test/java/org/mvndaemon/mvnd/common/MessageTest.java
index 7d6fdb6b..907f8ff1 100644
--- a/common/src/test/java/org/mvndaemon/mvnd/common/MessageTest.java
+++ b/common/src/test/java/org/mvndaemon/mvnd/common/MessageTest.java
@@ -18,17 +18,18 @@
*/
package org.mvndaemon.mvnd.common;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
+
import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
public class MessageTest {
@Test
diff --git a/common/src/test/java/org/mvndaemon/mvnd/common/SocketFamilyTest.java b/common/src/test/java/org/mvndaemon/mvnd/common/SocketFamilyTest.java
index e6f9fa28..f98601c1 100644
--- a/common/src/test/java/org/mvndaemon/mvnd/common/SocketFamilyTest.java
+++ b/common/src/test/java/org/mvndaemon/mvnd/common/SocketFamilyTest.java
@@ -18,17 +18,18 @@
*/
package org.mvndaemon.mvnd.common;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.net.UnknownHostException;
+
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledForJreRange;
import org.junit.jupiter.api.condition.JRE;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
public class SocketFamilyTest {
@Test
diff --git a/common/src/test/java/org/mvndaemon/mvnd/common/TimeUtilsTest.java b/common/src/test/java/org/mvndaemon/mvnd/common/TimeUtilsTest.java
index 6c9a0831..8dc6906f 100644
--- a/common/src/test/java/org/mvndaemon/mvnd/common/TimeUtilsTest.java
+++ b/common/src/test/java/org/mvndaemon/mvnd/common/TimeUtilsTest.java
@@ -18,11 +18,12 @@
*/
package org.mvndaemon.mvnd.common;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
import java.time.Duration;
+
import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
public class TimeUtilsTest {
@Test
diff --git a/daemon/src/main/java/org/apache/maven/classrealm/MvndClassRealmManager.java b/daemon/src/main/java/org/apache/maven/classrealm/MvndClassRealmManager.java
index 90e03d18..67dea464 100644
--- a/daemon/src/main/java/org/apache/maven/classrealm/MvndClassRealmManager.java
+++ b/daemon/src/main/java/org/apache/maven/classrealm/MvndClassRealmManager.java
@@ -18,6 +18,10 @@
*/
package org.apache.maven.classrealm;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
import java.io.File;
import java.net.MalformedURLException;
import java.util.ArrayList;
@@ -29,9 +33,7 @@ import java.util.Objects;
import java.util.Random;
import java.util.Set;
import java.util.TreeMap;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
+
import org.apache.maven.artifact.ArtifactUtils;
import org.apache.maven.extension.internal.CoreExportsProvider;
import org.apache.maven.model.Model;
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 214c0196..a296b4af 100644
--- a/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java
+++ b/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java
@@ -18,10 +18,6 @@
*/
package org.apache.maven.cli;
-import static java.util.Comparator.comparing;
-import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
-
-import com.google.inject.AbstractModule;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
@@ -45,6 +41,8 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+
+import com.google.inject.AbstractModule;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.ParseException;
@@ -120,6 +118,9 @@ import org.slf4j.LoggerFactory;
import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;
+import static java.util.Comparator.comparing;
+import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
+
/**
* File origin:
* https://github.com/apache/maven/blob/maven-3.6.2/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
diff --git a/daemon/src/main/java/org/apache/maven/cli/MvndHelpFormatter.java b/daemon/src/main/java/org/apache/maven/cli/MvndHelpFormatter.java
index 68ce2ef2..271836b0 100644
--- a/daemon/src/main/java/org/apache/maven/cli/MvndHelpFormatter.java
+++ b/daemon/src/main/java/org/apache/maven/cli/MvndHelpFormatter.java
@@ -28,6 +28,7 @@ import java.util.Set;
import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+
import org.apache.commons.cli.HelpFormatter;
import org.mvndaemon.mvnd.common.Environment;
import org.mvndaemon.mvnd.common.OptionType;
diff --git a/daemon/src/main/java/org/apache/maven/project/CachingProjectBuilder.java b/daemon/src/main/java/org/apache/maven/project/CachingProjectBuilder.java
index 7b6610c8..0a9445ec 100644
--- a/daemon/src/main/java/org/apache/maven/project/CachingProjectBuilder.java
+++ b/daemon/src/main/java/org/apache/maven/project/CachingProjectBuilder.java
@@ -18,6 +18,10 @@
*/
package org.apache.maven.project;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
import java.io.File;
import java.io.IOException;
import java.util.AbstractMap;
@@ -31,9 +35,7 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
+
import org.apache.maven.RepositoryUtils;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.InvalidArtifactRTException;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/DependencyGraph.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/DependencyGraph.java
index e20aaf58..49a9d5fb 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/DependencyGraph.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/DependencyGraph.java
@@ -34,6 +34,7 @@ import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+
import org.apache.maven.execution.MavenSession;
import org.apache.maven.execution.ProjectDependencyGraph;
import org.apache.maven.project.MavenProject;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/ProjectComparator.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/ProjectComparator.java
index fee21ce0..8b3c915b 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/ProjectComparator.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/ProjectComparator.java
@@ -28,6 +28,7 @@ import java.util.Set;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Function;
import java.util.function.ToLongFunction;
+
import org.apache.maven.project.MavenProject;
/**
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/ProjectExecutorService.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/ProjectExecutorService.java
index 58f56f0b..d7dc8431 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/ProjectExecutorService.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/ProjectExecutorService.java
@@ -29,6 +29,7 @@ import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
+
import org.apache.maven.lifecycle.internal.BuildThreadFactory;
import org.apache.maven.project.MavenProject;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/ReactorBuildQueue.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/ReactorBuildQueue.java
index d4c289b3..a387c2fa 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/ReactorBuildQueue.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/ReactorBuildQueue.java
@@ -22,6 +22,7 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Stream;
+
import org.apache.maven.project.MavenProject;
/**
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/ReactorBuildStats.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/ReactorBuildStats.java
index 18d660be..1a00bb45 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/ReactorBuildStats.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/ReactorBuildStats.java
@@ -18,7 +18,6 @@
*/
package org.mvndaemon.mvnd.builder;
-import com.google.common.collect.ImmutableMap;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
@@ -30,6 +29,8 @@ import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+
+import com.google.common.collect.ImmutableMap;
import org.apache.maven.project.MavenProject;
/**
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilder.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilder.java
index fad26e32..6cbd712c 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilder.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilder.java
@@ -18,6 +18,10 @@
*/
package org.mvndaemon.mvnd.builder;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.List;
@@ -26,9 +30,7 @@ import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
+
import org.apache.maven.execution.MavenSession;
import org.apache.maven.lifecycle.internal.LifecycleModuleBuilder;
import org.apache.maven.lifecycle.internal.ProjectBuildList;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilderImpl.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilderImpl.java
index 027a66e3..81cdc6bd 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilderImpl.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilderImpl.java
@@ -24,6 +24,7 @@ import java.util.List;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
+
import org.apache.maven.execution.BuildFailure;
import org.apache.maven.execution.BuildSuccess;
import org.apache.maven.execution.BuildSummary;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/DefaultCacheFactory.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/DefaultCacheFactory.java
index 354af14d..c5751541 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/DefaultCacheFactory.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/DefaultCacheFactory.java
@@ -20,6 +20,7 @@ package org.mvndaemon.mvnd.cache.impl;
import javax.inject.Named;
import javax.inject.Singleton;
+
import org.eclipse.sisu.Priority;
import org.mvndaemon.mvnd.cache.Cache;
import org.mvndaemon.mvnd.cache.CacheFactory;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/TimestampCacheFactory.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/TimestampCacheFactory.java
index c7bf4a0a..0bb752f0 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/TimestampCacheFactory.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/TimestampCacheFactory.java
@@ -32,6 +32,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.function.BiPredicate;
import java.util.function.Function;
import java.util.stream.Collectors;
+
import org.mvndaemon.mvnd.cache.Cache;
import org.mvndaemon.mvnd.cache.CacheFactory;
import org.mvndaemon.mvnd.cache.CacheRecord;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/WatchServiceCacheFactory.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/WatchServiceCacheFactory.java
index b40c75fc..e8ab45ca 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/WatchServiceCacheFactory.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/WatchServiceCacheFactory.java
@@ -35,6 +35,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.BiPredicate;
import java.util.function.Function;
import java.util.stream.Stream;
+
import org.mvndaemon.mvnd.cache.Cache;
import org.mvndaemon.mvnd.cache.CacheFactory;
import org.mvndaemon.mvnd.cache.CacheRecord;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingExtensionRealmCache.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingExtensionRealmCache.java
index 630cdc96..8f9be623 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingExtensionRealmCache.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingExtensionRealmCache.java
@@ -18,12 +18,14 @@
*/
package org.mvndaemon.mvnd.cache.invalidating;
-import java.nio.file.Path;
-import java.util.List;
-import java.util.stream.Stream;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
+
+import java.nio.file.Path;
+import java.util.List;
+import java.util.stream.Stream;
+
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.DefaultExtensionRealmCache;
import org.apache.maven.project.ExtensionDescriptor;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginArtifactsCache.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginArtifactsCache.java
index a5be4346..4173a065 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginArtifactsCache.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginArtifactsCache.java
@@ -18,12 +18,14 @@
*/
package org.mvndaemon.mvnd.cache.invalidating;
-import java.nio.file.Path;
-import java.util.List;
-import java.util.stream.Stream;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
+
+import java.nio.file.Path;
+import java.util.List;
+import java.util.stream.Stream;
+
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.DefaultPluginArtifactsCache;
import org.apache.maven.plugin.PluginResolutionException;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginDescriptorCache.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginDescriptorCache.java
index fb5f4d24..23862274 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginDescriptorCache.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginDescriptorCache.java
@@ -18,14 +18,16 @@
*/
package org.mvndaemon.mvnd.cache.invalidating;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
import java.nio.file.Path;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Stream;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
+
import org.apache.maven.model.Plugin;
import org.apache.maven.plugin.DefaultPluginDescriptorCache;
import org.apache.maven.plugin.InvalidPluginDescriptorException;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginRealmCache.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginRealmCache.java
index 6817d854..67796309 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginRealmCache.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginRealmCache.java
@@ -18,12 +18,14 @@
*/
package org.mvndaemon.mvnd.cache.invalidating;
-import java.nio.file.Path;
-import java.util.List;
-import java.util.stream.Stream;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
+
+import java.nio.file.Path;
+import java.util.List;
+import java.util.stream.Stream;
+
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.DefaultPluginRealmCache;
import org.apache.maven.plugin.PluginContainerException;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingProjectArtifactsCache.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingProjectArtifactsCache.java
index 70d2aae8..f97ea1a0 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingProjectArtifactsCache.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingProjectArtifactsCache.java
@@ -18,6 +18,10 @@
*/
package org.mvndaemon.mvnd.cache.invalidating;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
import java.io.File;
import java.nio.file.Path;
import java.util.ArrayList;
@@ -29,9 +33,7 @@ import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Stream;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
+
import org.apache.maven.RepositoryUtils;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.lifecycle.LifecycleExecutionException;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingRealmCacheEventSpy.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingRealmCacheEventSpy.java
index 40c90ec5..e69da0a0 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingRealmCacheEventSpy.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingRealmCacheEventSpy.java
@@ -18,6 +18,10 @@
*/
package org.mvndaemon.mvnd.cache.invalidating;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.FileSystems;
@@ -26,9 +30,7 @@ import java.nio.file.PathMatcher;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
+
import org.apache.maven.eventspy.AbstractEventSpy;
import org.apache.maven.eventspy.EventSpy;
import org.apache.maven.execution.MavenExecutionRequest;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cli/EnvHelper.java b/daemon/src/main/java/org/mvndaemon/mvnd/cli/EnvHelper.java
index 766b9bb4..3ed9e305 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cli/EnvHelper.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cli/EnvHelper.java
@@ -32,6 +32,7 @@ import java.util.TreeMap;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+
import org.jline.utils.ExecHelper;
import org.mvndaemon.mvnd.common.JavaVersion;
import org.mvndaemon.mvnd.common.Os;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java
index 743ea7a9..92bbf631 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java
@@ -25,6 +25,7 @@ import java.util.Map.Entry;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Pattern;
+
import org.apache.maven.execution.ExecutionEvent;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoExecution;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Connection.java b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Connection.java
index 08929367..382117a9 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Connection.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Connection.java
@@ -19,6 +19,7 @@
package org.mvndaemon.mvnd.daemon;
import java.util.function.Predicate;
+
import org.mvndaemon.mvnd.common.Message;
public interface Connection {
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/DaemonExpiration.java b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/DaemonExpiration.java
index ed293f62..87e70b8f 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/DaemonExpiration.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/DaemonExpiration.java
@@ -18,11 +18,8 @@
*/
package org.mvndaemon.mvnd.daemon;
-import static org.mvndaemon.mvnd.common.DaemonExpirationStatus.DO_NOT_EXPIRE;
-import static org.mvndaemon.mvnd.common.DaemonExpirationStatus.GRACEFUL_EXPIRE;
-import static org.mvndaemon.mvnd.common.DaemonExpirationStatus.IMMEDIATE_EXPIRE;
-import static org.mvndaemon.mvnd.common.DaemonExpirationStatus.QUIET_EXPIRE;
-import static org.mvndaemon.mvnd.daemon.DaemonExpiration.DaemonExpirationResult.NOT_TRIGGERED;
+import javax.management.Attribute;
+import javax.management.ObjectName;
import java.lang.management.ManagementFactory;
import java.nio.file.Files;
@@ -37,8 +34,7 @@ import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
-import javax.management.Attribute;
-import javax.management.ObjectName;
+
import org.mvndaemon.mvnd.common.DaemonCompatibilitySpec;
import org.mvndaemon.mvnd.common.DaemonCompatibilitySpec.Result;
import org.mvndaemon.mvnd.common.DaemonExpirationStatus;
@@ -49,6 +45,12 @@ import org.mvndaemon.mvnd.common.Os;
import org.mvndaemon.mvnd.common.TimeUtils;
import org.mvndaemon.mvnd.nativ.CLibrary;
+import static org.mvndaemon.mvnd.common.DaemonExpirationStatus.DO_NOT_EXPIRE;
+import static org.mvndaemon.mvnd.common.DaemonExpirationStatus.GRACEFUL_EXPIRE;
+import static org.mvndaemon.mvnd.common.DaemonExpirationStatus.IMMEDIATE_EXPIRE;
+import static org.mvndaemon.mvnd.common.DaemonExpirationStatus.QUIET_EXPIRE;
+import static org.mvndaemon.mvnd.daemon.DaemonExpiration.DaemonExpirationResult.NOT_TRIGGERED;
+
/**
* File origin:
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/server/MasterExpirationStrategy.java
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java
index 61bb75df..115417cd 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java
@@ -18,12 +18,6 @@
*/
package org.mvndaemon.mvnd.daemon;
-import static org.mvndaemon.mvnd.common.DaemonState.Broken;
-import static org.mvndaemon.mvnd.common.DaemonState.Busy;
-import static org.mvndaemon.mvnd.common.DaemonState.Canceled;
-import static org.mvndaemon.mvnd.common.DaemonState.StopRequested;
-import static org.mvndaemon.mvnd.common.DaemonState.Stopped;
-
import java.io.IOException;
import java.io.InputStream;
import java.io.InterruptedIOException;
@@ -55,6 +49,7 @@ import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Collectors;
+
import org.apache.maven.cli.DaemonMavenCli;
import org.mvndaemon.mvnd.builder.SmartBuilder;
import org.mvndaemon.mvnd.common.DaemonConnection;
@@ -78,6 +73,12 @@ import org.mvndaemon.mvnd.logging.smart.ProjectBuildLogAppender;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static org.mvndaemon.mvnd.common.DaemonState.Broken;
+import static org.mvndaemon.mvnd.common.DaemonState.Busy;
+import static org.mvndaemon.mvnd.common.DaemonState.Canceled;
+import static org.mvndaemon.mvnd.common.DaemonState.StopRequested;
+import static org.mvndaemon.mvnd.common.DaemonState.Stopped;
+
public class Server implements AutoCloseable, Runnable {
private static final Logger LOGGER = LoggerFactory.getLogger(Server.class);
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/execution/BuildResumptionAnalyzer.java b/daemon/src/main/java/org/mvndaemon/mvnd/execution/BuildResumptionAnalyzer.java
index 33986f66..d75c4772 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/execution/BuildResumptionAnalyzer.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/execution/BuildResumptionAnalyzer.java
@@ -37,6 +37,7 @@ package org.mvndaemon.mvnd.execution;
* under the License.
*/
import java.util.Optional;
+
import org.apache.maven.execution.MavenExecutionResult;
/**
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/execution/DefaultBuildResumptionAnalyzer.java b/daemon/src/main/java/org/mvndaemon/mvnd/execution/DefaultBuildResumptionAnalyzer.java
index 4e6680c9..a0207d5d 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/execution/DefaultBuildResumptionAnalyzer.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/execution/DefaultBuildResumptionAnalyzer.java
@@ -36,11 +36,13 @@ package org.mvndaemon.mvnd.execution;
* specific language governing permissions and limitations
* under the License.
*/
+import javax.inject.Named;
+import javax.inject.Singleton;
+
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
-import javax.inject.Named;
-import javax.inject.Singleton;
+
import org.apache.maven.execution.BuildFailure;
import org.apache.maven.execution.BuildSuccess;
import org.apache.maven.execution.MavenExecutionResult;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/execution/DefaultBuildResumptionDataRepository.java b/daemon/src/main/java/org/mvndaemon/mvnd/execution/DefaultBuildResumptionDataRepository.java
index 8c3c2726..bbf377e3 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/execution/DefaultBuildResumptionDataRepository.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/execution/DefaultBuildResumptionDataRepository.java
@@ -36,6 +36,9 @@ package org.mvndaemon.mvnd.execution;
* specific language governing permissions and limitations
* under the License.
*/
+import javax.inject.Named;
+import javax.inject.Singleton;
+
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
@@ -44,8 +47,7 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Properties;
import java.util.stream.Stream;
-import javax.inject.Named;
-import javax.inject.Singleton;
+
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.execution.MavenExecutionRequest;
import org.apache.maven.project.MavenProject;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/interactivity/DaemonPrompter.java b/daemon/src/main/java/org/mvndaemon/mvnd/interactivity/DaemonPrompter.java
index f763a6d2..392a76f5 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/interactivity/DaemonPrompter.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/interactivity/DaemonPrompter.java
@@ -18,12 +18,14 @@
*/
package org.mvndaemon.mvnd.interactivity;
+import javax.inject.Named;
+
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
-import javax.inject.Named;
+
import org.codehaus.plexus.components.interactivity.AbstractInputHandler;
import org.codehaus.plexus.components.interactivity.InputHandler;
import org.codehaus.plexus.components.interactivity.OutputHandler;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/logging/smart/LoggingExecutionListener.java b/daemon/src/main/java/org/mvndaemon/mvnd/logging/smart/LoggingExecutionListener.java
index c0c36857..3fe2a20a 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/logging/smart/LoggingExecutionListener.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/logging/smart/LoggingExecutionListener.java
@@ -20,6 +20,7 @@ package org.mvndaemon.mvnd.logging.smart;
import javax.inject.Named;
import javax.inject.Singleton;
+
import org.apache.maven.execution.ExecutionEvent;
import org.apache.maven.execution.ExecutionListener;
import org.apache.maven.execution.MavenSession;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/logging/smart/ProjectBuildLogAppender.java b/daemon/src/main/java/org/mvndaemon/mvnd/logging/smart/ProjectBuildLogAppender.java
index c28e1ad7..64ea0872 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/logging/smart/ProjectBuildLogAppender.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/logging/smart/ProjectBuildLogAppender.java
@@ -18,6 +18,8 @@
*/
package org.mvndaemon.mvnd.logging.smart;
+import java.util.Map;
+
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.PatternLayout;
@@ -25,7 +27,6 @@ import ch.qos.logback.classic.pattern.ClassicConverter;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.AppenderBase;
import ch.qos.logback.core.Context;
-import java.util.Map;
import org.apache.maven.shared.utils.logging.LoggerLevelRenderer;
import org.apache.maven.shared.utils.logging.MessageUtils;
import org.slf4j.LoggerFactory;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/plugin/CachingPluginVersionResolver.java b/daemon/src/main/java/org/mvndaemon/mvnd/plugin/CachingPluginVersionResolver.java
index c65a602d..19c73f9b 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/plugin/CachingPluginVersionResolver.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/plugin/CachingPluginVersionResolver.java
@@ -18,12 +18,14 @@
*/
package org.mvndaemon.mvnd.plugin;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import javax.inject.Named;
-import javax.inject.Singleton;
+
import org.apache.maven.plugin.version.PluginVersionRequest;
import org.apache.maven.plugin.version.PluginVersionResolutionException;
import org.apache.maven.plugin.version.PluginVersionResolver;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/plugin/CliMavenPluginManager.java b/daemon/src/main/java/org/mvndaemon/mvnd/plugin/CliMavenPluginManager.java
index 1b0d7d5e..203f20c7 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/plugin/CliMavenPluginManager.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/plugin/CliMavenPluginManager.java
@@ -18,6 +18,10 @@
*/
package org.mvndaemon.mvnd.plugin;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -38,9 +42,7 @@ import java.util.Map;
import java.util.Objects;
import java.util.jar.JarFile;
import java.util.zip.ZipEntry;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
+
import org.apache.maven.RepositoryUtils;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.classrealm.ClassRealmManager;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/plugin/ValidatingConfigurationListener.java b/daemon/src/main/java/org/mvndaemon/mvnd/plugin/ValidatingConfigurationListener.java
index a7aa258b..06d8b65f 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/plugin/ValidatingConfigurationListener.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/plugin/ValidatingConfigurationListener.java
@@ -21,6 +21,7 @@ package org.mvndaemon.mvnd.plugin;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
+
import org.apache.maven.plugin.descriptor.MojoDescriptor;
import org.apache.maven.plugin.descriptor.Parameter;
import org.codehaus.plexus.component.configurator.ConfigurationListener;
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/timing/BuildTimeEventSpy.java b/daemon/src/main/java/org/mvndaemon/mvnd/timing/BuildTimeEventSpy.java
index 87f1d1bd..99241e9d 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/timing/BuildTimeEventSpy.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/timing/BuildTimeEventSpy.java
@@ -18,6 +18,9 @@
*/
package org.mvndaemon.mvnd.timing;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
import java.util.Comparator;
import java.util.HashMap;
import java.util.Locale;
@@ -27,8 +30,7 @@ import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Consumer;
import java.util.stream.Stream;
-import javax.inject.Named;
-import javax.inject.Singleton;
+
import org.apache.maven.eventspy.AbstractEventSpy;
import org.apache.maven.eventspy.EventSpy;
import org.apache.maven.execution.ExecutionEvent;
diff --git a/daemon/src/test/java/org/mvndaemon/mvnd/builder/AbstractSmartBuilderTest.java b/daemon/src/test/java/org/mvndaemon/mvnd/builder/AbstractSmartBuilderTest.java
index 86a77e7b..c6e32947 100644
--- a/daemon/src/test/java/org/mvndaemon/mvnd/builder/AbstractSmartBuilderTest.java
+++ b/daemon/src/test/java/org/mvndaemon/mvnd/builder/AbstractSmartBuilderTest.java
@@ -21,6 +21,7 @@ package org.mvndaemon.mvnd.builder;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
+
import org.apache.maven.project.MavenProject;
import org.junit.jupiter.api.Assertions;
diff --git a/daemon/src/test/java/org/mvndaemon/mvnd/builder/DagWidthTest.java b/daemon/src/test/java/org/mvndaemon/mvnd/builder/DagWidthTest.java
index 340df6b6..2dd2fa1b 100644
--- a/daemon/src/test/java/org/mvndaemon/mvnd/builder/DagWidthTest.java
+++ b/daemon/src/test/java/org/mvndaemon/mvnd/builder/DagWidthTest.java
@@ -18,8 +18,6 @@
*/
package org.mvndaemon.mvnd.builder;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@@ -31,9 +29,12 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.builder.DependencyGraph.DagWidth;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
public class DagWidthTest {
@Test
diff --git a/daemon/src/test/java/org/mvndaemon/mvnd/builder/ProjectComparatorTest.java b/daemon/src/test/java/org/mvndaemon/mvnd/builder/ProjectComparatorTest.java
index 761c3917..7657dcdc 100644
--- a/daemon/src/test/java/org/mvndaemon/mvnd/builder/ProjectComparatorTest.java
+++ b/daemon/src/test/java/org/mvndaemon/mvnd/builder/ProjectComparatorTest.java
@@ -18,17 +18,18 @@
*/
package org.mvndaemon.mvnd.builder;
-import static org.mvndaemon.mvnd.builder.ProjectComparator.id;
-
import java.util.Comparator;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.concurrent.atomic.AtomicLong;
+
import org.apache.maven.project.MavenProject;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
+import static org.mvndaemon.mvnd.builder.ProjectComparator.id;
+
public class ProjectComparatorTest extends AbstractSmartBuilderTest {
@Test
diff --git a/daemon/src/test/java/org/mvndaemon/mvnd/builder/ProjectExecutorServiceTest.java b/daemon/src/test/java/org/mvndaemon/mvnd/builder/ProjectExecutorServiceTest.java
index 0cfe3352..f1ad7da5 100644
--- a/daemon/src/test/java/org/mvndaemon/mvnd/builder/ProjectExecutorServiceTest.java
+++ b/daemon/src/test/java/org/mvndaemon/mvnd/builder/ProjectExecutorServiceTest.java
@@ -18,9 +18,6 @@
*/
package org.mvndaemon.mvnd.builder;
-import static org.mvndaemon.mvnd.builder.ProjectComparator.id;
-
-import com.google.common.util.concurrent.Monitor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -28,11 +25,15 @@ import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;
+
+import com.google.common.util.concurrent.Monitor;
import org.apache.maven.project.MavenProject;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.builder.ProjectExecutorService.ProjectRunnable;
+import static org.mvndaemon.mvnd.builder.ProjectComparator.id;
+
public class ProjectExecutorServiceTest extends AbstractSmartBuilderTest {
@Test
diff --git a/daemon/src/test/java/org/mvndaemon/mvnd/builder/TestProjectDependencyGraph.java b/daemon/src/test/java/org/mvndaemon/mvnd/builder/TestProjectDependencyGraph.java
index 9db0c648..47d6a104 100644
--- a/daemon/src/test/java/org/mvndaemon/mvnd/builder/TestProjectDependencyGraph.java
+++ b/daemon/src/test/java/org/mvndaemon/mvnd/builder/TestProjectDependencyGraph.java
@@ -18,11 +18,12 @@
*/
package org.mvndaemon.mvnd.builder;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.ListMultimap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+
+import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.ListMultimap;
import org.apache.maven.execution.ProjectDependencyGraph;
import org.apache.maven.project.MavenProject;
import org.junit.jupiter.api.Assertions;
diff --git a/daemon/src/test/java/org/mvndaemon/mvnd/cache/impl/CacheFactoryTest.java b/daemon/src/test/java/org/mvndaemon/mvnd/cache/impl/CacheFactoryTest.java
index 012a7406..6d47f3a4 100644
--- a/daemon/src/test/java/org/mvndaemon/mvnd/cache/impl/CacheFactoryTest.java
+++ b/daemon/src/test/java/org/mvndaemon/mvnd/cache/impl/CacheFactoryTest.java
@@ -26,6 +26,7 @@ import java.nio.file.attribute.BasicFileAttributes;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;
+
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
diff --git a/daemon/src/test/java/org/mvndaemon/mvnd/cli/EnvHelperTest.java b/daemon/src/test/java/org/mvndaemon/mvnd/cli/EnvHelperTest.java
index 516d4718..69d6a49e 100644
--- a/daemon/src/test/java/org/mvndaemon/mvnd/cli/EnvHelperTest.java
+++ b/daemon/src/test/java/org/mvndaemon/mvnd/cli/EnvHelperTest.java
@@ -18,9 +18,6 @@
*/
package org.mvndaemon.mvnd.cli;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNull;
-
import java.io.File;
import java.nio.file.Paths;
import java.util.ArrayList;
@@ -30,10 +27,14 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;
+
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.common.Os;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
public class EnvHelperTest {
@Test
diff --git a/daemon/src/test/java/org/mvndaemon/mvnd/daemon/ServerTest.java b/daemon/src/test/java/org/mvndaemon/mvnd/daemon/ServerTest.java
index 9350be98..18243fd8 100644
--- a/daemon/src/test/java/org/mvndaemon/mvnd/daemon/ServerTest.java
+++ b/daemon/src/test/java/org/mvndaemon/mvnd/daemon/ServerTest.java
@@ -18,14 +18,15 @@
*/
package org.mvndaemon.mvnd.daemon;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
import java.util.Arrays;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.PriorityBlockingQueue;
+
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.common.Message;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
public class ServerTest {
@Test
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/assertj/MatchInOrderAmongOthers.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/assertj/MatchInOrderAmongOthers.java
index 5bf67b77..7ad472e5 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/assertj/MatchInOrderAmongOthers.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/assertj/MatchInOrderAmongOthers.java
@@ -24,6 +24,7 @@ import java.util.Objects;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+
import org.assertj.core.api.Condition;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/assertj/TestClientOutput.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/assertj/TestClientOutput.java
index e5739616..07e5578c 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/assertj/TestClientOutput.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/assertj/TestClientOutput.java
@@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import java.util.stream.Collectors;
+
import org.assertj.core.api.Assertions;
import org.mvndaemon.mvnd.common.Message;
import org.mvndaemon.mvnd.common.logging.ClientOutput;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/AttachedArtifactResolutionTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/AttachedArtifactResolutionTest.java
index 6e8ebb4f..c65b1d1e 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/AttachedArtifactResolutionTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/AttachedArtifactResolutionTest.java
@@ -19,6 +19,7 @@
package org.mvndaemon.mvnd.it;
import javax.inject.Inject;
+
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
import org.mvndaemon.mvnd.client.Client;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/BootstrapPluginTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/BootstrapPluginTest.java
index a1401eab..57a8d67c 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/BootstrapPluginTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/BootstrapPluginTest.java
@@ -18,10 +18,10 @@
*/
package org.mvndaemon.mvnd.it;
-import static org.junit.jupiter.api.Assertions.fail;
+import javax.inject.Inject;
import java.io.IOException;
-import javax.inject.Inject;
+
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
@@ -33,6 +33,8 @@ import org.mvndaemon.mvnd.common.DaemonInfo;
import org.mvndaemon.mvnd.junit.MvndTest;
import org.mvndaemon.mvnd.junit.TestRegistry;
+import static org.junit.jupiter.api.Assertions.fail;
+
@MvndTest(projectDir = "src/test/projects/bootstrap-plugin")
@DisabledOnOs(OS.WINDOWS)
public class BootstrapPluginTest {
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/CompletionNativeIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/CompletionNativeIT.java
index 067cb2b9..d06ea9a5 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/CompletionNativeIT.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/CompletionNativeIT.java
@@ -18,8 +18,10 @@
*/
package org.mvndaemon.mvnd.it;
-import java.io.IOException;
import javax.inject.Inject;
+
+import java.io.IOException;
+
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
import org.mvndaemon.mvnd.client.Client;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ConcurrentDownloadsTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ConcurrentDownloadsTest.java
index 703bcc9c..739d0b6e 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ConcurrentDownloadsTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ConcurrentDownloadsTest.java
@@ -18,10 +18,10 @@
*/
package org.mvndaemon.mvnd.it;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import javax.inject.Inject;
import java.io.IOException;
-import javax.inject.Inject;
+
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
import org.mvndaemon.mvnd.client.Client;
@@ -29,6 +29,8 @@ import org.mvndaemon.mvnd.client.DaemonParameters;
import org.mvndaemon.mvnd.common.Message;
import org.mvndaemon.mvnd.junit.MvndTest;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
@MvndTest(projectDir = "src/test/projects/concurrent-downloads")
public class ConcurrentDownloadsTest {
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DaemonCrashTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DaemonCrashTest.java
index d50ca1f6..6ade3a0f 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DaemonCrashTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DaemonCrashTest.java
@@ -18,13 +18,13 @@
*/
package org.mvndaemon.mvnd.it;
-import static org.junit.jupiter.api.Assertions.assertThrows;
+import javax.inject.Inject;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.stream.Stream;
-import javax.inject.Inject;
+
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
@@ -34,6 +34,8 @@ import org.mvndaemon.mvnd.client.DaemonParameters;
import org.mvndaemon.mvnd.common.DaemonException;
import org.mvndaemon.mvnd.junit.MvndTest;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
@MvndTest(projectDir = "src/test/projects/daemon-crash", keepAlive = "100ms", maxLostKeepAlive = "30")
@Timeout(60)
public class DaemonCrashTest {
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DeleteRepoNativeIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DeleteRepoNativeIT.java
index e62648b5..610cb8df 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DeleteRepoNativeIT.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DeleteRepoNativeIT.java
@@ -18,9 +18,11 @@
*/
package org.mvndaemon.mvnd.it;
+import javax.inject.Inject;
+
import java.io.IOException;
import java.nio.file.Path;
-import javax.inject.Inject;
+
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DistroIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DistroIT.java
index a51494da..1044673d 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DistroIT.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DistroIT.java
@@ -29,6 +29,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DupGATest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DupGATest.java
index 0a461207..89494a53 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DupGATest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DupGATest.java
@@ -18,8 +18,10 @@
*/
package org.mvndaemon.mvnd.it;
-import java.io.IOException;
import javax.inject.Inject;
+
+import java.io.IOException;
+
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
import org.mvndaemon.mvnd.client.Client;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/EnvironmentTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/EnvironmentTest.java
index 1ecb5e33..6e3f993a 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/EnvironmentTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/EnvironmentTest.java
@@ -18,12 +18,12 @@
*/
package org.mvndaemon.mvnd.it;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import javax.inject.Inject;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Arrays;
-import javax.inject.Inject;
+
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
@@ -33,6 +33,8 @@ import org.mvndaemon.mvnd.junit.MvndTest;
import org.mvndaemon.mvnd.junit.TestParameters;
import org.mvndaemon.mvnd.junit.TestRegistry;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
@MvndTest(projectDir = "src/test/projects/environment")
public class EnvironmentTest {
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ExecOutputTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ExecOutputTest.java
index 5453945d..23eceedd 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ExecOutputTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ExecOutputTest.java
@@ -18,16 +18,18 @@
*/
package org.mvndaemon.mvnd.it;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import javax.inject.Inject;
import java.io.IOException;
-import javax.inject.Inject;
+
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
import org.mvndaemon.mvnd.client.Client;
import org.mvndaemon.mvnd.client.DaemonParameters;
import org.mvndaemon.mvnd.junit.MvndTest;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
@MvndTest(projectDir = "src/test/projects/exec-output")
public class ExecOutputTest {
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ExtensionsNativeIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ExtensionsNativeIT.java
index 74b46511..719f13db 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ExtensionsNativeIT.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ExtensionsNativeIT.java
@@ -18,10 +18,10 @@
*/
package org.mvndaemon.mvnd.it;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import javax.inject.Inject;
import java.io.IOException;
-import javax.inject.Inject;
+
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
@@ -31,6 +31,8 @@ import org.mvndaemon.mvnd.common.DaemonInfo;
import org.mvndaemon.mvnd.junit.MvndNativeTest;
import org.mvndaemon.mvnd.junit.TestRegistry;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
@MvndNativeTest(projectDir = "src/test/projects/extensions")
public class ExtensionsNativeIT {
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ForkedTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ForkedTest.java
index e8f867f9..7fb23296 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ForkedTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ForkedTest.java
@@ -18,16 +18,18 @@
*/
package org.mvndaemon.mvnd.it;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import javax.inject.Inject;
import java.io.IOException;
-import javax.inject.Inject;
+
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
import org.mvndaemon.mvnd.client.Client;
import org.mvndaemon.mvnd.client.DaemonParameters;
import org.mvndaemon.mvnd.junit.MvndTest;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
@MvndTest(projectDir = "src/test/projects/forked")
public class ForkedTest {
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/InteractiveTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/InteractiveTest.java
index 56b7ee25..5a281983 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/InteractiveTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/InteractiveTest.java
@@ -18,8 +18,10 @@
*/
package org.mvndaemon.mvnd.it;
-import java.io.IOException;
import javax.inject.Inject;
+
+import java.io.IOException;
+
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/InvokerNativeIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/InvokerNativeIT.java
index be5ec704..abb78b3a 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/InvokerNativeIT.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/InvokerNativeIT.java
@@ -18,13 +18,15 @@
*/
package org.mvndaemon.mvnd.it;
+import javax.inject.Inject;
+
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.regex.Pattern;
-import javax.inject.Inject;
+
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/JUnitPlatformTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/JUnitPlatformTest.java
index cd70da31..0f14094e 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/JUnitPlatformTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/JUnitPlatformTest.java
@@ -18,9 +18,8 @@
*/
package org.mvndaemon.mvnd.it;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
import javax.inject.Inject;
+
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
import org.mvndaemon.mvnd.client.Client;
@@ -28,6 +27,8 @@ import org.mvndaemon.mvnd.client.DaemonParameters;
import org.mvndaemon.mvnd.common.Message;
import org.mvndaemon.mvnd.junit.MvndTest;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
@MvndTest(projectDir = "src/test/projects/junit-platform")
public class JUnitPlatformTest {
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfNativeIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfNativeIT.java
index 8d109e82..f562b233 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfNativeIT.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MavenConfNativeIT.java
@@ -18,16 +18,18 @@
*/
package org.mvndaemon.mvnd.it;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import javax.inject.Inject;
import java.io.IOException;
-import javax.inject.Inject;
+
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
import org.mvndaemon.mvnd.client.Client;
import org.mvndaemon.mvnd.client.DaemonParameters;
import org.mvndaemon.mvnd.junit.MvndNativeTest;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
@MvndNativeTest(projectDir = "src/test/projects/maven-conf")
public class MavenConfNativeIT {
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MaxHeapNativeIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MaxHeapNativeIT.java
index bf992dbf..2b00562f 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MaxHeapNativeIT.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MaxHeapNativeIT.java
@@ -18,13 +18,12 @@
*/
package org.mvndaemon.mvnd.it;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import javax.inject.Inject;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.read.ListAppender;
-import javax.inject.Inject;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
@@ -34,6 +33,8 @@ import org.mvndaemon.mvnd.client.Client;
import org.mvndaemon.mvnd.junit.MvndNativeTest;
import org.slf4j.LoggerFactory;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
public class MaxHeapNativeIT {
static class BaseTest {
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ModuleAndPluginNativeIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ModuleAndPluginNativeIT.java
index f72a0921..ff20b9d3 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ModuleAndPluginNativeIT.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ModuleAndPluginNativeIT.java
@@ -18,12 +18,14 @@
*/
package org.mvndaemon.mvnd.it;
+import javax.inject.Inject;
+
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.stream.Stream;
-import javax.inject.Inject;
+
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MultiLookupTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MultiLookupTest.java
index b2c8d48f..85c4b611 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MultiLookupTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MultiLookupTest.java
@@ -18,8 +18,10 @@
*/
package org.mvndaemon.mvnd.it;
-import java.io.IOException;
import javax.inject.Inject;
+
+import java.io.IOException;
+
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
import org.mvndaemon.mvnd.junit.ClientFactory;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MultiModuleTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MultiModuleTest.java
index 144b02b6..2695d7da 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MultiModuleTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MultiModuleTest.java
@@ -18,6 +18,8 @@
*/
package org.mvndaemon.mvnd.it;
+import javax.inject.Inject;
+
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -25,7 +27,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import javax.inject.Inject;
+
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.MatchInOrderAmongOthers;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MvndTestUtil.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MvndTestUtil.java
index 925dafdf..05e9f537 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MvndTestUtil.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MvndTestUtil.java
@@ -24,6 +24,7 @@ import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Properties;
+
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/NewManagedModuleNativeIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/NewManagedModuleNativeIT.java
index 77612907..889e7315 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/NewManagedModuleNativeIT.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/NewManagedModuleNativeIT.java
@@ -18,12 +18,14 @@
*/
package org.mvndaemon.mvnd.it;
+import javax.inject.Inject;
+
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.stream.Stream;
-import javax.inject.Inject;
+
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ParentWithPropertyTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ParentWithPropertyTest.java
index ce8a6f17..66ad833c 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ParentWithPropertyTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ParentWithPropertyTest.java
@@ -18,8 +18,10 @@
*/
package org.mvndaemon.mvnd.it;
-import java.nio.file.Path;
import javax.inject.Inject;
+
+import java.nio.file.Path;
+
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/RawStreamsTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/RawStreamsTest.java
index c3785484..889ed265 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/RawStreamsTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/RawStreamsTest.java
@@ -18,10 +18,10 @@
*/
package org.mvndaemon.mvnd.it;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import javax.inject.Inject;
import java.io.IOException;
-import javax.inject.Inject;
+
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
@@ -30,6 +30,8 @@ import org.mvndaemon.mvnd.client.DaemonParameters;
import org.mvndaemon.mvnd.junit.MvndTest;
import org.mvndaemon.mvnd.junit.TestRegistry;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
@MvndTest(projectDir = "src/test/projects/raw-streams")
public class RawStreamsTest {
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ResidentExtensionsTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ResidentExtensionsTest.java
index 75181eb6..ffd72a98 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ResidentExtensionsTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ResidentExtensionsTest.java
@@ -18,12 +18,11 @@
*/
package org.mvndaemon.mvnd.it;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import javax.inject.Inject;
import java.io.IOException;
import java.nio.file.Path;
-import javax.inject.Inject;
+
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
@@ -32,6 +31,9 @@ import org.mvndaemon.mvnd.junit.MvndTest;
import org.mvndaemon.mvnd.junit.TestParameters;
import org.mvndaemon.mvnd.junit.TestRegistry;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
@MvndTest(projectDir = "src/test/projects/resident-extensions")
public class ResidentExtensionsTest {
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SingleModuleNativeIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SingleModuleNativeIT.java
index 66a8b9d6..a8be5941 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SingleModuleNativeIT.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SingleModuleNativeIT.java
@@ -18,13 +18,15 @@
*/
package org.mvndaemon.mvnd.it;
+import javax.inject.Inject;
+
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.Properties;
import java.util.stream.Collectors;
-import javax.inject.Inject;
+
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.MatchInOrderAmongOthers;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SingleModuleTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SingleModuleTest.java
index 4662b2a6..9a7d524d 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SingleModuleTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SingleModuleTest.java
@@ -21,6 +21,7 @@ package org.mvndaemon.mvnd.it;
import java.util.List;
import java.util.Properties;
import java.util.stream.Collectors;
+
import org.assertj.core.api.Assertions;
import org.mvndaemon.mvnd.assertj.MatchInOrderAmongOthers;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SpecificFileNativeIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SpecificFileNativeIT.java
index 356c4189..59a3d96b 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SpecificFileNativeIT.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SpecificFileNativeIT.java
@@ -18,11 +18,11 @@
*/
package org.mvndaemon.mvnd.it;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import javax.inject.Inject;
import java.io.IOException;
import java.nio.file.Path;
-import javax.inject.Inject;
+
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
import org.mvndaemon.mvnd.client.Client;
@@ -30,6 +30,8 @@ import org.mvndaemon.mvnd.junit.ClientFactory;
import org.mvndaemon.mvnd.junit.MvndNativeTest;
import org.mvndaemon.mvnd.junit.TestParameters;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
/**
* NOTE: there is no related JVM test because the support for the maven
* multiModuleProjectDiscovery is done very early in the client in order
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/StopStatusTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/StopStatusTest.java
index ba5e05ad..b2a096d8 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/StopStatusTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/StopStatusTest.java
@@ -18,9 +18,11 @@
*/
package org.mvndaemon.mvnd.it;
+import javax.inject.Inject;
+
import java.io.IOException;
import java.util.stream.Collectors;
-import javax.inject.Inject;
+
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ThreadOptionNativeIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ThreadOptionNativeIT.java
index 935c8f5d..ea14bc36 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ThreadOptionNativeIT.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ThreadOptionNativeIT.java
@@ -18,8 +18,10 @@
*/
package org.mvndaemon.mvnd.it;
-import java.io.IOException;
import javax.inject.Inject;
+
+import java.io.IOException;
+
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
import org.mvndaemon.mvnd.client.Client;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/TypeDescriptionTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/TypeDescriptionTest.java
index 0af95c5f..83b81880 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/TypeDescriptionTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/TypeDescriptionTest.java
@@ -18,8 +18,10 @@
*/
package org.mvndaemon.mvnd.it;
-import java.io.IOException;
import javax.inject.Inject;
+
+import java.io.IOException;
+
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
import org.mvndaemon.mvnd.client.Client;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/UpgradesInBomNativeIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/UpgradesInBomNativeIT.java
index 5a798124..b9b6a51b 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/UpgradesInBomNativeIT.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/UpgradesInBomNativeIT.java
@@ -18,10 +18,12 @@
*/
package org.mvndaemon.mvnd.it;
+import javax.inject.Inject;
+
import java.io.IOException;
import java.nio.file.Path;
import java.util.Arrays;
-import javax.inject.Inject;
+
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/VersionNativeIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/VersionNativeIT.java
index 681e9471..9a6caa76 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/VersionNativeIT.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/VersionNativeIT.java
@@ -18,8 +18,10 @@
*/
package org.mvndaemon.mvnd.it;
-import java.io.IOException;
import javax.inject.Inject;
+
+import java.io.IOException;
+
import org.junit.jupiter.api.Test;
import org.mvndaemon.mvnd.assertj.TestClientOutput;
import org.mvndaemon.mvnd.client.Client;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/JvmTestClient.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/JvmTestClient.java
index f1664d7f..82549d3e 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/JvmTestClient.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/JvmTestClient.java
@@ -21,6 +21,7 @@ package org.mvndaemon.mvnd.junit;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
+
import org.mvndaemon.mvnd.assertj.TestClientOutput;
import org.mvndaemon.mvnd.client.DaemonParameters;
import org.mvndaemon.mvnd.client.DefaultClient;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndNativeTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndNativeTest.java
index a342e7f4..e91f9090 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndNativeTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndNativeTest.java
@@ -22,6 +22,7 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+
import org.junit.jupiter.api.extension.ExtendWith;
import org.mvndaemon.mvnd.client.Client;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndTest.java
index d26a0b73..710cce3a 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndTest.java
@@ -22,6 +22,7 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+
import org.junit.jupiter.api.extension.ExtendWith;
@ExtendWith(MvndTestExtension.class)
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndTestExtension.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndTestExtension.java
index c56afda3..4aa6a7b0 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndTestExtension.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndTestExtension.java
@@ -18,8 +18,6 @@
*/
package org.mvndaemon.mvnd.junit;
-import static org.mvndaemon.mvnd.junit.TestUtils.deleteDir;
-
import java.io.IOException;
import java.io.UncheckedIOException;
import java.lang.reflect.Field;
@@ -30,6 +28,7 @@ import java.nio.file.Paths;
import java.util.Locale;
import java.util.Objects;
import java.util.stream.Stream;
+
import org.apache.log4j.Logger;
import org.junit.jupiter.api.extension.AfterAllCallback;
import org.junit.jupiter.api.extension.BeforeAllCallback;
@@ -42,6 +41,8 @@ import org.mvndaemon.mvnd.common.DaemonRegistry;
import org.mvndaemon.mvnd.common.Environment;
import org.mvndaemon.mvnd.common.TimeUtils;
+import static org.mvndaemon.mvnd.junit.TestUtils.deleteDir;
+
public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback, AfterAllCallback {
private static final Logger LOG = Logger.getLogger(MvndTestExtension.class);
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/NativeTestClient.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/NativeTestClient.java
index 83419968..6325282e 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/NativeTestClient.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/NativeTestClient.java
@@ -26,6 +26,7 @@ import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Supplier;
+
import org.mvndaemon.mvnd.client.Client;
import org.mvndaemon.mvnd.client.DaemonParameters;
import org.mvndaemon.mvnd.client.ExecutionResult;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/TestParameters.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/TestParameters.java
index 07876360..90ef6f8e 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/TestParameters.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/TestParameters.java
@@ -20,6 +20,7 @@ package org.mvndaemon.mvnd.junit;
import java.nio.file.Path;
import java.time.Duration;
+
import org.mvndaemon.mvnd.client.DaemonParameters;
import org.mvndaemon.mvnd.common.Environment;
import org.mvndaemon.mvnd.common.TimeUtils;
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/TestRegistry.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/TestRegistry.java
index d5d4e104..cffeb18b 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/TestRegistry.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/TestRegistry.java
@@ -23,6 +23,7 @@ import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
+
import org.assertj.core.api.Assertions;
import org.mvndaemon.mvnd.common.DaemonInfo;
import org.mvndaemon.mvnd.common.DaemonRegistry;
diff --git a/native/src/test/java/org/mvndaemon/mvnd/nativ/CLibraryTest.java b/native/src/test/java/org/mvndaemon/mvnd/nativ/CLibraryTest.java
index cf1af713..ee1a2aa7 100644
--- a/native/src/test/java/org/mvndaemon/mvnd/nativ/CLibraryTest.java
+++ b/native/src/test/java/org/mvndaemon/mvnd/nativ/CLibraryTest.java
@@ -18,14 +18,15 @@
*/
package org.mvndaemon.mvnd.nativ;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
import java.io.File;
+
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.OS;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
public class CLibraryTest {
@Test
diff --git a/pom.xml b/pom.xml
index b9427503..0057b0ad 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,8 +23,8 @@
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId>
- <version>38</version>
- <relativePath/>
+ <version>39</version>
+ <relativePath />
</parent>
<groupId>org.apache.maven.daemon</groupId>
[maven-mvnd] 03/28: Upgrade parent pom to 38
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit af189641a6a45f1087b4986e9e7dff58d7bfc544
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Tue Nov 22 13:40:35 2022 +0100
Upgrade parent pom to 38
# Conflicts:
# pom.xml
---
build/eclipse-formatter-config.xml | 281 -------------------------------------
pom.xml | 53 +------
2 files changed, 1 insertion(+), 333 deletions(-)
diff --git a/build/eclipse-formatter-config.xml b/build/eclipse-formatter-config.xml
deleted file mode 100644
index 330afe85..00000000
--- a/build/eclipse-formatter-config.xml
+++ /dev/null
@@ -1,281 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<profiles version="8">
- <profile name="Camel Java Conventions" version="8" kind="CodeFormatterProfile">
- <setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
- <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.format_comments" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.indent_return_description" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
- <setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
- <setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
- <setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.indentation.size" value="8"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
- <setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.lineSplit" value="128"/>
- <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
- <setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
- <setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
- <setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
- <setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
- <setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
- <setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="CHECKSTYLE:OFF"/>
- <setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="CHECKSTYLE:ON"/>
- </profile>
-</profiles>
diff --git a/pom.xml b/pom.xml
index b1bd89d5..52f934cb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId>
- <version>36</version>
+ <version>38</version>
<relativePath/>
</parent>
@@ -72,9 +72,7 @@
<!-- plugin versions a..z -->
<buildnumber-maven-plugin.version>1.4</buildnumber-maven-plugin.version>
<compiler.version>3.8.1</compiler.version>
- <formatter-maven-plugin.version>2.15.0</formatter-maven-plugin.version>
<groovy-maven-plugin.version>2.1.0</groovy-maven-plugin.version>
- <impsort-maven-plugin.version>1.6.0</impsort-maven-plugin.version>
<license-maven-plugin.version>3.0</license-maven-plugin.version>
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
<maven-install-plugin.version>2.4</maven-install-plugin.version>
@@ -390,29 +388,6 @@ limitations under the License.</inlineHeader>
</dependency>
</dependencies>
</plugin>
- <plugin>
- <groupId>net.revelc.code.formatter</groupId>
- <artifactId>formatter-maven-plugin</artifactId>
- <version>${formatter-maven-plugin.version}</version>
- <configuration>
- <configFile>${maven.multiModuleProjectDirectory}/build/eclipse-formatter-config.xml</configFile>
- <skip>${format.skip}</skip>
- <lineEnding>KEEP</lineEnding>
- <cachedir>${project.build.directory}/cache</cachedir>
- </configuration>
- </plugin>
- <plugin>
- <groupId>net.revelc.code</groupId>
- <artifactId>impsort-maven-plugin</artifactId>
- <version>${impsort-maven-plugin.version}</version>
- <configuration>
- <removeUnused>true</removeUnused>
- <staticAfter>true</staticAfter>
- <lineEnding>KEEP</lineEnding>
- <skip>${format.skip}</skip>
- <cachedir>${project.build.directory}/cache</cachedir>
- </configuration>
- </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@@ -507,32 +482,6 @@ limitations under the License.</inlineHeader>
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>net.revelc.code.formatter</groupId>
- <artifactId>formatter-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>format</id>
- <goals>
- <goal>format</goal>
- </goals>
- <phase>process-sources</phase>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>net.revelc.code</groupId>
- <artifactId>impsort-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>sort-imports</id>
- <goals>
- <goal>sort</goal>
- </goals>
- <phase>process-sources</phase>
- </execution>
- </executions>
- </plugin>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
[maven-mvnd] 17/28: Support redirecting input from client to daemon, #541 (#581)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit c9dec667231507d1c14490c6b4630ad32780bdf2
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Tue Dec 13 23:59:35 2022 +0100
Support redirecting input from client to daemon, #541 (#581)
The implementation currently switches on the redirection when the daemon actually starts reading the System.in stream using InputStream.read() or InputStream.available().
---
.../java/org/mvndaemon/mvnd/common/Message.java | 76 ++++++++++++++++++++++
.../mvnd/common/logging/TerminalOutput.java | 31 ++++++++-
.../java/org/mvndaemon/mvnd/daemon/Server.java | 74 +++++++++++++++++++++
3 files changed, 178 insertions(+), 3 deletions(-)
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/Message.java b/common/src/main/java/org/mvndaemon/mvnd/common/Message.java
index 10b641e5..f274f940 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/Message.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/Message.java
@@ -62,6 +62,8 @@ public abstract class Message {
public static final int EXECUTION_FAILURE = 24;
public static final int PRINT_OUT = 25;
public static final int PRINT_ERR = 26;
+ public static final int REQUEST_INPUT = 27;
+ public static final int INPUT_DATA = 28;
final int type;
@@ -115,6 +117,10 @@ public abstract class Message {
case PRINT_OUT:
case PRINT_ERR:
return StringMessage.read(type, input);
+ case REQUEST_INPUT:
+ return RequestInput.read(input);
+ case INPUT_DATA:
+ return InputData.read(input);
}
throw new IllegalStateException("Unexpected message type: " + type);
}
@@ -137,6 +143,8 @@ public abstract class Message {
case DISPLAY:
case PRINT_OUT:
case PRINT_ERR:
+ case REQUEST_INPUT:
+ case INPUT_DATA:
return 2;
case PROJECT_STARTED:
return 3;
@@ -1036,6 +1044,66 @@ public abstract class Message {
}
}
+ public static class RequestInput extends Message {
+
+ private String projectId;
+
+ public static RequestInput read(DataInputStream input) throws IOException {
+ String projectId = readUTF(input);
+ return new RequestInput(projectId);
+ }
+
+ public RequestInput(String projectId) {
+ super(REQUEST_INPUT);
+ this.projectId = projectId;
+ }
+
+ public String getProjectId() {
+ return projectId;
+ }
+
+ @Override
+ public String toString() {
+ return "RequestInput{" + "projectId='" + projectId + '\'' + '}';
+ }
+
+ @Override
+ public void write(DataOutputStream output) throws IOException {
+ super.write(output);
+ writeUTF(output, projectId);
+ }
+ }
+
+ public static class InputData extends Message {
+
+ final String data;
+
+ public static Message read(DataInputStream input) throws IOException {
+ String data = readUTF(input);
+ return new InputData(data);
+ }
+
+ private InputData(String data) {
+ super(INPUT_DATA);
+ this.data = data;
+ }
+
+ public String getData() {
+ return data;
+ }
+
+ @Override
+ public String toString() {
+ return "InputResponse{" + "data='" + data + "\'" + '}';
+ }
+
+ @Override
+ public void write(DataOutputStream output) throws IOException {
+ super.write(output);
+ writeUTF(output, data);
+ }
+ }
+
public int getType() {
return type;
}
@@ -1048,6 +1116,14 @@ public abstract class Message {
return new StringMessage(DISPLAY, message);
}
+ public static RequestInput requestInput(String projectId) {
+ return new RequestInput(projectId);
+ }
+
+ public static InputData inputResponse(String data) {
+ return new InputData(data);
+ }
+
public static StringMessage out(String message) {
return new StringMessage(PRINT_OUT, message);
}
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java b/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java
index e5e5edaf..a7e024ef 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java
@@ -53,6 +53,7 @@ import org.mvndaemon.mvnd.common.Message.BuildStarted;
import org.mvndaemon.mvnd.common.Message.ExecutionFailureEvent;
import org.mvndaemon.mvnd.common.Message.MojoStartedEvent;
import org.mvndaemon.mvnd.common.Message.ProjectEvent;
+import org.mvndaemon.mvnd.common.Message.RequestInput;
import org.mvndaemon.mvnd.common.Message.StringMessage;
import org.mvndaemon.mvnd.common.Message.TransferEvent;
import org.mvndaemon.mvnd.common.OsUtils;
@@ -112,6 +113,8 @@ public class TerminalOutput implements ClientOutput {
private volatile Consumer<Message> daemonDispatch;
/** A sink for queuing messages to the main queue */
private volatile Consumer<Message> daemonReceive;
+ /** The project id which is trying to read the input stream */
+ private volatile String projectReadingInput;
/*
* The following non-final fields are read/written from the main thread only.
@@ -441,6 +444,15 @@ public class TerminalOutput implements ClientOutput {
failures.add(efe);
break;
}
+ case Message.REQUEST_INPUT: {
+ RequestInput ri = (RequestInput) entry;
+ projectReadingInput = ri.getProjectId();
+ break;
+ }
+ case Message.INPUT_DATA: {
+ daemonDispatch.accept(entry);
+ break;
+ }
default:
throw new IllegalStateException("Unexpected message " + entry);
}
@@ -480,7 +492,21 @@ public class TerminalOutput implements ClientOutput {
try {
while (!closing) {
if (readInput.readLock().tryLock(10, TimeUnit.MILLISECONDS)) {
- try {
+ if (projectReadingInput != null) {
+ char[] buf = new char[256];
+ int idx = 0;
+ while (idx < buf.length) {
+ int c = terminal.reader().read(idx > 0 ? 1 : 10);
+ if (c < 0) {
+ break;
+ }
+ buf[idx++] = (char) c;
+ }
+ if (idx > 0) {
+ String data = String.valueOf(buf, 0, idx);
+ daemonReceive.accept(Message.inputResponse(data));
+ }
+ } else {
int c = terminal.reader().read(10);
if (c == -1) {
break;
@@ -488,9 +514,8 @@ public class TerminalOutput implements ClientOutput {
if (c == KEY_PLUS || c == KEY_MINUS || c == KEY_CTRL_L || c == KEY_CTRL_M || c == KEY_CTRL_B) {
daemonReceive.accept(Message.keyboardInput((char) c));
}
- } finally {
- readInput.readLock().unlock();
}
+ readInput.readLock().unlock();
}
}
} catch (InterruptedException e) {
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java
index 7d3da541..d16483c8 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java
@@ -25,18 +25,23 @@ import static org.mvndaemon.mvnd.common.DaemonState.StopRequested;
import static org.mvndaemon.mvnd.common.DaemonState.Stopped;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.InterruptedIOException;
import java.lang.reflect.Field;
import java.nio.ByteBuffer;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
+import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.security.SecureRandom;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.Objects;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingDeque;
@@ -47,6 +52,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
+import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import org.apache.maven.cli.DaemonMavenCli;
@@ -482,6 +488,8 @@ public class Server implements AutoCloseable, Runnable {
final BlockingQueue<Message> sendQueue = new PriorityBlockingQueue<>(64, Message.getMessageComparator());
final BlockingQueue<Message> recvQueue = new LinkedBlockingDeque<>();
final BuildEventListener buildEventListener = new ClientDispatcher(sendQueue);
+ final DaemonInputStream daemonInputStream =
+ new DaemonInputStream(projectId -> sendQueue.add(Message.requestInput(projectId)));
try (ProjectBuildLogAppender logAppender = new ProjectBuildLogAppender(buildEventListener)) {
LOGGER.info("Executing request");
@@ -529,6 +537,8 @@ public class Server implements AutoCloseable, Runnable {
if (message == Message.BareMessage.CANCEL_BUILD_SINGLETON) {
updateState(Canceled);
return;
+ } else if (message instanceof Message.InputData) {
+ daemonInputStream.addInputData(((Message.InputData) message).getData());
} else {
synchronized (recvQueue) {
recvQueue.put(message);
@@ -581,6 +591,7 @@ public class Server implements AutoCloseable, Runnable {
}
}
});
+ System.setIn(daemonInputStream);
System.setOut(new LoggingOutputStream(s -> sendQueue.add(Message.out(s))).printStream());
System.setErr(new LoggingOutputStream(s -> sendQueue.add(Message.err(s))).printStream());
int exitCode = cli.main(
@@ -650,4 +661,67 @@ public class Server implements AutoCloseable, Runnable {
public String toString() {
return info.toString();
}
+
+ static class DaemonInputStream extends InputStream {
+ private final Consumer<String> startReadingFromProject;
+ private final LinkedList<byte[]> datas = new LinkedList<>();
+ private int pos = -1;
+ private String projectReading = null;
+
+ DaemonInputStream(Consumer<String> startReadingFromProject) {
+ this.startReadingFromProject = startReadingFromProject;
+ }
+
+ @Override
+ public int available() throws IOException {
+ synchronized (datas) {
+ String projectId = ProjectBuildLogAppender.getProjectId();
+ if (!Objects.equals(projectId, projectReading)) {
+ projectReading = projectId;
+ startReadingFromProject.accept(projectId);
+ }
+ return datas.stream().mapToInt(a -> a.length).sum() - Math.max(pos, 0);
+ }
+ }
+
+ @Override
+ public int read() throws IOException {
+ synchronized (datas) {
+ String projectId = ProjectBuildLogAppender.getProjectId();
+ if (!Objects.equals(projectId, projectReading)) {
+ projectReading = projectId;
+ startReadingFromProject.accept(projectId);
+ // TODO: start a 10ms timer to turn data off
+ }
+ for (; ; ) {
+ if (datas.isEmpty()) {
+ try {
+ datas.wait();
+ } catch (InterruptedException e) {
+ throw new InterruptedIOException("Interrupted");
+ }
+ pos = -1;
+ continue;
+ }
+ byte[] curData = datas.getFirst();
+ if (pos >= curData.length) {
+ datas.removeFirst();
+ pos = -1;
+ continue;
+ }
+ if (pos < 0) {
+ pos = 0;
+ }
+ return curData[pos++];
+ }
+ }
+ }
+
+ public void addInputData(String data) {
+ synchronized (datas) {
+ datas.add(data.getBytes(Charset.forName(System.getProperty("file.encoding"))));
+ datas.notifyAll();
+ }
+ }
+ }
}
[maven-mvnd] 11/28: Reset system properties after calling event syps (#729)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 3be232595f06d4d5aa74bd0fbb449c93ae937a93
Author: Stefan Oehme <st...@gmail.com>
AuthorDate: Wed Dec 7 18:05:50 2022 +0100
Reset system properties after calling event syps (#729)
Event spies may want to read system properties, which will fail if they are reset
too early. This change makes the behavior consistent with regular Maven.
---
daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 19aa5c59..9e686c15 100644
--- a/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java
+++ b/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java
@@ -242,8 +242,8 @@ public class DaemonMavenCli {
} catch (ExitException e) {
return e.exitCode;
} finally {
- System.setProperties(props);
eventSpyDispatcher.close();
+ System.setProperties(props);
Thread.currentThread().setContextClassLoader(tccl);
}
}
[maven-mvnd] 19/28: Improve the README file (#734)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit ee43e50b4b6b7ac968d1d5846fea66d54e90c1d8
Author: Plamen Totev <pl...@gmail.com>
AuthorDate: Wed Dec 14 12:52:24 2022 +0200
Improve the README file (#734)
There is wide spread misconception that in order to build a Maven project
the command is `mvn clean install`.
It would be better to promote the right way (in the vast majority of the cases)
to build a Maven project.
`mvnd verify` aligns with Maven documentation as well,
where the example command is `mvn verify`.
---
README.adoc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.adoc b/README.adoc
index 14783d12..795d89eb 100644
--- a/README.adoc
+++ b/README.adoc
@@ -152,7 +152,7 @@ $ xattr -r -d com.apple.quarantine mvnd-x.y.z-darwin-amd64
[source,shell]
----
-mvnd clean install
+mvnd verify
----
== `mvnd` specific options
[maven-mvnd] 06/28: Fix possible NullPointerException
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit bbffbd3651fa9367234f3e9e245c70f73976010f
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Wed Nov 23 09:35:22 2022 +0100
Fix possible NullPointerException
---
daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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 2dbf3f2d..19aa5c59 100644
--- a/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java
+++ b/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java
@@ -720,7 +720,10 @@ public class DaemonMavenCli {
logSummary(summary, references, "", cliRequest.showErrors);
if (exception instanceof LifecycleExecutionException) {
- failedProjects.add(((LifecycleExecutionException) exception).getProject());
+ MavenProject project = ((LifecycleExecutionException) exception).getProject();
+ if (project != null) {
+ failedProjects.add(project);
+ }
}
}
[maven-mvnd] 09/28: Clean up and upgrade dependencies/plugins versions (#741)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 3443ce32949cf04e5aa39f19abfdbe1d4836e4a6
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Wed Nov 23 13:23:10 2022 +0100
Clean up and upgrade dependencies/plugins versions (#741)
# Conflicts:
# pom.xml
---
build-plugin/pom.xml | 6 +++---
daemon/pom.xml | 7 -------
pom.xml | 56 ++++++++++++++++++++++++++++++++--------------------
3 files changed, 38 insertions(+), 31 deletions(-)
diff --git a/build-plugin/pom.xml b/build-plugin/pom.xml
index 7b584dc6..5f75cf10 100644
--- a/build-plugin/pom.xml
+++ b/build-plugin/pom.xml
@@ -34,9 +34,9 @@
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
- <roaster.version>2.23.2.Final</roaster.version>
- <maven.plugin-tools.version>3.6.0</maven.plugin-tools.version>
- <maven-plugin-plugin.version>${maven.plugin-tools.version}</maven-plugin-plugin.version>
+ <roaster.version>2.28.0.Final</roaster.version>
+ <maven.plugin-tools.version>3.7.0</maven.plugin-tools.version>
+ <maven-plugin-plugin.version>3.7.0</maven-plugin-plugin.version>
</properties>
<dependencyManagement>
diff --git a/daemon/pom.xml b/daemon/pom.xml
index b41136d2..cbf0700c 100644
--- a/daemon/pom.xml
+++ b/daemon/pom.xml
@@ -52,13 +52,6 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-interactivity-api</artifactId>
- <version>1.0</version>
- <exclusions>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<!-- Logging -->
diff --git a/pom.xml b/pom.xml
index 2162a332..736d8672 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,15 +73,15 @@
<!-- dependency versions a..z -->
<apiguardian-api.version>1.0.0</apiguardian-api.version>
- <assertj.version>3.16.1</assertj.version>
- <commons-compress.version>1.21</commons-compress.version>
+ <assertj.version>3.23.1</assertj.version>
+ <commons-compress.version>1.22</commons-compress.version>
<graalvm.version>22.3.0</graalvm.version>
<graalvm.plugin.version>0.9.18</graalvm.plugin.version>
<groovy.version>4.0.6</groovy.version>
<jakarta.inject.version>1.0</jakarta.inject.version>
<jansi.version>2.4.0</jansi.version>
<jline.version>3.21.0</jline.version>
- <junit.jupiter.version>5.7.2</junit.jupiter.version>
+ <junit.jupiter.version>5.9.1</junit.jupiter.version>
<logback.version>1.2.10</logback.version>
<maven.version>3.8.6</maven.version>
<maven.resolver.version>1.7.3</maven.resolver.version>
@@ -89,23 +89,26 @@
<sisu.version>0.3.5</sisu.version>
<!-- plugin versions a..z -->
- <buildnumber-maven-plugin.version>1.4</buildnumber-maven-plugin.version>
- <compiler.version>3.8.1</compiler.version>
+ <buildnumber-maven-plugin.version>3.0.0</buildnumber-maven-plugin.version>
+ <compiler.version>3.10.1</compiler.version>
<groovy-maven-plugin.version>2.1.0</groovy-maven-plugin.version>
- <license-maven-plugin.version>3.0</license-maven-plugin.version>
- <maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
- <maven-install-plugin.version>2.4</maven-install-plugin.version>
+ <license-maven-plugin.version>4.2.rc3</license-maven-plugin.version>
+ <maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
+ <maven-install-plugin.version>3.1.0</maven-install-plugin.version>
<maven-shade-plugin.version>3.4.1</maven-shade-plugin.version>
- <mrm.version>1.2.0</mrm.version>
- <surefire.version>3.0.0-M5</surefire.version>
+ <mrm.version>1.4.1</mrm.version>
+ <surefire.version>3.0.0-M7</surefire.version>
<!-- keep in sync with junit-platform-launcher.version -->
<junit-platform-launcher.version>1.3.2</junit-platform-launcher.version>
<!-- keep in sync with surefire.version -->
- <release.plugin.version>3.0.0-M5</release.plugin.version>
+ <release.plugin.version>3.0.0-M7</release.plugin.version>
<takari-lifecycle.version>1.13.9</takari-lifecycle.version>
<takari-provisio.version>1.0.19</takari-provisio.version>
- <javassist.version>3.27.0-GA</javassist.version>
+ <javassist.version>3.29.2-GA</javassist.version>
+ <maven-assembly-plugin.version>3.3.0</maven-assembly-plugin.version>
+ <xstream.version>1.4.19</xstream.version>
+ <plexus-interactivity-api.version>1.0</plexus-interactivity-api.version>
</properties>
<dependencyManagement>
@@ -223,38 +226,38 @@
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-native</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-agent</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-client</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-common</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-dist</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-daemon</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-helper-agent</artifactId>
- <version>0.9.0-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
@@ -300,6 +303,17 @@
<artifactId>javassist</artifactId>
<version>${javassist.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-interactivity-api</artifactId>
+ <version>${plexus-interactivity-api.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -388,7 +402,7 @@ limitations under the License.</inlineHeader>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
- <version>1.4.19</version>
+ <version>${xstream.version}</version>
</dependency>
</dependencies>
</plugin>
@@ -532,7 +546,7 @@ limitations under the License.</inlineHeader>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
- <version>3.3.0</version>
+ <version>${maven-assembly-plugin.version}</version>
<executions>
<execution>
<id>create-source-distribution</id>
[maven-mvnd] 23/28: Move signal handling into its own class (#754)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 852e4e553514d804f1676377410799bfa2542155
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Fri Dec 16 11:11:04 2022 +0100
Move signal handling into its own class (#754)
This opens some room to per-jdk implementation
---
.../org/mvndaemon/mvnd/common/SignalHelper.java | 32 ++++++++++++++++++++++
.../java/org/mvndaemon/mvnd/daemon/Server.java | 9 ++----
2 files changed, 34 insertions(+), 7 deletions(-)
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/SignalHelper.java b/common/src/main/java/org/mvndaemon/mvnd/common/SignalHelper.java
new file mode 100644
index 00000000..bf9ce527
--- /dev/null
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/SignalHelper.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.mvndaemon.mvnd.common;
+
+public class SignalHelper {
+
+ /**
+ * Ignore signals to that stopping the mvnd client won't stop the daemon
+ */
+ public static void ignoreStopSignals() throws Exception {
+ sun.misc.Signal.handle(new sun.misc.Signal("INT"), sun.misc.SignalHandler.SIG_IGN);
+ if (Os.current() != Os.WINDOWS) {
+ sun.misc.Signal.handle(new sun.misc.Signal("TSTP"), sun.misc.SignalHandler.SIG_IGN);
+ }
+ }
+}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java
index d16483c8..61bb75df 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Server.java
@@ -67,8 +67,8 @@ import org.mvndaemon.mvnd.common.DaemonStopEvent;
import org.mvndaemon.mvnd.common.Environment;
import org.mvndaemon.mvnd.common.Message;
import org.mvndaemon.mvnd.common.Message.BuildRequest;
-import org.mvndaemon.mvnd.common.Os;
import org.mvndaemon.mvnd.common.ProcessHelper;
+import org.mvndaemon.mvnd.common.SignalHelper;
import org.mvndaemon.mvnd.common.SocketFamily;
import org.mvndaemon.mvnd.daemon.DaemonExpiration.DaemonExpirationResult;
import org.mvndaemon.mvnd.daemon.DaemonExpiration.DaemonExpirationStrategy;
@@ -77,8 +77,6 @@ import org.mvndaemon.mvnd.logging.smart.LoggingOutputStream;
import org.mvndaemon.mvnd.logging.smart.ProjectBuildLogAppender;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import sun.misc.Signal;
-import sun.misc.SignalHandler;
public class Server implements AutoCloseable, Runnable {
@@ -110,10 +108,7 @@ public class Server implements AutoCloseable, Runnable {
// without ignoring those signals, a client being interrupted will
// also interrupt and kill the daemon.
try {
- Signal.handle(new Signal("INT"), SignalHandler.SIG_IGN);
- if (Os.current() != Os.WINDOWS) {
- Signal.handle(new Signal("TSTP"), SignalHandler.SIG_IGN);
- }
+ SignalHelper.ignoreStopSignals();
} catch (Throwable t) {
LOGGER.warn("Unable to ignore INT and TSTP signals", t);
}
[maven-mvnd] 05/28: Ignore reformat commit in git blame
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit fbf6dd16cb768b3f5b5d82b6597421deab86c3e4
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Tue Nov 22 15:47:53 2022 +0100
Ignore reformat commit in git blame
---
.git-blame-ignore-revs | 21 +++++++++++++++++++++
pom.xml | 1 +
2 files changed, 22 insertions(+)
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
new file mode 100644
index 00000000..f0bf0518
--- /dev/null
+++ b/.git-blame-ignore-revs
@@ -0,0 +1,21 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Change maven code style
+e95bd93dcae85c92bac36a823377d3e839698943
diff --git a/pom.xml b/pom.xml
index bcd36d02..e42ee5d2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -351,6 +351,7 @@ limitations under the License.</inlineHeader>
<exclude>**/.mvn/maven.config</exclude>
<exclude>**/.mvn/jvm.config</exclude>
<exclude>.gitattributes/</exclude>
+ <exclude>.git-blame-ignore-revs</exclude>
<exclude>.mvn/maven.config</exclude>
<exclude>.mvn/wrapper/</exclude>
<exclude>LICENSE.txt</exclude>
[maven-mvnd] 07/28: Switch graalvm to 22.3.0
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 790830daed4a14bf04c0b569bb13f20918fb03d5
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Sat Nov 19 10:11:05 2022 +0100
Switch graalvm to 22.3.0
---
.github/workflows/release.yaml | 2 +-
pom.xml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index d38e2209..6b1c9063 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -26,7 +26,7 @@ on:
- '*'
env:
- GRAALVM_VERSION: '22.2.0'
+ GRAALVM_VERSION: '22.3.0'
JAVA_VERSION: '17'
jobs:
diff --git a/pom.xml b/pom.xml
index e42ee5d2..f8f6059d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -75,8 +75,8 @@
<apiguardian-api.version>1.0.0</apiguardian-api.version>
<assertj.version>3.16.1</assertj.version>
<commons-compress.version>1.21</commons-compress.version>
- <graalvm.version>22.2.0</graalvm.version>
- <graalvm.plugin.version>0.9.13</graalvm.plugin.version>
+ <graalvm.version>22.3.0</graalvm.version>
+ <graalvm.plugin.version>0.9.18</graalvm.plugin.version>
<groovy.version>4.0.6</groovy.version>
<jakarta.inject.version>1.0</jakarta.inject.version>
<jansi.version>2.4.0</jansi.version>
[maven-mvnd] 04/28: Reformat
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit e95bd93dcae85c92bac36a823377d3e839698943
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Fri Jan 6 13:26:18 2023 +0100
Reformat
---
agent/pom.xml | 110 +--
.../main/java/org/mvndaemon/mvnd/agent/Agent.java | 40 +-
build-plugin/pom.xml | 164 ++--
.../org/mvndaemon/mvnd/plugin/doc/DocMojo.java | 46 +-
client/pom.xml | 278 +++---
.../org/mvndaemon/mvnd/client/BuildProperties.java | 25 +-
.../java/org/mvndaemon/mvnd/client/Client.java | 26 +-
.../java/org/mvndaemon/mvnd/client/Completion.java | 26 +-
.../mvnd/client/DaemonClientConnection.java | 39 +-
.../org/mvndaemon/mvnd/client/DaemonConnector.java | 160 ++--
.../mvndaemon/mvnd/client/DaemonDiagnostics.java | 67 +-
.../mvndaemon/mvnd/client/DaemonParameters.java | 125 ++-
.../org/mvndaemon/mvnd/client/DefaultClient.java | 117 ++-
.../org/mvndaemon/mvnd/client/ExecutionResult.java | 26 +-
.../mvnd/client/svm/ReflectionRegistration.java | 25 +-
.../client/svm/StaticMDCBinderSubstitution.java | 26 +-
.../mvnd/client/CompletionGeneratorTest.java | 31 +-
.../mvndaemon/mvnd/client/DaemonConnectorTest.java | 29 +-
.../org/mvndaemon/mvnd/client/EnvironmentTest.java | 60 +-
.../org/mvndaemon/mvnd/client/OsUtilsTest.java | 25 +-
common/pom.xml | 340 +++----
.../org/mvndaemon/mvnd/common/BufferCaster.java | 26 +-
.../org/mvndaemon/mvnd/common/BufferHelper.java | 35 +-
.../mvndaemon/mvnd/common/ByteChannelWrapper.java | 25 +-
.../mvnd/common/DaemonCompatibilitySpec.java | 35 +-
.../mvndaemon/mvnd/common/DaemonConnection.java | 32 +-
.../org/mvndaemon/mvnd/common/DaemonException.java | 26 +-
.../mvnd/common/DaemonExpirationStatus.java | 25 +-
.../java/org/mvndaemon/mvnd/common/DaemonInfo.java | 75 +-
.../org/mvndaemon/mvnd/common/DaemonRegistry.java | 71 +-
.../org/mvndaemon/mvnd/common/DaemonState.java | 26 +-
.../org/mvndaemon/mvnd/common/DaemonStopEvent.java | 33 +-
.../org/mvndaemon/mvnd/common/Environment.java | 73 +-
.../mvndaemon/mvnd/common/InterpolationHelper.java | 53 +-
.../java/org/mvndaemon/mvnd/common/IoUtils.java | 31 +-
.../org/mvndaemon/mvnd/common/JavaVersion.java | 25 +-
.../org/mvndaemon/mvnd/common/MavenDaemon.java | 61 +-
.../java/org/mvndaemon/mvnd/common/Message.java | 443 +++++----
.../java/org/mvndaemon/mvnd/common/OptionType.java | 25 +-
.../main/java/org/mvndaemon/mvnd/common/Os.java | 29 +-
.../java/org/mvndaemon/mvnd/common/OsUtils.java | 63 +-
.../org/mvndaemon/mvnd/common/ProcessHelper.java | 29 +-
.../org/mvndaemon/mvnd/common/SocketFamily.java | 88 +-
.../org/mvndaemon/mvnd/common/SocketHelper.java | 25 +-
.../java/org/mvndaemon/mvnd/common/TimeUtils.java | 46 +-
.../mvnd/common/logging/ClientOutput.java | 25 +-
.../mvnd/common/logging/TerminalOutput.java | 538 +++++------
.../mvndaemon/mvnd/common/DaemonRegistryTest.java | 89 +-
.../org/mvndaemon/mvnd/common/MessageTest.java | 33 +-
.../org/mvndaemon/mvnd/common/OsUtilsTest.java | 26 +-
.../mvndaemon/mvnd/common/SocketFamilyTest.java | 36 +-
.../org/mvndaemon/mvnd/common/TimeUtilsTest.java | 33 +-
daemon/pom.xml | 194 ++--
.../maven/classrealm/MvndClassRealmManager.java | 106 +-
.../java/org/apache/maven/cli/DaemonMavenCli.java | 240 ++---
.../org/apache/maven/cli/MvndHelpFormatter.java | 170 ++--
.../maven/project/CachingProjectBuilder.java | 257 +++--
.../apache/maven/project/SnapshotModelCache.java | 28 +-
.../mvndaemon/mvnd/builder/DependencyGraph.java | 100 +-
.../mvndaemon/mvnd/builder/ProjectComparator.java | 55 +-
.../mvnd/builder/ProjectExecutorService.java | 67 +-
.../mvndaemon/mvnd/builder/ReactorBuildQueue.java | 29 +-
.../mvndaemon/mvnd/builder/ReactorBuildStats.java | 46 +-
.../org/mvndaemon/mvnd/builder/SmartBuilder.java | 52 +-
.../mvndaemon/mvnd/builder/SmartBuilderImpl.java | 54 +-
.../main/java/org/mvndaemon/mvnd/cache/Cache.java | 26 +-
.../org/mvndaemon/mvnd/cache/CacheFactory.java | 26 +-
.../java/org/mvndaemon/mvnd/cache/CacheRecord.java | 26 +-
.../mvnd/cache/impl/DefaultCacheFactory.java | 26 +-
.../mvnd/cache/impl/TimestampCacheFactory.java | 72 +-
.../mvnd/cache/impl/WatchServiceCacheFactory.java | 42 +-
.../InvalidatingExtensionRealmCache.java | 36 +-
.../InvalidatingPluginArtifactsCache.java | 32 +-
.../InvalidatingPluginDescriptorCache.java | 33 +-
.../invalidating/InvalidatingPluginRealmCache.java | 32 +-
.../InvalidatingProjectArtifactsCache.java | 66 +-
.../InvalidatingRealmCacheEventSpy.java | 55 +-
.../java/org/mvndaemon/mvnd/cli/EnvHelper.java | 37 +-
.../mvndaemon/mvnd/daemon/ClientDispatcher.java | 126 ++-
.../java/org/mvndaemon/mvnd/daemon/Connection.java | 26 +-
.../mvndaemon/mvnd/daemon/DaemonExpiration.java | 113 +--
.../mvndaemon/mvnd/daemon/DaemonMemoryStatus.java | 52 +-
.../java/org/mvndaemon/mvnd/daemon/Server.java | 200 ++--
.../mvnd/execution/BuildResumptionAnalyzer.java | 27 +-
.../mvnd/execution/BuildResumptionData.java | 28 +-
.../execution/BuildResumptionDataRepository.java | 30 +-
.../BuildResumptionPersistenceException.java | 27 +-
.../execution/DefaultBuildResumptionAnalyzer.java | 30 +-
.../DefaultBuildResumptionDataRepository.java | 28 +-
.../mvnd/interactivity/DaemonPrompter.java | 32 +-
.../logging/internal/MvndSlf4jConfiguration.java | 46 +-
.../mvnd/logging/internal/SimpleAppender.java | 55 +-
.../mvnd/logging/internal/Slf4jLogger.java | 7 +-
.../mvnd/logging/internal/Slf4jLoggerManager.java | 16 +-
.../mvnd/logging/smart/BuildEventListener.java | 58 +-
.../logging/smart/LoggingExecutionListener.java | 47 +-
.../mvnd/logging/smart/LoggingOutputStream.java | 25 +-
.../logging/smart/ProjectBuildLogAppender.java | 41 +-
.../mvnd/plugin/CachingPluginVersionResolver.java | 35 +-
.../mvnd/plugin/CliMavenPluginManager.java | 134 +--
.../plugin/ValidatingConfigurationListener.java | 7 +-
.../syncontext/DaemonNamedLockFactorySelector.java | 36 +-
.../mvndaemon/mvnd/timing/BuildTimeEventSpy.java | 101 +-
.../mvnd/transfer/DaemonMavenTransferListener.java | 25 +-
.../mvnd/builder/AbstractSmartBuilderTest.java | 26 +-
.../org/mvndaemon/mvnd/builder/DagWidthTest.java | 82 +-
.../mvnd/builder/ProjectComparatorTest.java | 30 +-
.../mvnd/builder/ProjectExecutorServiceTest.java | 36 +-
.../mvnd/builder/ReactorBuildQueueTest.java | 25 +-
.../mvnd/builder/TestProjectDependencyGraph.java | 25 +-
.../mvnd/cache/impl/CacheFactoryTest.java | 31 +-
.../java/org/mvndaemon/mvnd/cli/EnvHelperTest.java | 35 +-
.../mvnd/daemon/ClientDispatcherTest.java | 26 +-
.../java/org/mvndaemon/mvnd/daemon/ServerTest.java | 29 +-
dist/pom.xml | 108 +--
helper/pom.xml | 22 +-
.../java/org/mvndaemon/mvnd/pump/AgentHelper.java | 31 +-
integration-tests/pom.xml | 322 ++++---
.../mvnd/assertj/MatchInOrderAmongOthers.java | 30 +-
.../mvndaemon/mvnd/assertj/TestClientOutput.java | 35 +-
.../mvnd/it/AttachedArtifactResolutionTest.java | 26 +-
.../org/mvndaemon/mvnd/it/BootstrapPluginTest.java | 32 +-
.../org/mvndaemon/mvnd/it/CompletionNativeIT.java | 25 +-
.../java/org/mvndaemon/mvnd/it/CompletionTest.java | 28 +-
.../mvndaemon/mvnd/it/ConcurrentDownloadsTest.java | 33 +-
.../org/mvndaemon/mvnd/it/DaemonCrashTest.java | 38 +-
.../org/mvndaemon/mvnd/it/DeleteRepoNativeIT.java | 29 +-
.../java/org/mvndaemon/mvnd/it/DeleteRepoTest.java | 29 +-
.../test/java/org/mvndaemon/mvnd/it/DistroIT.java | 44 +-
.../test/java/org/mvndaemon/mvnd/it/DupGATest.java | 25 +-
.../org/mvndaemon/mvnd/it/EnvironmentTest.java | 46 +-
.../java/org/mvndaemon/mvnd/it/ExecOutputTest.java | 33 +-
.../org/mvndaemon/mvnd/it/ExtensionsNativeIT.java | 33 +-
.../java/org/mvndaemon/mvnd/it/ExtensionsTest.java | 29 +-
.../java/org/mvndaemon/mvnd/it/ForkedTest.java | 37 +-
.../org/mvndaemon/mvnd/it/InteractiveTest.java | 32 +-
.../org/mvndaemon/mvnd/it/InvokerNativeIT.java | 32 +-
.../java/org/mvndaemon/mvnd/it/InvokerTest.java | 29 +-
.../org/mvndaemon/mvnd/it/JUnitPlatformTest.java | 30 +-
.../org/mvndaemon/mvnd/it/MavenConfNativeIT.java | 45 +-
.../java/org/mvndaemon/mvnd/it/MavenConfTest.java | 29 +-
.../org/mvndaemon/mvnd/it/MaxHeapNativeIT.java | 65 +-
.../java/org/mvndaemon/mvnd/it/MaxHeapTest.java | 38 +-
.../mvndaemon/mvnd/it/ModuleAndPluginNativeIT.java | 57 +-
.../org/mvndaemon/mvnd/it/ModuleAndPluginTest.java | 29 +-
.../org/mvndaemon/mvnd/it/MultiLookupTest.java | 34 +-
.../org/mvndaemon/mvnd/it/MultiModuleTest.java | 70 +-
.../java/org/mvndaemon/mvnd/it/MvndTestUtil.java | 29 +-
.../mvnd/it/NewManagedModuleNativeIT.java | 28 +-
.../mvndaemon/mvnd/it/NewManagedModuleTest.java | 29 +-
.../mvndaemon/mvnd/it/ParentWithPropertyTest.java | 25 +-
.../java/org/mvndaemon/mvnd/it/RawStreamsTest.java | 35 +-
.../mvndaemon/mvnd/it/ResidentExtensionsTest.java | 46 +-
.../mvndaemon/mvnd/it/SingleModuleNativeIT.java | 33 +-
.../org/mvndaemon/mvnd/it/SingleModuleTest.java | 39 +-
.../mvndaemon/mvnd/it/SpecificFileNativeIT.java | 62 +-
.../java/org/mvndaemon/mvnd/it/StopStatusTest.java | 29 +-
.../mvndaemon/mvnd/it/ThreadOptionNativeIT.java | 25 +-
.../org/mvndaemon/mvnd/it/ThreadOptionTest.java | 25 +-
.../org/mvndaemon/mvnd/it/TypeDescriptionTest.java | 25 +-
.../mvndaemon/mvnd/it/UpgradesInBomNativeIT.java | 40 +-
.../org/mvndaemon/mvnd/it/UpgradesInBomTest.java | 28 +-
.../org/mvndaemon/mvnd/it/VersionNativeIT.java | 29 +-
.../java/org/mvndaemon/mvnd/it/VersionTest.java | 26 +-
.../org/mvndaemon/mvnd/junit/ClientFactory.java | 25 +-
.../org/mvndaemon/mvnd/junit/JvmTestClient.java | 30 +-
.../org/mvndaemon/mvnd/junit/MvndNativeTest.java | 25 +-
.../java/org/mvndaemon/mvnd/junit/MvndTest.java | 25 +-
.../mvndaemon/mvnd/junit/MvndTestExtension.java | 131 +--
.../org/mvndaemon/mvnd/junit/NativeTestClient.java | 34 +-
.../org/mvndaemon/mvnd/junit/TestParameters.java | 45 +-
.../org/mvndaemon/mvnd/junit/TestRegistry.java | 36 +-
.../java/org/mvndaemon/mvnd/junit/TestUtils.java | 26 +-
native/pom.xml | 178 ++--
.../java/org/mvndaemon/mvnd/nativ/CLibrary.java | 26 +-
.../org/mvndaemon/mvnd/nativ/MvndNativeLoader.java | 57 +-
.../main/java/org/mvndaemon/mvnd/nativ/OSInfo.java | 35 +-
.../org/mvndaemon/mvnd/nativ/CLibraryTest.java | 31 +-
.../mvndaemon/mvnd/nativ/MvndNativeLoaderTest.java | 25 +-
pom.xml | 1009 ++++++++++----------
180 files changed, 6086 insertions(+), 5299 deletions(-)
diff --git a/agent/pom.xml b/agent/pom.xml
index aed7a480..667afb39 100644
--- a/agent/pom.xml
+++ b/agent/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2021 the original author or authors.
@@ -15,67 +16,66 @@
limitations under the License.
-->
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.maven.daemon</groupId>
- <artifactId>mvnd</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.maven.daemon</groupId>
+ <artifactId>mvnd</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ </parent>
- <artifactId>mvnd-agent</artifactId>
+ <artifactId>mvnd-agent</artifactId>
- <packaging>jar</packaging>
- <name>Maven Daemon - Agent</name>
+ <packaging>jar</packaging>
+ <name>Maven Daemon - Agent</name>
- <dependencies>
+ <dependencies>
- <dependency>
- <groupId>org.javassist</groupId>
- <artifactId>javassist</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.javassist</groupId>
+ <artifactId>javassist</artifactId>
+ </dependency>
- </dependencies>
+ </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestEntries>
- <Premain-Class>org.mvndaemon.mvnd.agent.Agent</Premain-Class>
- <Boot-Class-Path>mvnd-helper-agent-${project.version}.jar</Boot-Class-Path>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <filters>
- <filter>
- <artifact>org.javassist:javassist</artifact>
- <excludes>
- <exclude>META-INF/MANIFEST.MF</exclude>
- </excludes>
- </filter>
- </filters>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Premain-Class>org.mvndaemon.mvnd.agent.Agent</Premain-Class>
+ <Boot-Class-Path>mvnd-helper-agent-${project.version}.jar</Boot-Class-Path>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <filters>
+ <filter>
+ <artifact>org.javassist:javassist</artifact>
+ <excludes>
+ <exclude>META-INF/MANIFEST.MF</exclude>
+ </excludes>
+ </filter>
+ </filters>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/agent/src/main/java/org/mvndaemon/mvnd/agent/Agent.java b/agent/src/main/java/org/mvndaemon/mvnd/agent/Agent.java
index 3c33984a..2109f5b3 100644
--- a/agent/src/main/java/org/mvndaemon/mvnd/agent/Agent.java
+++ b/agent/src/main/java/org/mvndaemon/mvnd/agent/Agent.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.agent;
@@ -37,15 +40,21 @@ public class Agent {
public static void premain(String args, Instrumentation instrumentation) throws Exception {
instrumentation.addTransformer(new ClassFileTransformer() {
@Override
- public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined,
- ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException {
+ public byte[] transform(
+ ClassLoader loader,
+ String className,
+ Class<?> classBeingRedefined,
+ ProtectionDomain protectionDomain,
+ byte[] classfileBuffer)
+ throws IllegalClassFormatException {
if ("java/lang/ProcessBuilder".equals(className)) {
try {
ClassPool pool = ClassPool.getDefault();
CtClass clazz = pool.get("java.lang.ProcessBuilder");
pool.importPackage("org.mvndaemon.mvnd.pump");
- clazz.getDeclaredMethod("start",
- new CtClass[] { clazz.getClassPool().get("java.lang.ProcessBuilder$Redirect[]") })
+ clazz.getDeclaredMethod(
+ "start",
+ new CtClass[] {clazz.getClassPool().get("java.lang.ProcessBuilder$Redirect[]")})
.insertBefore(START_WITH_PIPES);
byte[] data = clazz.toBytecode();
clazz.detach();
@@ -60,5 +69,4 @@ public class Agent {
}
});
}
-
}
diff --git a/build-plugin/pom.xml b/build-plugin/pom.xml
index 35007806..7b584dc6 100644
--- a/build-plugin/pom.xml
+++ b/build-plugin/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2019 the original author or authors.
@@ -15,89 +16,88 @@
limitations under the License.
-->
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.maven.daemon</groupId>
- <artifactId>mvnd</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>mvnd-build-maven-plugin</artifactId>
-
- <packaging>maven-plugin</packaging>
- <name>Maven Daemon - Documentation Maven Plugin</name>
-
- <properties>
- <maven.compiler.target>11</maven.compiler.target>
- <maven.compiler.source>11</maven.compiler.source>
-
- <roaster.version>2.23.2.Final</roaster.version>
- <maven.plugin-tools.version>3.6.0</maven.plugin-tools.version>
- <maven-plugin-plugin.version>${maven.plugin-tools.version}</maven-plugin-plugin.version>
- </properties>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>${maven.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-annotations</artifactId>
- <version>${maven.plugin-tools.version}</version>
- </dependency>
-
- </dependencies>
- </dependencyManagement>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.maven.daemon</groupId>
+ <artifactId>mvnd</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>mvnd-build-maven-plugin</artifactId>
+
+ <packaging>maven-plugin</packaging>
+ <name>Maven Daemon - Documentation Maven Plugin</name>
+
+ <properties>
+ <maven.compiler.target>11</maven.compiler.target>
+ <maven.compiler.source>11</maven.compiler.source>
+
+ <roaster.version>2.23.2.Final</roaster.version>
+ <maven.plugin-tools.version>3.6.0</maven.plugin-tools.version>
+ <maven-plugin-plugin.version>${maven.plugin-tools.version}</maven-plugin-plugin.version>
+ </properties>
+
+ <dependencyManagement>
<dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-annotations</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.forge.roaster</groupId>
- <artifactId>roaster-jdt</artifactId>
- <version>${roaster.version}</version>
- </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>${maven.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <version>${maven.plugin-tools.version}</version>
+ </dependency>
</dependencies>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <version>${maven-plugin-plugin.version}</version>
- </plugin>
- </plugins>
- </pluginManagement>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <configuration>
- <goalPrefix>mvnd-build</goalPrefix>
- <mojoDependencies>
- <dep>org.apache.maven:maven-plugin-api</dep>
- </mojoDependencies>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
\ No newline at end of file
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.forge.roaster</groupId>
+ <artifactId>roaster-jdt</artifactId>
+ <version>${roaster.version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>${maven-plugin-plugin.version}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <configuration>
+ <goalPrefix>mvnd-build</goalPrefix>
+ <mojoDependencies>
+ <dep>org.apache.maven:maven-plugin-api</dep>
+ </mojoDependencies>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/build-plugin/src/main/java/org/mvndaemon/mvnd/plugin/doc/DocMojo.java b/build-plugin/src/main/java/org/mvndaemon/mvnd/plugin/doc/DocMojo.java
index 46285f3d..5a660b8a 100644
--- a/build-plugin/src/main/java/org/mvndaemon/mvnd/plugin/doc/DocMojo.java
+++ b/build-plugin/src/main/java/org/mvndaemon/mvnd/plugin/doc/DocMojo.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.plugin.doc;
@@ -46,7 +49,12 @@ import org.jboss.forge.roaster.model.source.JavaEnumSource;
/**
* Extracts JavaDoc blocks from enum entries and stores them into a properties file.
*/
-@Mojo(name = "doc", defaultPhase = LifecyclePhase.NONE, threadSafe = true, requiresProject = true, requiresDependencyResolution = ResolutionScope.NONE)
+@Mojo(
+ name = "doc",
+ defaultPhase = LifecyclePhase.NONE,
+ threadSafe = true,
+ requiresProject = true,
+ requiresDependencyResolution = ResolutionScope.NONE)
public class DocMojo extends AbstractMojo {
/**
@@ -80,8 +88,7 @@ public class DocMojo extends AbstractMojo {
static void extractEnumJavaDoc(Path basePath, String enumClassName) throws MojoFailureException {
final String classRelPath = enumClassName.replace('.', '/');
- final Path enumClassLocation = basePath.resolve("src/main/java")
- .resolve(classRelPath + ".java");
+ final Path enumClassLocation = basePath.resolve("src/main/java").resolve(classRelPath + ".java");
final Path propsPath = basePath.resolve("target/classes/" + classRelPath + ".javadoc.properties");
try {
Files.createDirectories(propsPath.getParent());
@@ -99,8 +106,7 @@ public class DocMojo extends AbstractMojo {
final Properties optionsProperties = new SortedProperties();
for (EnumConstantSource enumConst : source.getEnumConstants()) {
final JavaDocSource<EnumConstantSource> javaDoc = enumConst.getJavaDoc();
- final String javadocText = javaDoc.getText()
- .replaceAll("/", "/");
+ final String javadocText = javaDoc.getText().replaceAll("/", "/");
optionsProperties.setProperty(enumConst.getName(), javadocText);
}
optionsProperties.store(Files.newOutputStream(propsPath), null);
@@ -137,14 +143,12 @@ public class DocMojo extends AbstractMojo {
}
@Override
- public void store(Writer writer, String comments)
- throws IOException {
+ public void store(Writer writer, String comments) throws IOException {
super.store(new SkipFirstLineBufferedWriter(writer), null);
}
@Override
- public void store(OutputStream out, String comments)
- throws IOException {
+ public void store(OutputStream out, String comments) throws IOException {
this.store(new OutputStreamWriter(out, "8859_1"), comments);
}
@@ -177,8 +181,6 @@ public class DocMojo extends AbstractMojo {
super.write(cbuf, off, len);
}
}
-
}
-
}
}
diff --git a/client/pom.xml b/client/pom.xml
index abc00937..efc003a5 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2019 the original author or authors.
@@ -15,159 +16,156 @@
limitations under the License.
-->
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.maven.daemon</groupId>
- <artifactId>mvnd</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.maven.daemon</groupId>
+ <artifactId>mvnd</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ </parent>
- <artifactId>mvnd-client</artifactId>
+ <artifactId>mvnd-client</artifactId>
- <packaging>jar</packaging>
- <name>Maven Daemon - Client</name>
+ <packaging>jar</packaging>
+ <name>Maven Daemon - Client</name>
- <properties>
- <maven.compiler.target>11</maven.compiler.target>
- <maven.compiler.source>11</maven.compiler.source>
- </properties>
+ <properties>
+ <maven.compiler.target>11</maven.compiler.target>
+ <maven.compiler.source>11</maven.compiler.source>
+ </properties>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven.daemon</groupId>
- <artifactId>mvnd-common</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-embedder</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- </dependency>
- <dependency>
- <groupId>org.graalvm.nativeimage</groupId>
- <artifactId>svm</artifactId>
- <scope>provided</scope>
- </dependency>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.daemon</groupId>
+ <artifactId>mvnd-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-embedder</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.graalvm.nativeimage</groupId>
+ <artifactId>svm</artifactId>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
- <build>
- <resources>
- <resource>
- <directory>${basedir}/src/main/resources</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <executions>
- <execution>
- <id>enforce-bytecode-version</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- <configuration>
- <rules>
- <enforceBytecodeVersion>
- <excludes>
- <exclude>org.graalvm.nativeimage:svm</exclude>
- </excludes>
- </enforceBytecodeVersion>
- </rules>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>buildnumber-maven-plugin</artifactId>
- <configuration>
- <locale>en_US</locale>
- </configuration>
- <executions>
- <execution>
- <phase>validate</phase>
- <goals>
- <goal>create</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <compilerArgs>
- <arg>--add-exports=java.base/sun.nio.ch=ALL-UNNAMED</arg>
- <arg>--add-exports=java.base/jdk.internal.module=ALL-UNNAMED</arg>
- </compilerArgs>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <systemPropertyVariables>
- <project.basedir>${project.basedir}</project.basedir>
- </systemPropertyVariables>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <build>
+ <resources>
+ <resource>
+ <filtering>true</filtering>
+ <directory>${basedir}/src/main/resources</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>enforce-bytecode-version</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <enforceBytecodeVersion>
+ <excludes>
+ <exclude>org.graalvm.nativeimage:svm</exclude>
+ </excludes>
+ </enforceBytecodeVersion>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>buildnumber-maven-plugin</artifactId>
+ <configuration>
+ <locale>en_US</locale>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>create</goal>
+ </goals>
+ <phase>validate</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <compilerArgs>
+ <arg>--add-exports=java.base/sun.nio.ch=ALL-UNNAMED</arg>
+ <arg>--add-exports=java.base/jdk.internal.module=ALL-UNNAMED</arg>
+ </compilerArgs>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <project.basedir>${project.basedir}</project.basedir>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
- <profiles>
- <profile>
- <id>native</id>
+ <profiles>
+ <profile>
+ <id>native</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.graalvm.buildtools</groupId>
- <artifactId>native-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>build</goal>
- </goals>
- <phase>package</phase>
- </execution>
- </executions>
- <configuration>
- <skip>false</skip>
- <mainClass>org.mvndaemon.mvnd.client.DefaultClient</mainClass>
- <imageName>mvnd</imageName>
- <buildArgs>
- --no-server
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.graalvm.buildtools</groupId>
+ <artifactId>native-maven-plugin</artifactId>
+ <configuration>
+ <skip>false</skip>
+ <mainClass>org.mvndaemon.mvnd.client.DefaultClient</mainClass>
+ <imageName>mvnd</imageName>
+ <buildArgs>--no-server
--no-fallback
--allow-incomplete-classpath
-H:IncludeResources=org/mvndaemon/mvnd/.*
-H:IncludeResources=mvnd-bash-completion.bash
-H:-ParseRuntimeOptions
-H:+AddAllCharsets
- -ea
- </buildArgs>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ -ea</buildArgs>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ <phase>package</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
-</project>
\ No newline at end of file
+</project>
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/BuildProperties.java b/client/src/main/java/org/mvndaemon/mvnd/client/BuildProperties.java
index 8282b986..5c3aaa47 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/BuildProperties.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/BuildProperties.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2018 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.client;
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/Client.java b/client/src/main/java/org/mvndaemon/mvnd/client/Client.java
index 34b79b03..8f82b4e0 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/Client.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/Client.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.client;
@@ -26,5 +29,4 @@ public interface Client {
default ExecutionResult execute(ClientOutput output, String... args) throws InterruptedException {
return execute(output, Arrays.asList(args));
}
-
}
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/Completion.java b/client/src/main/java/org/mvndaemon/mvnd/client/Completion.java
index 765e5e46..f971f82a 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/Completion.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/Completion.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.client;
@@ -37,5 +40,4 @@ public class Completion {
throw new UncheckedIOException("Could not read " + bashCompletionPath, e);
}
}
-
}
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonClientConnection.java b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonClientConnection.java
index 210fbbdc..24e5875e 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonClientConnection.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonClientConnection.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.client;
@@ -41,7 +44,7 @@ import org.slf4j.LoggerFactory;
*/
public class DaemonClientConnection implements Closeable {
- private final static Logger LOG = LoggerFactory.getLogger(DaemonClientConnection.class);
+ private static final Logger LOG = LoggerFactory.getLogger(DaemonClientConnection.class);
private final DaemonConnection connection;
private final DaemonInfo daemon;
@@ -56,8 +59,12 @@ public class DaemonClientConnection implements Closeable {
private final long maxKeepAliveMs;
private final DaemonParameters parameters;
- public DaemonClientConnection(DaemonConnection connection, DaemonInfo daemon,
- StaleAddressDetector staleAddressDetector, boolean newDaemon, DaemonParameters parameters) {
+ public DaemonClientConnection(
+ DaemonConnection connection,
+ DaemonInfo daemon,
+ StaleAddressDetector staleAddressDetector,
+ boolean newDaemon,
+ DaemonParameters parameters) {
this.connection = connection;
this.daemon = daemon;
this.staleAddressDetector = staleAddressDetector;
@@ -126,7 +133,8 @@ public class DaemonClientConnection implements Closeable {
if (!hasReceived && newDaemon) {
throw new ConnectException("Could not receive a message from the daemon.\n" + diag.describe(), e);
} else if (staleAddressDetector.maybeStaleAddress(e)) {
- throw new StaleAddressException("Could not receive a message from the daemon.\n" + diag.describe(), e);
+ throw new StaleAddressException(
+ "Could not receive a message from the daemon.\n" + diag.describe(), e);
}
} finally {
hasReceived = true;
@@ -171,5 +179,4 @@ public class DaemonClientConnection implements Closeable {
*/
boolean maybeStaleAddress(Exception failure);
}
-
}
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java
index 83ef6742..70d3d933 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonConnector.java
@@ -1,20 +1,26 @@
/*
- * Copyright 2011-2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.client;
+import static java.lang.Thread.sleep;
+import static org.mvndaemon.mvnd.common.DaemonState.Canceled;
+
import java.io.File;
import java.io.IOException;
import java.net.SocketAddress;
@@ -53,9 +59,6 @@ import org.mvndaemon.mvnd.common.logging.ClientOutput;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import static java.lang.Thread.sleep;
-import static org.mvndaemon.mvnd.common.DaemonState.Canceled;
-
/**
* File origin:
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/client/DefaultDaemonConnector.java
@@ -94,11 +97,11 @@ public class DaemonConnector {
return connectNoDaemon();
}
- final DaemonCompatibilitySpec constraint = new DaemonCompatibilitySpec(
- parameters.javaHome(), parameters.getDaemonOpts());
+ final DaemonCompatibilitySpec constraint =
+ new DaemonCompatibilitySpec(parameters.javaHome(), parameters.getDaemonOpts());
output.accept(Message.buildStatus("Looking up daemon..."));
- Map<Boolean, List<DaemonInfo>> idleBusy = registry.getAll().stream()
- .collect(Collectors.groupingBy(di -> di.getState() == DaemonState.Idle));
+ Map<Boolean, List<DaemonInfo>> idleBusy =
+ registry.getAll().stream().collect(Collectors.groupingBy(di -> di.getState() == DaemonState.Idle));
final Collection<DaemonInfo> idleDaemons = idleBusy.getOrDefault(true, Collections.emptyList());
final Collection<DaemonInfo> busyDaemons = idleBusy.getOrDefault(false, Collections.emptyList());
@@ -128,20 +131,27 @@ public class DaemonConnector {
}
String daemon = ProcessHandle.current().pid() + "-" + System.currentTimeMillis();
Properties properties = new Properties();
- properties.put(Environment.JAVA_HOME.getProperty(), parameters.javaHome().toString());
+ properties.put(
+ Environment.JAVA_HOME.getProperty(), parameters.javaHome().toString());
properties.put(Environment.USER_DIR.getProperty(), parameters.userDir().toString());
- properties.put(Environment.USER_HOME.getProperty(), parameters.userHome().toString());
- properties.put(Environment.MVND_HOME.getProperty(), parameters.mvndHome().toString());
+ properties.put(
+ Environment.USER_HOME.getProperty(), parameters.userHome().toString());
+ properties.put(
+ Environment.MVND_HOME.getProperty(), parameters.mvndHome().toString());
properties.put(Environment.MVND_ID.getProperty(), daemon);
- properties.put(Environment.MVND_DAEMON_STORAGE.getProperty(), parameters.daemonStorage().toString());
- properties.put(Environment.MVND_REGISTRY.getProperty(), parameters.registry().toString());
+ properties.put(
+ Environment.MVND_DAEMON_STORAGE.getProperty(),
+ parameters.daemonStorage().toString());
+ properties.put(
+ Environment.MVND_REGISTRY.getProperty(), parameters.registry().toString());
properties.putAll(parameters.getDaemonOptsMap());
Environment.setProperties(properties);
AtomicReference<Throwable> throwable = new AtomicReference<>();
Thread serverThread = new Thread(() -> {
try {
Class<?> clazz = getClass().getClassLoader().loadClass("org.mvndaemon.mvnd.daemon.Server");
- try (AutoCloseable server = (AutoCloseable) clazz.getConstructor().newInstance()) {
+ try (AutoCloseable server =
+ (AutoCloseable) clazz.getConstructor().newInstance()) {
((Runnable) server).run();
}
} catch (Throwable t) {
@@ -164,34 +174,37 @@ public class DaemonConnector {
throw new RuntimeException("Unable to connect to internal daemon", throwable.get());
}
- private String handleStopEvents(String daemonId, Collection<DaemonInfo> idleDaemons, Collection<DaemonInfo> busyDaemons) {
+ private String handleStopEvents(
+ String daemonId, Collection<DaemonInfo> idleDaemons, Collection<DaemonInfo> busyDaemons) {
final List<DaemonStopEvent> stopEvents = registry.getStopEvents();
// Clean up old stop events
long time = System.currentTimeMillis() - TimeUnit.HOURS.toMillis(1);
- List<DaemonStopEvent> oldStopEvents = stopEvents.stream()
- .filter(e -> e.getTimestamp() < time)
- .collect(Collectors.toList());
+ List<DaemonStopEvent> oldStopEvents =
+ stopEvents.stream().filter(e -> e.getTimestamp() < time).collect(Collectors.toList());
registry.removeStopEvents(oldStopEvents);
final List<DaemonStopEvent> recentStopEvents = stopEvents.stream()
.filter(e -> e.getTimestamp() >= time)
- .collect(Collectors.groupingBy(DaemonStopEvent::getDaemonId,
- Collectors.minBy(this::compare)))
+ .collect(Collectors.groupingBy(DaemonStopEvent::getDaemonId, Collectors.minBy(this::compare)))
.values()
.stream()
.map(Optional::get)
.collect(Collectors.toList());
for (DaemonStopEvent stopEvent : recentStopEvents) {
- LOGGER.debug("Previous Daemon ({}) stopped at {} {}",
- stopEvent.getDaemonId(), stopEvent.getTimestamp(), stopEvent.getReason());
+ LOGGER.debug(
+ "Previous Daemon ({}) stopped at {} {}",
+ stopEvent.getDaemonId(),
+ stopEvent.getTimestamp(),
+ stopEvent.getReason());
}
return generate(daemonId, busyDaemons.size(), idleDaemons.size(), recentStopEvents.size());
}
- public static String generate(final String daemonId, final int numBusy, final int numIncompatible, final int numStopped) {
+ public static String generate(
+ final String daemonId, final int numBusy, final int numIncompatible, final int numStopped) {
final int totalUnavailableDaemons = numBusy + numIncompatible + numStopped;
if (totalUnavailableDaemons > 0) {
final List<String> reasons = new ArrayList<>();
@@ -223,21 +236,23 @@ public class DaemonConnector {
return 0;
}
- private DaemonClientConnection connectToIdleDaemon(Collection<DaemonInfo> idleDaemons, DaemonCompatibilitySpec constraint) {
+ private DaemonClientConnection connectToIdleDaemon(
+ Collection<DaemonInfo> idleDaemons, DaemonCompatibilitySpec constraint) {
final List<DaemonInfo> compatibleIdleDaemons = getCompatibleDaemons(idleDaemons, constraint);
LOGGER.debug("Found {} idle daemons, {} compatibles", idleDaemons.size(), compatibleIdleDaemons.size());
return findConnection(compatibleIdleDaemons);
}
- private DaemonClientConnection connectToCanceledDaemon(Collection<DaemonInfo> busyDaemons,
- DaemonCompatibilitySpec constraint) {
+ private DaemonClientConnection connectToCanceledDaemon(
+ Collection<DaemonInfo> busyDaemons, DaemonCompatibilitySpec constraint) {
DaemonClientConnection connection = null;
- List<DaemonInfo> canceledBusy = busyDaemons.stream()
- .filter(di -> di.getState() == Canceled)
- .collect(Collectors.toList());
- final List<DaemonInfo> compatibleCanceledDaemons = getCompatibleDaemons(
- canceledBusy, constraint);
- LOGGER.debug("Found {} busy daemons, {} cancelled, {} compatibles", busyDaemons.size(), canceledBusy.size(),
+ List<DaemonInfo> canceledBusy =
+ busyDaemons.stream().filter(di -> di.getState() == Canceled).collect(Collectors.toList());
+ final List<DaemonInfo> compatibleCanceledDaemons = getCompatibleDaemons(canceledBusy, constraint);
+ LOGGER.debug(
+ "Found {} busy daemons, {} cancelled, {} compatibles",
+ busyDaemons.size(),
+ canceledBusy.size(),
compatibleCanceledDaemons.size());
if (!compatibleCanceledDaemons.isEmpty()) {
LOGGER.debug("Waiting for daemons with canceled builds to become available");
@@ -261,8 +276,10 @@ public class DaemonConnector {
if (result.isCompatible()) {
compatibleDaemons.add(daemon);
} else {
- LOGGER.debug("{} daemon {} does not match the desired criteria: "
- + result.getWhy(), daemon.getState(), daemon.getId());
+ LOGGER.debug(
+ "{} daemon {} does not match the desired criteria: " + result.getWhy(),
+ daemon.getState(),
+ daemon.getId());
}
}
return compatibleDaemons;
@@ -295,7 +312,8 @@ public class DaemonConnector {
}
} while (process.isAlive() && System.currentTimeMillis() - start < DEFAULT_CONNECT_TIMEOUT);
DaemonDiagnostics diag = new DaemonDiagnostics(daemonId, parameters);
- throw new DaemonException.ConnectException("Timeout waiting to connect to the Maven daemon.\n" + diag.describe());
+ throw new DaemonException.ConnectException(
+ "Timeout waiting to connect to the Maven daemon.\n" + diag.describe());
}
static String newId() {
@@ -364,24 +382,33 @@ public class DaemonConnector {
args.add("-Dmaven.home=" + mvndHome.resolve("mvn"));
args.add("-Dmaven.conf=" + mvndHome.resolve("mvn/conf"));
- Environment.MVND_JAVA_HOME.addCommandLineOption(args, parameters.javaHome().toString());
- Environment.LOGBACK_CONFIGURATION_FILE
- .addCommandLineOption(args, parameters.logbackConfigurationPath().toString());
+ Environment.MVND_JAVA_HOME.addCommandLineOption(
+ args, parameters.javaHome().toString());
+ Environment.LOGBACK_CONFIGURATION_FILE.addCommandLineOption(
+ args, parameters.logbackConfigurationPath().toString());
Environment.MVND_ID.addCommandLineOption(args, daemonId);
- Environment.MVND_DAEMON_STORAGE.addCommandLineOption(args, parameters.daemonStorage().toString());
- Environment.MVND_REGISTRY.addCommandLineOption(args, parameters.registry().toString());
- Environment.MVND_SOCKET_FAMILY.addCommandLineOption(args,
- parameters.socketFamily().orElseGet(
- () -> getJavaVersion() >= 16.0f ? SocketFamily.unix : SocketFamily.inet)
+ Environment.MVND_DAEMON_STORAGE.addCommandLineOption(
+ args, parameters.daemonStorage().toString());
+ Environment.MVND_REGISTRY.addCommandLineOption(
+ args, parameters.registry().toString());
+ Environment.MVND_SOCKET_FAMILY.addCommandLineOption(
+ args,
+ parameters
+ .socketFamily()
+ .orElseGet(() -> getJavaVersion() >= 16.0f ? SocketFamily.unix : SocketFamily.inet)
.toString());
parameters.discriminatingCommandLineOptions(args);
args.add(MavenDaemon.class.getName());
command = String.join(" ", args);
- LOGGER.debug("Starting daemon process: id = {}, workingDir = {}, daemonArgs: {}", daemonId, workingDir, command);
- ProcessBuilder.Redirect redirect = ProcessBuilder.Redirect.appendTo(parameters.daemonOutLog(daemonId).toFile());
+ LOGGER.debug(
+ "Starting daemon process: id = {}, workingDir = {}, daemonArgs: {}", daemonId, workingDir, command);
+ ProcessBuilder.Redirect redirect = ProcessBuilder.Redirect.appendTo(
+ parameters.daemonOutLog(daemonId).toFile());
ProcessBuilder processBuilder = new ProcessBuilder();
- processBuilder.environment().put(Environment.JDK_JAVA_OPTIONS.getEnvironmentVariable(), parameters.jdkJavaOpts());
+ processBuilder
+ .environment()
+ .put(Environment.JDK_JAVA_OPTIONS.getEnvironmentVariable(), parameters.jdkJavaOpts());
Process process = processBuilder
.directory(workingDir.toFile())
.command(args)
@@ -391,7 +418,8 @@ public class DaemonConnector {
return process;
} catch (Exception e) {
throw new DaemonException.StartException(
- String.format("Error starting daemon: id = %s, workingDir = %s, daemonArgs: %s",
+ String.format(
+ "Error starting daemon: id = %s, workingDir = %s, daemonArgs: %s",
daemonId, workingDir, command),
e);
}
@@ -432,14 +460,15 @@ public class DaemonConnector {
return connectToDaemon(daemonInfo, new CleanupOnStaleAddress(daemonInfo), newDaemon);
} catch (DaemonException.ConnectException e) {
DaemonDiagnostics diag = new DaemonDiagnostics(daemon, parameters);
- throw new DaemonException.ConnectException("Could not connect to the Maven daemon.\n" + diag.describe(), e);
+ throw new DaemonException.ConnectException(
+ "Could not connect to the Maven daemon.\n" + diag.describe(), e);
}
}
return null;
}
- private DaemonClientConnection connectToDaemon(DaemonInfo daemon,
- DaemonClientConnection.StaleAddressDetector staleAddressDetector, boolean newDaemon)
+ private DaemonClientConnection connectToDaemon(
+ DaemonInfo daemon, DaemonClientConnection.StaleAddressDetector staleAddressDetector, boolean newDaemon)
throws DaemonException.ConnectException {
LOGGER.debug("Connecting to Daemon");
try {
@@ -462,10 +491,11 @@ public class DaemonConnector {
@Override
public boolean maybeStaleAddress(Exception failure) {
- LOGGER.debug("Removing daemon from the registry due to communication failure. Daemon information: {}", daemon);
+ LOGGER.debug(
+ "Removing daemon from the registry due to communication failure. Daemon information: {}", daemon);
final long timestamp = System.currentTimeMillis();
- final DaemonStopEvent stopEvent = new DaemonStopEvent(daemon.getId(), timestamp, null,
- "by user or operating system");
+ final DaemonStopEvent stopEvent =
+ new DaemonStopEvent(daemon.getId(), timestamp, null, "by user or operating system");
registry.storeStopEvent(stopEvent);
registry.remove(daemon.getId());
return true;
@@ -500,7 +530,8 @@ public class DaemonConnector {
// socket.connect(address, CONNECT_TIMEOUT);
// if (socket.getLocalSocketAddress().equals(socket.getRemoteSocketAddress())) {
// socketChannel.close();
- // throw new DaemonException.ConnectException(String.format("Socket connected to itself on %s.", address));
+ // throw new DaemonException.ConnectException(String.format("Socket connected to itself on
+ // %s.", address));
// }
LOGGER.debug("Connected to address {}.", socketChannel.getRemoteAddress());
@@ -517,5 +548,4 @@ public class DaemonConnector {
throw new DaemonException.ConnectException(String.format("Could not connect to server %s.", address), e);
}
}
-
}
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonDiagnostics.java b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonDiagnostics.java
index 4c22c2c3..a2135e6a 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonDiagnostics.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonDiagnostics.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2009 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.client;
@@ -32,7 +35,7 @@ import java.util.stream.Collector;
*/
public class DaemonDiagnostics {
- private final static int TAIL_SIZE = 200;
+ private static final int TAIL_SIZE = 200;
private final String id;
private final DaemonParameters parameters;
@@ -44,10 +47,7 @@ public class DaemonDiagnostics {
@Override
public String toString() {
- return "{"
- + "id=" + id
- + ", parameters=" + parameters
- + '}';
+ return "{" + "id=" + id + ", parameters=" + parameters + '}';
}
public String describe() {
@@ -62,14 +62,21 @@ public class DaemonDiagnostics {
try {
String tail = tail(log);
sb.append(" ").append(name).append(": ").append(log).append("\n");
- sb.append("----- Last " + TAIL_SIZE + " lines from daemon ").append(name).append(" - ").append(log)
+ sb.append("----- Last " + TAIL_SIZE + " lines from daemon ")
+ .append(name)
+ .append(" - ")
+ .append(log)
.append(" -----\n");
sb.append(tail);
sb.append("----- End of the daemon ").append(name).append(" -----\n");
} catch (NoSuchFileException e) {
sb.append(" no ").append(name).append(" at: ").append(log).append("\n");
} catch (IOException e) {
- sb.append(" unable to read from the daemon ").append(name).append(": ").append(log).append(", because of: ")
+ sb.append(" unable to read from the daemon ")
+ .append(name)
+ .append(": ")
+ .append(log)
+ .append(", because of: ")
.append(e);
}
}
@@ -86,16 +93,18 @@ public class DaemonDiagnostics {
}
static <T> Collector<T, ?, List<T>> lastN(int n) {
- return Collector.<T, Deque<T>, List<T>> of(ArrayDeque::new, (acc, t) -> {
- if (acc.size() == n)
- acc.pollFirst();
- acc.add(t);
- }, (acc1, acc2) -> {
- while (acc2.size() < n && !acc1.isEmpty()) {
- acc2.addFirst(acc1.pollLast());
- }
- return acc2;
- }, ArrayList::new);
+ return Collector.<T, Deque<T>, List<T>>of(
+ ArrayDeque::new,
+ (acc, t) -> {
+ if (acc.size() == n) acc.pollFirst();
+ acc.add(t);
+ },
+ (acc1, acc2) -> {
+ while (acc2.size() < n && !acc1.isEmpty()) {
+ acc2.addFirst(acc1.pollLast());
+ }
+ return acc2;
+ },
+ ArrayList::new);
}
-
}
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java
index 102fb823..e0fc8b98 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/DaemonParameters.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.client;
@@ -63,8 +66,8 @@ public class DaemonParameters {
private static final String ENV_PREFIX = "env.";
protected final Map<Path, Properties> mvndProperties = new ConcurrentHashMap<>();
- protected final Function<Path, Properties> provider = path -> mvndProperties.computeIfAbsent(path,
- p -> loadProperties(path));
+ protected final Function<Path, Properties> provider =
+ path -> mvndProperties.computeIfAbsent(path, p -> loadProperties(path));
private final Map<String, String> properties;
public DaemonParameters() {
@@ -83,9 +86,7 @@ public class DaemonParameters {
public Map<String, String> getDaemonOptsMap() {
return discriminatingValues()
- .collect(Collectors.toMap(
- envValue -> envValue.envKey.getProperty(),
- EnvValue::asString));
+ .collect(Collectors.toMap(envValue -> envValue.envKey.getProperty(), EnvValue::asString));
}
Stream<EnvValue> discriminatingValues() {
@@ -96,8 +97,7 @@ public class DaemonParameters {
}
public void discriminatingCommandLineOptions(List<String> args) {
- discriminatingValues()
- .forEach(envValue -> envValue.envKey.addCommandLineOption(args, envValue.asString()));
+ discriminatingValues().forEach(envValue -> envValue.envKey.addCommandLineOption(args, envValue.asString()));
}
public Path mvndHome() {
@@ -112,7 +112,8 @@ public class DaemonParameters {
.orEnvironmentVariable()
.orFail()
.asPath()
- .toAbsolutePath().normalize();
+ .toAbsolutePath()
+ .normalize();
}
private String mvndHomeFromExecutable() {
@@ -120,8 +121,8 @@ public class DaemonParameters {
if (Environment.isNative() && cmd.isPresent()) {
final Path mvndH = Paths.get(cmd.get()).getParent().getParent();
if (mvndH != null) {
- final Path mvndDaemonLib = mvndH
- .resolve("mvn/lib/ext/mvnd-daemon-" + BuildProperties.getInstance().getVersion() + ".jar");
+ final Path mvndDaemonLib = mvndH.resolve("mvn/lib/ext/mvnd-daemon-"
+ + BuildProperties.getInstance().getVersion() + ".jar");
if (Files.exists(mvndDaemonLib)) {
return mvndH.toString();
}
@@ -138,9 +139,7 @@ public class DaemonParameters {
.orLocalProperty(provider, globalPropertiesPath())
.orSystemProperty()
.orEnvironmentVariable()
- .or(new ValueSource(
- description -> description.append("java command"),
- this::javaHomeFromPath))
+ .or(new ValueSource(description -> description.append("java command"), this::javaHomeFromPath))
.orFail()
.asPath();
try {
@@ -159,19 +158,11 @@ public class DaemonParameters {
}
public Path userDir() {
- return value(Environment.USER_DIR)
- .orSystemProperty()
- .orFail()
- .asPath()
- .toAbsolutePath();
+ return value(Environment.USER_DIR).orSystemProperty().orFail().asPath().toAbsolutePath();
}
public Path userHome() {
- return value(Environment.USER_HOME)
- .orSystemProperty()
- .orFail()
- .asPath()
- .toAbsolutePath();
+ return value(Environment.USER_HOME).orSystemProperty().orFail().asPath().toAbsolutePath();
}
public Path suppliedPropertiesPath() {
@@ -207,8 +198,10 @@ public class DaemonParameters {
.orSystemProperty()
.orLocalProperty(provider, globalPropertiesPath())
.orEnvironmentVariable()
- .orDefault(
- () -> userHome().resolve(".m2/mvnd/registry/" + BuildProperties.getInstance().getVersion()).toString())
+ .orDefault(() -> userHome()
+ .resolve(".m2/mvnd/registry/"
+ + BuildProperties.getInstance().getVersion())
+ .toString())
.asPath();
}
@@ -233,7 +226,8 @@ public class DaemonParameters {
.orSystemProperty()
.orDefault(() -> findDefaultMultimoduleProjectDirectory(projectDir))
.asPath()
- .toAbsolutePath().normalize();
+ .toAbsolutePath()
+ .normalize();
}
public Path logbackConfigurationPath() {
@@ -317,10 +311,7 @@ public class DaemonParameters {
* @return if mvnd should behave as maven
*/
public boolean serial() {
- return value(Environment.SERIAL)
- .orSystemProperty()
- .orDefault()
- .asBoolean();
+ return value(Environment.SERIAL).orSystemProperty().orDefault().asBoolean();
}
/**
@@ -333,14 +324,14 @@ public class DaemonParameters {
public DaemonParameters withJdkJavaOpts(String opts, boolean before) {
String org = this.properties.getOrDefault(Environment.JDK_JAVA_OPTIONS.getProperty(), "");
- return derive(b -> b.put(Environment.JDK_JAVA_OPTIONS,
- org.isEmpty() ? opts : before ? opts + " " + org : org + " " + opts));
+ return derive(b -> b.put(
+ Environment.JDK_JAVA_OPTIONS, org.isEmpty() ? opts : before ? opts + " " + org : org + " " + opts));
}
public DaemonParameters withJvmArgs(String opts, boolean before) {
String org = this.properties.getOrDefault(Environment.MVND_JVM_ARGS.getProperty(), "");
- return derive(b -> b.put(Environment.MVND_JVM_ARGS,
- org.isEmpty() ? opts : before ? opts + " " + org : org + " " + opts));
+ return derive(b ->
+ b.put(Environment.MVND_JVM_ARGS, org.isEmpty() ? opts : before ? opts + " " + org : org + " " + opts));
}
protected DaemonParameters derive(Consumer<PropertiesBuilder> customizer) {
@@ -400,9 +391,11 @@ public class DaemonParameters {
}
protected EnvValue value(Environment env) {
- return new EnvValue(env, new ValueSource(
- description -> description.append("value: ").append(env.getProperty()),
- () -> properties.get(env.getProperty())));
+ return new EnvValue(
+ env,
+ new ValueSource(
+ description -> description.append("value: ").append(env.getProperty()),
+ () -> properties.get(env.getProperty())));
}
public static EnvValue systemProperty(Environment env) {
@@ -519,7 +512,6 @@ public class DaemonParameters {
public String toString() {
return descriptionFunction.apply(new StringBuilder()).toString();
}
-
}
/**
@@ -548,7 +540,8 @@ public class DaemonParameters {
private static ValueSource systemPropertySource(Environment env) {
String property = env.getProperty();
if (property == null) {
- throw new IllegalStateException("Cannot use " + Environment.class.getName() + " for getting a system property");
+ throw new IllegalStateException(
+ "Cannot use " + Environment.class.getName() + " for getting a system property");
}
return new ValueSource(
description -> description.append("system property ").append(property),
@@ -558,9 +551,8 @@ public class DaemonParameters {
private static ValueSource environmentVariableSource(Environment env) {
String envVar = env.getEnvironmentVariable();
if (envVar == null) {
- throw new IllegalStateException(
- "Cannot use " + Environment.class.getName() + "." + env.name()
- + " for getting an environment variable");
+ throw new IllegalStateException("Cannot use " + Environment.class.getName() + "." + env.name()
+ + " for getting an environment variable");
}
return new ValueSource(
description -> description.append("environment variable ").append(envVar),
@@ -573,10 +565,16 @@ public class DaemonParameters {
public EnvValue orLocalProperty(Function<Path, Properties> provider, Path localPropertiesPath) {
if (localPropertiesPath != null) {
- return new EnvValue(this, envKey, new ValueSource(
- description -> description.append("property ").append(envKey.getProperty()).append(" in ")
- .append(localPropertiesPath),
- () -> provider.apply(localPropertiesPath).getProperty(envKey.getProperty())));
+ return new EnvValue(
+ this,
+ envKey,
+ new ValueSource(
+ description -> description
+ .append("property ")
+ .append(envKey.getProperty())
+ .append(" in ")
+ .append(localPropertiesPath),
+ () -> provider.apply(localPropertiesPath).getProperty(envKey.getProperty())));
} else {
return this;
}
@@ -595,7 +593,9 @@ public class DaemonParameters {
}
public EnvValue orDefault(Supplier<String> defaultSupplier) {
- return new EnvValue(this, envKey,
+ return new EnvValue(
+ this,
+ envKey,
new ValueSource(sb -> sb.append("default: ").append(defaultSupplier.get()), defaultSupplier));
}
@@ -609,7 +609,9 @@ public class DaemonParameters {
EnvValue val = this;
final StringBuilder sb = new StringBuilder("Could not get value for ")
.append(Environment.class.getSimpleName())
- .append(".").append(envKey.name()).append(" from any of the following sources: ");
+ .append(".")
+ .append(envKey.name())
+ .append(" from any of the following sources: ");
/*
* Compose the description functions to invert the order thus getting the resolution order in the
@@ -640,9 +642,7 @@ public class DaemonParameters {
.append(envKey.name())
.append("] from ");
valueSource.descriptionFunction.apply(sb);
- sb.append(": [")
- .append(result)
- .append(']');
+ sb.append(": [").append(result).append(']');
LOG.trace(sb.toString());
}
return result;
@@ -690,6 +690,5 @@ public class DaemonParameters {
throw couldNotgetValue();
}
}
-
}
}
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/DefaultClient.java b/client/src/main/java/org/mvndaemon/mvnd/client/DefaultClient.java
index 58f91db6..9c4774da 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/DefaultClient.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/DefaultClient.java
@@ -1,20 +1,25 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.client;
+import static org.mvndaemon.mvnd.client.DaemonParameters.LOG_EXTENSION;
+
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.file.Files;
@@ -56,8 +61,6 @@ import org.mvndaemon.mvnd.common.logging.TerminalOutput;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import static org.mvndaemon.mvnd.client.DaemonParameters.LOG_EXTENSION;
-
public class DefaultClient implements Client {
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultClient.class);
@@ -88,7 +91,8 @@ public class DefaultClient implements Client {
|| Environment.COMPLETION.hasCommandLineOption(args);
// Color
- Color styleColor = Color.of(Environment.MAVEN_COLOR.removeCommandLineOption(args)).orElse(Color.auto);
+ Color styleColor =
+ Color.of(Environment.MAVEN_COLOR.removeCommandLineOption(args)).orElse(Color.auto);
if (styleColor == Color.auto) {
/* Translate from auto to either always or never */
/* stdout is not a terminal e.g. when stdout is redirected to a file */
@@ -114,7 +118,8 @@ public class DefaultClient implements Client {
System.setProperty(Environment.MVND_NO_BUFERING.getProperty(), Boolean.toString(true));
}
- System.setProperty(Environment.MVND_HOME.getProperty(), parameters.mvndHome().toString());
+ System.setProperty(
+ Environment.MVND_HOME.getProperty(), parameters.mvndHome().toString());
Path dir;
if (Environment.MAVEN_FILE.hasCommandLineOption(args)) {
@@ -126,7 +131,8 @@ public class DefaultClient implements Client {
} else {
dir = parameters.userDir();
}
- System.setProperty(Environment.MAVEN_MULTIMODULE_PROJECT_DIRECTORY.getProperty(),
+ System.setProperty(
+ Environment.MAVEN_MULTIMODULE_PROJECT_DIRECTORY.getProperty(),
parameters.multiModuleProjectDirectory(dir).toString());
// .mvn/jvm.config
@@ -158,7 +164,8 @@ public class DefaultClient implements Client {
boolean defineIsEmpty = false;
while (iterator.hasNext()) {
final String arg = iterator.next();
- String val = Environment.MAVEN_DEFINE.removeCommandLineOption(new ArrayList<>(Collections.singletonList(arg)));
+ String val =
+ Environment.MAVEN_DEFINE.removeCommandLineOption(new ArrayList<>(Collections.singletonList(arg)));
/* not -D or --define and pre define is empty */
if (val == null && defineIsEmpty) {
defineIsEmpty = false;
@@ -187,8 +194,7 @@ public class DefaultClient implements Client {
private static boolean maybeDefineCommandLineOption(String arg) {
// if arg maybe MAVEN_DEFINE value
- return EnumSet.allOf(Environment.class)
- .stream()
+ return EnumSet.allOf(Environment.class).stream()
.filter(e -> e != Environment.MAVEN_DEFINE)
.noneMatch(e -> e.hasCommandLineOption(Collections.singletonList(arg)));
}
@@ -245,15 +251,19 @@ public class DefaultClient implements Client {
try (DaemonRegistry registry = new DaemonRegistry(parameters.registry())) {
if (Environment.STATUS.removeCommandLineOption(args) != null) {
final String template = "%8s %7s %24s %7s %5s %23s %s";
- output.accept(Message.out(String.format(template,
- "ID", "PID", "Address", "Status", "RSS", "Last activity", "Java home")));
+ output.accept(Message.out(String.format(
+ template, "ID", "PID", "Address", "Status", "RSS", "Last activity", "Java home")));
for (DaemonInfo d : registry.getAll()) {
if (ProcessHandle.of(d.getPid()).isEmpty()) {
/* The process does not exist anymore - remove it from the registry */
registry.remove(d.getId());
} else {
- output.accept(Message.out(String.format(template,
- d.getId(), d.getPid(), d.getAddress(), d.getState(),
+ output.accept(Message.out(String.format(
+ template,
+ d.getId(),
+ d.getPid(),
+ d.getAddress(),
+ d.getState(),
OsUtils.kbTohumanReadable(OsUtils.findProcessRssInKb(d.getPid())),
LocalDateTime.ofInstant(
Instant.ofEpochMilli(Math.max(d.getLastIdle(), d.getLastBusy())),
@@ -318,14 +328,16 @@ public class DefaultClient implements Client {
parameters.multiModuleProjectDirectory().toString(),
System.getenv()));
- output.accept(Message
- .buildStatus("Connected to daemon " + daemon.getDaemon().getId() + ", scanning for projects..."));
+ output.accept(Message.buildStatus(
+ "Connected to daemon " + daemon.getDaemon().getId() + ", scanning for projects..."));
// We've sent the request, so it gives us a bit of time to purge the logs
AtomicReference<String> purgeMessage = new AtomicReference<>();
- Thread purgeLog = new Thread(() -> {
- purgeMessage.set(purgeLogs());
- }, "Log purge");
+ Thread purgeLog = new Thread(
+ () -> {
+ purgeMessage.set(purgeLogs());
+ },
+ "Log purge");
purgeLog.setDaemon(true);
purgeLog.start();
@@ -335,16 +347,18 @@ public class DefaultClient implements Client {
output.accept(messages);
for (Message m : messages) {
switch (m.getType()) {
- case Message.CANCEL_BUILD:
- return new DefaultResult(argv,
- new InterruptedException("The build was canceled"), 130);
- case Message.BUILD_EXCEPTION:
- final BuildException e = (BuildException) m;
- return new DefaultResult(argv,
- new Exception(e.getClassName() + ": " + e.getMessage() + "\n" + e.getStackTrace()),
- 1);
- case Message.BUILD_FINISHED:
- return new DefaultResult(argv, null, ((BuildFinished) m).getExitCode());
+ case Message.CANCEL_BUILD:
+ return new DefaultResult(
+ argv, new InterruptedException("The build was canceled"), 130);
+ case Message.BUILD_EXCEPTION:
+ final BuildException e = (BuildException) m;
+ return new DefaultResult(
+ argv,
+ new Exception(e.getClassName() + ": " + e.getMessage() + "\n"
+ + e.getStackTrace()),
+ 1);
+ case Message.BUILD_FINISHED:
+ return new DefaultResult(argv, null, ((BuildFinished) m).getExitCode());
}
}
}
@@ -364,13 +378,16 @@ public class DefaultClient implements Client {
if (!Files.isDirectory(storage) || !TimeUtils.isPositive(purgeLogPeriod)) {
return null;
}
- String date = DateTimeFormatter.ofPattern("yyyy-MM-dd").withZone(ZoneId.systemDefault()).format(Instant.now());
+ String date = DateTimeFormatter.ofPattern("yyyy-MM-dd")
+ .withZone(ZoneId.systemDefault())
+ .format(Instant.now());
Path log = storage.resolve("purge-" + date + ".log");
List<Path> deleted = new ArrayList<>();
List<Throwable> exceptions = new ArrayList<>();
FileTime limit = FileTime.from(Instant.now().minus(purgeLogPeriod));
try (Stream<Path> storagePath = Files.list(storage)) {
- storagePath.filter(p -> p.getFileName().toString().endsWith(LOG_EXTENSION))
+ storagePath
+ .filter(p -> p.getFileName().toString().endsWith(LOG_EXTENSION))
.filter(p -> !log.equals(p))
.filter(p -> {
try {
@@ -396,8 +413,8 @@ public class DefaultClient implements Client {
return null;
}
String logMessage;
- try (PrintWriter w = new PrintWriter(Files.newBufferedWriter(log,
- StandardOpenOption.WRITE, StandardOpenOption.APPEND, StandardOpenOption.CREATE))) {
+ try (PrintWriter w = new PrintWriter(Files.newBufferedWriter(
+ log, StandardOpenOption.WRITE, StandardOpenOption.APPEND, StandardOpenOption.CREATE))) {
w.printf("Purge executed at %s%n", Instant.now().toString());
if (deleted.isEmpty()) {
w.printf("No files deleted.%n");
@@ -423,7 +440,8 @@ public class DefaultClient implements Client {
if (exceptions.isEmpty()) {
return String.format("Purged %d log files (%s)", deleted.size(), logMessage);
} else {
- return String.format("Purged %d log files with %d exceptions (%s)", deleted.size(), exceptions.size(), logMessage);
+ return String.format(
+ "Purged %d log files with %d exceptions (%s)", deleted.size(), exceptions.size(), logMessage);
}
}
@@ -447,13 +465,17 @@ public class DefaultClient implements Client {
@Override
public ExecutionResult assertSuccess() {
if (exception != null) {
- throw new AssertionError(ExecutionResult.appendCommand(new StringBuilder("Build failed: "), args).toString(),
+ throw new AssertionError(
+ ExecutionResult.appendCommand(new StringBuilder("Build failed: "), args)
+ .toString(),
exception);
}
if (exitCode != 0) {
throw new AssertionError(
ExecutionResult.appendCommand(
- new StringBuilder("Build exited with non-zero exit code " + exitCode + ": "), args).toString(),
+ new StringBuilder("Build exited with non-zero exit code " + exitCode + ": "),
+ args)
+ .toString(),
exception);
}
return this;
@@ -462,7 +484,8 @@ public class DefaultClient implements Client {
@Override
public ExecutionResult assertFailure() {
if (exception == null && exitCode == 0) {
- throw new AssertionError(ExecutionResult.appendCommand(new StringBuilder("Build did not fail: "), args));
+ throw new AssertionError(
+ ExecutionResult.appendCommand(new StringBuilder("Build did not fail: "), args));
}
return this;
}
@@ -476,7 +499,5 @@ public class DefaultClient implements Client {
public boolean isSuccess() {
return exception == null;
}
-
}
-
}
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/ExecutionResult.java b/client/src/main/java/org/mvndaemon/mvnd/client/ExecutionResult.java
index 0c87f011..55106fd0 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/ExecutionResult.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/ExecutionResult.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.client;
@@ -37,5 +40,4 @@ public interface ExecutionResult {
}
return sb;
}
-
}
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/svm/ReflectionRegistration.java b/client/src/main/java/org/mvndaemon/mvnd/client/svm/ReflectionRegistration.java
index 97c1b577..3f46b716 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/svm/ReflectionRegistration.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/svm/ReflectionRegistration.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.client.svm;
diff --git a/client/src/main/java/org/mvndaemon/mvnd/client/svm/StaticMDCBinderSubstitution.java b/client/src/main/java/org/mvndaemon/mvnd/client/svm/StaticMDCBinderSubstitution.java
index 5a0fcd9f..e2371474 100644
--- a/client/src/main/java/org/mvndaemon/mvnd/client/svm/StaticMDCBinderSubstitution.java
+++ b/client/src/main/java/org/mvndaemon/mvnd/client/svm/StaticMDCBinderSubstitution.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.client.svm;
@@ -28,5 +31,4 @@ final class StaticMDCBinderSubstitution {
private static MDCAdapter bwCompatibleGetMDCAdapterFromBinder() throws NoClassDefFoundError {
return StaticMDCBinder.SINGLETON.getMDCA();
}
-
}
diff --git a/client/src/test/java/org/mvndaemon/mvnd/client/CompletionGeneratorTest.java b/client/src/test/java/org/mvndaemon/mvnd/client/CompletionGeneratorTest.java
index 03a9036b..1f5f4afb 100644
--- a/client/src/test/java/org/mvndaemon/mvnd/client/CompletionGeneratorTest.java
+++ b/client/src/test/java/org/mvndaemon/mvnd/client/CompletionGeneratorTest.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.client;
@@ -34,8 +37,8 @@ public class CompletionGeneratorTest {
@Test
void generate() throws IOException {
- String template = IoUtils.readResource(Completion.class.getClassLoader(),
- "completion-templates/mvnd-bash-completion.bash");
+ String template = IoUtils.readResource(
+ Completion.class.getClassLoader(), "completion-templates/mvnd-bash-completion.bash");
final String shortOpts = Stream.of(Environment.values())
.filter(env -> !env.isInternal())
@@ -71,7 +74,5 @@ public class CompletionGeneratorTest {
final byte[] bytes = template.getBytes(StandardCharsets.UTF_8);
Files.write(baseDir.resolve("../dist/src/main/distro/bin/mvnd-bash-completion.bash"), bytes);
-
}
-
}
diff --git a/client/src/test/java/org/mvndaemon/mvnd/client/DaemonConnectorTest.java b/client/src/test/java/org/mvndaemon/mvnd/client/DaemonConnectorTest.java
index 11eaf55d..2e28d084 100644
--- a/client/src/test/java/org/mvndaemon/mvnd/client/DaemonConnectorTest.java
+++ b/client/src/test/java/org/mvndaemon/mvnd/client/DaemonConnectorTest.java
@@ -1,25 +1,28 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.client;
-import org.junit.jupiter.api.Test;
-
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
+import org.junit.jupiter.api.Test;
+
public class DaemonConnectorTest {
@Test
diff --git a/client/src/test/java/org/mvndaemon/mvnd/client/EnvironmentTest.java b/client/src/test/java/org/mvndaemon/mvnd/client/EnvironmentTest.java
index 5dca9740..0d14670d 100644
--- a/client/src/test/java/org/mvndaemon/mvnd/client/EnvironmentTest.java
+++ b/client/src/test/java/org/mvndaemon/mvnd/client/EnvironmentTest.java
@@ -1,20 +1,25 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.client;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
@@ -28,8 +33,6 @@ import org.mvndaemon.mvnd.client.DaemonParameters.EnvValue;
import org.mvndaemon.mvnd.client.DaemonParameters.ValueSource;
import org.mvndaemon.mvnd.common.Environment;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
public class EnvironmentTest {
@Test
@@ -57,7 +60,9 @@ public class EnvironmentTest {
void prop() {
try (EnvironmentResource env = new EnvironmentResource()) {
env.props("mvnd.home", "/maven/home/prop");
- assertEquals("/maven/home/prop", DaemonParameters.systemProperty(Environment.MVND_HOME).asString());
+ assertEquals(
+ "/maven/home/prop",
+ DaemonParameters.systemProperty(Environment.MVND_HOME).asString());
}
}
@@ -65,7 +70,9 @@ public class EnvironmentTest {
void env() {
try (EnvironmentResource env = new EnvironmentResource()) {
env.env("MVND_HOME", "/maven/home/env");
- assertEquals("/maven/home/env", DaemonParameters.environmentVariable(Environment.MVND_HOME).asString());
+ assertEquals(
+ "/maven/home/env",
+ DaemonParameters.environmentVariable(Environment.MVND_HOME).asString());
}
}
@@ -74,9 +81,9 @@ public class EnvironmentTest {
try (EnvironmentResource env = new EnvironmentResource()) {
final Properties localProps = new Properties();
localProps.put("mvnd.home", "/maven/home/local");
- assertEquals(Paths.get("/maven/home/local"),
- DaemonParameters
- .environmentVariable(Environment.MVND_HOME)
+ assertEquals(
+ Paths.get("/maven/home/local"),
+ DaemonParameters.environmentVariable(Environment.MVND_HOME)
.orSystemProperty()
.orLocalProperty(path -> localProps, Paths.get("/local/properties"))
.orFail()
@@ -89,9 +96,9 @@ public class EnvironmentTest {
try (EnvironmentResource env = new EnvironmentResource()) {
env.props("mvnd.home", "/maven/home/prop");
env.env("MVND_HOME", "/maven/home/env");
- assertEquals("/maven/home/env",
- DaemonParameters
- .environmentVariable(Environment.MVND_HOME)
+ assertEquals(
+ "/maven/home/env",
+ DaemonParameters.environmentVariable(Environment.MVND_HOME)
.orSystemProperty()
.asString());
}
@@ -101,9 +108,9 @@ public class EnvironmentTest {
void fail() {
try (EnvironmentResource env = new EnvironmentResource()) {
try {
- assertEquals("/maven/home/env",
- DaemonParameters
- .environmentVariable(Environment.MVND_HOME)
+ assertEquals(
+ "/maven/home/env",
+ DaemonParameters.environmentVariable(Environment.MVND_HOME)
.orSystemProperty()
.orFail()
.asString());
@@ -124,7 +131,8 @@ public class EnvironmentTest {
@Test
void emptyBooleanEnvValueIsTrue() {
final String EMPTY_STRING = "";
- final EnvValue envVal = new EnvValue(Environment.MVND_NO_BUFERING,
+ final EnvValue envVal = new EnvValue(
+ Environment.MVND_NO_BUFERING,
new ValueSource(sb -> sb.append("envValueAsBoolean"), () -> EMPTY_STRING));
assertEquals(true, envVal.asBoolean());
}
@@ -158,7 +166,5 @@ public class EnvironmentTest {
DaemonParameters.EnvValue.env = System.getenv();
Environment.setProperties(System.getProperties());
}
-
}
-
}
diff --git a/client/src/test/java/org/mvndaemon/mvnd/client/OsUtilsTest.java b/client/src/test/java/org/mvndaemon/mvnd/client/OsUtilsTest.java
index d32d630c..c2fdf6a4 100644
--- a/client/src/test/java/org/mvndaemon/mvnd/client/OsUtilsTest.java
+++ b/client/src/test/java/org/mvndaemon/mvnd/client/OsUtilsTest.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.client;
diff --git a/common/pom.xml b/common/pom.xml
index c103b140..9d040397 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2019 the original author or authors.
@@ -15,184 +16,183 @@
limitations under the License.
-->
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.maven.daemon</groupId>
- <artifactId>mvnd</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.maven.daemon</groupId>
+ <artifactId>mvnd</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>mvnd-common</artifactId>
- <artifactId>mvnd-common</artifactId>
+ <packaging>jar</packaging>
+ <name>Maven Daemon - Common</name>
- <packaging>jar</packaging>
- <name>Maven Daemon - Common</name>
+ <dependencies>
- <dependencies>
+ <dependency>
+ <groupId>org.jline</groupId>
+ <artifactId>jline-terminal</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jline</groupId>
+ <artifactId>jline-terminal-jansi</artifactId>
+ </dependency>
- <dependency>
- <groupId>org.jline</groupId>
- <artifactId>jline-terminal</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jline</groupId>
- <artifactId>jline-terminal-jansi</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.daemon</groupId>
+ <artifactId>mvnd-build-maven-plugin</artifactId>
+ <version>${project.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>doc</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
- <build>
+ <profiles>
+ <profile>
+ <id>jdk11-15</id>
+ <activation>
+ <jdk>[11,15)</jdk>
+ </activation>
+ <build>
<plugins>
- <plugin>
- <groupId>org.apache.maven.daemon</groupId>
- <artifactId>mvnd-build-maven-plugin</artifactId>
- <version>${project.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>doc</goal>
- </goals>
- <phase>generate-resources</phase>
- </execution>
- </executions>
- </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default</id>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <fork>true</fork>
+ <compilerArgs>
+ <arg>-XDignore.symbol.file</arg>
+ </compilerArgs>
+ </configuration>
+ </execution>
+ <execution>
+ <id>jdk11</id>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <fork>true</fork>
+ <compilerArgs>
+ <arg>-XDignore.symbol.file</arg>
+ </compilerArgs>
+ <release>11</release>
+ <multiReleaseOutput>true</multiReleaseOutput>
+ <compileSourceRoots>
+ <root>${project.basedir}/src/main/java11</root>
+ </compileSourceRoots>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Multi-Release>true</Multi-Release>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
</plugins>
- </build>
-
- <profiles>
- <profile>
- <id>jdk11-15</id>
- <activation>
- <jdk>[11,15)</jdk>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <executions>
- <execution>
- <id>default</id>
- <goals>
- <goal>compile</goal>
- </goals>
- <configuration>
- <fork>true</fork>
- <compilerArgs>
- <arg>-XDignore.symbol.file</arg>
- </compilerArgs>
- </configuration>
- </execution>
- <execution>
- <id>jdk11</id>
- <goals>
- <goal>compile</goal>
- </goals>
- <configuration>
- <fork>true</fork>
- <compilerArgs>
- <arg>-XDignore.symbol.file</arg>
- </compilerArgs>
- <release>11</release>
- <multiReleaseOutput>true</multiReleaseOutput>
- <compileSourceRoots>
- <root>${project.basedir}/src/main/java11</root>
- </compileSourceRoots>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestEntries>
- <Multi-Release>true</Multi-Release>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>jdk16+</id>
- <activation>
- <jdk>[16,)</jdk>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <executions>
- <execution>
- <id>default</id>
- <goals>
- <goal>compile</goal>
- </goals>
- <configuration>
- <fork>true</fork>
- <compilerArgs>
- <arg>-XDignore.symbol.file</arg>
- </compilerArgs>
- </configuration>
- </execution>
- <execution>
- <id>jdk11</id>
- <goals>
- <goal>compile</goal>
- </goals>
- <configuration>
- <fork>true</fork>
- <compilerArgs>
- <arg>-XDignore.symbol.file</arg>
- </compilerArgs>
- <release>11</release>
- <multiReleaseOutput>true</multiReleaseOutput>
- <compileSourceRoots>
- <root>${project.basedir}/src/main/java11</root>
- </compileSourceRoots>
- </configuration>
- </execution>
- <execution>
- <id>jdk16</id>
- <goals>
- <goal>compile</goal>
- </goals>
- <configuration>
- <fork>true</fork>
- <compilerArgs>
- <arg>-XDignore.symbol.file</arg>
- </compilerArgs>
- <release>16</release>
- <multiReleaseOutput>true</multiReleaseOutput>
- <compileSourceRoots>
- <root>${project.basedir}/src/main/java16</root>
- </compileSourceRoots>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ </build>
+ </profile>
+ <profile>
+ <id>jdk16+</id>
+ <activation>
+ <jdk>[16,)</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default</id>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <fork>true</fork>
+ <compilerArgs>
+ <arg>-XDignore.symbol.file</arg>
+ </compilerArgs>
+ </configuration>
+ </execution>
+ <execution>
+ <id>jdk11</id>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <fork>true</fork>
+ <compilerArgs>
+ <arg>-XDignore.symbol.file</arg>
+ </compilerArgs>
+ <release>11</release>
+ <multiReleaseOutput>true</multiReleaseOutput>
+ <compileSourceRoots>
+ <root>${project.basedir}/src/main/java11</root>
+ </compileSourceRoots>
+ </configuration>
+ </execution>
+ <execution>
+ <id>jdk16</id>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <fork>true</fork>
+ <compilerArgs>
+ <arg>-XDignore.symbol.file</arg>
+ </compilerArgs>
+ <release>16</release>
+ <multiReleaseOutput>true</multiReleaseOutput>
+ <compileSourceRoots>
+ <root>${project.basedir}/src/main/java16</root>
+ </compileSourceRoots>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
-</project>
\ No newline at end of file
+</project>
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/BufferCaster.java b/common/src/main/java/org/mvndaemon/mvnd/common/BufferCaster.java
index e0bc9a67..38d2ff52 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/BufferCaster.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/BufferCaster.java
@@ -1,19 +1,21 @@
/*
- * Copyright 2018 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
-
package org.mvndaemon.mvnd.common;
import java.nio.Buffer;
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/BufferHelper.java b/common/src/main/java/org/mvndaemon/mvnd/common/BufferHelper.java
index 31f46357..ef5acac0 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/BufferHelper.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/BufferHelper.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
@@ -28,7 +31,8 @@ import java.util.function.Consumer;
*/
public class BufferHelper {
- private static boolean PRE_JAVA_9 = System.getProperty("java.specification.version", "9").startsWith("1.");
+ private static boolean PRE_JAVA_9 =
+ System.getProperty("java.specification.version", "9").startsWith("1.");
/** The DirectByteBuffer.cleaner() method. */
private static Method directByteBufferCleanerMethod;
@@ -74,7 +78,7 @@ public class BufferHelper {
// Ignore
}
} else {
- //boolean jdkSuccess = false;
+ // boolean jdkSuccess = false;
// // TODO: This feature is in incubation now -- enable after it leaves incubation.
// // To enable this feature, need to:
// // -- add whatever the "jdk.incubator.foreign" module name is replaced with to <Import-Package>
@@ -94,7 +98,7 @@ public class BufferHelper {
// } catch (ClassNotFoundException | NoSuchMethodException | SecurityException e1) {
// // Fall through
// }
- //if (!jdk14Success) { // In JDK9+, calling sun.misc.Cleaner.clean() gives a reflection warning on stderr,
+ // if (!jdk14Success) { // In JDK9+, calling sun.misc.Cleaner.clean() gives a reflection warning on stderr,
// so we need to call Unsafe.theUnsafe.invokeCleaner(byteBuffer) instead, which makes
// the same call, but does not print the reflection warning.
try {
@@ -117,7 +121,7 @@ public class BufferHelper {
} catch (final ReflectiveOperationException | LinkageError ex) {
// Ignore
}
- //}
+ // }
}
}
@@ -261,5 +265,4 @@ public class BufferHelper {
return false;
}
}
-
}
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/ByteChannelWrapper.java b/common/src/main/java/org/mvndaemon/mvnd/common/ByteChannelWrapper.java
index b2991513..f74fc3f0 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/ByteChannelWrapper.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/ByteChannelWrapper.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonCompatibilitySpec.java b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonCompatibilitySpec.java
index eae53bef..d18e45dd 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonCompatibilitySpec.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonCompatibilitySpec.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2011 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
@@ -68,8 +71,7 @@ public class DaemonCompatibilitySpec {
}
private boolean daemonOptsMatch(DaemonInfo daemon) {
- return daemon.getOptions().containsAll(options)
- && daemon.getOptions().size() == options.size();
+ return daemon.getOptions().containsAll(options) && daemon.getOptions().size() == options.size();
}
private boolean javaHomeMatches(DaemonInfo daemon) {
@@ -77,13 +79,14 @@ public class DaemonCompatibilitySpec {
}
StringBuilder appendFields(StringBuilder sb) {
- return sb.append("javaHome=").append(javaHome)
- .append(", options=").append(options);
+ return sb.append("javaHome=").append(javaHome).append(", options=").append(options);
}
@Override
public String toString() {
- return appendFields(new StringBuilder("DaemonCompatibilitySpec{")).append('}').toString();
+ return appendFields(new StringBuilder("DaemonCompatibilitySpec{"))
+ .append('}')
+ .toString();
}
public static class Result {
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonConnection.java b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonConnection.java
index 66f1d3b9..ba79896e 100755
--- a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonConnection.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonConnection.java
@@ -1,19 +1,21 @@
/*
- * Copyright 2016 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
-
package org.mvndaemon.mvnd.common;
import java.io.Closeable;
@@ -82,7 +84,8 @@ public class DaemonConnection implements AutoCloseable {
throw new DaemonException.RecoverableMessageIOException(
String.format("Could not read message from '%s'.", remoteAddress), e);
} catch (Throwable e) {
- throw new DaemonException.MessageIOException(String.format("Could not read message from '%s'.", remoteAddress), e);
+ throw new DaemonException.MessageIOException(
+ String.format("Could not read message from '%s'.", remoteAddress), e);
}
}
@@ -94,7 +97,8 @@ public class DaemonConnection implements AutoCloseable {
if (Objects.equals(e.getMessage(), "An existing connection was forcibly closed by the remote host")) {
return true;
}
- if (Objects.equals(e.getMessage(), "An established connection was aborted by the software in your host machine")) {
+ if (Objects.equals(
+ e.getMessage(), "An established connection was aborted by the software in your host machine")) {
return true;
}
if (Objects.equals(e.getMessage(), "Connection reset by peer")) {
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonException.java b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonException.java
index adf90e1f..c6177e25 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonException.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonException.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
@@ -84,5 +87,4 @@ public class DaemonException extends RuntimeException {
super(message, cause);
}
}
-
}
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonExpirationStatus.java b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonExpirationStatus.java
index e844074c..57b07d5a 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonExpirationStatus.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonExpirationStatus.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2016 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonInfo.java b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonInfo.java
index c0f69073..3d435a97 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonInfo.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonInfo.java
@@ -1,25 +1,28 @@
/*
- * Copyright 2011 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
-import java.util.List;
-
import static org.mvndaemon.mvnd.common.DaemonState.Busy;
import static org.mvndaemon.mvnd.common.DaemonState.Idle;
+import java.util.List;
+
/**
* File origin:
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/registry/DaemonInfo.java
@@ -40,10 +43,18 @@ public class DaemonInfo {
private final long lastIdle;
private final long lastBusy;
- public DaemonInfo(String id, String javaHome, String mavenHome,
- int pid, String address, byte[] token,
- String locale, List<String> options,
- DaemonState state, long lastIdle, long lastBusy) {
+ public DaemonInfo(
+ String id,
+ String javaHome,
+ String mavenHome,
+ int pid,
+ String address,
+ byte[] token,
+ String locale,
+ List<String> options,
+ DaemonState state,
+ long lastIdle,
+ long lastBusy) {
this.id = id;
this.javaHome = javaHome;
this.mvndHome = mavenHome;
@@ -113,8 +124,7 @@ public class DaemonInfo {
li = lastIdle;
lb = lastBusy;
}
- return new DaemonInfo(id, javaHome, mvndHome, pid, address,
- token, locale, options, state, li, lb);
+ return new DaemonInfo(id, javaHome, mvndHome, pid, address, token, locale, options, state, li, lb);
}
@Override
@@ -125,14 +135,23 @@ public class DaemonInfo {
}
public StringBuilder appendNonKeyFields(StringBuilder sb) {
- return sb.append("javaHome=").append(javaHome)
- .append(", options=").append(options)
- .append(", mavenHome=").append(mvndHome)
- .append(", pid=").append(pid)
- .append(", address=").append(address)
- .append(", locale=").append(locale)
- .append(", state=").append(state)
- .append(", lastIdle=").append(lastIdle)
- .append(", lastBusy=").append(lastBusy);
+ return sb.append("javaHome=")
+ .append(javaHome)
+ .append(", options=")
+ .append(options)
+ .append(", mavenHome=")
+ .append(mvndHome)
+ .append(", pid=")
+ .append(pid)
+ .append(", address=")
+ .append(address)
+ .append(", locale=")
+ .append(locale)
+ .append(", state=")
+ .append(state)
+ .append(", lastIdle=")
+ .append(lastIdle)
+ .append(", lastBusy=")
+ .append(lastBusy);
}
}
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonRegistry.java b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonRegistry.java
index c488f51c..449e3f1a 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonRegistry.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonRegistry.java
@@ -1,21 +1,26 @@
/*
- * Copyright 2011 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
-
package org.mvndaemon.mvnd.common;
+import static org.mvndaemon.mvnd.common.DaemonState.Canceled;
+import static org.mvndaemon.mvnd.common.DaemonState.Idle;
+
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.nio.BufferOverflowException;
@@ -40,9 +45,6 @@ import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import static org.mvndaemon.mvnd.common.DaemonState.Canceled;
-import static org.mvndaemon.mvnd.common.DaemonState.Idle;
-
/**
* Access to daemon registry files. Useful also for testing.
*
@@ -76,8 +78,8 @@ public class DaemonRegistry implements AutoCloseable {
Files.createDirectories(absPath.getParent());
}
}
- channel = FileChannel.open(absPath,
- StandardOpenOption.CREATE, StandardOpenOption.READ, StandardOpenOption.WRITE);
+ channel = FileChannel.open(
+ absPath, StandardOpenOption.CREATE, StandardOpenOption.READ, StandardOpenOption.WRITE);
size = nextPowerOf2(channel.size(), MAX_LENGTH);
buffer = channel.map(FileChannel.MapMode.READ_WRITE, 0, size);
} catch (IOException e) {
@@ -117,15 +119,11 @@ public class DaemonRegistry implements AutoCloseable {
public List<DaemonInfo> getIdle() {
read();
- return infosMap.values().stream()
- .filter(di -> di.getState() == Idle)
- .collect(Collectors.toList());
+ return infosMap.values().stream().filter(di -> di.getState() == Idle).collect(Collectors.toList());
}
public List<DaemonInfo> getNotIdle() {
- return infosMap.values().stream()
- .filter(di -> di.getState() != Idle)
- .collect(Collectors.toList());
+ return infosMap.values().stream().filter(di -> di.getState() != Idle).collect(Collectors.toList());
}
public List<DaemonInfo> getCanceled() {
@@ -211,8 +209,9 @@ public class DaemonRegistry implements AutoCloseable {
DaemonState state = DaemonState.values()[buffer.get()];
long lastIdle = buffer.getLong();
long lastBusy = buffer.getLong();
- DaemonInfo di = new DaemonInfo(daemonId, javaHome, mavenHome, pid, address, token, locale,
- opts, state, lastIdle, lastBusy);
+ DaemonInfo di = new DaemonInfo(
+ daemonId, javaHome, mavenHome, pid, address, token, locale, opts, state, lastIdle,
+ lastBusy);
infosMap.putIfAbsent(di.getId(), di);
}
stopEvents.clear();
@@ -251,7 +250,10 @@ public class DaemonRegistry implements AutoCloseable {
for (DaemonStopEvent dse : stopEvents) {
writeString(dse.getDaemonId());
buffer.putLong(dse.getTimestamp());
- buffer.put((byte) (dse.getStatus() == null ? -1 : dse.getStatus().ordinal()));
+ buffer.put((byte)
+ (dse.getStatus() == null
+ ? -1
+ : dse.getStatus().ordinal()));
writeString(dse.getReason());
}
}
@@ -285,14 +287,16 @@ public class DaemonRegistry implements AutoCloseable {
throw new DaemonException("Could not resize registry " + registryFile, ex);
}
} catch (IOException e) {
- throw new DaemonException("Exception while "
- + (updater != null ? "updating " : "reading ") + registryFile, e);
+ throw new DaemonException(
+ "Exception while " + (updater != null ? "updating " : "reading ") + registryFile, e);
} catch (IllegalStateException | ArrayIndexOutOfBoundsException | BufferUnderflowException e) {
String absPath = registryFile.toAbsolutePath().normalize().toString();
- LOGGER.warn("Invalid daemon registry info, " +
- "trying to recover from this issue. " +
- "If you keep getting this warning, " +
- "try deleting the `registry.bin` file at [" + absPath + "]", e);
+ LOGGER.warn(
+ "Invalid daemon registry info, " + "trying to recover from this issue. "
+ + "If you keep getting this warning, "
+ + "try deleting the `registry.bin` file at ["
+ + absPath + "]",
+ e);
this.reset();
return;
}
@@ -347,7 +351,8 @@ public class DaemonRegistry implements AutoCloseable {
return Integer.parseInt(pid);
} catch (NumberFormatException x) {
int rpid = new Random().nextInt(1 << 16);
- LOGGER.warn("Unable to determine PID from malformed VM name `" + vmname + "`, picked a random number=" + rpid);
+ LOGGER.warn(
+ "Unable to determine PID from malformed VM name `" + vmname + "`, picked a random number=" + rpid);
return rpid;
}
}
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonState.java b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonState.java
index 808b4983..5c4158c0 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonState.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonState.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2012 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
@@ -20,7 +23,6 @@ package org.mvndaemon.mvnd.common;
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/server/api/DaemonStateControl.java
*/
public enum DaemonState {
-
Idle,
Busy,
Canceled,
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonStopEvent.java b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonStopEvent.java
index 45201308..e36e5d35 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/DaemonStopEvent.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/DaemonStopEvent.java
@@ -1,19 +1,21 @@
/*
- * Copyright 2016 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
-
package org.mvndaemon.mvnd.common;
import java.io.Serializable;
@@ -59,10 +61,8 @@ public class DaemonStopEvent implements Serializable {
@Override
public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o == null || getClass() != o.getClass())
- return false;
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
DaemonStopEvent that = (DaemonStopEvent) o;
return Objects.equals(daemonId, that.daemonId)
&& timestamp == that.timestamp
@@ -84,5 +84,4 @@ public class DaemonStopEvent implements Serializable {
+ ", reason=" + reason
+ "}";
}
-
}
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 c703059e..6181dc9c 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2020 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
@@ -214,7 +217,8 @@ public enum Environment {
* The <code>-Xss</code> value to pass to the daemon.
* This option takes precedence over options specified in {@link #MVND_JVM_ARGS}.
*/
- MVND_THREAD_STACK_SIZE("mvnd.threadStackSize", null, null, OptionType.MEMORY_SIZE, Flags.DISCRIMINATING | Flags.OPTIONAL),
+ MVND_THREAD_STACK_SIZE(
+ "mvnd.threadStackSize", null, null, OptionType.MEMORY_SIZE, Flags.DISCRIMINATING | Flags.OPTIONAL),
/**
* Additional JVM args to pass to the daemon.
* The content of the <code>.mvn/jvm.config</code> file will prepended (and thus with
@@ -230,13 +234,14 @@ public enum Environment {
/**
* The daemon will check this often whether it should exit.
*/
- MVND_EXPIRATION_CHECK_DELAY("mvnd.expirationCheckDelay", null, "10 seconds", OptionType.DURATION, Flags.DISCRIMINATING),
+ MVND_EXPIRATION_CHECK_DELAY(
+ "mvnd.expirationCheckDelay", null, "10 seconds", OptionType.DURATION, Flags.DISCRIMINATING),
/**
* Period after which idle duplicate daemons will be shut down. Duplicate daemons are daemons with the same set of
* discriminating start parameters.
*/
- MVND_DUPLICATE_DAEMON_GRACE_PERIOD("mvnd.duplicateDaemonGracePeriod", null, "10 seconds", OptionType.DURATION,
- Flags.DISCRIMINATING),
+ MVND_DUPLICATE_DAEMON_GRACE_PERIOD(
+ "mvnd.duplicateDaemonGracePeriod", null, "10 seconds", OptionType.DURATION, Flags.DISCRIMINATING),
/**
* Internal property to tell the daemon the width of the terminal
*/
@@ -289,7 +294,12 @@ public enum Environment {
private final OptionType type;
private final Map<String, OptionOrigin> options;
- Environment(String property, String environmentVariable, Object default_, OptionType type, int flags,
+ Environment(
+ String property,
+ String environmentVariable,
+ Object default_,
+ OptionType type,
+ int flags,
String... options) {
if (property == null && options.length == 0) {
throw new IllegalArgumentException(
@@ -305,7 +315,8 @@ public enum Environment {
} else {
final Map<String, OptionOrigin> optMap = new LinkedHashMap<>();
for (String opt : options) {
- OPTION_ORIGIN_SEARCH: {
+ OPTION_ORIGIN_SEARCH:
+ {
for (OptionOrigin oo : OptionOrigin.values()) {
if (opt.startsWith(oo.prefix)) {
optMap.put(opt.substring(oo.prefix.length()), oo);
@@ -314,7 +325,9 @@ public enum Environment {
}
throw new IllegalArgumentException(
"Unexpected option prefix: '" + opt + "'; Options should start with any of "
- + Stream.of(OptionOrigin.values()).map(oo -> oo.prefix).collect(Collectors.joining(",")));
+ + Stream.of(OptionOrigin.values())
+ .map(oo -> oo.prefix)
+ .collect(Collectors.joining(",")));
}
}
this.options = Collections.unmodifiableMap(optMap);
@@ -425,7 +438,7 @@ public enum Environment {
String getCommandLineOption(Collection<String> args, boolean remove) {
final String[] prefixes = getPrefixes();
String value = null;
- for (Iterator<String> it = args.iterator(); it.hasNext();) {
+ for (Iterator<String> it = args.iterator(); it.hasNext(); ) {
String arg = it.next();
if (Stream.of(prefixes).anyMatch(arg::startsWith)) {
if (remove) {
@@ -434,8 +447,10 @@ public enum Environment {
if (type == OptionType.VOID) {
value = "";
} else {
- String opt = Stream.of(prefixes).filter(arg::startsWith)
- .max(Comparator.comparing(String::length)).get();
+ String opt = Stream.of(prefixes)
+ .filter(arg::startsWith)
+ .max(Comparator.comparing(String::length))
+ .get();
value = arg.substring(opt.length());
if (value.isEmpty()) {
if (it.hasNext()) {
@@ -458,7 +473,7 @@ public enum Environment {
private String[] getPrefixes() {
final String[] prefixes;
if (options.isEmpty()) {
- prefixes = new String[] { "-D" + property + "=" };
+ prefixes = new String[] {"-D" + property + "="};
} else if (property != null) {
prefixes = new String[options.size() + 1];
options.keySet().toArray(prefixes);
@@ -493,13 +508,16 @@ public enum Environment {
}
return Stream.of(values)
.filter(env -> !env.isInternal())
- .sorted(Comparator.<Environment, String> comparing(env -> env.property != null ? env.property : "")
- .thenComparing(env -> !env.options.isEmpty() ? env.options.keySet().iterator().next() : ""))
+ .sorted(Comparator.<Environment, String>comparing(env -> env.property != null ? env.property : "")
+ .thenComparing(env -> !env.options.isEmpty()
+ ? env.options.keySet().iterator().next()
+ : ""))
.map(env -> new DocumentedEnumEntry<>(env, props.getProperty(env.name())));
}
public enum OptionOrigin {
- mvn, mvnd;
+ mvn,
+ mvnd;
private final String prefix;
@@ -512,7 +530,9 @@ public enum Environment {
* The values of {@link Environment#MAVEN_COLOR} option.
*/
public enum Color {
- always, never, auto;
+ always,
+ never,
+ auto;
public static Optional<Color> of(String color) {
return color == null ? Optional.empty() : Optional.of(Color.valueOf(color));
@@ -544,5 +564,4 @@ public enum Environment {
private static final int INTERNAL = 0b10;
private static final int OPTIONAL = 0b100;
}
-
}
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/InterpolationHelper.java b/common/src/main/java/org/mvndaemon/mvnd/common/InterpolationHelper.java
index 7e0a7e6b..138b0cbd 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/InterpolationHelper.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/InterpolationHelper.java
@@ -1,18 +1,20 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
@@ -30,8 +32,7 @@ import java.util.Properties;
*/
public class InterpolationHelper {
- private InterpolationHelper() {
- }
+ private InterpolationHelper() {}
private static final char ESCAPE_CHAR = '\\';
private static final String DELIM_START = "${";
@@ -45,7 +46,6 @@ public class InterpolationHelper {
public interface SubstitutionCallback {
String getValue(String key);
-
}
/**
@@ -57,7 +57,8 @@ public class InterpolationHelper {
* @param defaultsToEmptyString sets an empty string if a replacement value is not found, leaves intact
* otherwise
*/
- public static void performSubstitution(Properties properties,
+ public static void performSubstitution(
+ Properties properties,
SubstitutionCallback callback,
boolean substituteFromConfig,
boolean defaultsToEmptyString) {
@@ -65,9 +66,8 @@ public class InterpolationHelper {
properties.stringPropertyNames().forEach(n -> org.put(n, properties.getProperty(n)));
for (String name : properties.stringPropertyNames()) {
String value = properties.getProperty(name);
- properties.setProperty(name,
- substVars(value, name, null, org, callback, substituteFromConfig,
- defaultsToEmptyString));
+ properties.setProperty(
+ name, substVars(value, name, null, org, callback, substituteFromConfig, defaultsToEmptyString));
}
}
@@ -97,7 +97,8 @@ public class InterpolationHelper {
* @throws IllegalArgumentException If there was a syntax error in the
* property placeholder syntax or a recursive variable reference.
**/
- public static String substVars(String val,
+ public static String substVars(
+ String val,
String currentKey,
Map<String, String> cycleMap,
Map<String, String> configProps,
@@ -105,11 +106,12 @@ public class InterpolationHelper {
boolean substituteFromConfig,
boolean defaultsToEmptyString)
throws IllegalArgumentException {
- return unescape(doSubstVars(val, currentKey, cycleMap, configProps, callback, substituteFromConfig,
- defaultsToEmptyString));
+ return unescape(doSubstVars(
+ val, currentKey, cycleMap, configProps, callback, substituteFromConfig, defaultsToEmptyString));
}
- private static String doSubstVars(String val,
+ private static String doSubstVars(
+ String val,
String currentKey,
Map<String, String> cycleMap,
Map<String, String> configProps,
@@ -231,8 +233,8 @@ public class InterpolationHelper {
// Now perform substitution again, since there could still
// be substitutions to make.
- val = doSubstVars(val, currentKey, cycleMap, configProps, callback, substituteFromConfig,
- defaultsToEmptyString);
+ val = doSubstVars(
+ val, currentKey, cycleMap, configProps, callback, substituteFromConfig, defaultsToEmptyString);
cycleMap.remove(currentKey);
@@ -252,5 +254,4 @@ public class InterpolationHelper {
}
return val;
}
-
}
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/IoUtils.java b/common/src/main/java/org/mvndaemon/mvnd/common/IoUtils.java
index 0d7f0555..0779d239 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/IoUtils.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/IoUtils.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
@@ -26,10 +29,7 @@ public class IoUtils {
final StringBuilder result = new StringBuilder();
final int bufSize = 1024;
try (Reader in = new BufferedReader(
- new InputStreamReader(
- cl.getResourceAsStream(resourcePath),
- StandardCharsets.UTF_8),
- bufSize)) {
+ new InputStreamReader(cl.getResourceAsStream(resourcePath), StandardCharsets.UTF_8), bufSize)) {
int len = 0;
char[] buf = new char[bufSize];
while ((len = in.read(buf)) >= 0) {
@@ -39,6 +39,5 @@ public class IoUtils {
throw new RuntimeException("Could not read a class path resource: " + resourcePath, e);
}
return result.toString();
-
}
}
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/JavaVersion.java b/common/src/main/java/org/mvndaemon/mvnd/common/JavaVersion.java
index 1854d8b4..e6eb3d1c 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/JavaVersion.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/JavaVersion.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/MavenDaemon.java b/common/src/main/java/org/mvndaemon/mvnd/common/MavenDaemon.java
index d94779f1..cf4bb133 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/MavenDaemon.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/MavenDaemon.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
@@ -27,24 +30,23 @@ public class MavenDaemon {
public static void main(String[] args) throws Exception {
final Path mvndHome = Environment.MVND_HOME.asPath();
URL[] classpath = Stream.concat(
- /* jars */
- Stream.of("mvn/lib/ext", "mvn/lib", "mvn/boot")
- .map(mvndHome::resolve)
- .flatMap((Path p) -> {
- try {
- return Files.list(p);
- } catch (java.io.IOException e) {
- throw new RuntimeException("Could not list " + p, e);
- }
- })
- .filter(p -> {
- final String fileName = p.getFileName().toString();
- return fileName.endsWith(".jar") && !fileName.startsWith("mvnd-client-");
- })
- .filter(Files::isRegularFile),
- /* resources */
- Stream.of(mvndHome.resolve("mvn/conf"), mvndHome.resolve("mvn/conf/logging")))
-
+ /* jars */
+ Stream.of("mvn/lib/ext", "mvn/lib", "mvn/boot")
+ .map(mvndHome::resolve)
+ .flatMap((Path p) -> {
+ try {
+ return Files.list(p);
+ } catch (java.io.IOException e) {
+ throw new RuntimeException("Could not list " + p, e);
+ }
+ })
+ .filter(p -> {
+ final String fileName = p.getFileName().toString();
+ return fileName.endsWith(".jar") && !fileName.startsWith("mvnd-client-");
+ })
+ .filter(Files::isRegularFile),
+ /* resources */
+ Stream.of(mvndHome.resolve("mvn/conf"), mvndHome.resolve("mvn/conf/logging")))
.map(Path::normalize)
.map(Path::toUri)
.map(uri -> {
@@ -80,5 +82,4 @@ public class MavenDaemon {
((Runnable) server).run();
}
}
-
}
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/Message.java b/common/src/main/java/org/mvndaemon/mvnd/common/Message.java
index c1ffa7dd..e983b321 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/Message.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/Message.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
@@ -37,6 +40,7 @@ public abstract class Message {
public static final int PROJECT_STARTED = 4;
/** A {@link StringMessage} bearing the {@code artifactId} of the project whose build just finished */
public static final int PROJECT_STOPPED = 5;
+
public static final int MOJO_STARTED = 6;
public static final int PROJECT_LOG_MESSAGE = 7;
public static final int BUILD_LOG_MESSAGE = 8;
@@ -71,46 +75,46 @@ public abstract class Message {
return null;
}
switch (type) {
- case BUILD_REQUEST:
- return BuildRequest.read(input);
- case BUILD_STARTED:
- return BuildStarted.read(input);
- case BUILD_FINISHED:
- return BuildFinished.read(input);
- case MOJO_STARTED:
- return MojoStartedEvent.read(input);
- case PROJECT_LOG_MESSAGE:
- case DISPLAY:
- return ProjectEvent.read(type, input);
- case BUILD_EXCEPTION:
- return BuildException.read(input);
- case KEEP_ALIVE:
- return BareMessage.KEEP_ALIVE_SINGLETON;
- case STOP:
- return BareMessage.STOP_SINGLETON;
- case PROMPT:
- return Prompt.read(input);
- case PROMPT_RESPONSE:
- return PromptResponse.read(input);
- case PROJECT_STARTED:
- case PROJECT_STOPPED:
- case BUILD_STATUS:
- case BUILD_LOG_MESSAGE:
- return StringMessage.read(type, input);
- case CANCEL_BUILD:
- return BareMessage.CANCEL_BUILD_SINGLETON;
- case TRANSFER_INITIATED:
- case TRANSFER_STARTED:
- case TRANSFER_PROGRESSED:
- case TRANSFER_CORRUPTED:
- case TRANSFER_SUCCEEDED:
- case TRANSFER_FAILED:
- return TransferEvent.read(type, input);
- case EXECUTION_FAILURE:
- return ExecutionFailureEvent.read(input);
- case PRINT_OUT:
- case PRINT_ERR:
- return StringMessage.read(type, input);
+ case BUILD_REQUEST:
+ return BuildRequest.read(input);
+ case BUILD_STARTED:
+ return BuildStarted.read(input);
+ case BUILD_FINISHED:
+ return BuildFinished.read(input);
+ case MOJO_STARTED:
+ return MojoStartedEvent.read(input);
+ case PROJECT_LOG_MESSAGE:
+ case DISPLAY:
+ return ProjectEvent.read(type, input);
+ case BUILD_EXCEPTION:
+ return BuildException.read(input);
+ case KEEP_ALIVE:
+ return BareMessage.KEEP_ALIVE_SINGLETON;
+ case STOP:
+ return BareMessage.STOP_SINGLETON;
+ case PROMPT:
+ return Prompt.read(input);
+ case PROMPT_RESPONSE:
+ return PromptResponse.read(input);
+ case PROJECT_STARTED:
+ case PROJECT_STOPPED:
+ case BUILD_STATUS:
+ case BUILD_LOG_MESSAGE:
+ return StringMessage.read(type, input);
+ case CANCEL_BUILD:
+ return BareMessage.CANCEL_BUILD_SINGLETON;
+ case TRANSFER_INITIATED:
+ case TRANSFER_STARTED:
+ case TRANSFER_PROGRESSED:
+ case TRANSFER_CORRUPTED:
+ case TRANSFER_SUCCEEDED:
+ case TRANSFER_FAILED:
+ return TransferEvent.read(type, input);
+ case EXECUTION_FAILURE:
+ return ExecutionFailureEvent.read(input);
+ case PRINT_OUT:
+ case PRINT_ERR:
+ return StringMessage.read(type, input);
}
throw new IllegalStateException("Unexpected message type: " + type);
}
@@ -123,46 +127,46 @@ public abstract class Message {
public static int getClassOrder(Message m) {
switch (m.getType()) {
- case KEEP_ALIVE:
- case BUILD_REQUEST:
- return 0;
- case BUILD_STARTED:
- return 1;
- case PROMPT:
- case PROMPT_RESPONSE:
- case DISPLAY:
- case PRINT_OUT:
- case PRINT_ERR:
- return 2;
- case PROJECT_STARTED:
- return 3;
- case MOJO_STARTED:
- return 4;
- case EXECUTION_FAILURE:
- return 10;
- case TRANSFER_INITIATED:
- case TRANSFER_STARTED:
- return 40;
- case TRANSFER_PROGRESSED:
- return 41;
- case TRANSFER_CORRUPTED:
- case TRANSFER_SUCCEEDED:
- case TRANSFER_FAILED:
- return 42;
- case PROJECT_LOG_MESSAGE:
- return 50;
- case BUILD_LOG_MESSAGE:
- return 51;
- case PROJECT_STOPPED:
- return 95;
- case BUILD_FINISHED:
- return 96;
- case BUILD_EXCEPTION:
- return 97;
- case STOP:
- return 99;
- default:
- throw new IllegalStateException("Unexpected message type " + m.getType() + ": " + m);
+ case KEEP_ALIVE:
+ case BUILD_REQUEST:
+ return 0;
+ case BUILD_STARTED:
+ return 1;
+ case PROMPT:
+ case PROMPT_RESPONSE:
+ case DISPLAY:
+ case PRINT_OUT:
+ case PRINT_ERR:
+ return 2;
+ case PROJECT_STARTED:
+ return 3;
+ case MOJO_STARTED:
+ return 4;
+ case EXECUTION_FAILURE:
+ return 10;
+ case TRANSFER_INITIATED:
+ case TRANSFER_STARTED:
+ return 40;
+ case TRANSFER_PROGRESSED:
+ return 41;
+ case TRANSFER_CORRUPTED:
+ case TRANSFER_SUCCEEDED:
+ case TRANSFER_FAILED:
+ return 42;
+ case PROJECT_LOG_MESSAGE:
+ return 50;
+ case BUILD_LOG_MESSAGE:
+ return 51;
+ case PROJECT_STOPPED:
+ return 95;
+ case BUILD_FINISHED:
+ return 96;
+ case BUILD_EXCEPTION:
+ return 97;
+ case STOP:
+ return 99;
+ default:
+ throw new IllegalStateException("Unexpected message type " + m.getType() + ": " + m);
}
}
@@ -352,12 +356,11 @@ public abstract class Message {
@Override
public String toString() {
- return "BuildRequest{" +
- "args=" + args +
- ", workingDir='" + workingDir + '\'' +
- ", projectDir='" + projectDir + '\'' +
- ", env='" + env + '\'' +
- '}';
+ return "BuildRequest{" + "args="
+ + args + ", workingDir='"
+ + workingDir + '\'' + ", projectDir='"
+ + projectDir + '\'' + ", env='"
+ + env + '\'' + '}';
}
@Override
@@ -442,11 +445,10 @@ public abstract class Message {
@Override
public String toString() {
- return "BuildException{" +
- "message='" + message + '\'' +
- ", className='" + className + '\'' +
- ", stackTrace='" + stackTrace + '\'' +
- '}';
+ return "BuildException{" + "message='"
+ + message + '\'' + ", className='"
+ + className + '\'' + ", stackTrace='"
+ + stackTrace + '\'' + '}';
}
@Override
@@ -484,18 +486,15 @@ public abstract class Message {
@Override
public String toString() {
- return mnemonic() + "{" +
- "projectId='" + projectId + '\'' +
- ", message='" + message + '\'' +
- '}';
+ return mnemonic() + "{" + "projectId='" + projectId + '\'' + ", message='" + message + '\'' + '}';
}
private String mnemonic() {
switch (type) {
- case PROJECT_LOG_MESSAGE:
- return "ProjectLogMessage";
- default:
- throw new IllegalStateException("Unexpected type " + type);
+ case PROJECT_LOG_MESSAGE:
+ return "ProjectLogMessage";
+ default:
+ throw new IllegalStateException("Unexpected type " + type);
}
}
@@ -525,8 +524,13 @@ public abstract class Message {
return new MojoStartedEvent(artifactId, pluginGroupId, pluginArtifactId, pluginVersion, mojo, executionId);
}
- public MojoStartedEvent(String artifactId, String pluginGroupId, String pluginArtifactId,
- String pluginVersion, String mojo, String executionId) {
+ public MojoStartedEvent(
+ String artifactId,
+ String pluginGroupId,
+ String pluginArtifactId,
+ String pluginVersion,
+ String mojo,
+ String executionId) {
super(Message.MOJO_STARTED);
this.artifactId = Objects.requireNonNull(artifactId, "artifactId cannot be null");
this.pluginGroupId = Objects.requireNonNull(pluginGroupId, "pluginGroupId cannot be null");
@@ -562,14 +566,13 @@ public abstract class Message {
@Override
public String toString() {
- return "MojoStarted{" +
- "artifactId='" + artifactId + '\'' +
- ", pluginGroupId='" + pluginGroupId + '\'' +
- ", pluginArtifactId='" + pluginArtifactId + '\'' +
- ", pluginVersion='" + pluginVersion + '\'' +
- ", mojo='" + mojo + '\'' +
- ", executionId='" + executionId + '\'' +
- '}';
+ return "MojoStarted{" + "artifactId='"
+ + artifactId + '\'' + ", pluginGroupId='"
+ + pluginGroupId + '\'' + ", pluginArtifactId='"
+ + pluginArtifactId + '\'' + ", pluginVersion='"
+ + pluginVersion + '\'' + ", mojo='"
+ + mojo + '\'' + ", executionId='"
+ + executionId + '\'' + '}';
}
@Override
@@ -625,9 +628,9 @@ public abstract class Message {
@Override
public String toString() {
- return "BuildStarted{" +
- "projectId='" + projectId + "', projectCount=" + projectCount +
- ", maxThreads=" + maxThreads + ", artifactIdDisplayLength=" + artifactIdDisplayLength + "}";
+ return "BuildStarted{" + "projectId='"
+ + projectId + "', projectCount=" + projectCount + ", maxThreads="
+ + maxThreads + ", artifactIdDisplayLength=" + artifactIdDisplayLength + "}";
}
@Override
@@ -638,7 +641,6 @@ public abstract class Message {
output.writeInt(maxThreads);
output.writeInt(artifactIdDisplayLength);
}
-
}
public static class BareMessage extends Message {
@@ -654,19 +656,18 @@ public abstract class Message {
@Override
public String toString() {
switch (type) {
- case KEEP_ALIVE:
- return "KeepAlive";
- case BUILD_FINISHED:
- return "BuildStopped";
- case STOP:
- return "Stop";
- case CANCEL_BUILD:
- return "BuildCanceled";
- default:
- throw new IllegalStateException("Unexpected type " + type);
+ case KEEP_ALIVE:
+ return "KeepAlive";
+ case BUILD_FINISHED:
+ return "BuildStopped";
+ case STOP:
+ return "Stop";
+ case CANCEL_BUILD:
+ return "BuildCanceled";
+ default:
+ throw new IllegalStateException("Unexpected type " + type);
}
}
-
}
public static class StringMessage extends Message {
@@ -700,27 +701,26 @@ public abstract class Message {
private String mnemonic() {
switch (type) {
- case PROJECT_STARTED:
- return "ProjectStarted";
- case PROJECT_STOPPED:
- return "ProjectStopped";
- case BUILD_STATUS:
- return "BuildStatus";
- case KEYBOARD_INPUT:
- return "KeyboardInput";
- case BUILD_LOG_MESSAGE:
- return "BuildLogMessage";
- case DISPLAY:
- return "Display";
- case PRINT_OUT:
- return "PrintOut";
- case PRINT_ERR:
- return "PrintErr";
- default:
- throw new IllegalStateException("Unexpected type " + type);
+ case PROJECT_STARTED:
+ return "ProjectStarted";
+ case PROJECT_STOPPED:
+ return "ProjectStopped";
+ case BUILD_STATUS:
+ return "BuildStatus";
+ case KEYBOARD_INPUT:
+ return "KeyboardInput";
+ case BUILD_LOG_MESSAGE:
+ return "BuildLogMessage";
+ case DISPLAY:
+ return "Display";
+ case PRINT_OUT:
+ return "PrintOut";
+ case PRINT_ERR:
+ return "PrintErr";
+ default:
+ throw new IllegalStateException("Unexpected type " + type);
}
}
-
}
public static class Prompt extends Message {
@@ -764,12 +764,11 @@ public abstract class Message {
@Override
public String toString() {
- return "Prompt{" +
- "projectId='" + projectId + '\'' +
- ", uid='" + uid + '\'' +
- ", message='" + message + '\'' +
- ", password=" + password +
- '}';
+ return "Prompt{" + "projectId='"
+ + projectId + '\'' + ", uid='"
+ + uid + '\'' + ", message='"
+ + message + '\'' + ", password="
+ + password + '}';
}
@Override
@@ -784,7 +783,6 @@ public abstract class Message {
public PromptResponse response(String message) {
return new PromptResponse(projectId, uid, message);
}
-
}
public static class PromptResponse extends Message {
@@ -821,11 +819,10 @@ public abstract class Message {
@Override
public String toString() {
- return "PromptResponse{" +
- "projectId='" + projectId + '\'' +
- ", uid='" + uid + '\'' +
- ", message='" + message + '\'' +
- '}';
+ return "PromptResponse{" + "projectId='"
+ + projectId + '\'' + ", uid='"
+ + uid + '\'' + ", message='"
+ + message + '\'' + '}';
}
@Override
@@ -864,11 +861,10 @@ public abstract class Message {
@Override
public String toString() {
- return "ExecutionFailure{" +
- "projectId='" + projectId + '\'' +
- ", halted=" + halted +
- ", exception='" + exception + '\'' +
- '}';
+ return "ExecutionFailure{" + "projectId='"
+ + projectId + '\'' + ", halted="
+ + halted + ", exception='"
+ + exception + '\'' + '}';
}
@Override
@@ -909,9 +905,15 @@ public abstract class Message {
final long transferredBytes;
final String exception;
- private TransferEvent(int type, String projectId, int requestType,
- String repositoryId, String repositoryUrl,
- String resourceName, long contentLength, long transferredBytes,
+ private TransferEvent(
+ int type,
+ String projectId,
+ int requestType,
+ String repositoryId,
+ String repositoryUrl,
+ String resourceName,
+ long contentLength,
+ long transferredBytes,
String exception) {
super(type);
this.projectId = projectId;
@@ -958,34 +960,33 @@ public abstract class Message {
@Override
public String toString() {
- return mnemonic() + "{" +
- "projectId=" + projectId +
- ", requestType=" + requestType +
- ", repositoryId='" + repositoryId + '\'' +
- ", repositoryUrl='" + repositoryUrl + '\'' +
- ", resourceName='" + resourceName + '\'' +
- ", contentLength=" + contentLength +
- ", transferredBytes=" + transferredBytes +
- ", exception='" + exception + '\'' +
- '}';
+ return mnemonic() + "{" + "projectId="
+ + projectId + ", requestType="
+ + requestType + ", repositoryId='"
+ + repositoryId + '\'' + ", repositoryUrl='"
+ + repositoryUrl + '\'' + ", resourceName='"
+ + resourceName + '\'' + ", contentLength="
+ + contentLength + ", transferredBytes="
+ + transferredBytes + ", exception='"
+ + exception + '\'' + '}';
}
private String mnemonic() {
switch (type) {
- case TRANSFER_INITIATED:
- return "TransferInitiated";
- case TRANSFER_STARTED:
- return "TransferStarted";
- case TRANSFER_PROGRESSED:
- return "TransferProgressed";
- case TRANSFER_CORRUPTED:
- return "TransferCorrupted";
- case TRANSFER_SUCCEEDED:
- return "TransferSucceeded";
- case TRANSFER_FAILED:
- return "TransferFailed";
- default:
- throw new IllegalStateException("Unexpected type " + type);
+ case TRANSFER_INITIATED:
+ return "TransferInitiated";
+ case TRANSFER_STARTED:
+ return "TransferStarted";
+ case TRANSFER_PROGRESSED:
+ return "TransferProgressed";
+ case TRANSFER_CORRUPTED:
+ return "TransferCorrupted";
+ case TRANSFER_SUCCEEDED:
+ return "TransferSucceeded";
+ case TRANSFER_FAILED:
+ return "TransferFailed";
+ default:
+ throw new IllegalStateException("Unexpected type " + type);
}
}
@@ -1011,8 +1012,16 @@ public abstract class Message {
long contentLength = input.readLong();
long transferredBytes = input.readLong();
String exception = readUTF(input);
- return new TransferEvent(type, projectId, request, repositoryId, repositoryUrl, resourceName,
- contentLength, transferredBytes, exception);
+ return new TransferEvent(
+ type,
+ projectId,
+ request,
+ repositoryId,
+ repositoryUrl,
+ resourceName,
+ contentLength,
+ transferredBytes,
+ exception);
}
}
@@ -1060,8 +1069,13 @@ public abstract class Message {
return new ExecutionFailureEvent(projectId, halted, exception);
}
- public static Message mojoStarted(String artifactId, String pluginGroupId, String pluginArtifactId,
- String pluginVersion, String mojo, String executionId) {
+ public static Message mojoStarted(
+ String artifactId,
+ String pluginGroupId,
+ String pluginArtifactId,
+ String pluginVersion,
+ String mojo,
+ String executionId) {
return new MojoStartedEvent(artifactId, pluginGroupId, pluginArtifactId, pluginVersion, mojo, executionId);
}
@@ -1069,12 +1083,25 @@ public abstract class Message {
return new ProjectEvent(Message.DISPLAY, projectId, message);
}
- public static TransferEvent transfer(String projectId, int transferEventType, int requestType,
- String repositoryId, String repositoryUrl,
- String resourceName, long contentLength, long transferredBytes,
+ public static TransferEvent transfer(
+ String projectId,
+ int transferEventType,
+ int requestType,
+ String repositoryId,
+ String repositoryUrl,
+ String resourceName,
+ long contentLength,
+ long transferredBytes,
String exception) {
- return new TransferEvent(transferEventType, projectId, requestType,
- repositoryId, repositoryUrl, resourceName, contentLength, transferredBytes, exception);
+ return new TransferEvent(
+ transferEventType,
+ projectId,
+ requestType,
+ repositoryId,
+ repositoryUrl,
+ resourceName,
+ contentLength,
+ transferredBytes,
+ exception);
}
-
}
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/OptionType.java b/common/src/main/java/org/mvndaemon/mvnd/common/OptionType.java
index cbf49ec3..9f73fdec 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/OptionType.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/OptionType.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/Os.java b/common/src/main/java/org/mvndaemon/mvnd/common/Os.java
index 68701631..cef74ffa 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/Os.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/Os.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
@@ -22,6 +25,7 @@ public enum Os {
MAC(true),
WINDOWS(false) {
private boolean cygwin;
+
{
String pwd = System.getenv("PWD");
cygwin = pwd != null && pwd.startsWith("/");
@@ -38,10 +42,10 @@ public enum Os {
public boolean isUnixLike() {
throw new UnsupportedOperationException("Cannot tell isUnixLike() for an " + UNKNOWN.name() + " OS");
}
-
};
private static final Os CURRENT;
+
static {
final String osName = System.getProperty("os.name").toLowerCase(Locale.ROOT);
if (osName.startsWith("osx") || osName.startsWith("mac os x")) {
@@ -72,5 +76,4 @@ public enum Os {
public boolean isCygwin() {
return false;
}
-
}
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/OsUtils.java b/common/src/main/java/org/mvndaemon/mvnd/common/OsUtils.java
index fd4170e7..eb0569db 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/OsUtils.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/OsUtils.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
@@ -35,9 +38,7 @@ public class OsUtils {
private static final long KB = 1024;
private static final String UNITS = "Bkmgt";
- private OsUtils() {
-
- }
+ private OsUtils() {}
public static String bytesTohumanReadable(long bytes) {
int unit = 0;
@@ -46,7 +47,10 @@ public class OsUtils {
unit++;
}
String kbString = String.valueOf(bytes);
- return new StringBuilder(kbString.length() + 1).append(kbString).append(UNITS.charAt(unit)).toString();
+ return new StringBuilder(kbString.length() + 1)
+ .append(kbString)
+ .append(UNITS.charAt(unit))
+ .toString();
}
public static String kbTohumanReadable(long kb) {
@@ -56,22 +60,26 @@ public class OsUtils {
unit++;
}
String kbString = String.valueOf(kb);
- return new StringBuilder(kbString.length() + 1).append(kbString).append(UNITS.charAt(unit)).toString();
+ return new StringBuilder(kbString.length() + 1)
+ .append(kbString)
+ .append(UNITS.charAt(unit))
+ .toString();
}
public static long findProcessRssInKb(long pid) {
final Os os = Os.current();
if (os.isUnixLike()) {
- String[] cmd = { "ps", "-o", "rss=", "-p", String.valueOf(pid) };
+ String[] cmd = {"ps", "-o", "rss=", "-p", String.valueOf(pid)};
final List<String> output = new ArrayList<String>(1);
exec(cmd, output);
if (output.size() == 1) {
try {
return Long.parseLong(output.get(0).trim());
} catch (NumberFormatException e) {
- LOGGER.warn("Could not parse the output of " + Stream.of(cmd).collect(Collectors.joining(" "))
- + " as a long:\n"
- + output.stream().collect(Collectors.joining("\n")));
+ LOGGER.warn(
+ "Could not parse the output of " + Stream.of(cmd).collect(Collectors.joining(" "))
+ + " as a long:\n"
+ + output.stream().collect(Collectors.joining("\n")));
}
} else {
LOGGER.warn("Unexpected output of " + Stream.of(cmd).collect(Collectors.joining(" ")) + ":\n"
@@ -79,15 +87,17 @@ public class OsUtils {
}
return -1;
} else if (os == Os.WINDOWS) {
- String[] cmd = { "wmic", "process", "where", "processid=" + pid, "get", "WorkingSetSize" };
+ String[] cmd = {"wmic", "process", "where", "processid=" + pid, "get", "WorkingSetSize"};
final List<String> output = new ArrayList<String>(1);
exec(cmd, output);
- final List<String> nonEmptyLines = output.stream().filter(l -> !l.isEmpty()).collect(Collectors.toList());
+ final List<String> nonEmptyLines =
+ output.stream().filter(l -> !l.isEmpty()).collect(Collectors.toList());
if (nonEmptyLines.size() >= 2) {
try {
return Long.parseLong(nonEmptyLines.get(1).trim()) / KB;
} catch (NumberFormatException e) {
- LOGGER.warn("Could not parse the second line of " + Stream.of(cmd).collect(Collectors.joining(" "))
+ LOGGER.warn("Could not parse the second line of "
+ + Stream.of(cmd).collect(Collectors.joining(" "))
+ " output as a long:\n"
+ nonEmptyLines.stream().collect(Collectors.joining("\n")));
}
@@ -102,11 +112,11 @@ public class OsUtils {
}
public static String findJavaHomeFromPath() {
- String[] cmd = { "java", "-XshowSettings:properties", "-version" };
+ String[] cmd = {"java", "-XshowSettings:properties", "-version"};
final List<String> output = new ArrayList<String>(1);
exec(cmd, output);
- List<String> javaHomeLines = output.stream().filter(l -> l.contains(" java.home = "))
- .collect(Collectors.toList());
+ List<String> javaHomeLines =
+ output.stream().filter(l -> l.contains(" java.home = ")).collect(Collectors.toList());
if (javaHomeLines.size() == 1) {
return javaHomeLines.get(0).trim().replaceFirst("java.home = ", "");
}
@@ -210,6 +220,5 @@ public class OsUtils {
final int exitCode = timeouted ? TIMEOUT_EXIT_CODE : process.exitValue();
return exitCode;
}
-
}
}
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/ProcessHelper.java b/common/src/main/java/org/mvndaemon/mvnd/common/ProcessHelper.java
index 17acbdb8..97bbd7fa 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/ProcessHelper.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/ProcessHelper.java
@@ -1,23 +1,24 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
public class ProcessHelper {
- public static void killChildrenProcesses() {
- }
-
+ public static void killChildrenProcesses() {}
}
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/SocketFamily.java b/common/src/main/java/org/mvndaemon/mvnd/common/SocketFamily.java
index 1a8cb9ec..243244da 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/SocketFamily.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/SocketFamily.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
@@ -32,23 +35,23 @@ public enum SocketFamily {
public SocketChannel openSocket() throws IOException {
switch (this) {
- case inet:
- return SocketChannel.open();
- case unix:
- return SocketHelper.openUnixSocket();
- default:
- throw new IllegalStateException();
+ case inet:
+ return SocketChannel.open();
+ case unix:
+ return SocketHelper.openUnixSocket();
+ default:
+ throw new IllegalStateException();
}
}
public ServerSocketChannel openServerSocket() throws IOException {
switch (this) {
- case inet:
- return ServerSocketChannel.open().bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
- case unix:
- return SocketHelper.openUnixServerSocket();
- default:
- throw new IllegalStateException();
+ case inet:
+ return ServerSocketChannel.open().bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
+ case unix:
+ return SocketHelper.openUnixServerSocket();
+ default:
+ throw new IllegalStateException();
}
}
@@ -105,26 +108,26 @@ public enum SocketFamily {
public static String toString(SocketAddress address) {
switch (familyOf(address)) {
- case inet:
- InetSocketAddress isa = (InetSocketAddress) address;
- String host = isa.getHostString();
- InetAddress addr = isa.getAddress();
- int port = isa.getPort();
- String formatted;
- if (addr == null) {
- formatted = host + "/<unresolved>";
- } else {
- formatted = addr.toString();
- if (addr instanceof Inet6Address) {
- int i = formatted.lastIndexOf("/");
- formatted = formatted.substring(0, i + 1) + "[" + formatted.substring(i + 1) + "]";
+ case inet:
+ InetSocketAddress isa = (InetSocketAddress) address;
+ String host = isa.getHostString();
+ InetAddress addr = isa.getAddress();
+ int port = isa.getPort();
+ String formatted;
+ if (addr == null) {
+ formatted = host + "/<unresolved>";
+ } else {
+ formatted = addr.toString();
+ if (addr instanceof Inet6Address) {
+ int i = formatted.lastIndexOf("/");
+ formatted = formatted.substring(0, i + 1) + "[" + formatted.substring(i + 1) + "]";
+ }
}
- }
- return "inet:" + formatted + ":" + port;
- case unix:
- return "unix:" + address;
- default:
- throw new IllegalArgumentException("Unsupported socket address: '" + address + "'");
+ return "inet:" + formatted + ":" + port;
+ case unix:
+ return "unix:" + address;
+ default:
+ throw new IllegalArgumentException("Unsupported socket address: '" + address + "'");
}
}
@@ -137,5 +140,4 @@ public enum SocketFamily {
throw new IllegalArgumentException("Unsupported socket address '" + address + "'");
}
}
-
}
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/SocketHelper.java b/common/src/main/java/org/mvndaemon/mvnd/common/SocketHelper.java
index 765777bc..96b1dbbc 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/SocketHelper.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/SocketHelper.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/TimeUtils.java b/common/src/main/java/org/mvndaemon/mvnd/common/TimeUtils.java
index d5abefd0..8d676aea 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/TimeUtils.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/TimeUtils.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2020 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
@@ -32,19 +35,17 @@ public final class TimeUtils {
public static final long SECONDS_MILLIS = TimeUnit.SECONDS.toMillis(ONE_UNIT);
private static final Pattern DURATION_PATTERN = Pattern.compile(
- "(?<n>-?\\d+)" +
- "|" +
- "(" +
- "((?<d>\\d+)\\s*d(ay(s)?)?)?" + "\\s*" +
- "((?<h>\\d+)\\s*h(our(s)?)?)?" + "\\s*" +
- "((?<m>\\d+)\\s*m(in(ute(s)?)?)?)?" + "\\s*" +
- "((?<s>\\d+(\\.\\d+)?)\\s*s(ec(ond(s)?)?)?)?" + "\\s*" +
- "((?<l>\\d+(\\.\\d+)?)\\s*m(illi)?s(ec(ond)?(s)?)?)?" +
- ")",
+ "(?<n>-?\\d+)" + "|"
+ + "("
+ + "((?<d>\\d+)\\s*d(ay(s)?)?)?"
+ + "\\s*" + "((?<h>\\d+)\\s*h(our(s)?)?)?"
+ + "\\s*" + "((?<m>\\d+)\\s*m(in(ute(s)?)?)?)?"
+ + "\\s*" + "((?<s>\\d+(\\.\\d+)?)\\s*s(ec(ond(s)?)?)?)?"
+ + "\\s*" + "((?<l>\\d+(\\.\\d+)?)\\s*m(illi)?s(ec(ond)?(s)?)?)?"
+ + ")",
Pattern.CASE_INSENSITIVE);
- private TimeUtils() {
- }
+ private TimeUtils() {}
public static boolean isPositive(Duration dur) {
return dur.getSeconds() > 0 || dur.getNano() != 0;
@@ -117,5 +118,4 @@ public final class TimeUtils {
+ (l != null ? TimeUnit.MILLISECONDS.toMillis(Long.parseLong(l)) : 0);
}
}
-
}
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/logging/ClientOutput.java b/common/src/main/java/org/mvndaemon/mvnd/common/logging/ClientOutput.java
index 9d55552a..0d1425a4 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/logging/ClientOutput.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/logging/ClientOutput.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common.logging;
diff --git a/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java b/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java
index e5feec21..d5393cb7 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalOutput.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2020 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common.logging;
@@ -122,10 +125,12 @@ public class TerminalOutput implements ClientOutput {
private int totalProjects;
/** String format for formatting the number of projects done with padding based on {@link #totalProjects} */
private String projectsDoneFomat;
+
private int maxThreads;
private String artifactIdFormat;
/** String format for formatting the actual/hidden/max thread counts */
private String threadsFormat;
+
private int linesPerProject = 0;
private int doneProjects = 0;
private String buildStatus;
@@ -164,8 +169,8 @@ public class TerminalOutput implements ClientOutput {
mainThread.interrupt();
}
};
- this.previousIntHandler = terminal.handle(Terminal.Signal.INT,
- sig -> daemonDispatch.accept(Message.BareMessage.CANCEL_BUILD_SINGLETON));
+ this.previousIntHandler = terminal.handle(
+ Terminal.Signal.INT, sig -> daemonDispatch.accept(Message.BareMessage.CANCEL_BUILD_SINGLETON));
this.display = new Display(terminal, false);
this.log = logFile == null ? new MessageCollector() : new FileLog(logFile);
if (!dumb) {
@@ -214,228 +219,230 @@ public class TerminalOutput implements ClientOutput {
private boolean doAccept(Message entry) {
switch (entry.getType()) {
- case Message.BUILD_STARTED: {
- BuildStarted bs = (BuildStarted) entry;
- this.name = bs.getProjectId();
- this.totalProjects = bs.getProjectCount();
- final int totalProjectsDigits = (int) (Math.log10(totalProjects) + 1);
- this.projectsDoneFomat = "%" + totalProjectsDigits + "d";
- this.maxThreads = bs.getMaxThreads();
- this.artifactIdFormat = "%-" + bs.getArtifactIdDisplayLength() + "s ";
- final int maxThreadsDigits = (int) (Math.log10(maxThreads) + 1);
- this.threadsFormat = "%" + (maxThreadsDigits * 3 + 2) + "s";
- if (maxThreads <= 1 || totalProjects <= 1) {
- this.noBuffering = true;
- display.update(Collections.emptyList(), 0);
- applyNoBuffering();
- }
- break;
- }
- case Message.CANCEL_BUILD: {
- projects.values().stream().flatMap(p -> p.log.stream()).forEach(log);
- clearDisplay();
- try {
- log.close();
- } catch (IOException e1) {
- throw new RuntimeException(e1);
- }
- final AttributedStyle s = new AttributedStyle().bold().foreground(AttributedStyle.RED);
- new AttributedString("The build was canceled", s).println(terminal);
- terminal.flush();
- return false;
- }
- case Message.BUILD_EXCEPTION: {
- final BuildException e = (BuildException) entry;
- final String msg;
- if ("org.apache.commons.cli.UnrecognizedOptionException".equals(e.getClassName())) {
- msg = "Unable to parse command line options: " + e.getMessage();
- } else {
- msg = e.getClassName() + ": " + e.getMessage();
+ case Message.BUILD_STARTED: {
+ BuildStarted bs = (BuildStarted) entry;
+ this.name = bs.getProjectId();
+ this.totalProjects = bs.getProjectCount();
+ final int totalProjectsDigits = (int) (Math.log10(totalProjects) + 1);
+ this.projectsDoneFomat = "%" + totalProjectsDigits + "d";
+ this.maxThreads = bs.getMaxThreads();
+ this.artifactIdFormat = "%-" + bs.getArtifactIdDisplayLength() + "s ";
+ final int maxThreadsDigits = (int) (Math.log10(maxThreads) + 1);
+ this.threadsFormat = "%" + (maxThreadsDigits * 3 + 2) + "s";
+ if (maxThreads <= 1 || totalProjects <= 1) {
+ this.noBuffering = true;
+ display.update(Collections.emptyList(), 0);
+ applyNoBuffering();
+ }
+ break;
}
- projects.values().stream().flatMap(p -> p.log.stream()).forEach(log);
- clearDisplay();
- try {
- log.close();
- } catch (IOException e1) {
- throw new RuntimeException(e1);
+ case Message.CANCEL_BUILD: {
+ projects.values().stream().flatMap(p -> p.log.stream()).forEach(log);
+ clearDisplay();
+ try {
+ log.close();
+ } catch (IOException e1) {
+ throw new RuntimeException(e1);
+ }
+ final AttributedStyle s = new AttributedStyle().bold().foreground(AttributedStyle.RED);
+ new AttributedString("The build was canceled", s).println(terminal);
+ terminal.flush();
+ return false;
}
- final AttributedStyle s = new AttributedStyle().bold().foreground(AttributedStyle.RED);
- new AttributedString(msg, s).println(terminal);
- terminal.flush();
- return false;
- }
- case Message.PROJECT_STARTED: {
- StringMessage be = (StringMessage) entry;
- final String artifactId = be.getMessage();
- projects.put(artifactId, new Project(artifactId));
- break;
- }
- case Message.MOJO_STARTED: {
- final MojoStartedEvent execution = (MojoStartedEvent) entry;
- final Project prj = projects.computeIfAbsent(execution.getArtifactId(), Project::new);
- prj.runningExecution = execution;
- break;
- }
- case Message.PROJECT_STOPPED: {
- StringMessage be = (StringMessage) entry;
- final String artifactId = be.getMessage();
- Project prj = projects.remove(artifactId);
- if (prj != null) {
- prj.log.forEach(log);
- }
- doneProjects++;
- displayDone();
- break;
- }
- case Message.BUILD_STATUS: {
- this.buildStatus = ((StringMessage) entry).getMessage();
- break;
- }
- case Message.BUILD_FINISHED: {
- projects.values().stream().flatMap(p -> p.log.stream()).forEach(log);
- clearDisplay();
- try {
- log.close();
- } catch (IOException e) {
- throw new RuntimeException(e);
- } finally {
+ case Message.BUILD_EXCEPTION: {
+ final BuildException e = (BuildException) entry;
+ final String msg;
+ if ("org.apache.commons.cli.UnrecognizedOptionException".equals(e.getClassName())) {
+ msg = "Unable to parse command line options: " + e.getMessage();
+ } else {
+ msg = e.getClassName() + ": " + e.getMessage();
+ }
+ projects.values().stream().flatMap(p -> p.log.stream()).forEach(log);
+ clearDisplay();
+ try {
+ log.close();
+ } catch (IOException e1) {
+ throw new RuntimeException(e1);
+ }
+ final AttributedStyle s = new AttributedStyle().bold().foreground(AttributedStyle.RED);
+ new AttributedString(msg, s).println(terminal);
terminal.flush();
+ return false;
}
- return false;
- }
- case Message.KEEP_ALIVE: {
- break;
- }
- case Message.DISPLAY: {
- Message.StringMessage d = (Message.StringMessage) entry;
- clearDisplay();
- terminal.writer().printf("%s%n", d.getMessage());
- break;
- }
- case Message.PRINT_OUT: {
- Message.StringMessage d = (Message.StringMessage) entry;
- clearDisplay();
- System.out.printf("%s%n", d.getMessage());
- break;
- }
- case Message.PRINT_ERR: {
- Message.StringMessage d = (Message.StringMessage) entry;
- clearDisplay();
- System.err.printf("%s%n", d.getMessage());
- break;
- }
- case Message.PROMPT: {
- Message.Prompt prompt = (Message.Prompt) entry;
- if (dumb) {
- terminal.writer().println("");
+ case Message.PROJECT_STARTED: {
+ StringMessage be = (StringMessage) entry;
+ final String artifactId = be.getMessage();
+ projects.put(artifactId, new Project(artifactId));
break;
}
- readInput.writeLock().lock();
- try {
+ case Message.MOJO_STARTED: {
+ final MojoStartedEvent execution = (MojoStartedEvent) entry;
+ final Project prj = projects.computeIfAbsent(execution.getArtifactId(), Project::new);
+ prj.runningExecution = execution;
+ break;
+ }
+ case Message.PROJECT_STOPPED: {
+ StringMessage be = (StringMessage) entry;
+ final String artifactId = be.getMessage();
+ Project prj = projects.remove(artifactId);
+ if (prj != null) {
+ prj.log.forEach(log);
+ }
+ doneProjects++;
+ displayDone();
+ break;
+ }
+ case Message.BUILD_STATUS: {
+ this.buildStatus = ((StringMessage) entry).getMessage();
+ break;
+ }
+ case Message.BUILD_FINISHED: {
+ projects.values().stream().flatMap(p -> p.log.stream()).forEach(log);
clearDisplay();
- terminal.writer().printf("[%s] %s", prompt.getProjectId(), prompt.getMessage());
- terminal.flush();
- StringBuilder sb = new StringBuilder();
- while (true) {
- int c = terminal.reader().read();
- if (c < 0) {
- break;
- } else if (c == '\n' || c == '\r') {
- terminal.writer().println();
- daemonDispatch.accept(prompt.response(sb.toString()));
- break;
- } else if (c == 127) {
- if (sb.length() > 0) {
- sb.setLength(sb.length() - 1);
- terminal.writer().write("\b \b");
+ try {
+ log.close();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ } finally {
+ terminal.flush();
+ }
+ return false;
+ }
+ case Message.KEEP_ALIVE: {
+ break;
+ }
+ case Message.DISPLAY: {
+ Message.StringMessage d = (Message.StringMessage) entry;
+ clearDisplay();
+ terminal.writer().printf("%s%n", d.getMessage());
+ break;
+ }
+ case Message.PRINT_OUT: {
+ Message.StringMessage d = (Message.StringMessage) entry;
+ clearDisplay();
+ System.out.printf("%s%n", d.getMessage());
+ break;
+ }
+ case Message.PRINT_ERR: {
+ Message.StringMessage d = (Message.StringMessage) entry;
+ clearDisplay();
+ System.err.printf("%s%n", d.getMessage());
+ break;
+ }
+ case Message.PROMPT: {
+ Message.Prompt prompt = (Message.Prompt) entry;
+ if (dumb) {
+ terminal.writer().println("");
+ break;
+ }
+ readInput.writeLock().lock();
+ try {
+ clearDisplay();
+ terminal.writer().printf("[%s] %s", prompt.getProjectId(), prompt.getMessage());
+ terminal.flush();
+ StringBuilder sb = new StringBuilder();
+ while (true) {
+ int c = terminal.reader().read();
+ if (c < 0) {
+ break;
+ } else if (c == '\n' || c == '\r') {
+ terminal.writer().println();
+ daemonDispatch.accept(prompt.response(sb.toString()));
+ break;
+ } else if (c == 127) {
+ if (sb.length() > 0) {
+ sb.setLength(sb.length() - 1);
+ terminal.writer().write("\b \b");
+ terminal.writer().flush();
+ }
+ } else {
+ terminal.writer().print((char) c);
terminal.writer().flush();
+ sb.append((char) c);
}
- } else {
- terminal.writer().print((char) c);
- terminal.writer().flush();
- sb.append((char) c);
}
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ } finally {
+ readInput.writeLock().unlock();
}
- } catch (IOException e) {
- throw new RuntimeException(e);
- } finally {
- readInput.writeLock().unlock();
- }
- break;
- }
- case Message.BUILD_LOG_MESSAGE: {
- StringMessage sm = (StringMessage) entry;
- log.accept(sm.getMessage());
- break;
- }
- case Message.PROJECT_LOG_MESSAGE: {
- final ProjectEvent bm = (ProjectEvent) entry;
- final Project prj = projects.get(bm.getProjectId());
- if (prj == null) {
- log.accept(bm.getMessage());
- } else if (noBuffering || dumb) {
- String msg;
- if (maxThreads > 1) {
- msg = String.format("[%s] %s", bm.getProjectId(), bm.getMessage());
- } else {
- msg = bm.getMessage();
- }
- log.accept(msg);
- } else {
- prj.log.add(bm.getMessage());
- }
- break;
- }
- case Message.KEYBOARD_INPUT: {
- char keyStroke = ((StringMessage) entry).getMessage().charAt(0);
- switch (keyStroke) {
- case KEY_PLUS:
- linesPerProject = Math.min(10, linesPerProject + 1);
break;
- case KEY_MINUS:
- linesPerProject = Math.max(0, linesPerProject - 1);
+ }
+ case Message.BUILD_LOG_MESSAGE: {
+ StringMessage sm = (StringMessage) entry;
+ log.accept(sm.getMessage());
break;
- case KEY_CTRL_B:
- noBuffering = !noBuffering;
- if (noBuffering) {
- applyNoBuffering();
+ }
+ case Message.PROJECT_LOG_MESSAGE: {
+ final ProjectEvent bm = (ProjectEvent) entry;
+ final Project prj = projects.get(bm.getProjectId());
+ if (prj == null) {
+ log.accept(bm.getMessage());
+ } else if (noBuffering || dumb) {
+ String msg;
+ if (maxThreads > 1) {
+ msg = String.format("[%s] %s", bm.getProjectId(), bm.getMessage());
+ } else {
+ msg = bm.getMessage();
+ }
+ log.accept(msg);
} else {
- clearDisplay();
+ prj.log.add(bm.getMessage());
}
break;
- case KEY_CTRL_L:
- clearDisplay();
+ }
+ case Message.KEYBOARD_INPUT: {
+ char keyStroke = ((StringMessage) entry).getMessage().charAt(0);
+ switch (keyStroke) {
+ case KEY_PLUS:
+ linesPerProject = Math.min(10, linesPerProject + 1);
+ break;
+ case KEY_MINUS:
+ linesPerProject = Math.max(0, linesPerProject - 1);
+ break;
+ case KEY_CTRL_B:
+ noBuffering = !noBuffering;
+ if (noBuffering) {
+ applyNoBuffering();
+ } else {
+ clearDisplay();
+ }
+ break;
+ case KEY_CTRL_L:
+ clearDisplay();
+ break;
+ case KEY_CTRL_M:
+ displayDone = !displayDone;
+ displayDone();
+ break;
+ }
break;
- case KEY_CTRL_M:
- displayDone = !displayDone;
- displayDone();
+ }
+ case Message.TRANSFER_INITIATED:
+ case Message.TRANSFER_STARTED:
+ case Message.TRANSFER_PROGRESSED: {
+ final TransferEvent te = (TransferEvent) entry;
+ transfers
+ .computeIfAbsent(orEmpty(te.getProjectId()), p -> new LinkedHashMap<>())
+ .put(te.getResourceName(), te);
break;
}
- break;
- }
- case Message.TRANSFER_INITIATED:
- case Message.TRANSFER_STARTED:
- case Message.TRANSFER_PROGRESSED: {
- final TransferEvent te = (TransferEvent) entry;
- transfers.computeIfAbsent(orEmpty(te.getProjectId()), p -> new LinkedHashMap<>())
- .put(te.getResourceName(), te);
- break;
- }
- case Message.TRANSFER_CORRUPTED:
- case Message.TRANSFER_SUCCEEDED:
- case Message.TRANSFER_FAILED: {
- final TransferEvent te = (TransferEvent) entry;
- transfers.computeIfAbsent(orEmpty(te.getProjectId()), p -> new LinkedHashMap<>())
- .remove(te.getResourceName());
- break;
- }
- case Message.EXECUTION_FAILURE: {
- final ExecutionFailureEvent efe = (ExecutionFailureEvent) entry;
- failures.add(efe);
- break;
- }
- default:
- throw new IllegalStateException("Unexpected message " + entry);
+ case Message.TRANSFER_CORRUPTED:
+ case Message.TRANSFER_SUCCEEDED:
+ case Message.TRANSFER_FAILED: {
+ final TransferEvent te = (TransferEvent) entry;
+ transfers
+ .computeIfAbsent(orEmpty(te.getProjectId()), p -> new LinkedHashMap<>())
+ .remove(te.getResourceName());
+ break;
+ }
+ case Message.EXECUTION_FAILURE: {
+ final ExecutionFailureEvent efe = (ExecutionFailureEvent) entry;
+ failures.add(efe);
+ break;
+ }
+ default:
+ throw new IllegalStateException("Unexpected message " + entry);
}
return true;
@@ -455,7 +462,11 @@ public class TerminalOutput implements ClientOutput {
StringBuilder sb = new StringBuilder();
sb.append("Terminal: ").append(terminal != null ? terminal.getClass().getName() : null);
if (terminal instanceof AbstractPosixTerminal) {
- sb.append(" with pty ").append(((AbstractPosixTerminal) terminal).getPty().getClass().getName());
+ sb.append(" with pty ")
+ .append(((AbstractPosixTerminal) terminal)
+ .getPty()
+ .getClass()
+ .getName());
}
this.accept(Message.log(sb.toString()));
}
@@ -589,9 +600,8 @@ public class TerminalOutput implements ClientOutput {
}
}
}
- List<AttributedString> trimmed = lines.stream()
- .map(s -> s.columnSubSequence(0, cols))
- .collect(Collectors.toList());
+ List<AttributedString> trimmed =
+ lines.stream().map(s -> s.columnSubSequence(0, cols)).collect(Collectors.toList());
display.update(trimmed, -1);
}
@@ -612,14 +622,15 @@ public class TerminalOutput implements ClientOutput {
String exception = efe.getException();
if (exception != null) {
if (exception.startsWith("org.apache.maven.lifecycle.LifecycleExecutionException: ")) {
- exception = exception
- .substring("org.apache.maven.lifecycle.LifecycleExecutionException: ".length());
+ exception =
+ exception.substring("org.apache.maven.lifecycle.LifecycleExecutionException: ".length());
}
asb.append(": ").append(exception);
}
} else {
asb.append(String.valueOf(failures.size())).append(" projects failed: ");
- asb.append(failures.stream().map(ExecutionFailureEvent::getProjectId).collect(Collectors.joining(", ")));
+ asb.append(
+ failures.stream().map(ExecutionFailureEvent::getProjectId).collect(Collectors.joining(", ")));
}
AttributedString as = asb.toAttributedString();
if (as.columnLength() >= getTerminalWidth() - 1) {
@@ -633,7 +644,8 @@ public class TerminalOutput implements ClientOutput {
}
private AttributedString formatTransfers(String projectId) {
- Collection<TransferEvent> transfers = this.transfers.getOrDefault(projectId, Collections.emptyMap()).values();
+ Collection<TransferEvent> transfers =
+ this.transfers.getOrDefault(projectId, Collections.emptyMap()).values();
if (transfers.isEmpty()) {
return null;
}
@@ -675,7 +687,8 @@ public class TerminalOutput implements ClientOutput {
String artifactIdVersion = artifactId + "-" + version;
StringBuilder sb = new StringBuilder();
if (p[p.length - 1].charAt(artifactIdVersion.length()) == '-') {
- classifier = p[p.length - 1].substring(artifactIdVersion.length() + 1, p[p.length - 1].lastIndexOf('.'));
+ classifier =
+ p[p.length - 1].substring(artifactIdVersion.length() + 1, p[p.length - 1].lastIndexOf('.'));
} else {
classifier = null;
}
@@ -711,30 +724,27 @@ public class TerminalOutput implements ClientOutput {
asb.style(AttributedStyle.DEFAULT);
/* Daemon ID */
- asb
- .append(" daemon: ")
+ asb.append(" daemon: ")
.style(AttributedStyle.BOLD)
.append(daemonId)
.style(AttributedStyle.DEFAULT);
/* Threads */
- asb
- .append(" threads used/hidden/max: ")
+ asb.append(" threads used/hidden/max: ")
.style(AttributedStyle.BOLD)
- .append(
- String.format(
- threadsFormat,
- new StringBuilder(threadsFormat.length())
- .append(projectsCount)
- .append('/')
- .append(Math.max(0, projectsCount - dispLines))
- .append('/')
- .append(maxThreads).toString()))
+ .append(String.format(
+ threadsFormat,
+ new StringBuilder(threadsFormat.length())
+ .append(projectsCount)
+ .append('/')
+ .append(Math.max(0, projectsCount - dispLines))
+ .append('/')
+ .append(maxThreads)
+ .toString()))
.style(AttributedStyle.DEFAULT);
/* Progress */
- asb
- .append(" progress: ")
+ asb.append(" progress: ")
.style(AttributedStyle.BOLD)
.append(String.format(projectsDoneFomat, doneProjects))
.append('/')
@@ -745,16 +755,12 @@ public class TerminalOutput implements ClientOutput {
.style(AttributedStyle.DEFAULT);
} else if (buildStatus != null) {
- asb
- .style(AttributedStyle.BOLD)
- .append(buildStatus)
- .style(AttributedStyle.DEFAULT);
+ asb.style(AttributedStyle.BOLD).append(buildStatus).style(AttributedStyle.DEFAULT);
}
/* Time */
long sec = (System.currentTimeMillis() - this.start) / 1000;
- asb
- .append(" time: ")
+ asb.append(" time: ")
.style(AttributedStyle.BOLD)
.append(String.format("%02d:%02d", sec / 60, sec % 60))
.style(AttributedStyle.DEFAULT);
@@ -768,20 +774,15 @@ public class TerminalOutput implements ClientOutput {
final AttributedStringBuilder asb = new AttributedStringBuilder();
AttributedString transfer = formatTransfers(prj.id);
if (transfer != null) {
- asb
- .append(':')
+ asb.append(':')
.style(CYAN_FOREGROUND)
.append(String.format(artifactIdFormat, prj.id))
.style(AttributedStyle.DEFAULT)
.append(transfer);
} else if (execution == null) {
- asb
- .append(':')
- .style(CYAN_FOREGROUND)
- .append(prj.id);
+ asb.append(':').style(CYAN_FOREGROUND).append(prj.id);
} else {
- asb
- .append(':')
+ asb.append(':')
.style(CYAN_FOREGROUND)
.append(String.format(artifactIdFormat, prj.id))
.style(GREEN_FOREGROUND)
@@ -802,18 +803,21 @@ public class TerminalOutput implements ClientOutput {
}
private static <T> Collector<T, ?, List<T>> lastN(int n) {
- return Collector.<T, Deque<T>, List<T>> of(ArrayDeque::new, (acc, t) -> {
- if (n > 0) {
- if (acc.size() == n)
- acc.pollFirst();
- acc.add(t);
- }
- }, (acc1, acc2) -> {
- while (acc2.size() < n && !acc1.isEmpty()) {
- acc2.addFirst(acc1.pollLast());
- }
- return acc2;
- }, ArrayList::new);
+ return Collector.<T, Deque<T>, List<T>>of(
+ ArrayDeque::new,
+ (acc, t) -> {
+ if (n > 0) {
+ if (acc.size() == n) acc.pollFirst();
+ acc.add(t);
+ }
+ },
+ (acc1, acc2) -> {
+ while (acc2.size() < n && !acc1.isEmpty()) {
+ acc2.addFirst(acc1.pollLast());
+ }
+ return acc2;
+ },
+ ArrayList::new);
}
private static AttributedString concat(String s1, AttributedString s2) {
@@ -868,7 +872,6 @@ public class TerminalOutput implements ClientOutput {
public void close() throws IOException {
out.close();
}
-
}
/**
@@ -896,6 +899,5 @@ public class TerminalOutput implements ClientOutput {
public void close() {
flush();
}
-
}
}
diff --git a/common/src/test/java/org/mvndaemon/mvnd/common/DaemonRegistryTest.java b/common/src/test/java/org/mvndaemon/mvnd/common/DaemonRegistryTest.java
index 0af81621..4f50732a 100644
--- a/common/src/test/java/org/mvndaemon/mvnd/common/DaemonRegistryTest.java
+++ b/common/src/test/java/org/mvndaemon/mvnd/common/DaemonRegistryTest.java
@@ -1,20 +1,27 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
@@ -29,10 +36,6 @@ import java.util.Random;
import java.util.UUID;
import org.junit.jupiter.api.Test;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
public class DaemonRegistryTest {
@Test
@@ -47,10 +50,18 @@ public class DaemonRegistryTest {
byte[] token = new byte[16];
new Random().nextBytes(token);
- reg1.store(new DaemonInfo("12345678", "/java/home/",
- "/data/reg/", 0x12345678, "inet:/127.0.0.1:7502", token,
- Locale.getDefault().toLanguageTag(), Arrays.asList("-Xmx"),
- DaemonState.Idle, System.currentTimeMillis(), System.currentTimeMillis()));
+ reg1.store(new DaemonInfo(
+ "12345678",
+ "/java/home/",
+ "/data/reg/",
+ 0x12345678,
+ "inet:/127.0.0.1:7502",
+ token,
+ Locale.getDefault().toLanguageTag(),
+ Arrays.asList("-Xmx"),
+ DaemonState.Idle,
+ System.currentTimeMillis(),
+ System.currentTimeMillis()));
assertNotNull(reg1.getAll());
assertEquals(1, reg1.getAll().size());
@@ -69,10 +80,18 @@ public class DaemonRegistryTest {
for (int i = 0; i < nbDaemons; i++) {
byte[] token = new byte[16];
random.nextBytes(token);
- reg.store(new DaemonInfo(UUID.randomUUID().toString(), "/java/home/",
- "/data/reg/", random.nextInt(), "inet:/127.0.0.1:7502", token,
- Locale.getDefault().toLanguageTag(), Collections.singletonList("-Xmx"),
- DaemonState.Idle, System.currentTimeMillis(), System.currentTimeMillis()));
+ reg.store(new DaemonInfo(
+ UUID.randomUUID().toString(),
+ "/java/home/",
+ "/data/reg/",
+ random.nextInt(),
+ "inet:/127.0.0.1:7502",
+ token,
+ Locale.getDefault().toLanguageTag(),
+ Collections.singletonList("-Xmx"),
+ DaemonState.Idle,
+ System.currentTimeMillis(),
+ System.currentTimeMillis()));
}
}
@@ -94,7 +113,6 @@ public class DaemonRegistryTest {
try (DaemonRegistry reg = new DaemonRegistry(temp)) {
assertEquals(nbDaemons / 2, reg.getAll().size());
}
-
}
@Test
@@ -105,20 +123,26 @@ public class DaemonRegistryTest {
// first store daemon
byte[] token = new byte[16];
new Random().nextBytes(token);
- reg1.store(new DaemonInfo("12345678", "/java/home/",
- "/data/reg/", 0x12345678, "inet:/127.0.0.1:7502", token,
- Locale.getDefault().toLanguageTag(), Arrays.asList("-Xmx"),
- DaemonState.Idle, System.currentTimeMillis(), System.currentTimeMillis()));
+ reg1.store(new DaemonInfo(
+ "12345678",
+ "/java/home/",
+ "/data/reg/",
+ 0x12345678,
+ "inet:/127.0.0.1:7502",
+ token,
+ Locale.getDefault().toLanguageTag(),
+ Arrays.asList("-Xmx"),
+ DaemonState.Idle,
+ System.currentTimeMillis(),
+ System.currentTimeMillis()));
assertEquals(1, reg1.getAll().size());
// store an invalid event to trigger recovery
StringBuilder sb = new StringBuilder(1024);
for (int i = 0; i < 1024; i++) {
sb.append('…');
}
- reg1.storeStopEvent(new DaemonStopEvent("11111",
- System.currentTimeMillis(),
- DaemonExpirationStatus.QUIET_EXPIRE,
- sb.toString()));
+ reg1.storeStopEvent(new DaemonStopEvent(
+ "11111", System.currentTimeMillis(), DaemonExpirationStatus.QUIET_EXPIRE, sb.toString()));
assertEquals(1, reg1.doGetDaemonStopEvents().size());
// check if registry is reset
assertEquals(0, reg1.getAll().size());
@@ -143,5 +167,4 @@ public class DaemonRegistryTest {
}
}
}
-
}
diff --git a/common/src/test/java/org/mvndaemon/mvnd/common/MessageTest.java b/common/src/test/java/org/mvndaemon/mvnd/common/MessageTest.java
index 65f5e3ec..7d6fdb6b 100644
--- a/common/src/test/java/org/mvndaemon/mvnd/common/MessageTest.java
+++ b/common/src/test/java/org/mvndaemon/mvnd/common/MessageTest.java
@@ -1,20 +1,27 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
@@ -22,10 +29,6 @@ import java.io.DataOutputStream;
import java.io.IOException;
import org.junit.jupiter.api.Test;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
public class MessageTest {
@Test
diff --git a/common/src/test/java/org/mvndaemon/mvnd/common/OsUtilsTest.java b/common/src/test/java/org/mvndaemon/mvnd/common/OsUtilsTest.java
index 3d176aff..41cb71bd 100644
--- a/common/src/test/java/org/mvndaemon/mvnd/common/OsUtilsTest.java
+++ b/common/src/test/java/org/mvndaemon/mvnd/common/OsUtilsTest.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
@@ -28,5 +31,4 @@ public class OsUtilsTest {
Assertions.assertEquals("1g", OsUtils.kbTohumanReadable(1024 * 1024));
Assertions.assertEquals("1t", OsUtils.kbTohumanReadable(1024 * 1024 * 1024));
}
-
}
diff --git a/common/src/test/java/org/mvndaemon/mvnd/common/SocketFamilyTest.java b/common/src/test/java/org/mvndaemon/mvnd/common/SocketFamilyTest.java
index e8fc1fdf..e6f9fa28 100644
--- a/common/src/test/java/org/mvndaemon/mvnd/common/SocketFamilyTest.java
+++ b/common/src/test/java/org/mvndaemon/mvnd/common/SocketFamilyTest.java
@@ -1,20 +1,25 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
@@ -24,14 +29,12 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledForJreRange;
import org.junit.jupiter.api.condition.JRE;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
public class SocketFamilyTest {
@Test
void testInetNullHost() throws UnknownHostException {
- InetSocketAddress i4a = new InetSocketAddress(
- InetAddress.getByAddress(null, new byte[] { (byte) 192, (byte) 168, 0, 1 }), 8080);
+ InetSocketAddress i4a =
+ new InetSocketAddress(InetAddress.getByAddress(null, new byte[] {(byte) 192, (byte) 168, 0, 1}), 8080);
assertEquals("inet:/192.168.0.1:8080", SocketFamily.toString(i4a));
assertEquals(i4a, SocketFamily.fromString("inet:/192.168.0.1:8080"));
@@ -40,7 +43,7 @@ public class SocketFamilyTest {
@Test
void testInetDummyHost() throws UnknownHostException {
InetSocketAddress i4a = new InetSocketAddress(
- InetAddress.getByAddress("dummy.org", new byte[] { (byte) 192, (byte) 168, 0, 1 }), 8080);
+ InetAddress.getByAddress("dummy.org", new byte[] {(byte) 192, (byte) 168, 0, 1}), 8080);
assertEquals("inet:dummy.org/192.168.0.1:8080", SocketFamily.toString(i4a));
assertEquals(i4a, SocketFamily.fromString("inet:dummy.org/192.168.0.1:8080"));
@@ -70,5 +73,4 @@ public class SocketFamilyTest {
assertEquals(SocketFamily.unix, SocketFamily.familyOf(address));
assertEquals("unix:/tmp/foo-0123456.socket", SocketFamily.toString(address));
}
-
}
diff --git a/common/src/test/java/org/mvndaemon/mvnd/common/TimeUtilsTest.java b/common/src/test/java/org/mvndaemon/mvnd/common/TimeUtilsTest.java
index 26e3f83a..6c9a0831 100644
--- a/common/src/test/java/org/mvndaemon/mvnd/common/TimeUtilsTest.java
+++ b/common/src/test/java/org/mvndaemon/mvnd/common/TimeUtilsTest.java
@@ -1,25 +1,28 @@
/*
- * Copyright 2020 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.common;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
import java.time.Duration;
import org.junit.jupiter.api.Test;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
public class TimeUtilsTest {
@Test
@@ -33,8 +36,8 @@ public class TimeUtilsTest {
assertEquals("5m10s300ms", TimeUtils.printDuration(310300));
assertEquals("5s500ms", TimeUtils.printDuration(5500));
assertEquals("1h50m", TimeUtils.printDuration(6600000));
- assertEquals("2d3h4m", TimeUtils.printDuration(Duration.parse("P2DT3H4M").toMillis()));
+ assertEquals(
+ "2d3h4m", TimeUtils.printDuration(Duration.parse("P2DT3H4M").toMillis()));
assertEquals("2d4m", TimeUtils.printDuration(Duration.parse("P2DT4M").toMillis()));
}
-
}
diff --git a/daemon/pom.xml b/daemon/pom.xml
index 2d6f6e0c..b41136d2 100644
--- a/daemon/pom.xml
+++ b/daemon/pom.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2019 the original author or authors.
@@ -15,113 +16,110 @@
limitations under the License.
-->
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.maven.daemon</groupId>
- <artifactId>mvnd</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.maven.daemon</groupId>
+ <artifactId>mvnd</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ </parent>
- <artifactId>mvnd-daemon</artifactId>
+ <artifactId>mvnd-daemon</artifactId>
- <packaging>jar</packaging>
- <name>Maven Daemon</name>
+ <packaging>jar</packaging>
+ <name>Maven Daemon</name>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven.daemon</groupId>
- <artifactId>mvnd-common</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.daemon</groupId>
- <artifactId>mvnd-native</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-embedder</artifactId>
- </dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-interactivity-api</artifactId>
- <version>1.0</version>
- <exclusions>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.daemon</groupId>
+ <artifactId>mvnd-common</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.daemon</groupId>
+ <artifactId>mvnd-native</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-embedder</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-interactivity-api</artifactId>
+ <version>1.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
- <!-- Logging -->
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>log4j-over-slf4j</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jul-to-slf4j</artifactId>
- </dependency>
+ <!-- Logging -->
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jul-to-slf4j</artifactId>
+ </dependency>
- <dependency>
- <groupId>org.jline</groupId>
- <artifactId>jline-terminal</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.jline</groupId>
+ <artifactId>jline-terminal</artifactId>
+ </dependency>
- <dependency>
- <groupId>org.eclipse.sisu</groupId>
- <artifactId>org.eclipse.sisu.inject</artifactId>
- <version>${sisu.version}</version>
- <scope>compile</scope>
- </dependency>
+ <dependency>
+ <groupId>org.eclipse.sisu</groupId>
+ <artifactId>org.eclipse.sisu.inject</artifactId>
+ <version>${sisu.version}</version>
+ <scope>compile</scope>
+ </dependency>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
- <build>
- <resources>
- <resource>
- <directory>${basedir}/src/main/resources</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <redirectTestOutputToFile>true</redirectTestOutputToFile>
- <forkCount>1</forkCount>
- <reuseForks>true</reuseForks>
- <argLine>
- --add-opens java.base/java.io=ALL-UNNAMED
+ <build>
+ <resources>
+ <resource>
+ <filtering>true</filtering>
+ <directory>${basedir}/src/main/resources</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <forkCount>1</forkCount>
+ <reuseForks>true</reuseForks>
+ <argLine>--add-opens java.base/java.io=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
- --add-opens java.base/sun.nio.fs=ALL-UNNAMED
- </argLine>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ --add-opens java.base/sun.nio.fs=ALL-UNNAMED</argLine>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
-</project>
\ No newline at end of file
+</project>
diff --git a/daemon/src/main/java/org/apache/maven/classrealm/MvndClassRealmManager.java b/daemon/src/main/java/org/apache/maven/classrealm/MvndClassRealmManager.java
index cddc0077..90e03d18 100644
--- a/daemon/src/main/java/org/apache/maven/classrealm/MvndClassRealmManager.java
+++ b/daemon/src/main/java/org/apache/maven/classrealm/MvndClassRealmManager.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.maven.classrealm;
@@ -55,8 +58,7 @@ import org.eclipse.sisu.Priority;
@Named
@Singleton
@Priority(10)
-public class MvndClassRealmManager
- implements ClassRealmManager {
+public class MvndClassRealmManager implements ClassRealmManager {
public static final String API_REALMID = "maven.api";
/**
@@ -87,8 +89,11 @@ public class MvndClassRealmManager
private final Set<String> providedArtifacts;
@Inject
- public MvndClassRealmManager(Logger logger, PlexusContainer container,
- List<ClassRealmManagerDelegate> delegates, CoreExportsProvider exports) {
+ public MvndClassRealmManager(
+ Logger logger,
+ PlexusContainer container,
+ List<ClassRealmManagerDelegate> delegates,
+ CoreExportsProvider exports) {
this.logger = logger;
this.world = ((MutablePlexusContainer) container).getClassWorld();
this.containerRealm = container.getContainerRealm();
@@ -96,9 +101,13 @@ public class MvndClassRealmManager
Map<String, ClassLoader> foreignImports = exports.get().getExportedPackages();
- this.mavenApiRealm = createRealm(API_REALMID, ClassRealmRequest.RealmType.Core, null /* parent */,
+ this.mavenApiRealm = createRealm(
+ API_REALMID,
+ ClassRealmRequest.RealmType.Core,
+ null /* parent */,
null /* parentImports */,
- foreignImports, null /* artifacts */ );
+ foreignImports,
+ null /* artifacts */);
this.providedArtifacts = exports.get().getExportedArtifacts();
}
@@ -141,9 +150,13 @@ public class MvndClassRealmManager
* missing file) will automatically be excluded from the realm.
* @return The created class realm, never {@code null}.
*/
- private ClassRealm createRealm(String baseRealmId, ClassRealmRequest.RealmType type, ClassLoader parent,
+ private ClassRealm createRealm(
+ String baseRealmId,
+ ClassRealmRequest.RealmType type,
+ ClassLoader parent,
List<String> parentImports,
- Map<String, ClassLoader> foreignImports, List<Artifact> artifacts) {
+ Map<String, ClassLoader> foreignImports,
+ List<Artifact> artifacts) {
Set<String> artifactIds = new LinkedHashSet<>();
List<ClassRealmConstituent> constituents = new ArrayList<>();
@@ -215,25 +228,34 @@ public class MvndClassRealmManager
ClassLoader parent = PARENT_CLASSLOADER;
- Map<String, ClassLoader> foreignImports = Collections.<String, ClassLoader> singletonMap("", getMavenApiRealm());
+ Map<String, ClassLoader> foreignImports = Collections.<String, ClassLoader>singletonMap("", getMavenApiRealm());
- return createRealm(getKey(plugin, true), ClassRealmRequest.RealmType.Extension, parent, null, foreignImports,
- artifacts);
+ return createRealm(
+ getKey(plugin, true), ClassRealmRequest.RealmType.Extension, parent, null, foreignImports, artifacts);
}
private boolean isProvidedArtifact(Artifact artifact) {
return providedArtifacts.contains(artifact.getGroupId() + ":" + artifact.getArtifactId());
}
- public ClassRealm createPluginRealm(Plugin plugin, ClassLoader parent, List<String> parentImports,
- Map<String, ClassLoader> foreignImports, List<Artifact> artifacts) {
+ public ClassRealm createPluginRealm(
+ Plugin plugin,
+ ClassLoader parent,
+ List<String> parentImports,
+ Map<String, ClassLoader> foreignImports,
+ List<Artifact> artifacts) {
Objects.requireNonNull(plugin, "plugin cannot be null");
if (parent == null) {
parent = PARENT_CLASSLOADER;
}
- return createRealm(getKey(plugin, false), ClassRealmRequest.RealmType.Plugin, parent, parentImports, foreignImports,
+ return createRealm(
+ getKey(plugin, false),
+ ClassRealmRequest.RealmType.Plugin,
+ parent,
+ parentImports,
+ foreignImports,
artifacts);
}
@@ -244,33 +266,48 @@ public class MvndClassRealmManager
}
private static String getId(Artifact artifact) {
- return getId(artifact.getGroupId(), artifact.getArtifactId(), artifact.getExtension(),
- artifact.getClassifier(), artifact.getBaseVersion());
+ return getId(
+ artifact.getGroupId(),
+ artifact.getArtifactId(),
+ artifact.getExtension(),
+ artifact.getClassifier(),
+ artifact.getBaseVersion());
}
private static String getId(ClassRealmConstituent constituent) {
- return getId(constituent.getGroupId(), constituent.getArtifactId(), constituent.getType(),
- constituent.getClassifier(), constituent.getVersion());
+ return getId(
+ constituent.getGroupId(),
+ constituent.getArtifactId(),
+ constituent.getType(),
+ constituent.getClassifier(),
+ constituent.getVersion());
}
private static String getId(String gid, String aid, String type, String cls, String ver) {
return gid + ':' + aid + ':' + type + (StringUtils.isNotEmpty(cls) ? ':' + cls : "") + ':' + ver;
}
- private void callDelegates(ClassRealm classRealm, ClassRealmRequest.RealmType type, ClassLoader parent,
+ private void callDelegates(
+ ClassRealm classRealm,
+ ClassRealmRequest.RealmType type,
+ ClassLoader parent,
List<String> parentImports,
- Map<String, ClassLoader> foreignImports, List<ClassRealmConstituent> constituents) {
+ Map<String, ClassLoader> foreignImports,
+ List<ClassRealmConstituent> constituents) {
List<ClassRealmManagerDelegate> delegates = new ArrayList<>(this.delegates);
if (!delegates.isEmpty()) {
- ClassRealmRequest request = new DefaultClassRealmRequest(type, parent, parentImports, foreignImports, constituents);
+ ClassRealmRequest request =
+ new DefaultClassRealmRequest(type, parent, parentImports, foreignImports, constituents);
for (ClassRealmManagerDelegate delegate : delegates) {
try {
delegate.setupRealm(classRealm, request);
} catch (Exception e) {
- logger.error(delegate.getClass().getName() + " failed to setup class realm " + classRealm + ": "
- + e.getMessage(), e);
+ logger.error(
+ delegate.getClass().getName() + " failed to setup class realm " + classRealm + ": "
+ + e.getMessage(),
+ e);
}
}
}
@@ -343,5 +380,4 @@ public class MvndClassRealmManager
}
return String.valueOf(classLoader);
}
-
}
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 5d23c9a4..2dbf3f2d 100644
--- a/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java
+++ b/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java
@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
@@ -18,6 +18,9 @@
*/
package org.apache.maven.cli;
+import static java.util.Comparator.comparing;
+import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
+
import com.google.inject.AbstractModule;
import java.io.File;
import java.io.FileNotFoundException;
@@ -117,9 +120,6 @@ import org.slf4j.LoggerFactory;
import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher;
import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;
-import static java.util.Comparator.comparing;
-import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
-
/**
* File origin:
* https://github.com/apache/maven/blob/maven-3.6.2/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
@@ -137,7 +137,8 @@ public class DaemonMavenCli {
public static final File DEFAULT_USER_TOOLCHAINS_FILE = new File(USER_MAVEN_CONFIGURATION_HOME, "toolchains.xml");
- public static final File DEFAULT_GLOBAL_TOOLCHAINS_FILE = new File(System.getProperty("maven.conf"), "toolchains.xml");
+ public static final File DEFAULT_GLOBAL_TOOLCHAINS_FILE =
+ new File(System.getProperty("maven.conf"), "toolchains.xml");
private static final String EXT_CLASS_PATH = "maven.ext.class.path";
@@ -198,14 +199,15 @@ public class DaemonMavenCli {
toolchainsBuilder = container.lookup(ToolchainsBuilder.class);
dispatcher = (DefaultSecDispatcher) container.lookup(SecDispatcher.class, "maven");
executionListener = container.lookup(LoggingExecutionListener.class);
-
}
- public int main(List<String> arguments,
+ public int main(
+ List<String> arguments,
String workingDirectory,
String projectDirectory,
Map<String, String> clientEnv,
- BuildEventListener buildEventListener) throws Exception {
+ BuildEventListener buildEventListener)
+ throws Exception {
this.buildEventListener = buildEventListener;
try {
CliRequest req = new CliRequest(null, null);
@@ -246,8 +248,7 @@ public class DaemonMavenCli {
}
}
- void initialize(CliRequest cliRequest)
- throws ExitException {
+ void initialize(CliRequest cliRequest) throws ExitException {
cliRequest.classWorld = classWorld;
if (cliRequest.workingDirectory == null) {
@@ -255,15 +256,13 @@ public class DaemonMavenCli {
}
if (cliRequest.multiModuleProjectDirectory == null) {
- buildEventListener.log(String.format(
- "-D%s system property is not set.", MULTIMODULE_PROJECT_DIRECTORY));
+ buildEventListener.log(String.format("-D%s system property is not set.", MULTIMODULE_PROJECT_DIRECTORY));
throw new ExitException(1);
}
System.setProperty("maven.multiModuleProjectDirectory", cliRequest.multiModuleProjectDirectory.toString());
}
- void cli(CliRequest cliRequest)
- throws Exception {
+ void cli(CliRequest cliRequest) throws Exception {
CLIManager cliManager = newCLIManager();
List<String> args = new ArrayList<>();
@@ -312,10 +311,15 @@ public class DaemonMavenCli {
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").build());
+ 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")
+ .build());
return cliManager;
}
@@ -383,8 +387,8 @@ public class DaemonMavenCli {
}
// Workaround for https://github.com/apache/maven-mvnd/issues/39
- final ch.qos.logback.classic.Logger mvndLogger = (ch.qos.logback.classic.Logger) slf4jLoggerFactory
- .getLogger("org.mvndaemon.mvnd");
+ final ch.qos.logback.classic.Logger mvndLogger =
+ (ch.qos.logback.classic.Logger) slf4jLoggerFactory.getLogger("org.mvndaemon.mvnd");
mvndLogger.setLevel(ch.qos.logback.classic.Level.toLevel(System.getProperty("mvnd.log.level"), null));
// LOG STREAMS
@@ -403,8 +407,10 @@ public class DaemonMavenCli {
//
}
} else if (!cliRequest.commandLine.hasOption(RAW_STREAMS)) {
- ch.qos.logback.classic.Logger stdout = (ch.qos.logback.classic.Logger) slf4jLoggerFactory.getLogger("stdout");
- ch.qos.logback.classic.Logger stderr = (ch.qos.logback.classic.Logger) slf4jLoggerFactory.getLogger("stderr");
+ ch.qos.logback.classic.Logger stdout =
+ (ch.qos.logback.classic.Logger) slf4jLoggerFactory.getLogger("stdout");
+ ch.qos.logback.classic.Logger stderr =
+ (ch.qos.logback.classic.Logger) slf4jLoggerFactory.getLogger("stderr");
stdout.setLevel(ch.qos.logback.classic.Level.INFO);
stderr.setLevel(ch.qos.logback.classic.Level.INFO);
System.setOut(new LoggingOutputStream(s -> stdout.info("[stdout] " + s)).printStream());
@@ -452,8 +458,8 @@ public class DaemonMavenCli {
}
}
- //Needed to make this method package visible to make writing a unit test possible
- //Maybe it's better to move some of those methods to separate class (SoC).
+ // Needed to make this method package visible to make writing a unit test possible
+ // Maybe it's better to move some of those methods to separate class (SoC).
void properties(CliRequest cliRequest) {
populateProperties(cliRequest.commandLine, cliRequest.systemProperties, cliRequest.userProperties);
}
@@ -468,22 +474,21 @@ public class DaemonMavenCli {
eventSpyDispatcher.init(() -> data);
}
- DefaultPlexusContainer container()
- throws Exception {
+ DefaultPlexusContainer container() throws Exception {
ClassRealm coreRealm = classWorld.getClassRealm("plexus.core");
if (coreRealm == null) {
coreRealm = classWorld.getRealms().iterator().next();
}
- List<File> extClassPath = Stream
- .of(Environment.MVND_EXT_CLASSPATH.asString().split(","))
+ List<File> extClassPath = Stream.of(
+ Environment.MVND_EXT_CLASSPATH.asString().split(","))
.map(File::new)
.collect(Collectors.toList());
CoreExtensionEntry coreEntry = CoreExtensionEntry.discoverFrom(coreRealm);
- List<CoreExtension> extensions = Stream
- .of(Environment.MVND_CORE_EXTENSIONS.asString().split(";"))
+ List<CoreExtension> extensions = Stream.of(
+ Environment.MVND_CORE_EXTENSIONS.asString().split(";"))
.filter(s -> s != null && !s.isEmpty())
.map(s -> {
String[] parts = s.split(":");
@@ -494,13 +499,17 @@ public class DaemonMavenCli {
return ce;
})
.collect(Collectors.toList());
- List<CoreExtensionEntry> extensionsEntries = loadCoreExtensions(extensions, coreRealm,
- coreEntry.getExportedArtifacts());
+ List<CoreExtensionEntry> extensionsEntries =
+ loadCoreExtensions(extensions, coreRealm, coreEntry.getExportedArtifacts());
ClassRealm containerRealm = setupContainerRealm(classWorld, coreRealm, extClassPath, extensionsEntries);
- ContainerConfiguration cc = new DefaultContainerConfiguration().setClassWorld(classWorld)
- .setRealm(containerRealm).setClassPathScanning(PlexusConstants.SCANNING_INDEX).setAutoWiring(true)
- .setJSR250Lifecycle(true).setName("maven");
+ ContainerConfiguration cc = new DefaultContainerConfiguration()
+ .setClassWorld(classWorld)
+ .setRealm(containerRealm)
+ .setClassPathScanning(PlexusConstants.SCANNING_INDEX)
+ .setAutoWiring(true)
+ .setJSR250Lifecycle(true)
+ .setName("maven");
Set<String> exportedArtifacts = new HashSet<>(coreEntry.getExportedArtifacts());
Set<String> exportedPackages = new HashSet<>(coreEntry.getExportedPackages());
@@ -535,14 +544,16 @@ public class DaemonMavenCli {
container.setLoggerManager(plexusLoggerManager);
for (CoreExtensionEntry extension : extensionsEntries) {
- container.discoverComponents(extension.getClassRealm(), new SessionScopeModule(container),
+ container.discoverComponents(
+ extension.getClassRealm(),
+ new SessionScopeModule(container),
new MojoExecutionScopeModule(container));
}
return container;
}
- private List<CoreExtensionEntry> loadCoreExtensions(List<CoreExtension> extensions, ClassRealm containerRealm,
- Set<String> providedArtifacts) {
+ private List<CoreExtensionEntry> loadCoreExtensions(
+ List<CoreExtension> extensions, ClassRealm containerRealm, Set<String> providedArtifacts) {
try {
if (extensions.isEmpty()) {
return Collections.emptyList();
@@ -570,19 +581,25 @@ public class DaemonMavenCli {
container.getLoggerManager().setThresholds(cliRequest.request.getLoggingLevel());
Thread.currentThread().setContextClassLoader(container.getContainerRealm());
executionRequestPopulator = container.lookup(MavenExecutionRequestPopulator.class);
- final Map<String, ConfigurationProcessor> configurationProcessors = container
- .lookupMap(ConfigurationProcessor.class);
+ final Map<String, ConfigurationProcessor> configurationProcessors =
+ container.lookupMap(ConfigurationProcessor.class);
final EventSpyDispatcher eventSpyDispatcher = container.lookup(EventSpyDispatcher.class);
properties(cliRequest);
configure(cliRequest, eventSpyDispatcher, configurationProcessors);
LoggingExecutionListener executionListener = container.lookup(LoggingExecutionListener.class);
- populateRequest(cliRequest, cliRequest.request, slf4jLogger, eventSpyDispatcher,
- container.lookup(ModelProcessor.class), createTransferListener(cliRequest), buildEventListener,
+ populateRequest(
+ cliRequest,
+ cliRequest.request,
+ slf4jLogger,
+ eventSpyDispatcher,
+ container.lookup(ModelProcessor.class),
+ createTransferListener(cliRequest),
+ buildEventListener,
executionListener);
executionRequestPopulator.populateDefaults(cliRequest.request);
BootstrapCoreExtensionManager resolver = container.lookup(BootstrapCoreExtensionManager.class);
- return Collections
- .unmodifiableList(resolver.loadCoreExtensions(cliRequest.request, providedArtifacts, extensions));
+ return Collections.unmodifiableList(
+ resolver.loadCoreExtensions(cliRequest.request, providedArtifacts, extensions));
} finally {
executionRequestPopulator = null;
container.dispose();
@@ -596,8 +613,9 @@ public class DaemonMavenCli {
return Collections.emptyList();
}
- private ClassRealm setupContainerRealm(ClassWorld classWorld, ClassRealm coreRealm, List<File> extClassPath,
- List<CoreExtensionEntry> extensions) throws Exception {
+ private ClassRealm setupContainerRealm(
+ ClassWorld classWorld, ClassRealm coreRealm, List<File> extClassPath, List<CoreExtensionEntry> extensions)
+ throws Exception {
if (!extClassPath.isEmpty() || !extensions.isEmpty()) {
ClassRealm extRealm = classWorld.newRealm("maven.ext", null);
extRealm.setParentRealm(coreRealm);
@@ -652,8 +670,7 @@ public class DaemonMavenCli {
//
// This should probably be a separate tool and not be baked into Maven.
//
- private void encryption(CliRequest cliRequest)
- throws Exception {
+ private void encryption(CliRequest cliRequest) throws Exception {
if (cliRequest.commandLine.hasOption(CLIManager.ENCRYPT_MASTER_PASSWORD)) {
throw new UnsupportedOperationException("Unsupported option: " + CLIManager.ENCRYPT_MASTER_PASSWORD);
} else if (cliRequest.commandLine.hasOption(CLIManager.ENCRYPT_PASSWORD)) {
@@ -661,10 +678,9 @@ public class DaemonMavenCli {
}
}
- private void repository(CliRequest cliRequest)
- throws Exception {
- if (cliRequest.commandLine.hasOption(CLIManager.LEGACY_LOCAL_REPOSITORY) || Boolean.getBoolean(
- "maven.legacyLocalRepo")) {
+ private void repository(CliRequest cliRequest) throws Exception {
+ if (cliRequest.commandLine.hasOption(CLIManager.LEGACY_LOCAL_REPOSITORY)
+ || Boolean.getBoolean("maven.legacyLocalRepo")) {
cliRequest.request.setUseLegacyLocalRepository(true);
}
}
@@ -673,8 +689,7 @@ public class DaemonMavenCli {
EnvHelper.environment(workingDir, clientEnv);
}
- private int execute(CliRequest cliRequest)
- throws MavenExecutionRequestPopulationException {
+ private int execute(CliRequest cliRequest) throws MavenExecutionRequestPopulationException {
commands(cliRequest);
MavenExecutionRequest request = executionRequestPopulator.populateDefaults(cliRequest.request);
@@ -682,7 +697,8 @@ public class DaemonMavenCli {
eventSpyDispatcher.onEvent(request);
slf4jLogger.info(buffer().a("Processing build on daemon ")
- .strong(Environment.MVND_ID.asString()).toString());
+ .strong(Environment.MVND_ID.asString())
+ .toString());
MavenExecutionResult result = maven.execute(request);
@@ -711,12 +727,13 @@ public class DaemonMavenCli {
slf4jLogger.error("");
if (!cliRequest.showErrors) {
- slf4jLogger.error("To see the full stack trace of the errors, re-run Maven with the {} switch.",
+ slf4jLogger.error(
+ "To see the full stack trace of the errors, re-run Maven with the {} switch.",
buffer().strong("-e"));
}
if (!slf4jLogger.isDebugEnabled()) {
- slf4jLogger.error("Re-run Maven using the {} switch to enable full debug logging.",
- buffer().strong("-X"));
+ slf4jLogger.error(
+ "Re-run Maven using the {} switch to enable full debug logging.", buffer().strong("-X"));
}
if (!references.isEmpty()) {
@@ -729,16 +746,20 @@ public class DaemonMavenCli {
}
}
- boolean canResume = new DefaultBuildResumptionAnalyzer().determineBuildResumptionData(result).map(resumption -> {
- try {
- Path directory = Paths.get(request.getBaseDirectory()).resolve("target");
- new DefaultBuildResumptionDataRepository().persistResumptionData(directory, resumption);
- return true;
- } catch (BuildResumptionPersistenceException e) {
- slf4jLogger.warn("Could not persist build resumption data", e);
- }
- return false;
- }).orElse(false);
+ boolean canResume = new DefaultBuildResumptionAnalyzer()
+ .determineBuildResumptionData(result)
+ .map(resumption -> {
+ try {
+ Path directory =
+ Paths.get(request.getBaseDirectory()).resolve("target");
+ new DefaultBuildResumptionDataRepository().persistResumptionData(directory, resumption);
+ return true;
+ } catch (BuildResumptionPersistenceException e) {
+ slf4jLogger.warn("Could not persist build resumption data", e);
+ }
+ return false;
+ })
+ .orElse(false);
if (canResume) {
logBuildResumeHint("mvn <args> -r");
@@ -794,16 +815,16 @@ public class DaemonMavenCli {
*/
private String getResumeFromSelector(List<MavenProject> mavenProjects, MavenProject failedProject) {
for (MavenProject buildProject : mavenProjects) {
- if (failedProject.getArtifactId().equals(buildProject.getArtifactId()) && !failedProject.equals(
- buildProject)) {
+ if (failedProject.getArtifactId().equals(buildProject.getArtifactId())
+ && !failedProject.equals(buildProject)) {
return failedProject.getGroupId() + ":" + failedProject.getArtifactId();
}
}
return ":" + failedProject.getArtifactId();
}
- private void logSummary(ExceptionSummary summary, Map<String, String> references, String indent,
- boolean showErrors) {
+ private void logSummary(
+ ExceptionSummary summary, Map<String, String> references, String indent, boolean showErrors) {
String referenceKey = "";
if (StringUtils.isNotEmpty(summary.getReference())) {
@@ -845,8 +866,7 @@ public class DaemonMavenCli {
// effective line, with indent and reset if end is colored
line = indent + line + ("".equals(nextColor) ? "" : ANSI_RESET);
- if ((i == lines.length - 1) && (showErrors
- || (summary.getException() instanceof InternalErrorException))) {
+ if ((i == lines.length - 1) && (showErrors || (summary.getException() instanceof InternalErrorException))) {
slf4jLogger.error(line, summary.getException());
} else {
slf4jLogger.error(line);
@@ -909,14 +929,15 @@ public class DaemonMavenCli {
//
// There are too many ConfigurationProcessors so we don't know which one to run so report the error.
//
- StringBuilder sb = new StringBuilder(
- String.format("\nThere can only be one user supplied ConfigurationProcessor, there are %s:\n\n",
- userSuppliedConfigurationProcessorCount));
+ StringBuilder sb = new StringBuilder(String.format(
+ "\nThere can only be one user supplied ConfigurationProcessor, there are %s:\n\n",
+ userSuppliedConfigurationProcessorCount));
for (Entry<String, ConfigurationProcessor> entry : configurationProcessors.entrySet()) {
String hint = entry.getKey();
if (!hint.equals(SettingsXmlConfigurationProcessor.HINT)) {
ConfigurationProcessor configurationProcessor = entry.getValue();
- sb.append(String.format("%s\n", configurationProcessor.getClass().getName()));
+ sb.append(String.format(
+ "%s\n", configurationProcessor.getClass().getName()));
}
}
sb.append("\n");
@@ -924,8 +945,7 @@ public class DaemonMavenCli {
}
}
- void toolchains(CliRequest cliRequest)
- throws Exception {
+ void toolchains(CliRequest cliRequest) throws Exception {
File userToolchainsFile;
if (cliRequest.commandLine.hasOption(CLIManager.ALTERNATE_USER_TOOLCHAINS)) {
@@ -943,7 +963,8 @@ public class DaemonMavenCli {
File globalToolchainsFile;
if (cliRequest.commandLine.hasOption(CLIManager.ALTERNATE_GLOBAL_TOOLCHAINS)) {
- globalToolchainsFile = new File(cliRequest.commandLine.getOptionValue(CLIManager.ALTERNATE_GLOBAL_TOOLCHAINS));
+ globalToolchainsFile =
+ new File(cliRequest.commandLine.getOptionValue(CLIManager.ALTERNATE_GLOBAL_TOOLCHAINS));
globalToolchainsFile = resolveFile(globalToolchainsFile, cliRequest.workingDirectory);
if (!globalToolchainsFile.isFile()) {
@@ -967,17 +988,18 @@ public class DaemonMavenCli {
eventSpyDispatcher.onEvent(toolchainsRequest);
- slf4jLogger.debug("Reading global toolchains from {}",
+ slf4jLogger.debug(
+ "Reading global toolchains from {}",
getLocation(toolchainsRequest.getGlobalToolchainsSource(), globalToolchainsFile));
- slf4jLogger.debug("Reading user toolchains from {}",
+ slf4jLogger.debug(
+ "Reading user toolchains from {}",
getLocation(toolchainsRequest.getUserToolchainsSource(), userToolchainsFile));
ToolchainsBuildingResult toolchainsResult = toolchainsBuilder.build(toolchainsRequest);
eventSpyDispatcher.onEvent(toolchainsResult);
- executionRequestPopulator.populateFromToolchains(cliRequest.request,
- toolchainsResult.getEffectiveToolchains());
+ executionRequestPopulator.populateFromToolchains(cliRequest.request, toolchainsResult.getEffectiveToolchains());
if (!toolchainsResult.getProblems().isEmpty() && slf4jLogger.isWarnEnabled()) {
slf4jLogger.warn("");
@@ -999,8 +1021,15 @@ public class DaemonMavenCli {
}
private void populateRequest(CliRequest cliRequest) {
- populateRequest(cliRequest, cliRequest.request, slf4jLogger, eventSpyDispatcher, modelProcessor,
- createTransferListener(cliRequest), buildEventListener, executionListener);
+ populateRequest(
+ cliRequest,
+ cliRequest.request,
+ slf4jLogger,
+ eventSpyDispatcher,
+ modelProcessor,
+ createTransferListener(cliRequest),
+ buildEventListener,
+ executionListener);
}
private static void populateRequest(
@@ -1016,10 +1045,11 @@ public class DaemonMavenCli {
String workingDirectory = cliRequest.workingDirectory;
boolean showErrors = cliRequest.showErrors;
- String[] deprecatedOptions = { "up", "npu", "cpu", "npr" };
+ String[] deprecatedOptions = {"up", "npu", "cpu", "npr"};
for (String deprecatedOption : deprecatedOptions) {
if (commandLine.hasOption(deprecatedOption)) {
- slf4jLogger.warn("Command line option -{} is deprecated and will be removed in future Maven versions.",
+ slf4jLogger.warn(
+ "Command line option -{} is deprecated and will be removed in future Maven versions.",
deprecatedOption);
}
}
@@ -1111,9 +1141,7 @@ public class DaemonMavenCli {
}
ExecutionEventLogger executionEventLogger = new ExecutionEventLogger();
- executionListener.init(
- eventSpyDispatcher.chainListener(executionEventLogger),
- buildEventListener);
+ executionListener.init(eventSpyDispatcher.chainListener(executionEventLogger), buildEventListener);
String alternatePomFile = null;
if (commandLine.hasOption(CLIManager.ALTERNATE_POM_FILE)) {
@@ -1157,7 +1185,8 @@ public class DaemonMavenCli {
if (commandLine.hasOption(RESUME)) {
new DefaultBuildResumptionDataRepository()
- .applyResumptionData(request, Paths.get(request.getBaseDirectory()).resolve("target"));
+ .applyResumptionData(
+ request, Paths.get(request.getBaseDirectory()).resolve("target"));
}
if (commandLine.hasOption(CLIManager.RESUME_FROM)) {
@@ -1192,14 +1221,13 @@ public class DaemonMavenCli {
request.setExcludedProjects(exclProjects);
}
- if (commandLine.hasOption(CLIManager.ALSO_MAKE) && !commandLine.hasOption(
- CLIManager.ALSO_MAKE_DEPENDENTS)) {
+ if (commandLine.hasOption(CLIManager.ALSO_MAKE) && !commandLine.hasOption(CLIManager.ALSO_MAKE_DEPENDENTS)) {
request.setMakeBehavior(MavenExecutionRequest.REACTOR_MAKE_UPSTREAM);
- } else if (!commandLine.hasOption(CLIManager.ALSO_MAKE) && commandLine.hasOption(
- CLIManager.ALSO_MAKE_DEPENDENTS)) {
+ } else if (!commandLine.hasOption(CLIManager.ALSO_MAKE)
+ && commandLine.hasOption(CLIManager.ALSO_MAKE_DEPENDENTS)) {
request.setMakeBehavior(MavenExecutionRequest.REACTOR_MAKE_DOWNSTREAM);
- } else if (commandLine.hasOption(CLIManager.ALSO_MAKE) && commandLine.hasOption(
- CLIManager.ALSO_MAKE_DEPENDENTS)) {
+ } else if (commandLine.hasOption(CLIManager.ALSO_MAKE)
+ && commandLine.hasOption(CLIManager.ALSO_MAKE_DEPENDENTS)) {
request.setMakeBehavior(MavenExecutionRequest.REACTOR_MAKE_BOTH);
}
@@ -1224,9 +1252,8 @@ public class DaemonMavenCli {
// parameters but this is sufficient for now. Ultimately we want components like Builders to provide a way to
// extend the command line to accept its own configuration parameters.
//
- final String threadConfiguration = commandLine.hasOption(CLIManager.THREADS)
- ? commandLine.getOptionValue(CLIManager.THREADS)
- : null;
+ final String threadConfiguration =
+ commandLine.hasOption(CLIManager.THREADS) ? commandLine.getOptionValue(CLIManager.THREADS) : null;
if (threadConfiguration != null) {
//
@@ -1310,7 +1337,8 @@ public class DaemonMavenCli {
if (props != null) {
boolean caseSensitive = Os.current() == Os.WINDOWS;
for (Map.Entry<String, String> entry : System.getenv().entrySet()) {
- String key = "env." + (caseSensitive ? entry.getKey() : entry.getKey().toUpperCase(Locale.ENGLISH));
+ String key = "env."
+ + (caseSensitive ? entry.getKey() : entry.getKey().toUpperCase(Locale.ENGLISH));
props.setProperty(key, entry.getValue());
}
}
@@ -1343,8 +1371,7 @@ public class DaemonMavenCli {
System.setProperty(name, value);
}
- static class ExitException
- extends Exception {
+ static class ExitException extends Exception {
static final long serialVersionUID = 1L;
int exitCode;
@@ -1379,8 +1406,7 @@ public class DaemonMavenCli {
return new Slf4jMavenTransferListener();
}
- protected ModelProcessor createModelProcessor(PlexusContainer container)
- throws ComponentLookupException {
+ protected ModelProcessor createModelProcessor(PlexusContainer container) throws ComponentLookupException {
return container.lookup(ModelProcessor.class);
}
}
diff --git a/daemon/src/main/java/org/apache/maven/cli/MvndHelpFormatter.java b/daemon/src/main/java/org/apache/maven/cli/MvndHelpFormatter.java
index 62594d4e..68ce2ef2 100644
--- a/daemon/src/main/java/org/apache/maven/cli/MvndHelpFormatter.java
+++ b/daemon/src/main/java/org/apache/maven/cli/MvndHelpFormatter.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.maven.cli;
@@ -54,8 +57,16 @@ public class MvndHelpFormatter {
out.println();
PrintWriter pw = new PrintWriter(out);
HelpFormatter formatter = new HelpFormatter();
- formatter.printHelp(pw, terminalWidth, "mvnd [options] [<goal(s)>] [<phase(s)>]", "\nOptions:", cliManager.options,
- 1, 3, "\n", false);
+ formatter.printHelp(
+ pw,
+ terminalWidth,
+ "mvnd [options] [<goal(s)>] [<phase(s)>]",
+ "\nOptions:",
+ cliManager.options,
+ 1,
+ 3,
+ "\n",
+ false);
pw.flush();
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
@@ -65,78 +76,66 @@ public class MvndHelpFormatter {
final String indent = m.find() ? m.group() : " ";
final String lineSeparator = System.lineSeparator();
- final StringBuilder help = new StringBuilder(mvnHelp)
- .append(lineSeparator)
- .append("mvnd specific options:");
-
- Environment.documentedEntries()
- .forEach(entry -> {
- final Environment env = entry.getEntry();
- help.append(lineSeparator);
- int indentPos = help.length() + indent.length();
- int lineEnd = help.length() + terminalWidth;
- spaces(help, HelpFormatter.DEFAULT_LEFT_PAD);
- final String property = env.getProperty();
- if (property != null) {
- help
- .append("-D")
- .append(property);
- if (env.getType() != OptionType.VOID) {
- help
- .append("=<")
- .append(env.getType().name().toLowerCase(Locale.ROOT))
- .append('>');
-
- }
- }
+ final StringBuilder help =
+ new StringBuilder(mvnHelp).append(lineSeparator).append("mvnd specific options:");
+
+ Environment.documentedEntries().forEach(entry -> {
+ final Environment env = entry.getEntry();
+ help.append(lineSeparator);
+ int indentPos = help.length() + indent.length();
+ int lineEnd = help.length() + terminalWidth;
+ spaces(help, HelpFormatter.DEFAULT_LEFT_PAD);
+ final String property = env.getProperty();
+ if (property != null) {
+ help.append("-D").append(property);
+ if (env.getType() != OptionType.VOID) {
+ help.append("=<")
+ .append(env.getType().name().toLowerCase(Locale.ROOT))
+ .append('>');
+ }
+ }
- final Set<String> opts = env.getOptions();
- if (!opts.isEmpty()) {
- if (property != null) {
- help.append(';');
- }
- boolean first = true;
- for (String opt : opts) {
- if (first) {
- first = false;
- } else {
- help.append(',');
- }
- help.append(opt);
- }
- if (env.getType() != OptionType.VOID) {
- help
- .append(" <")
- .append(env.getType().name().toLowerCase(Locale.ROOT))
- .append('>');
- }
+ final Set<String> opts = env.getOptions();
+ if (!opts.isEmpty()) {
+ if (property != null) {
+ help.append(';');
+ }
+ boolean first = true;
+ for (String opt : opts) {
+ if (first) {
+ first = false;
+ } else {
+ help.append(',');
}
- help.append(' ');
-
- spaces(help, indentPos - help.length());
- wrap(help, toPlainText(entry.getJavaDoc()), terminalWidth, lineEnd, indent);
+ help.append(opt);
+ }
+ if (env.getType() != OptionType.VOID) {
+ help.append(" <")
+ .append(env.getType().name().toLowerCase(Locale.ROOT))
+ .append('>');
+ }
+ }
+ help.append(' ');
- indentedLine(help, terminalWidth, "Default", env.getDefault(), indent);
- indentedLine(help, terminalWidth, "Env. variable", env.getEnvironmentVariable(), indent);
+ spaces(help, indentPos - help.length());
+ wrap(help, toPlainText(entry.getJavaDoc()), terminalWidth, lineEnd, indent);
- });
+ indentedLine(help, terminalWidth, "Default", env.getDefault(), indent);
+ indentedLine(help, terminalWidth, "Env. variable", env.getEnvironmentVariable(), indent);
+ });
- help
- .append(lineSeparator)
- .append(lineSeparator)
- .append("mvnd value types:");
+ help.append(lineSeparator).append(lineSeparator).append("mvnd value types:");
- OptionType.documentedEntries()
- .forEach(entry -> {
- final OptionType type = entry.getEntry();
- help.append(lineSeparator);
- int indentPos = help.length() + indent.length();
- int lineEnd = help.length() + terminalWidth;
- spaces(help, HelpFormatter.DEFAULT_LEFT_PAD);
- help.append(type.name().toLowerCase(Locale.ROOT));
- spaces(help, indentPos - help.length());
- wrap(help, toPlainText(entry.getJavaDoc()), terminalWidth, lineEnd, indent);
- });
+ OptionType.documentedEntries().forEach(entry -> {
+ final OptionType type = entry.getEntry();
+ help.append(lineSeparator);
+ int indentPos = help.length() + indent.length();
+ int lineEnd = help.length() + terminalWidth;
+ spaces(help, HelpFormatter.DEFAULT_LEFT_PAD);
+ help.append(type.name().toLowerCase(Locale.ROOT));
+ spaces(help, indentPos - help.length());
+ wrap(help, toPlainText(entry.getJavaDoc()), terminalWidth, lineEnd, indent);
+ });
return help.toString();
}
@@ -151,13 +150,12 @@ public class MvndHelpFormatter {
return terminalWidth;
}
- private static void indentedLine(StringBuilder stringBuilder, int terminalWidth, String key, String value, String indent) {
+ private static void indentedLine(
+ StringBuilder stringBuilder, int terminalWidth, String key, String value, String indent) {
int lineEnd;
if (value != null) {
lineEnd = stringBuilder.length() + terminalWidth;
- stringBuilder
- .append(System.lineSeparator())
- .append(indent);
+ stringBuilder.append(System.lineSeparator()).append(indent);
wrap(stringBuilder, key + ": " + value, terminalWidth, lineEnd, indent);
}
}
@@ -187,10 +185,7 @@ public class MvndHelpFormatter {
} else {
nextLineEnd = stringBuilder.length() + lineLength;
- stringBuilder
- .append(System.lineSeparator())
- .append(indent)
- .append(token);
+ stringBuilder.append(System.lineSeparator()).append(indent).append(token);
}
lastWs = null;
}
@@ -210,5 +205,4 @@ public class MvndHelpFormatter {
}
return stringBuilder;
}
-
}
diff --git a/daemon/src/main/java/org/apache/maven/project/CachingProjectBuilder.java b/daemon/src/main/java/org/apache/maven/project/CachingProjectBuilder.java
index 9a919db4..bf3725d6 100644
--- a/daemon/src/main/java/org/apache/maven/project/CachingProjectBuilder.java
+++ b/daemon/src/main/java/org/apache/maven/project/CachingProjectBuilder.java
@@ -7,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
@@ -88,8 +88,7 @@ import org.eclipse.sisu.Typed;
@Singleton
@Typed(ProjectBuilder.class)
@Priority(10)
-public class CachingProjectBuilder
- implements ProjectBuilder {
+public class CachingProjectBuilder implements ProjectBuilder {
@Inject
private Logger logger;
@@ -117,25 +116,24 @@ public class CachingProjectBuilder
private final ModelCache modelCache = new ReactorModelCache();
- public CachingProjectBuilder() {
- }
+ public CachingProjectBuilder() {}
// ----------------------------------------------------------------------
// MavenProjectBuilder Implementation
// ----------------------------------------------------------------------
@Override
- public ProjectBuildingResult build(File pomFile, ProjectBuildingRequest request)
- throws ProjectBuildingException {
- return build(pomFile, new FileModelSource(pomFile),
+ public ProjectBuildingResult build(File pomFile, ProjectBuildingRequest request) throws ProjectBuildingException {
+ return build(
+ pomFile,
+ new FileModelSource(pomFile),
new InternalConfig(request, null, new SnapshotModelCache(getModelCache())));
}
@Override
public ProjectBuildingResult build(ModelSource modelSource, ProjectBuildingRequest request)
throws ProjectBuildingException {
- return build(null, modelSource,
- new InternalConfig(request, null, new SnapshotModelCache(getModelCache())));
+ return build(null, modelSource, new InternalConfig(request, null, new SnapshotModelCache(getModelCache())));
}
private ProjectBuildingResult build(File pomFile, ModelSource modelSource, InternalConfig config)
@@ -156,8 +154,8 @@ public class CachingProjectBuilder
project = new MavenProject();
project.setFile(pomFile);
- DefaultModelBuildingListener listener = new DefaultModelBuildingListener(project, projectBuildingHelper,
- projectBuildingRequest);
+ DefaultModelBuildingListener listener =
+ new DefaultModelBuildingListener(project, projectBuildingHelper, projectBuildingRequest);
request.setModelBuildingListener(listener);
request.setPomFile(pomFile);
@@ -170,8 +168,8 @@ public class CachingProjectBuilder
} catch (ModelBuildingException e) {
result = e.getResult();
if (result == null || result.getEffectiveModel() == null) {
- throw (ProjectBuildingException) new ProjectBuildingException(e.getModelId(), e.getMessage(), pomFile)
- .initCause(e);
+ throw (ProjectBuildingException)
+ new ProjectBuildingException(e.getModelId(), e.getMessage(), pomFile).initCause(e);
}
// validation error, continue project building and delay failing to help IDEs
error = e;
@@ -179,8 +177,13 @@ public class CachingProjectBuilder
modelProblems = result.getProblems();
- initProject(project, Collections.<String, MavenProject> emptyMap(), true,
- result, new HashMap<File, Boolean>(), projectBuildingRequest);
+ initProject(
+ project,
+ Collections.<String, MavenProject>emptyMap(),
+ true,
+ result,
+ new HashMap<File, Boolean>(),
+ projectBuildingRequest);
} else if (projectBuildingRequest.isResolveDependencies()) {
projectBuildingHelper.selectProjectRealm(project);
}
@@ -217,8 +220,11 @@ public class CachingProjectBuilder
Set<Artifact> artifacts = new LinkedHashSet<>();
if (resolutionResult.getDependencyGraph() != null) {
- RepositoryUtils.toArtifacts(artifacts, resolutionResult.getDependencyGraph().getChildren(),
- Collections.singletonList(project.getArtifact().getId()), null);
+ RepositoryUtils.toArtifacts(
+ artifacts,
+ resolutionResult.getDependencyGraph().getChildren(),
+ Collections.singletonList(project.getArtifact().getId()),
+ null);
// Maven 2.x quirk: an artifact always points at the local repo, regardless whether resolved or not
LocalRepositoryManager lrm = session.getLocalRepositoryManager();
@@ -251,9 +257,14 @@ public class CachingProjectBuilder
RequestTrace trace = RequestTrace.newChild(null, configuration).newChild(request);
- ModelResolver resolver = new ProjectModelResolver(config.session, trace, repoSystem, repositoryManager,
+ ModelResolver resolver = new ProjectModelResolver(
+ config.session,
+ trace,
+ repoSystem,
+ repositoryManager,
config.repositories,
- configuration.getRepositoryMerging(), config.modelPool);
+ configuration.getRepositoryMerging(),
+ config.modelPool);
request.setValidationLevel(configuration.getValidationLevel());
request.setProcessPlugins(configuration.isProcessPlugins());
@@ -297,8 +308,8 @@ public class CachingProjectBuilder
if (e.getResults().get(0).isMissing() && allowStubModel) {
return build(null, createStubModelSource(artifact), config);
}
- throw new ProjectBuildingException(artifact.getId(),
- "Error resolving project artifact: " + e.getMessage(), e);
+ throw new ProjectBuildingException(
+ artifact.getId(), "Error resolving project artifact: " + e.getMessage(), e);
}
File pomFile = pomArtifact.getFile();
@@ -340,16 +351,23 @@ public class CachingProjectBuilder
Map<String, MavenProject> projectIndex = new HashMap<>(256);
- boolean noErrors = build(results, interimResults, projectIndex, pomFiles, new LinkedHashSet<File>(), true, recursive,
- config);
+ boolean noErrors = build(
+ results, interimResults, projectIndex, pomFiles, new LinkedHashSet<File>(), true, recursive, config);
populateReactorModelPool(modelPool, interimResults);
ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader();
try {
- noErrors = build(results, new ArrayList<MavenProject>(), projectIndex, interimResults, request,
- new HashMap<File, Boolean>(), config.session) && noErrors;
+ noErrors = build(
+ results,
+ new ArrayList<MavenProject>(),
+ projectIndex,
+ interimResults,
+ request,
+ new HashMap<File, Boolean>(),
+ config.session)
+ && noErrors;
} finally {
Thread.currentThread().setContextClassLoader(oldContextClassLoader);
}
@@ -362,9 +380,15 @@ public class CachingProjectBuilder
}
@SuppressWarnings("checkstyle:parameternumber")
- private boolean build(List<ProjectBuildingResult> results, List<InterimResult> interimResults,
- Map<String, MavenProject> projectIndex, List<File> pomFiles, Set<File> aggregatorFiles,
- boolean isRoot, boolean recursive, InternalConfig config) {
+ private boolean build(
+ List<ProjectBuildingResult> results,
+ List<InterimResult> interimResults,
+ Map<String, MavenProject> projectIndex,
+ List<File> pomFiles,
+ Set<File> aggregatorFiles,
+ boolean isRoot,
+ boolean recursive,
+ InternalConfig config) {
boolean noErrors = true;
for (File pomFile : pomFiles) {
@@ -381,9 +405,15 @@ public class CachingProjectBuilder
}
@SuppressWarnings("checkstyle:parameternumber")
- private boolean build(List<ProjectBuildingResult> results, List<InterimResult> interimResults,
- Map<String, MavenProject> projectIndex, File pomFile, Set<File> aggregatorFiles,
- boolean isRoot, boolean recursive, InternalConfig config) {
+ private boolean build(
+ List<ProjectBuildingResult> results,
+ List<InterimResult> interimResults,
+ Map<String, MavenProject> projectIndex,
+ File pomFile,
+ Set<File> aggregatorFiles,
+ boolean isRoot,
+ boolean recursive,
+ InternalConfig config) {
boolean noErrors = true;
ModelBuildingRequest request = getModelBuildingRequest(config);
@@ -395,8 +425,8 @@ public class CachingProjectBuilder
request.setTwoPhaseBuilding(true);
request.setLocationTracking(true);
- DefaultModelBuildingListener listener = new DefaultModelBuildingListener(project, projectBuildingHelper,
- config.request);
+ DefaultModelBuildingListener listener =
+ new DefaultModelBuildingListener(project, projectBuildingHelper, config.request);
request.setModelBuildingListener(listener);
ModelBuildingResult result;
@@ -419,8 +449,8 @@ public class CachingProjectBuilder
// first pass: build without building parent.
initProject(project, projectIndex, false, result, new HashMap<File, Boolean>(0), config.request);
} catch (InvalidArtifactRTException iarte) {
- result.getProblems().add(new DefaultModelProblem(null, ModelProblem.Severity.ERROR, null, model, -1, -1,
- iarte));
+ result.getProblems()
+ .add(new DefaultModelProblem(null, ModelProblem.Severity.ERROR, null, model, -1, -1, iarte));
}
projectIndex.put(result.getModelIds().get(0), project);
@@ -447,9 +477,14 @@ public class CachingProjectBuilder
}
if (!moduleFile.isFile()) {
- ModelProblem problem = new DefaultModelProblem("Child module " + moduleFile + " of " + pomFile
- + " does not exist", ModelProblem.Severity.ERROR, ModelProblem.Version.BASE, model, -1,
- -1, null);
+ ModelProblem problem = new DefaultModelProblem(
+ "Child module " + moduleFile + " of " + pomFile + " does not exist",
+ ModelProblem.Severity.ERROR,
+ ModelProblem.Version.BASE,
+ model,
+ -1,
+ -1,
+ null);
result.getProblems().add(problem);
noErrors = false;
@@ -475,9 +510,14 @@ public class CachingProjectBuilder
}
buffer.append(moduleFile);
- ModelProblem problem = new DefaultModelProblem("Child module " + moduleFile + " of " + pomFile
- + " forms aggregation cycle " + buffer, ModelProblem.Severity.ERROR,
- ModelProblem.Version.BASE, model, -1, -1, null);
+ ModelProblem problem = new DefaultModelProblem(
+ "Child module " + moduleFile + " of " + pomFile + " forms aggregation cycle " + buffer,
+ ModelProblem.Severity.ERROR,
+ ModelProblem.Version.BASE,
+ model,
+ -1,
+ -1,
+ null);
result.getProblems().add(problem);
noErrors = false;
@@ -490,8 +530,15 @@ public class CachingProjectBuilder
interimResult.modules = new ArrayList<>();
- if (!build(results, interimResult.modules, projectIndex, moduleFiles, aggregatorFiles, false,
- recursive, config)) {
+ if (!build(
+ results,
+ interimResult.modules,
+ projectIndex,
+ moduleFiles,
+ aggregatorFiles,
+ false,
+ recursive,
+ config)) {
noErrors = false;
}
}
@@ -513,15 +560,18 @@ public class CachingProjectBuilder
List<InterimResult> modules = Collections.emptyList();
- InterimResult(File pomFile, ModelBuildingRequest request, ModelBuildingResult result,
- DefaultModelBuildingListener listener, boolean root) {
+ InterimResult(
+ File pomFile,
+ ModelBuildingRequest request,
+ ModelBuildingResult result,
+ DefaultModelBuildingListener listener,
+ boolean root) {
this.pomFile = pomFile;
this.request = request;
this.result = result;
this.listener = listener;
this.root = root;
}
-
}
private void populateReactorModelPool(ReactorModelPool reactorModelPool, List<InterimResult> interimResults) {
@@ -533,9 +583,13 @@ public class CachingProjectBuilder
}
}
- private boolean build(List<ProjectBuildingResult> results, List<MavenProject> projects,
- Map<String, MavenProject> projectIndex, List<InterimResult> interimResults,
- ProjectBuildingRequest request, Map<File, Boolean> profilesXmls,
+ private boolean build(
+ List<ProjectBuildingResult> results,
+ List<MavenProject> projects,
+ Map<String, MavenProject> projectIndex,
+ List<InterimResult> interimResults,
+ ProjectBuildingRequest request,
+ Map<File, Boolean> profilesXmls,
RepositorySystemSession session) {
boolean noErrors = true;
@@ -548,8 +602,15 @@ public class CachingProjectBuilder
try {
initProject(project, projectIndex, true, result, profilesXmls, request);
} catch (InvalidArtifactRTException iarte) {
- result.getProblems().add(new DefaultModelProblem(null, ModelProblem.Severity.ERROR, null,
- result.getEffectiveModel(), -1, -1, iarte));
+ result.getProblems()
+ .add(new DefaultModelProblem(
+ null,
+ ModelProblem.Severity.ERROR,
+ null,
+ result.getEffectiveModel(),
+ -1,
+ -1,
+ iarte));
}
List<MavenProject> modules = new ArrayList<>();
@@ -584,9 +645,13 @@ public class CachingProjectBuilder
}
@SuppressWarnings("checkstyle:methodlength")
- private void initProject(MavenProject project, Map<String, MavenProject> projects,
- boolean buildParentIfNotExisting, ModelBuildingResult result,
- Map<File, Boolean> profilesXmls, ProjectBuildingRequest projectBuildingRequest) {
+ private void initProject(
+ MavenProject project,
+ Map<String, MavenProject> projects,
+ boolean buildParentIfNotExisting,
+ ModelBuildingResult result,
+ Map<File, Boolean> profilesXmls,
+ ProjectBuildingRequest projectBuildingRequest) {
Model model = result.getEffectiveModel();
project.setModel(model);
@@ -595,9 +660,8 @@ public class CachingProjectBuilder
initParent(project, projects, buildParentIfNotExisting, result, projectBuildingRequest);
- Artifact projectArtifact = repositorySystem.createArtifact(project.getGroupId(), project.getArtifactId(),
- project.getVersion(), null,
- project.getPackaging());
+ Artifact projectArtifact = repositorySystem.createArtifact(
+ project.getGroupId(), project.getArtifactId(), project.getVersion(), null, project.getPackaging());
project.setArtifact(projectArtifact);
if (project.getFile() != null && buildParentIfNotExisting) // only set those on 2nd phase, ignore on 1st pass
@@ -620,9 +684,15 @@ public class CachingProjectBuilder
String modelId = findProfilesXml(result, profilesXmls);
if (modelId != null) {
- ModelProblem problem = new DefaultModelProblem("Detected profiles.xml alongside " + modelId
- + ", this file is no longer supported and was ignored" + ", please use the settings.xml instead",
- ModelProblem.Severity.WARNING, ModelProblem.Version.V30, model, -1, -1, null);
+ ModelProblem problem = new DefaultModelProblem(
+ "Detected profiles.xml alongside " + modelId + ", this file is no longer supported and was ignored"
+ + ", please use the settings.xml instead",
+ ModelProblem.Severity.WARNING,
+ ModelProblem.Version.V30,
+ model,
+ -1,
+ -1,
+ null);
result.getProblems().add(problem);
}
@@ -671,8 +741,8 @@ public class CachingProjectBuilder
version = ext.getVersion();
}
- Artifact artifact = repositorySystem.createArtifact(ext.getGroupId(), ext.getArtifactId(), version, null,
- "jar");
+ Artifact artifact =
+ repositorySystem.createArtifact(ext.getGroupId(), ext.getArtifactId(), version, null, "jar");
if (artifact != null) {
extensionArtifacts.add(artifact);
@@ -685,7 +755,8 @@ public class CachingProjectBuilder
Map<String, Artifact> map = null;
if (repositorySystem != null) {
final DependencyManagement dependencyManagement = project.getDependencyManagement();
- if ((dependencyManagement != null) && ((dependencyManagement.getDependencies()) != null)
+ if ((dependencyManagement != null)
+ && ((dependencyManagement.getDependencies()) != null)
&& (dependencyManagement.getDependencies().size() > 0)) {
map = new AbstractMap<String, Artifact>() {
HashMap<String, Artifact> delegate;
@@ -748,15 +819,14 @@ public class CachingProjectBuilder
DeploymentRepository r = project.getDistributionManagement().getRepository();
if (!StringUtils.isEmpty(r.getId()) && !StringUtils.isEmpty(r.getUrl())) {
ArtifactRepository repo = repositorySystem.buildArtifactRepository(r);
- repositorySystem.injectProxy(projectBuildingRequest.getRepositorySession(),
- Arrays.asList(repo));
- repositorySystem.injectAuthentication(projectBuildingRequest.getRepositorySession(),
- Arrays.asList(repo));
+ repositorySystem.injectProxy(projectBuildingRequest.getRepositorySession(), Arrays.asList(repo));
+ repositorySystem.injectAuthentication(
+ projectBuildingRequest.getRepositorySession(), Arrays.asList(repo));
project.setReleaseArtifactRepository(repo);
}
} catch (InvalidRepositoryException e) {
- throw new IllegalStateException("Failed to create release distribution repository for "
- + project.getId(), e);
+ throw new IllegalStateException(
+ "Failed to create release distribution repository for " + project.getId(), e);
}
}
@@ -767,32 +837,35 @@ public class CachingProjectBuilder
DeploymentRepository r = project.getDistributionManagement().getSnapshotRepository();
if (!StringUtils.isEmpty(r.getId()) && !StringUtils.isEmpty(r.getUrl())) {
ArtifactRepository repo = repositorySystem.buildArtifactRepository(r);
- repositorySystem.injectProxy(projectBuildingRequest.getRepositorySession(),
- Arrays.asList(repo));
- repositorySystem.injectAuthentication(projectBuildingRequest.getRepositorySession(),
- Arrays.asList(repo));
+ repositorySystem.injectProxy(projectBuildingRequest.getRepositorySession(), Arrays.asList(repo));
+ repositorySystem.injectAuthentication(
+ projectBuildingRequest.getRepositorySession(), Arrays.asList(repo));
project.setSnapshotArtifactRepository(repo);
}
} catch (InvalidRepositoryException e) {
- throw new IllegalStateException("Failed to create snapshot distribution repository for "
- + project.getId(), e);
+ throw new IllegalStateException(
+ "Failed to create snapshot distribution repository for " + project.getId(), e);
}
}
}
- private void initParent(MavenProject project, Map<String, MavenProject> projects, boolean buildParentIfNotExisting,
- ModelBuildingResult result, ProjectBuildingRequest projectBuildingRequest) {
- Model parentModel = result.getModelIds().size() > 1 && !result.getModelIds().get(1).isEmpty()
- ? result.getRawModel(result.getModelIds().get(1))
- : null;
+ private void initParent(
+ MavenProject project,
+ Map<String, MavenProject> projects,
+ boolean buildParentIfNotExisting,
+ ModelBuildingResult result,
+ ProjectBuildingRequest projectBuildingRequest) {
+ Model parentModel =
+ result.getModelIds().size() > 1 && !result.getModelIds().get(1).isEmpty()
+ ? result.getRawModel(result.getModelIds().get(1))
+ : null;
if (parentModel != null) {
final String parentGroupId = inheritedGroupId(result, 1);
final String parentVersion = inheritedVersion(result, 1);
- project.setParentArtifact(repositorySystem.createProjectArtifact(parentGroupId,
- parentModel.getArtifactId(),
- parentVersion));
+ project.setParentArtifact(
+ repositorySystem.createProjectArtifact(parentGroupId, parentModel.getArtifactId(), parentVersion));
// org.apache.maven.its.mng4834:parent:0.1
String parentModelId = result.getModelIds().get(1);
@@ -848,10 +921,7 @@ public class CachingProjectBuilder
if (!modelId.isEmpty()) {
final Model model = result.getRawModel(modelId);
- groupId = model.getGroupId() != null
- ? model.getGroupId()
- : inheritedGroupId(result, modelIndex + 1);
-
+ groupId = model.getGroupId() != null ? model.getGroupId() : inheritedGroupId(result, modelIndex + 1);
}
return groupId;
@@ -863,10 +933,7 @@ public class CachingProjectBuilder
if (!modelId.isEmpty()) {
final Model model = result.getRawModel(modelId);
- version = model.getVersion() != null
- ? model.getVersion()
- : inheritedVersion(result, modelIndex + 1);
-
+ version = model.getVersion() != null ? model.getVersion() : inheritedVersion(result, modelIndex + 1);
}
return version;
@@ -913,15 +980,13 @@ public class CachingProjectBuilder
this.request = request;
this.modelPool = modelPool;
this.modelCache = modelCache;
- session = LegacyLocalRepositoryManager.overlay(request.getLocalRepository(), request.getRepositorySession(),
- repoSystem);
+ session = LegacyLocalRepositoryManager.overlay(
+ request.getLocalRepository(), request.getRepositorySession(), repoSystem);
repositories = RepositoryUtils.toRepos(request.getRemoteRepositories());
}
-
}
private ModelCache getModelCache() {
return this.modelCache;
}
-
}
diff --git a/daemon/src/main/java/org/apache/maven/project/SnapshotModelCache.java b/daemon/src/main/java/org/apache/maven/project/SnapshotModelCache.java
index b4aee747..1809097d 100644
--- a/daemon/src/main/java/org/apache/maven/project/SnapshotModelCache.java
+++ b/daemon/src/main/java/org/apache/maven/project/SnapshotModelCache.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.apache.maven.project;
@@ -38,7 +41,6 @@ public class SnapshotModelCache implements ModelCache {
}
private ModelCache getDelegate(String version) {
- return version.contains("SNAPSHOT") || version.contains("${")
- ? reactorCache : globalCache;
+ return version.contains("SNAPSHOT") || version.contains("${") ? reactorCache : globalCache;
}
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/DependencyGraph.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/DependencyGraph.java
index 19baf211..a8d7ad2f 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/DependencyGraph.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/DependencyGraph.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2017 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.builder;
@@ -54,10 +57,10 @@ public class DependencyGraph<K> {
static DependencyGraph<MavenProject> fromMaven(ProjectDependencyGraph graph) {
final List<MavenProject> projects = graph.getSortedProjects();
- Map<MavenProject, List<MavenProject>> upstreams = projects.stream()
- .collect(Collectors.toMap(p -> p, p -> graph.getUpstreamProjects(p, false)));
- Map<MavenProject, List<MavenProject>> downstreams = projects.stream()
- .collect(Collectors.toMap(p -> p, p -> graph.getDownstreamProjects(p, false)));
+ Map<MavenProject, List<MavenProject>> upstreams =
+ projects.stream().collect(Collectors.toMap(p -> p, p -> graph.getUpstreamProjects(p, false)));
+ Map<MavenProject, List<MavenProject>> downstreams =
+ projects.stream().collect(Collectors.toMap(p -> p, p -> graph.getDownstreamProjects(p, false)));
return new DependencyGraph<>(Collections.unmodifiableList(projects), upstreams, downstreams);
}
@@ -70,7 +73,10 @@ public class DependencyGraph<K> {
projects.forEach(this::transitiveUpstreams); // topological ordering of projects matters
}
- DependencyGraph(List<K> projects, Map<K, List<K>> upstreams, Map<K, List<K>> downstreams,
+ DependencyGraph(
+ List<K> projects,
+ Map<K, List<K>> upstreams,
+ Map<K, List<K>> downstreams,
Map<K, Set<K>> transitiveUpstreams) {
this.projects = projects;
this.upstreams = upstreams;
@@ -138,29 +144,20 @@ public class DependencyGraph<K> {
@Override
public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
+ if (this == obj) return true;
+ if (obj == null) return false;
+ if (getClass() != obj.getClass()) return false;
@SuppressWarnings("unchecked")
DependencyGraph<K> other = (DependencyGraph<K>) obj;
if (downstreams == null) {
- if (other.downstreams != null)
- return false;
- } else if (!downstreams.equals(other.downstreams))
- return false;
+ if (other.downstreams != null) return false;
+ } else if (!downstreams.equals(other.downstreams)) return false;
if (projects == null) {
- if (other.projects != null)
- return false;
- } else if (!projects.equals(other.projects))
- return false;
+ if (other.projects != null) return false;
+ } else if (!projects.equals(other.projects)) return false;
if (upstreams == null) {
- if (other.upstreams != null)
- return false;
- } else if (!upstreams.equals(other.upstreams))
- return false;
+ if (other.upstreams != null) return false;
+ } else if (!upstreams.equals(other.upstreams)) return false;
return true;
}
@@ -207,16 +204,21 @@ public class DependencyGraph<K> {
newNodeUpstreams = new ArrayList<>(oldNodeUpstreams);
} else if (oldNodeUpstreams.size() == 1) {
newNodeUpstreams = new ArrayList<>(oldNodeUpstreams);
- newDownstreams.computeIfAbsent(newNodeUpstreams.get(0), k -> new ArrayList<>()).add(node);
+ newDownstreams
+ .computeIfAbsent(newNodeUpstreams.get(0), k -> new ArrayList<>())
+ .add(node);
} else {
newNodeUpstreams = new ArrayList<>(oldNodeUpstreams.size());
for (K leftNode : oldNodeUpstreams) {
if (oldNodeUpstreams.stream()
.filter(rightNode -> leftNode != rightNode)
- .noneMatch(rightNode -> transitiveUpstreams.get(rightNode).contains(leftNode))) {
+ .noneMatch(rightNode ->
+ transitiveUpstreams.get(rightNode).contains(leftNode))) {
newNodeUpstreams.add(leftNode);
- newDownstreams.computeIfAbsent(leftNode, k -> new ArrayList<>()).add(node);
+ newDownstreams
+ .computeIfAbsent(leftNode, k -> new ArrayList<>())
+ .add(node);
}
}
}
@@ -237,9 +239,7 @@ public class DependencyGraph<K> {
if (result == null) {
final List<K> firstOrderUpstreams = this.upstreams.get(node);
result = new HashSet<>(firstOrderUpstreams);
- firstOrderUpstreams.stream()
- .map(this::transitiveUpstreams)
- .forEach(result::addAll);
+ firstOrderUpstreams.stream().map(this::transitiveUpstreams).forEach(result::addAll);
transitiveUpstreams.put(node, result);
}
return result;
@@ -269,10 +269,7 @@ public class DependencyGraph<K> {
graph.transitiveUpstreams.forEach((k, ups) -> {
mapByUpstreams.computeIfAbsent(ups, n -> new HashSet<>()).add(k);
});
- max = mapByUpstreams.values().stream()
- .mapToInt(Set::size)
- .max()
- .orElse(0);
+ max = mapByUpstreams.values().stream().mapToInt(Set::size).max().orElse(0);
if (max >= maxmax) {
return maxmax;
}
@@ -316,22 +313,17 @@ public class DependencyGraph<K> {
}
private List<K> getRoots() {
- return graph.getProjects()
- .filter(graph::isRoot)
- .collect(Collectors.toList());
+ return graph.getProjects().filter(graph::isRoot).collect(Collectors.toList());
}
List<K> ensembleWithChildrenOf(List<K> list, K node) {
final List<K> result = Stream.concat(
- list.stream().filter(k -> !Objects.equals(k, node)),
- graph.getDownstreamProjects(node)
- .filter(k -> graph.transitiveUpstreams.get(k)
- .stream()
+ list.stream().filter(k -> !Objects.equals(k, node)),
+ graph.getDownstreamProjects(node).filter(k -> graph.transitiveUpstreams.get(k).stream()
.noneMatch(k2 -> !Objects.equals(k2, node) && list.contains(k2))))
- .distinct().collect(Collectors.toList());
+ .distinct()
+ .collect(Collectors.toList());
return result;
}
-
}
-
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/ProjectComparator.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/ProjectComparator.java
index 956932a7..fee21ce0 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/ProjectComparator.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/ProjectComparator.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2014 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.builder;
@@ -55,7 +58,8 @@ class ProjectComparator {
return create0(graph, Collections.emptyMap(), ProjectComparator::id);
}
- static <K> Comparator<K> create0(DependencyGraph<K> dependencyGraph,
+ static <K> Comparator<K> create0(
+ DependencyGraph<K> dependencyGraph,
Map<String, AtomicLong> historicalServiceTimes,
Function<K, String> toKey) {
final long defaultServiceTime = average(historicalServiceTimes.values());
@@ -79,18 +83,18 @@ class ProjectComparator {
}
private static long average(Collection<AtomicLong> values) {
- return (long) (values.stream().mapToLong(AtomicLong::longValue)
- .average().orElse(1.0d));
+ return (long)
+ (values.stream().mapToLong(AtomicLong::longValue).average().orElse(1.0d));
}
- private static <K> long getServiceTime(Map<String, AtomicLong> serviceTimes, K project,
- long defaultServiceTime, Function<K, String> toKey) {
+ private static <K> long getServiceTime(
+ Map<String, AtomicLong> serviceTimes, K project, long defaultServiceTime, Function<K, String> toKey) {
AtomicLong serviceTime = serviceTimes.get(toKey.apply(project));
return serviceTime != null ? serviceTime.longValue() : defaultServiceTime;
}
- private static <K> Map<K, Long> calculateWeights(DependencyGraph<K> dependencyGraph,
- Map<K, Long> serviceTimes, Collection<K> rootProjects) {
+ private static <K> Map<K, Long> calculateWeights(
+ DependencyGraph<K> dependencyGraph, Map<K, Long> serviceTimes, Collection<K> rootProjects) {
Map<K, Long> weights = new HashMap<>();
for (K rootProject : rootProjects) {
calculateWeights(dependencyGraph, serviceTimes, rootProject, weights);
@@ -102,10 +106,11 @@ class ProjectComparator {
* Returns the maximum sum of build time along a path from the project to an exit project. An
* "exit project" is a project without downstream dependencies.
*/
- private static <K> long calculateWeights(DependencyGraph<K> dependencyGraph,
- Map<K, Long> serviceTimes, K project, Map<K, Long> weights) {
+ private static <K> long calculateWeights(
+ DependencyGraph<K> dependencyGraph, Map<K, Long> serviceTimes, K project, Map<K, Long> weights) {
long weight = serviceTimes.get(project)
- + dependencyGraph.getDownstreamProjects(project)
+ + dependencyGraph
+ .getDownstreamProjects(project)
.mapToLong(successor -> {
long successorWeight;
if (weights.containsKey(successor)) {
@@ -115,15 +120,13 @@ class ProjectComparator {
}
return successorWeight;
})
- .max().orElse(0);
+ .max()
+ .orElse(0);
weights.put(project, weight);
return weight;
}
static String id(MavenProject project) {
- return project.getGroupId() +
- ':' + project.getArtifactId() +
- ':' + project.getVersion();
+ return project.getGroupId() + ':' + project.getArtifactId() + ':' + project.getVersion();
}
-
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/ProjectExecutorService.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/ProjectExecutorService.java
index 63b9710a..58f56f0b 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/ProjectExecutorService.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/ProjectExecutorService.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2014 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.builder;
@@ -44,36 +47,35 @@ class ProjectExecutorService {
private final BlockingQueue<Future<MavenProject>> completion = new LinkedBlockingQueue<>();
private final Comparator<Runnable> taskComparator;
- public ProjectExecutorService(final int degreeOfConcurrency,
- final Comparator<MavenProject> projectComparator) {
+ public ProjectExecutorService(final int degreeOfConcurrency, final Comparator<MavenProject> projectComparator) {
- this.taskComparator = Comparator.comparing(
- r -> ((ProjectRunnable) r).getProject(), projectComparator);
+ this.taskComparator = Comparator.comparing(r -> ((ProjectRunnable) r).getProject(), projectComparator);
- final BlockingQueue<Runnable> executorWorkQueue = new PriorityBlockingQueue<>(degreeOfConcurrency, taskComparator);
+ final BlockingQueue<Runnable> executorWorkQueue =
+ new PriorityBlockingQueue<>(degreeOfConcurrency, taskComparator);
- executor = new ThreadPoolExecutor(degreeOfConcurrency, // corePoolSize
- degreeOfConcurrency, // maximumPoolSize
- 0L, TimeUnit.MILLISECONDS, // keepAliveTime, unit
- executorWorkQueue, // workQueue
- new BuildThreadFactory() // threadFactory
- ) {
+ executor =
+ new ThreadPoolExecutor(
+ degreeOfConcurrency, // corePoolSize
+ degreeOfConcurrency, // maximumPoolSize
+ 0L,
+ TimeUnit.MILLISECONDS, // keepAliveTime, unit
+ executorWorkQueue, // workQueue
+ new BuildThreadFactory() // threadFactory
+ ) {
- @Override
- protected void beforeExecute(Thread t, Runnable r) {
- ProjectExecutorService.this.beforeExecute(t, r);
- }
- };
+ @Override
+ protected void beforeExecute(Thread t, Runnable r) {
+ ProjectExecutorService.this.beforeExecute(t, r);
+ }
+ };
}
public void submitAll(final Collection<? extends ProjectRunnable> tasks) {
// when there are available worker threads, tasks are immediately executed, i.e. bypassed the
// ordered queued. need to sort tasks, such that submission order matches desired execution
// order
- tasks.stream()
- .sorted(taskComparator)
- .map(ProjectFutureTask::new)
- .forEach(executor::execute);
+ tasks.stream().sorted(taskComparator).map(ProjectFutureTask::new).forEach(executor::execute);
}
/**
@@ -93,8 +95,7 @@ class ProjectExecutorService {
}
// hook to allow pausing executor during unit tests
- protected void beforeExecute(Thread t, Runnable r) {
- }
+ protected void beforeExecute(Thread t, Runnable r) {}
// for testing purposes only
public void awaitShutdown() throws InterruptedException {
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/ReactorBuildQueue.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/ReactorBuildQueue.java
index 69ecaeeb..d4c289b3 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/ReactorBuildQueue.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/ReactorBuildQueue.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2014 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.builder;
@@ -43,8 +46,7 @@ class ReactorBuildQueue {
private final Set<MavenProject> finishedProjects;
- public ReactorBuildQueue(Collection<MavenProject> projects,
- DependencyGraph<MavenProject> graph) {
+ public ReactorBuildQueue(Collection<MavenProject> projects, DependencyGraph<MavenProject> graph) {
this.graph = graph;
this.projects = new HashSet<>();
this.rootProjects = new HashSet<>();
@@ -116,5 +118,4 @@ class ReactorBuildQueue {
projects.removeAll(finishedProjects);
return projects;
}
-
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/ReactorBuildStats.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/ReactorBuildStats.java
index 4c8e9d08..18d660be 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/ReactorBuildStats.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/ReactorBuildStats.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2017 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.builder;
@@ -47,11 +50,11 @@ class ReactorBuildStats {
* structure prevented higher degree of parallelism.
*/
private final Map<String, AtomicLong> bottleneckTimes;
+
private long startTime;
private long stopTime;
- private ReactorBuildStats(Map<String, AtomicLong> serviceTimes,
- Map<String, AtomicLong> bottleneckTimes) {
+ private ReactorBuildStats(Map<String, AtomicLong> serviceTimes, Map<String, AtomicLong> bottleneckTimes) {
this.serviceTimes = ImmutableMap.copyOf(serviceTimes);
this.bottleneckTimes = ImmutableMap.copyOf(bottleneckTimes);
}
@@ -81,13 +84,13 @@ class ReactorBuildStats {
public void recordServiceTime(MavenProject project, long durationNanos) {
AtomicLong serviceTime = serviceTimes.get(projectGAV(project));
if (serviceTime == null) {
- throw new IllegalStateException("Unknown project " + projectGAV(project) + ", found " + serviceTimes.keySet());
+ throw new IllegalStateException(
+ "Unknown project " + projectGAV(project) + ", found " + serviceTimes.keySet());
}
serviceTime.addAndGet(durationNanos);
}
- public void recordBottlenecks(Set<MavenProject> projects, int degreeOfConcurrency,
- long durationNanos) {
+ public void recordBottlenecks(Set<MavenProject> projects, int degreeOfConcurrency, long durationNanos) {
// only projects that result in single-threaded builds
if (projects.size() == 1) {
projects.forEach(p -> bottleneckTimes.get(projectGAV(p)).addAndGet(durationNanos));
@@ -99,7 +102,8 @@ class ReactorBuildStats {
//
public long totalServiceTime(TimeUnit unit) {
- long nanos = serviceTimes.values().stream().mapToLong(AtomicLong::longValue).sum();
+ long nanos =
+ serviceTimes.values().stream().mapToLong(AtomicLong::longValue).sum();
return unit.convert(nanos, TimeUnit.NANOSECONDS);
}
@@ -124,8 +128,8 @@ class ReactorBuildStats {
criticalPathServiceTime += serviceTimes.get(key).get();
appendProjectTimes(result, key);
}
- result.append(String.format("\nBuild critical path total service time %s",
- formatDuration(criticalPathServiceTime)));
+ result.append(
+ String.format("\nBuild critical path total service time %s", formatDuration(criticalPathServiceTime)));
// render bottleneck projects
@@ -138,8 +142,7 @@ class ReactorBuildStats {
bottleneckTotalTime += bottleneckTimes.get(bottleneck).get();
appendProjectTimes(result, bottleneck);
}
- result.append(
- String.format("\nBuild bottlenecks total time %s", formatDuration(bottleneckTotalTime)));
+ result.append(String.format("\nBuild bottlenecks total time %s", formatDuration(bottleneckTotalTime)));
}
result.append("\n** Bottlenecks are projects that limit build concurrency");
@@ -192,5 +195,4 @@ class ReactorBuildStats {
private <K> K getCriticalProject(Stream<K> projects, Comparator<K> comparator) {
return projects.min(comparator).orElse(null);
}
-
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilder.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilder.java
index c5f61aa3..f6410f6f 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilder.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilder.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2014 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.builder;
@@ -86,25 +89,31 @@ public class SmartBuilder implements Builder {
}
@Override
- public synchronized void build(final MavenSession session, final ReactorContext reactorContext,
- ProjectBuildList projectBuilds, final List<TaskSegment> taskSegments,
- ReactorBuildStatus reactorBuildStatus) throws ExecutionException, InterruptedException {
+ public synchronized void build(
+ final MavenSession session,
+ final ReactorContext reactorContext,
+ ProjectBuildList projectBuilds,
+ final List<TaskSegment> taskSegments,
+ ReactorBuildStatus reactorBuildStatus)
+ throws ExecutionException, InterruptedException {
session.getRepositorySession().getData().set(ReactorBuildStatus.class, reactorBuildStatus);
- DependencyGraph<MavenProject> graph = (DependencyGraph<MavenProject>) session.getRequest().getData()
- .get(DependencyGraph.class.getName());
+ DependencyGraph<MavenProject> graph =
+ (DependencyGraph<MavenProject>) session.getRequest().getData().get(DependencyGraph.class.getName());
// log overall build info
final int degreeOfConcurrency = session.getRequest().getDegreeOfConcurrency();
- logger.info("Task segments : " + taskSegments.stream().map(Object::toString).collect(Collectors.joining(" ")));
+ logger.info(
+ "Task segments : " + taskSegments.stream().map(Object::toString).collect(Collectors.joining(" ")));
logger.info("Build maximum degree of concurrency is " + degreeOfConcurrency);
logger.info("Total number of projects is " + session.getProjects().size());
// the actual build execution
List<Map.Entry<TaskSegment, ReactorBuildStats>> allstats = new ArrayList<>();
for (TaskSegment taskSegment : taskSegments) {
- Set<MavenProject> projects = projectBuilds.getByTaskSegment(taskSegment).getProjects();
+ Set<MavenProject> projects =
+ projectBuilds.getByTaskSegment(taskSegment).getProjects();
if (canceled) {
return;
}
@@ -126,7 +135,8 @@ public class SmartBuilder implements Builder {
for (Map.Entry<TaskSegment, ReactorBuildStats> entry : allstats) {
TaskSegment taskSegment = entry.getKey();
ReactorBuildStats stats = entry.getValue();
- Set<MavenProject> projects = projectBuilds.getByTaskSegment(taskSegment).getProjects();
+ Set<MavenProject> projects =
+ projectBuilds.getByTaskSegment(taskSegment).getProjects();
logger.debug("Task segment {}, number of projects {}", taskSegment, projects.size());
@@ -136,7 +146,8 @@ public class SmartBuilder implements Builder {
logger.info(
"Segment walltime {} s, segment projects service time {} s, effective/maximum degree of concurrency {}/{}",
TimeUnit.NANOSECONDS.toSeconds(walltimeReactor),
- TimeUnit.NANOSECONDS.toSeconds(walltimeService), effectiveConcurrency,
+ TimeUnit.NANOSECONDS.toSeconds(walltimeService),
+ effectiveConcurrency,
degreeOfConcurrency);
if (projects.size() > 1 && isProfiling(session)) {
@@ -152,5 +163,4 @@ public class SmartBuilder implements Builder {
}
return Boolean.parseBoolean(value);
}
-
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilderImpl.java b/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilderImpl.java
index 5a32d097..027a66e3 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilderImpl.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/builder/SmartBuilderImpl.java
@@ -1,16 +1,20 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.builder;
@@ -61,9 +65,13 @@ class SmartBuilderImpl {
//
private final ReactorBuildStats stats;
- SmartBuilderImpl(LifecycleModuleBuilder lifecycleModuleBuilder, MavenSession session,
- ReactorContext reactorContext, TaskSegment taskSegment,
- Set<MavenProject> projects, DependencyGraph<MavenProject> graph) {
+ SmartBuilderImpl(
+ LifecycleModuleBuilder lifecycleModuleBuilder,
+ MavenSession session,
+ ReactorContext reactorContext,
+ TaskSegment taskSegment,
+ Set<MavenProject> projects,
+ DependencyGraph<MavenProject> graph) {
this.lifecycleModuleBuilder = lifecycleModuleBuilder;
this.rootSession = session;
this.reactorContext = reactorContext;
@@ -101,8 +109,7 @@ class SmartBuilderImpl {
try {
MavenProject completedProject = executor.take();
if (bottlenecks != null) {
- stats.recordBottlenecks(bottlenecks, degreeOfConcurrency,
- System.nanoTime() - timstampSubmit);
+ stats.recordBottlenecks(bottlenecks, degreeOfConcurrency, System.nanoTime() - timstampSubmit);
}
logCompleted(completedProject);
Set<MavenProject> readyProjects = reactorBuildQueue.onProjectFinish(completedProject);
@@ -135,8 +142,12 @@ class SmartBuilderImpl {
.map(SmartBuilderImpl::projectGA)
.collect(Collectors.joining(" ", "[", "]"));
}
- logger.debug("Builder state: blocked={} finished={} ready-or-running={} {}", blockedCount,
- finishedCount, readyCount, runningProjects);
+ logger.debug(
+ "Builder state: blocked={} finished={} ready-or-running={} {}",
+ blockedCount,
+ finishedCount,
+ readyCount,
+ runningProjects);
}
private void logCompleted(MavenProject project) {
@@ -170,17 +181,15 @@ class SmartBuilderImpl {
executor.submitAll(tasks);
}
- /* package */void buildProject(MavenProject project) {
+ /* package */ void buildProject(MavenProject project) {
logger.debug("STARTED build of project {}:{}", project.getGroupId(), project.getArtifactId());
try {
MavenSession copiedSession = rootSession.clone();
- lifecycleModuleBuilder.buildProject(copiedSession, rootSession, reactorContext, project,
- taskSegment);
+ lifecycleModuleBuilder.buildProject(copiedSession, rootSession, reactorContext, project, taskSegment);
} catch (RuntimeException ex) {
// preserve the xml stack trace, and the java cause chain
- rootSession.getResult()
- .addException(new RuntimeException(project.getName() + ": " + ex.getMessage(), ex));
+ rootSession.getResult().addException(new RuntimeException(project.getName() + ": " + ex.getMessage(), ex));
}
}
@@ -206,5 +215,4 @@ class SmartBuilderImpl {
return project;
}
}
-
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/Cache.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/Cache.java
index 49f90e41..dc167ac7 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/Cache.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/Cache.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.cache;
@@ -69,5 +72,4 @@ public interface Cache<K, V extends CacheRecord> {
* @return the existing or newly computed {@link CacheRecord}
*/
V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction);
-
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/CacheFactory.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/CacheFactory.java
index 01ffa527..38c3b266 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/CacheFactory.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/CacheFactory.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.cache;
@@ -26,5 +29,4 @@ public interface CacheFactory {
* @return a new {@link Cache}
*/
<K, V extends CacheRecord> Cache<K, V> newCache();
-
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/CacheRecord.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/CacheRecord.java
index 2cadad50..99fa9a5d 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/CacheRecord.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/CacheRecord.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.cache;
@@ -33,5 +36,4 @@ public interface CacheRecord {
* Callback called by the cache when this {@link CacheRecord} is removed from the cache.
*/
void invalidate();
-
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/DefaultCacheFactory.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/DefaultCacheFactory.java
index b8cc24eb..354af14d 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/DefaultCacheFactory.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/DefaultCacheFactory.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.cache.impl;
@@ -41,5 +44,4 @@ public class DefaultCacheFactory implements CacheFactory {
public <K, V extends CacheRecord> Cache<K, V> newCache() {
return delegate.newCache();
}
-
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/TimestampCacheFactory.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/TimestampCacheFactory.java
index ed308472..c7bf4a0a 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/TimestampCacheFactory.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/TimestampCacheFactory.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.cache.impl;
@@ -39,8 +42,7 @@ import org.mvndaemon.mvnd.cache.CacheRecord;
*/
public class TimestampCacheFactory implements CacheFactory {
- public TimestampCacheFactory() {
- }
+ public TimestampCacheFactory() {}
@Override
public <K, V extends CacheRecord> Cache<K, V> newCache() {
@@ -73,14 +75,12 @@ public class TimestampCacheFactory implements CacheFactory {
@Override
public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o == null || getClass() != o.getClass())
- return false;
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
FileState that = (FileState) o;
- return path.equals(that.path) &&
- Objects.equals(lastModifiedTime, that.lastModifiedTime) &&
- Objects.equals(fileKey, that.fileKey);
+ return path.equals(that.path)
+ && Objects.equals(lastModifiedTime, that.lastModifiedTime)
+ && Objects.equals(fileKey, that.fileKey);
}
@Override
@@ -92,7 +92,6 @@ public class TimestampCacheFactory implements CacheFactory {
public String toString() {
return "FileState [path=" + path + ", lastModifiedTime=" + lastModifiedTime + ", fileKey=" + fileKey + "]";
}
-
}
static class Record<V extends CacheRecord> {
@@ -110,9 +109,7 @@ public class TimestampCacheFactory implements CacheFactory {
* @return {@link Set} of {@link FileState}s at current time
*/
private Set<FileState> currentFileStates() {
- return record.getDependencyPaths()
- .map(FileState::new)
- .collect(Collectors.toSet());
+ return record.getDependencyPaths().map(FileState::new).collect(Collectors.toSet());
}
}
@@ -157,7 +154,7 @@ public class TimestampCacheFactory implements CacheFactory {
@Override
public void removeIf(BiPredicate<K, V> predicate) {
- for (Iterator<Map.Entry<K, Record<V>>> iterator = map.entrySet().iterator(); iterator.hasNext();) {
+ for (Iterator<Map.Entry<K, Record<V>>> iterator = map.entrySet().iterator(); iterator.hasNext(); ) {
Map.Entry<K, Record<V>> entry = iterator.next();
if (predicate.test(entry.getKey(), entry.getValue().record)) {
entry.getValue().record.invalidate();
@@ -169,19 +166,20 @@ public class TimestampCacheFactory implements CacheFactory {
@Override
public V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) {
return map.compute(key, (k, v) -> {
- if (v != null) {
- try {
- if (Objects.equals(v.fileStates, v.currentFileStates())) {
- return v;
+ if (v != null) {
+ try {
+ if (Objects.equals(v.fileStates, v.currentFileStates())) {
+ return v;
+ }
+ } catch (RuntimeException e) {
+ // ignore and invalidate the record
+ }
+ v.record.invalidate();
+ v = null;
}
- } catch (RuntimeException e) {
- // ignore and invalidate the record
- }
- v.record.invalidate();
- v = null;
- }
- return new Record<>(mappingFunction.apply(k));
- }).record;
+ return new Record<>(mappingFunction.apply(k));
+ })
+ .record;
}
}
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/WatchServiceCacheFactory.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/WatchServiceCacheFactory.java
index 13537db5..b40c75fc 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/WatchServiceCacheFactory.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/impl/WatchServiceCacheFactory.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.cache.impl;
@@ -93,14 +96,15 @@ public class WatchServiceCacheFactory implements CacheFactory {
try {
WatchEvent.Modifier[] mods;
try {
- mods = new WatchEvent.Modifier[] {
- com.sun.nio.file.SensitivityWatchEventModifier.HIGH
- };
+ mods = new WatchEvent.Modifier[] {com.sun.nio.file.SensitivityWatchEventModifier.HIGH};
} catch (Throwable t) {
mods = null;
}
- final WatchKey watchKey = key.register(watchService,
- new WatchEvent.Kind[] { StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY },
+ final WatchKey watchKey = key.register(
+ watchService,
+ new WatchEvent.Kind[] {
+ StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY
+ },
mods);
return new Registration(watchKey);
} catch (NoSuchFileException e) {
@@ -138,7 +142,8 @@ public class WatchServiceCacheFactory implements CacheFactory {
} else if (kind == StandardWatchEventKinds.OVERFLOW) {
/* Invalidate all records under the given dir */
LOG.debug("Got overflow event for path {}", dir);
- Iterator<Map.Entry<Path, List<CacheRecord>>> it = recordsByPath.entrySet().iterator();
+ Iterator<Map.Entry<Path, List<CacheRecord>>> it =
+ recordsByPath.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<Path, List<CacheRecord>> en = it.next();
final Path path = en.getKey();
@@ -230,7 +235,7 @@ public class WatchServiceCacheFactory implements CacheFactory {
@Override
public void removeIf(BiPredicate<K, V> predicate) {
- for (Iterator<Map.Entry<K, V>> iterator = map.entrySet().iterator(); iterator.hasNext();) {
+ for (Iterator<Map.Entry<K, V>> iterator = map.entrySet().iterator(); iterator.hasNext(); ) {
Map.Entry<K, V> entry = iterator.next();
if (predicate.test(entry.getKey(), entry.getValue())) {
entry.getValue().invalidate();
@@ -271,6 +276,5 @@ public class WatchServiceCacheFactory implements CacheFactory {
delegate.invalidate();
map.remove(key);
}
-
}
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingExtensionRealmCache.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingExtensionRealmCache.java
index 534e0143..630cdc96 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingExtensionRealmCache.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingExtensionRealmCache.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.cache.invalidating;
@@ -46,7 +49,8 @@ public class InvalidatingExtensionRealmCache extends DefaultExtensionRealmCache
@Override
public Stream<Path> getDependencyPaths() {
- return record.getArtifacts().stream().map(artifact -> artifact.getFile().toPath());
+ return record.getArtifacts().stream()
+ .map(artifact -> artifact.getFile().toPath());
}
@Override
@@ -74,8 +78,8 @@ public class InvalidatingExtensionRealmCache extends DefaultExtensionRealmCache
}
@Override
- public CacheRecord put(Key key, ClassRealm extensionRealm, ExtensionDescriptor extensionDescriptor,
- List<Artifact> artifacts) {
+ public CacheRecord put(
+ Key key, ClassRealm extensionRealm, ExtensionDescriptor extensionDescriptor, List<Artifact> artifacts) {
CacheRecord record = super.put(key, extensionRealm, extensionDescriptor, artifacts);
super.cache.remove(key);
cache.put(key, new Record(record));
@@ -88,7 +92,5 @@ public class InvalidatingExtensionRealmCache extends DefaultExtensionRealmCache
}
@Override
- public void register(MavenProject project, Key key, CacheRecord record) {
- }
-
+ public void register(MavenProject project, Key key, CacheRecord record) {}
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginArtifactsCache.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginArtifactsCache.java
index c5c83606..a5be4346 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginArtifactsCache.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginArtifactsCache.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.cache.invalidating;
@@ -46,12 +49,12 @@ public class InvalidatingPluginArtifactsCache extends DefaultPluginArtifactsCach
if (record.getException() != null) {
return Stream.empty();
}
- return record.getArtifacts().stream().map(artifact -> artifact.getFile().toPath());
+ return record.getArtifacts().stream()
+ .map(artifact -> artifact.getFile().toPath());
}
@Override
- public void invalidate() {
- }
+ public void invalidate() {}
}
final Cache<Key, Record> cache;
@@ -95,5 +98,4 @@ public class InvalidatingPluginArtifactsCache extends DefaultPluginArtifactsCach
public void flush() {
cache.clear();
}
-
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginDescriptorCache.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginDescriptorCache.java
index 8641de11..fb5f4d24 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginDescriptorCache.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginDescriptorCache.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.cache.invalidating;
@@ -59,8 +62,8 @@ public class InvalidatingPluginDescriptorCache extends DefaultPluginDescriptorCa
@Override
public Stream<Path> getDependencyPaths() {
- return Optional.ofNullable(descriptor.getArtifacts()).orElse(Collections.emptyList())
- .stream().map(artifact -> artifact.getFile().toPath());
+ return Optional.ofNullable(descriptor.getArtifacts()).orElse(Collections.emptyList()).stream()
+ .map(artifact -> artifact.getFile().toPath());
}
@Override
@@ -98,7 +101,9 @@ public class InvalidatingPluginDescriptorCache extends DefaultPluginDescriptorCa
Record r = cache.computeIfAbsent(key, k -> {
try {
return new Record(clone(supplier.load()));
- } catch (PluginDescriptorParsingException | PluginResolutionException | InvalidPluginDescriptorException e) {
+ } catch (PluginDescriptorParsingException
+ | PluginResolutionException
+ | InvalidPluginDescriptorException e) {
throw new RuntimeException(e);
}
});
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginRealmCache.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginRealmCache.java
index f6f22f10..6817d854 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginRealmCache.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingPluginRealmCache.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.cache.invalidating;
@@ -52,7 +55,8 @@ public class InvalidatingPluginRealmCache extends DefaultPluginRealmCache {
@Override
public Stream<Path> getDependencyPaths() {
- return record.getArtifacts().stream().map(artifact -> artifact.getFile().toPath());
+ return record.getArtifacts().stream()
+ .map(artifact -> artifact.getFile().toPath());
}
@Override
@@ -115,7 +119,5 @@ public class InvalidatingPluginRealmCache extends DefaultPluginRealmCache {
}
@Override
- public void register(MavenProject project, Key key, CacheRecord record) {
- }
-
+ public void register(MavenProject project, Key key, CacheRecord record) {}
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingProjectArtifactsCache.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingProjectArtifactsCache.java
index ee0531d2..70d2aae8 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingProjectArtifactsCache.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingProjectArtifactsCache.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.cache.invalidating;
@@ -47,8 +50,7 @@ import org.mvndaemon.mvnd.cache.CacheFactory;
@Priority(10)
public class InvalidatingProjectArtifactsCache extends DefaultProjectArtifactsCache {
- protected static class CacheKey
- implements Key {
+ protected static class CacheKey implements Key {
private final String groupId;
@@ -72,8 +74,12 @@ public class InvalidatingProjectArtifactsCache extends DefaultProjectArtifactsCa
private final int hashCode;
- public CacheKey(MavenProject project, List<RemoteRepository> repositories,
- Collection<String> scopesToCollect, Collection<String> scopesToResolve, boolean aggregating,
+ public CacheKey(
+ MavenProject project,
+ List<RemoteRepository> repositories,
+ Collection<String> scopesToCollect,
+ Collection<String> scopesToResolve,
+ boolean aggregating,
RepositorySystemSession session) {
groupId = project.getGroupId();
@@ -99,10 +105,10 @@ public class InvalidatingProjectArtifactsCache extends DefaultProjectArtifactsCa
}
}
collect = scopesToCollect == null
- ? Collections.<String> emptySet()
+ ? Collections.<String>emptySet()
: Collections.unmodifiableSet(new HashSet<>(scopesToCollect));
resolve = scopesToResolve == null
- ? Collections.<String> emptySet()
+ ? Collections.<String>emptySet()
: Collections.unmodifiableSet(new HashSet<>(scopesToResolve));
this.aggregating = aggregating;
@@ -148,7 +154,8 @@ public class InvalidatingProjectArtifactsCache extends DefaultProjectArtifactsCa
CacheKey that = (CacheKey) o;
- return Objects.equals(groupId, that.groupId) && Objects.equals(artifactId, that.artifactId)
+ return Objects.equals(groupId, that.groupId)
+ && Objects.equals(artifactId, that.artifactId)
&& Objects.equals(version, that.version)
&& Objects.equals(dependencyArtifacts, that.dependencyArtifacts)
&& Objects.equals(workspace, that.workspace)
@@ -179,8 +186,7 @@ public class InvalidatingProjectArtifactsCache extends DefaultProjectArtifactsCa
}
@Override
- public void invalidate() {
- }
+ public void invalidate() {}
}
final Cache<Key, Record> cache;
@@ -191,10 +197,19 @@ public class InvalidatingProjectArtifactsCache extends DefaultProjectArtifactsCa
}
@Override
- public Key createKey(MavenProject project, Collection<String> scopesToCollect, Collection<String> scopesToResolve,
- boolean aggregating, RepositorySystemSession session) {
- return new CacheKey(project, project.getRemoteProjectRepositories(), scopesToCollect, scopesToResolve,
- aggregating, session);
+ public Key createKey(
+ MavenProject project,
+ Collection<String> scopesToCollect,
+ Collection<String> scopesToResolve,
+ boolean aggregating,
+ RepositorySystemSession session) {
+ return new CacheKey(
+ project,
+ project.getRemoteProjectRepositories(),
+ scopesToCollect,
+ scopesToResolve,
+ aggregating,
+ session);
}
@Override
@@ -231,6 +246,5 @@ public class InvalidatingProjectArtifactsCache extends DefaultProjectArtifactsCa
}
@Override
- public void register(MavenProject project, Key cacheKey, CacheRecord record) {
- }
+ public void register(MavenProject project, Key cacheKey, CacheRecord record) {}
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingRealmCacheEventSpy.java b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingRealmCacheEventSpy.java
index fda2d6b1..40c90ec5 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingRealmCacheEventSpy.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cache/invalidating/InvalidatingRealmCacheEventSpy.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2020 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.cache.invalidating;
@@ -65,8 +68,11 @@ public class InvalidatingRealmCacheEventSpy extends AbstractEventSpy {
try {
if (event instanceof MavenExecutionRequest) {
/* Store the multiModuleProjectDirectory path */
- multiModuleProjectDirectory = ((MavenExecutionRequest) event).getMultiModuleProjectDirectory().toPath();
- pattern = Environment.MVND_PLUGIN_REALM_EVICT_PATTERN.asOptional()
+ multiModuleProjectDirectory = ((MavenExecutionRequest) event)
+ .getMultiModuleProjectDirectory()
+ .toPath();
+ pattern = Environment.MVND_PLUGIN_REALM_EVICT_PATTERN
+ .asOptional()
.orElse(Environment.MVND_PLUGIN_REALM_EVICT_PATTERN.getDefault());
if (!pattern.isEmpty()) {
String[] patterns = pattern.split(",");
@@ -104,15 +110,17 @@ public class InvalidatingRealmCacheEventSpy extends AbstractEventSpy {
extensionCache.cache.removeIf(this::shouldEvict);
MavenExecutionResult mer = (MavenExecutionResult) event;
List<MavenProject> projects = mer.getTopologicallySortedProjects();
- projectArtifactsCache.cache
- .removeIf((k, r) -> shouldEvict(projects, (InvalidatingProjectArtifactsCache.CacheKey) k, r));
+ projectArtifactsCache.cache.removeIf(
+ (k, r) -> shouldEvict(projects, (InvalidatingProjectArtifactsCache.CacheKey) k, r));
}
} catch (Exception e) {
LOG.warn("Could not notify CliPluginRealmCache", e);
}
}
- private boolean shouldEvict(List<MavenProject> projects, InvalidatingProjectArtifactsCache.CacheKey k,
+ private boolean shouldEvict(
+ List<MavenProject> projects,
+ InvalidatingProjectArtifactsCache.CacheKey k,
InvalidatingProjectArtifactsCache.Record v) {
return projects.stream().anyMatch(p -> k.matches(p.getGroupId(), p.getArtifactId(), p.getVersion()));
}
@@ -125,12 +133,15 @@ public class InvalidatingRealmCacheEventSpy extends AbstractEventSpy {
if (path.startsWith(multiModuleProjectDirectory)) {
LOG.debug(
"Removing PluginRealmCache entry {} because it refers to an artifact in the build tree {}",
- k, path);
+ k,
+ path);
return true;
} else if (matcher != null && matcher.matches(path)) {
LOG.debug(
"Removing PluginRealmCache entry {} because its components {} matches the eviction pattern '{}'",
- k, path, pattern);
+ k,
+ path,
+ pattern);
return true;
}
}
@@ -149,12 +160,15 @@ public class InvalidatingRealmCacheEventSpy extends AbstractEventSpy {
if (path.startsWith(multiModuleProjectDirectory)) {
LOG.debug(
"Removing ExtensionRealmCache entry {} because it refers to an artifact in the build tree {}",
- k, path);
+ k,
+ path);
return true;
} else if (matcher != null && matcher.matches(path)) {
LOG.debug(
"Removing ExtensionRealmCache entry {} because its components {} matches the eviction pattern '{}'",
- k, path, pattern);
+ k,
+ path,
+ pattern);
return true;
}
}
@@ -171,5 +185,4 @@ public class InvalidatingRealmCacheEventSpy extends AbstractEventSpy {
}
return FileSystems.getDefault().getPathMatcher(pattern);
}
-
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/cli/EnvHelper.java b/daemon/src/main/java/org/mvndaemon/mvnd/cli/EnvHelper.java
index 90896341..766b9bb4 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/cli/EnvHelper.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/cli/EnvHelper.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2021 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.cli;
@@ -40,8 +43,7 @@ public class EnvHelper {
private static final Logger LOGGER = LoggerFactory.getLogger(EnvHelper.class);
- private EnvHelper() {
- }
+ private EnvHelper() {}
public static void environment(String workingDir, Map<String, String> clientEnv) {
environment(workingDir, clientEnv, LOGGER::warn);
@@ -82,8 +84,9 @@ public class EnvHelper {
diffs.forEach(key -> {
String vr = requested.get(key);
String va = nactual.get(key);
- log.accept(String.format(" %s -> %s instead of %s", key,
- va != null ? "'" + va + "'" : "<null>", vr != null ? "'" + vr + "'" : "<null>"));
+ log.accept(String.format(
+ " %s -> %s instead of %s",
+ key, va != null ? "'" + va + "'" : "<null>", vr != null ? "'" + vr + "'" : "<null>"));
});
log.accept("If the difference matters to you, stop the running daemons using mvnd --stop and");
log.accept("start a new daemon from the current environment by issuing any mvnd build command.");
@@ -157,8 +160,8 @@ public class EnvHelper {
// OpenJDK 8-17 on Windows
if (Os.current() == Os.WINDOWS) {
Class<?> processEnvironmentClass = Class.forName("java.lang.ProcessEnvironment");
- Field theCaseInsensitiveEnvironmentField = processEnvironmentClass
- .getDeclaredField("theCaseInsensitiveEnvironment");
+ Field theCaseInsensitiveEnvironmentField =
+ processEnvironmentClass.getDeclaredField("theCaseInsensitiveEnvironment");
theCaseInsensitiveEnvironmentField.setAccessible(true);
Map<String, String> cienv = (Map<String, String>) theCaseInsensitiveEnvironmentField.get(null);
cienv.clear();
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java
index 0fce8af4..eda1c5cd 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/ClientDispatcher.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2019 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.daemon;
@@ -52,10 +55,14 @@ public class ClientDispatcher extends BuildEventListener {
final DependencyGraph<MavenProject> dependencyGraph = DependencyGraph.fromMaven(session);
session.getRequest().getData().put(DependencyGraph.class.getName(), dependencyGraph);
- final int maxThreads = degreeOfConcurrency == 1 ? 1 : dependencyGraph.computeMaxWidth(degreeOfConcurrency, 1000);
+ final int maxThreads =
+ degreeOfConcurrency == 1 ? 1 : dependencyGraph.computeMaxWidth(degreeOfConcurrency, 1000);
final List<MavenProject> projects = session.getProjects();
final int _90thArtifactIdLengthPercentile = artifactIdLength90thPercentile(projects);
- queue.add(new BuildStarted(getCurrentProject(session).getArtifactId(), projects.size(), maxThreads,
+ queue.add(new BuildStarted(
+ getCurrentProject(session).getArtifactId(),
+ projects.size(),
+ maxThreads,
_90thArtifactIdLengthPercentile));
}
@@ -65,7 +72,8 @@ public class ClientDispatcher extends BuildEventListener {
}
Map<Integer, Integer> frequencyDistribution = new TreeMap<>();
for (MavenProject p : projects) {
- frequencyDistribution.compute(p.getArtifactId().length(),
+ frequencyDistribution.compute(
+ p.getArtifactId().length(),
(k, v) -> (v == null) ? Integer.valueOf(1) : Integer.valueOf(v.intValue() + 1));
}
int _90PercCount = Math.round(0.9f * projects.size());
@@ -76,7 +84,8 @@ public class ClientDispatcher extends BuildEventListener {
return en.getKey().intValue();
}
}
- throw new IllegalStateException("Could not compute the 90th percentile of the projects length from " + projects);
+ throw new IllegalStateException(
+ "Could not compute the 90th percentile of the projects length from " + projects);
}
private final Map<String, Boolean> projects = new ConcurrentHashMap<>();
@@ -89,10 +98,12 @@ public class ClientDispatcher extends BuildEventListener {
public void projectLogMessage(String projectId, String event) {
if (projectId != null) {
Boolean b = projects.get(projectId);
- if (b != Boolean.TRUE) {
- }
+ if (b != Boolean.TRUE) {}
}
- queue.add(projectId == null ? Message.log(trimTrailingEols(event)) : Message.log(projectId, trimTrailingEols(event)));
+ queue.add(
+ projectId == null
+ ? Message.log(trimTrailingEols(event))
+ : Message.log(projectId, trimTrailingEols(event)));
}
@Override
@@ -134,40 +145,41 @@ public class ClientDispatcher extends BuildEventListener {
public void transfer(String projectId, TransferEvent e) {
final int event;
switch (e.getType()) {
- case INITIATED:
- event = Message.TRANSFER_INITIATED;
- break;
- case STARTED:
- event = Message.TRANSFER_STARTED;
- break;
- case PROGRESSED:
- event = Message.TRANSFER_PROGRESSED;
- break;
- case CORRUPTED:
- event = Message.TRANSFER_CORRUPTED;
- break;
- case SUCCEEDED:
- event = Message.TRANSFER_SUCCEEDED;
- break;
- case FAILED:
- event = Message.TRANSFER_FAILED;
- break;
- default:
- throw new IllegalStateException("Unexpected " + EventType.class.getSimpleName() + ": " + e.getType());
+ case INITIATED:
+ event = Message.TRANSFER_INITIATED;
+ break;
+ case STARTED:
+ event = Message.TRANSFER_STARTED;
+ break;
+ case PROGRESSED:
+ event = Message.TRANSFER_PROGRESSED;
+ break;
+ case CORRUPTED:
+ event = Message.TRANSFER_CORRUPTED;
+ break;
+ case SUCCEEDED:
+ event = Message.TRANSFER_SUCCEEDED;
+ break;
+ case FAILED:
+ event = Message.TRANSFER_FAILED;
+ break;
+ default:
+ throw new IllegalStateException("Unexpected " + EventType.class.getSimpleName() + ": " + e.getType());
}
final int requestType;
switch (e.getRequestType()) {
- case GET:
- requestType = Message.TransferEvent.GET;
- break;
- case GET_EXISTENCE:
- requestType = Message.TransferEvent.GET_EXISTENCE;
- break;
- case PUT:
- requestType = Message.TransferEvent.PUT;
- break;
- default:
- throw new IllegalStateException("Unexpected " + RequestType.class.getSimpleName() + ": " + e.getRequestType());
+ case GET:
+ requestType = Message.TransferEvent.GET;
+ break;
+ case GET_EXISTENCE:
+ requestType = Message.TransferEvent.GET_EXISTENCE;
+ break;
+ case PUT:
+ requestType = Message.TransferEvent.PUT;
+ break;
+ default:
+ throw new IllegalStateException(
+ "Unexpected " + RequestType.class.getSimpleName() + ": " + e.getRequestType());
}
String repositoryId = e.getResource().getRepositoryId();
String repositoryUrl = e.getResource().getRepositoryUrl();
@@ -175,8 +187,16 @@ public class ClientDispatcher extends BuildEventListener {
long contentLength = e.getResource().getContentLength();
long transferredBytes = e.getTransferredBytes();
String exception = e.getException() != null ? e.getException().toString() : null;
- queue.add(Message.transfer(projectId, event, requestType, repositoryId, repositoryUrl, resourceName,
- contentLength, transferredBytes, exception));
+ queue.add(Message.transfer(
+ projectId,
+ event,
+ requestType,
+ repositoryId,
+ repositoryUrl,
+ resourceName,
+ contentLength,
+ transferredBytes,
+ exception));
}
private MavenProject getCurrentProject(MavenSession mavenSession) {
@@ -187,7 +207,8 @@ public class ClientDispatcher extends BuildEventListener {
return mavenSession.getCurrentProject();
}
return mavenSession.getProjects().stream()
- .filter(p -> (p.getFile() != null && executionRootDirectory.equals(p.getFile().getParent())))
+ .filter(p -> (p.getFile() != null
+ && executionRootDirectory.equals(p.getFile().getParent())))
.findFirst()
.orElse(mavenSession.getCurrentProject());
}
@@ -195,5 +216,4 @@ public class ClientDispatcher extends BuildEventListener {
static String trimTrailingEols(String message) {
return message == null ? null : TRAILING_EOLS_PATTERN.matcher(message).replaceFirst("");
}
-
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Connection.java b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Connection.java
index 44cea49c..08929367 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Connection.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/Connection.java
@@ -1,17 +1,20 @@
/*
- * Copyright 2020 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.daemon;
@@ -35,5 +38,4 @@ public interface Connection {
class Holder {
static Connection CURRENT;
}
-
}
diff --git a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/DaemonExpiration.java b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/DaemonExpiration.java
index d47de8de..ed293f62 100644
--- a/daemon/src/main/java/org/mvndaemon/mvnd/daemon/DaemonExpiration.java
+++ b/daemon/src/main/java/org/mvndaemon/mvnd/daemon/DaemonExpiration.java
@@ -1,20 +1,29 @@
/*
- * Copyright 2016 the original author or authors.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
package org.mvndaemon.mvnd.daemon;
+import static org.mvndaemon.mvnd.common.DaemonExpirationStatus.DO_NOT_EXPIRE;
+import static org.mvndaemon.mvnd.common.DaemonExpirationStatus.GRACEFUL_EXPIRE;
+import static org.mvndaemon.mvnd.common.DaemonExpirationStatus.IMMEDIATE_EXPIRE;
+import static org.mvndaemon.mvnd.common.DaemonExpirationStatus.QUIET_EXPIRE;
+import static org.mvndaemon.mvnd.daemon.DaemonExpiration.DaemonExpirationResult.NOT_TRIGGERED;
+
import java.lang.management.ManagementFactory;
import java.nio.file.Files;
import java.nio.file.Paths;
@@ -40,12 +49,6 @@ import org.mvndaemon.mvnd.common.Os;
import org.mvndaemon.mvnd.common.TimeUtils;
import org.mvndaemon.mvnd.nativ.CLibrary;
-import static org.mvndaemon.mvnd.common.DaemonExpirationStatus.DO_NOT_EXPIRE;
-import static org.mvndaemon.mvnd.common.DaemonExpirationStatus.GRACEFUL_EXPIRE;
-import static org.mvndaemon.mvnd.common.DaemonExpirationStatus.IMMEDIATE_EXPIRE;
-import static org.mvndaemon.mvnd.common.DaemonExpirationStatus.QUIET_EXPIRE;
-import static org.mvndaemon.mvnd.daemon.DaemonExpiration.DaemonExpirationResult.NOT_TRIGGERED;
-
/**
* File origin:
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/server/MasterExpirationStrategy.java
@@ -55,7 +58,6 @@ public class DaemonExpiration {
public interface DaemonExpirationStrategy {
DaemonExpirationResult checkExpiration(Server daemon);
-
}
public static DaemonExpirationStrategy master() {
@@ -112,11 +114,11 @@ public class DaemonExpiration {
... 8130 lines suppressed ...
[maven-mvnd] 12/28: Add more discriminating properties to the daemon
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 21383df3040ba21870b4c3a8fd3de2269acdc934
Author: Stefan Oehme <st...@gmail.com>
AuthorDate: Wed Dec 7 17:01:26 2022 +0100
Add more discriminating properties to the daemon
The local repo and maven settings are both used while resolving core extensions,
which happens during daemon startup. Thus these two also need to be discriminating
properties, as the core extensions themselves are discriminating.
---
.../src/main/java/org/mvndaemon/mvnd/common/Environment.java | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
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 6181dc9c..9149eb8f 100644
--- a/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java
+++ b/common/src/main/java/org/mvndaemon/mvnd/common/Environment.java
@@ -94,9 +94,16 @@ public enum Environment {
// Maven properties
//
/** The path to the Maven local repository */
- MAVEN_REPO_LOCAL("maven.repo.local", null, null, OptionType.PATH, Flags.NONE),
+ MAVEN_REPO_LOCAL("maven.repo.local", null, null, OptionType.PATH, Flags.DISCRIMINATING | Flags.OPTIONAL),
/** The location of the maven settings file */
- MAVEN_SETTINGS("maven.settings", null, null, OptionType.PATH, Flags.NONE, "mvn:-s", "mvn:--settings"),
+ MAVEN_SETTINGS(
+ "maven.settings",
+ null,
+ null,
+ OptionType.PATH,
+ Flags.DISCRIMINATING | Flags.OPTIONAL,
+ "mvn:-s",
+ "mvn:--settings"),
/** The pom or directory to build */
MAVEN_FILE(null, null, null, OptionType.PATH, Flags.NONE, "mvn:-f", "mvn:--file"),
/** The root directory of the current multi module Maven project */
[maven-mvnd] 02/28: Upgrade maven-shade-plugin to 3.4.1
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 6e2ba24ed2bd7eb33c48227d9034e8e7015deda4
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Tue Nov 22 13:46:53 2022 +0100
Upgrade maven-shade-plugin to 3.4.1
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 8d2ffec1..b1bd89d5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -78,7 +78,7 @@
<license-maven-plugin.version>3.0</license-maven-plugin.version>
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
<maven-install-plugin.version>2.4</maven-install-plugin.version>
- <maven-shade-plugin.version>3.2.4</maven-shade-plugin.version>
+ <maven-shade-plugin.version>3.4.1</maven-shade-plugin.version>
<mrm.version>1.2.0</mrm.version>
<surefire.version>3.0.0-M5</surefire.version><!-- keep in sync with junit-platform-launcher.version -->
<junit-platform-launcher.version>1.3.2</junit-platform-launcher.version><!-- keep in sync with surefire.version -->
[maven-mvnd] 24/28: Add a mvnd.rawStreams property (#719)
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch mvnd-0.9.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 91f377d70b9fdbec2e694f69b82bd94de8abe65f
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Fri Dec 16 11:33:59 2022 +0100
Add a mvnd.rawStreams property (#719)
---
.../main/java-mvnd/org/mvndaemon/mvnd/client/DefaultClient.java | 5 +++++
common/src/main/java/org/mvndaemon/mvnd/common/Environment.java | 7 ++++++-
daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java | 7 +++++--
dist/src/main/distro/bin/mvnd-bash-completion.bash | 4 ++--
4 files changed, 18 insertions(+), 5 deletions(-)
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 417f17b4..2792652e 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 class DefaultClient implements Client {
return DefaultResult.success(argv);
}
+ // Raw streams
+ if (Environment.MVND_RAW_STREAMS.removeCommandLineOption(args) != null) {
+ args.add("-D" + Environment.MVND_RAW_STREAMS.getProperty());
+ }
+
Optional<String> 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 a7477de0..5ac6185a 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 <code>'glob:**/'</code> 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 9e686c15..214c0196 100644
--- a/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java
+++ b/daemon/src/main/java/org/apache/maven/cli/DaemonMavenCli.java
@@ -318,7 +318,7 @@ public class DaemonMavenCli {
.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;
}
@@ -406,7 +406,10 @@ public class DaemonMavenCli {
// 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 45ffc0d8..102a1ef2 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.no [...]
+ 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.no [...]
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-v [...]