Commit Graph

306 Commits

Author SHA1 Message Date
Guillaume Nodet
09e9f54391 Improve Windows RSS memory retrieval with multiple fallback strategies (#1414)
This commit enhances the Windows RSS memory retrieval functionality in OsUtils
to provide better compatibility and reliability across different Windows versions.

Key improvements:
- Added multiple fallback strategies for Windows RSS retrieval:
  1. PowerShell approach (modern, Windows 7+ with PowerShell 2.0+)
  2. WMIC approach (fallback for older systems)
  3. Tasklist approach (final fallback, most compatible from XP to Win11)

- Enhanced error handling with debug-level logging for memory queries
  to avoid log spam while maintaining visibility for debugging

- Added robust CSV parsing for tasklist output with proper handling
  of quoted fields and comma-separated numbers (e.g., '1,234 K')

- Improved regex pattern matching for memory values that handles
  various formats returned by Windows commands

- Refactored code structure by separating Unix and Windows logic
  into dedicated methods for better maintainability

These changes ensure reliable RSS memory retrieval across all supported
Windows versions while maintaining backward compatibility and improving
error handling.
2025-09-08 15:49:31 +02:00
Guillaume Nodet
6c5dd056fa Next is 2.0.0-rc-4-SNAPSHOT 2025-03-10 16:56:59 +01:00
Guillaume Nodet
f912362c18 [release] Release 2.0.0-rc-3 2025-03-10 16:56:55 +01:00
Tamas Cservenak
c4b5656d19 Bug: extension handling (#1282)
mvnd still had mvn3 like code, just drop it and let base parser
do the work. All the mvnd needs is filtering.

Discriminating based on XML file hashes.

Fixes #1280
2025-03-07 19:02:57 +01:00
Stefan Oehme
bb1191e4c6 Make DaemonRegistry concurrency-safe (#1281)
The previous implementation had two issues:

The memmory-mapped file was created in the constructor and ignored file expansions by other
threads or processes. It would then overwrite the file with its own, smaller size buffer.
Replaced the memory mapping with a regular InputStream/OutputStream approach. Memory mapping
is not very useful in this scenario anyway, since the file is small and infrequently read and
we always read/write the entire file.

The tryLock method was broken and only tried locking once. If the lock could not be acquired,
it returned null and the subsequent code then ignored that fact and proceeded without locking.
I've moved the retry loop and failure handling into the lock method, which gives it the intended
behavior of waiting for a lock for 20s and then failing.

The test expectation for the "big registry" test has changed, since we no longer
manually increase the file size to multiples of two, but instead simply write out
exactly the bytes we need.

I droped the String size requirement, since DataInputStream handles arbitrarly
long Strings. I also changed the exception handling to consistently do recovery
on any kind of exception while reading/writing, since it is reasonable to assume
that any such exception indicates a broken registry file. I've also adjusted the
user-facing message to only tell them to delete the file if recovery fails.
2025-03-07 18:34:44 +01:00
Guillaume Nodet
9e32662401 Refactor input stream support (fixes #1257) (#1268) 2025-02-17 23:12:16 +01:00
Guillaume Nodet
4f4e05f973 Cleanup BufferHelper for JDK 17+ (fixes #1261) (#1267) 2025-02-17 23:11:40 +01:00
Tamas Cservenak
2606a78f46 Align to 2.0.0-rc-3-SNAPSHOT
Same as Maven master
2024-12-17 14:34:46 +01:00
Jermaine Hua
7b309de9ab Support core extension more configuration (#1216)
Fixes #1163

Signed-off-by: crazyhzm <crazyhzm@apache.org>
2024-12-17 13:50:43 +01:00
Guillaume Nodet
c8fc604504 Next is 2.0.0-rc-2-SNAPSHOT 2024-11-26 10:14:09 +01:00
Guillaume Nodet
39127a4669 [release] Release 2.0.0-rc-1 2024-11-26 10:14:05 +01:00
Guillaume Nodet
083a28b7af Fixes --verbose/--debug options (fixes #1208) 2024-11-26 10:02:05 +01:00
Guillaume Nodet
dade78541c Upgrade to 4.0.0-rc-1 (fixes #1203 and #1204)
# Conflicts:
#	pom.xml
2024-11-26 10:02:05 +01:00
Guillaume Nodet
a070d0c07d Fix color option 2024-11-26 10:02:05 +01:00
Tamas Cservenak
64c0a8fdf4 Fix log ordering
nano time is not enough, rather use a "sequence"
2024-11-26 10:02:05 +01:00
Guillaume Nodet
9f0537a681 Do not display client environment unless specifically asked for 2024-11-26 10:02:05 +01:00
Guillaume Nodet
72b7365e21 Upgrade to Maven 4.0.0-beta-5 (#1187) 2024-11-07 19:11:26 +01:00
Guillaume Nodet
a032544164 Improve log and leverage the new infrastructure in Maven (#1164) 2024-10-15 18:15:15 +02:00
Tamas Cservenak
69e7232ae7 Next is 2.0.0-beta-2-SNAPSHOT 2024-06-20 18:09:45 +02:00
Tamas Cservenak
74cdaf62b2 [release] Release 2.0.0-beta-1 2024-06-20 18:09:44 +02:00
Tamas Cservenak
ef981d5f5b Client diag option, GraalVM updates (#1042)
Changes:
* add client --diag option
* update graalvm toolchain
* update GH actions
2024-06-20 17:54:54 +02:00
Tamas Cservenak
952a67450b mixup in case of DISPLAY messages type (#1038)
ProjectEvent message mixup fixed.

Fixes #1036
2024-06-20 09:01:29 +02:00
Tamas Cservenak
7caba4d555 Next is 2.0.0-beta-2-SNAPSHOT 2024-06-18 09:11:12 +02:00
Tamas Cservenak
3f5b472022 [release] Release 2.0.0-beta-1 2024-06-18 09:11:10 +02:00
Tamas Cservenak
bc61f6441e [2.x] Pre-release tidy-up (#1011)
Changes:
* no source change
* (build) expel all versions from child modules: they must be all top level depMgmt or pluginMgmt
* (build) Top POM contains GAVs while child modules GA+scope. This tremendously simplifies maintenance.
* (javadoc) fix Javadoc errors
* (build) remove obsolete profiles and mr-JARs, project is 17+

Updates:
* maven wrapper 3.3.2 w/ scripts
2024-06-13 10:05:16 +02:00
Guillaume Nodet
42b230c10c Upgrade to Maven 4.0.0-beta-1 (#974) 2024-05-03 21:10:04 +02:00
Guillaume Nodet
a6b275db59 Split Maven 3 and 4 support and switch to version 2.0-SNAPSHOT (fixes #973) (#970) 2024-04-26 10:38:39 +02:00
Peter Palaga
73bfecb19e Make TerminalOutput.pathToMaven() more robust to avoid #929 2024-04-25 16:49:35 +02:00
Tamas Cservenak
d23e0e88f6 Update to parent POM 42 (#932)
Changes:
* parent POM 42
* unset release where needed (makes com.sun pkg unreachable)
* explicitly index as parent disables "implicit" AP
* remove redundtant stuff
* update dependabot to take care of workflow as well (as mvnd uses own)
2024-04-18 19:40:05 +02:00
Tamas Cservenak
a1ac6660ec Ignore smart-builder core extension, if present. (#916)
Add new daemon param to ignore some extensions, make default to ignore takari-smart-builder as it is used by mvnd itself as well.

Fixes #912
2024-04-17 22:04:35 +02:00
Guillaume Nodet
f05de78d08 Next is 1.0-m9-SNAPSHOT 2023-10-26 07:45:20 +02:00
Guillaume Nodet
0f4bdb6df5 [release] Release 1.0-m8 2023-10-26 07:45:11 +02:00
Guillaume Nodet
acf64a7fab Small improvements to DaemonPrompter (#898) 2023-10-25 17:03:24 +02:00
Guillaume Nodet
15d622e185 Next is 1.0-m8-SNAPSHOT 2023-07-11 07:13:39 +02:00
Guillaume Nodet
b2ef5d8199 [release] Release 1.0-m7 2023-07-11 06:59:21 +02:00
Guillaume Nodet
f8adf1b770 Switch to slf4j simple logger (fixes #835) (#868) 2023-07-10 15:16:32 +02:00
Peter Palaga
7d9a39be1a JAVA_HOME should be documented as discriminating #852 2023-05-23 17:30:31 +02:00
Peter Palaga
c177fe220e {@link } JavaDoc refs missing in the output of mvnd --help 2023-05-22 13:35:32 +02:00
Guillaume Nodet
538a5c1369 Next is 1.0-m7-SNAPSHOT 2023-03-23 10:16:45 +01:00
Guillaume Nodet
47d4c6b9c3 [release] Release 1.0-m6 2023-03-23 09:59:27 +01:00
Guillaume Nodet
34b7ee35cf Next is 1.0-m6-SNAPSHOT 2023-03-22 08:58:41 +01:00
Guillaume Nodet
71146dab82 [release] Release 1.0-m5 2023-03-22 08:58:28 +01:00
Guillaume Nodet
89e41a23ec Use system out for build log and sys err for in progress display, fixes #822 (#824) 2023-03-21 14:33:51 +01:00
Guillaume Nodet
4d24010f55 Prompter prompt should not prepend the projectId when there's only one project, fixes #816
Also make sure the daemon prompter log only goes to the daemon log
2023-03-14 13:52:47 +01:00
Petr Široký
e1815e52a3 Minor clean-up in OsUtils
* fix typo in method names
 * add a test for the other *toHumanReadable method
 * replace StringBuilder usage with simple concatenation
   where applicable (for fixed length strings)
2023-03-12 23:08:32 +01:00
Petr Široký
3657375e97 Use String.join() instead of Collectors.joining() where applicable
* the String.join() is more readable and there should not be any
   downsides (like performance or so)
2023-03-12 23:08:32 +01:00
Petr Široký
50653ae7d9 logging: use format specifiers instead of string concatenation 2023-03-12 23:08:32 +01:00
Stefan Oehme
0b55c8f3e6 Add property to disable model caching
This is mostly for the integration tests of the Gradle Enterprise Maven extension,
which heavily test dependency resolution and reuse the same GAVs in many test,
e.g. a🅱️1.0. It would be a lot of effort to rewrite all those tests and a shame
to restart the daemon every time. So I wanted to ask if you'd consider this flag
to disable the caching altogether.
2023-03-02 22:42:36 +01:00
Stefan Oehme
1bcfc29d45 Make Classworld setup more alike to vanilla Maven (#784)
Use the plexus Launcher to start the daemon server, just like we would
launch a normal Maven process.

This improves compatibility with any extensions or plugins that assume that
their ClassLoader is a ClassRealm.
2023-02-14 17:06:34 +01:00
Guillaume Nodet
11c6567bdd Next is 1.0.0-m5-SNAPSHOT 2023-01-28 14:41:03 +01:00