Important
Version 2.0.00 is a complete overhaul of the library. The Apache CXF / SMBJ stack is gone, replaced by a purpose-built WSMan client with zero runtime dependencies, a new fluent WinRMClient API, and a full command-line interface shipped as a standalone executable JAR. Java 11+, as before.
πͺΆ Zero runtime dependencies
- The dependency-free "light" WinRM backend β introduced behind a toggle in #109 β is now the only implementation (#127). No more CXF, Jakarta XML, HttpComponents or SMBJ on your classpath, and no more JAXP/classloader conflicts when embedding the library in larger applications.
- File uploads no longer use SMB: files are transferred through the WinRM command shell itself (#120), so only the WinRM port (5985/5986) is needed β port 445 can stay closed.
- Fixed along the way: the CXF thread leak on
WinRMServiceclose (#85) and offline WSDL schema resolution (#82), for those who tracked these issues on the 1.x backend.
β¨ New fluent WinRMClient API
One client authenticates once and runs any number of WQL queries and commands over the same connection (#133):
try (WinRMClient client = WinRMClient.builder("server01.acme.com")
.credentials("ACME\\admin", password)
.build()) {
CommandResult result = client.command("ipconfig /all").run();
QueryResult processes = client.wql("SELECT Name FROM Win32_Process").run();
}- Typed results and an unchecked
WinRMClientExceptionhierarchy:WinRMAuthenticationException,WinRMFaultException(with WSMan fault code and detail),WinRMTimeoutException,WqlSyntaxException. - Streaming terminals:
stream()andstart()return a liveRemoteProcessto consume stdout/stderr as the command runs (#134). - stdin and interactive sessions:
stdin()builders andRemoteProcess.stdin()(#144). - Command output is decoded as UTF-8 β the library no longer guesses the remote code page (#143).
The 1.x entry points (WinRMWqlExecutor, WinRMCommandExecutor, β¦) still work β see the breaking changes below for the few behavioral differences.
π₯οΈ New: command-line interface
winrm-java-2.0.00-standalone.jar is a single executable JAR (#118) with wql, command, upload and an interactive shell subcommand (#144) β NTLM or Kerberos, HTTP or HTTPS. See the CLI manual.
java -jar winrm-java-2.0.00-standalone.jar -h server01 -u 'ACME\admin' -pf pwd.txt command ipconfigβ οΈ Breaking changes when upgrading from 1.x
- TLS certificates are now validated (the CXF client silently trusted everything). HTTPS connections to hosts with self-signed certificates fail during the handshake unless you add the certificate (or its CA) to a Java trust store, or disable validation with
-Dorg.metricshub.winrm.tls.insecure=true(testing only). - Collections returned by
WinRMWqlExecutor.getHeaders()/getRows()andWqlQuery.getSelectedProperties()/getSubPropertiesMap()are now unmodifiable views β copy before mutating. - The remote transfer directory is renamed from
SEN_ShareFor_<HOST>$to<windir>\Temp\winrm-upload-<HOST>(#151). Old directories are not reused or cleaned up, the SMB share created byWindowsTempShare.getOrCreateShare(...)is no longer hidden (no trailing$), and generated file names now use thewinrm-prefix instead ofSEN_. - A few CXF/SMB-only public types were removed with the legacy backend.
The full migration notes are in the README.
π Documentation
- The documentation site was rewritten from scratch (#125): authentication, TLS, timeouts and errors, and the CLI manual.
- New Preparing the Windows Host guide (#149): required privileges, why local administrator accounts are often denied, non-admin configuration, and a troubleshooting table.
π§ Under the hood
- The build is now gated on all quality checks, with every SpotBugs, PMD and CPD finding fixed (#126, #129, #130 β thanks @anuragpaul602-netizen).
- Mockito is gone: tests run against fakes and a
FakeWsmanServer(#132), and the project builds on modern JDKs. - Prettier was replaced by formatter-maven-plugin (#114).
New Contributors
- @NassimBtk made their first contribution in #76
- @ivanmerkish made their first contribution in #82
- @bertysentry made their first contribution in #85 (with @Copilot)
- @anuragpaul602-netizen made their first contribution in #127
Full Changelog: v1.1.02...v2.0.00