slachiewicz opened a new pull request, #1151:
URL: https://github.com/apache/maven-plugin-tools/pull/1151

   `maven-plugin-tools-api` had a compile dependency on `wagon-provider-api` 
for two classes. Its own comment said what for:
   
   ```xml
   <!-- wagon for proxy related classes -->
   ```
   
   The entire use was building a `ProxyInfo` as a carrier for one string and 
passing it to `ProxyUtils.validateNonProxyHosts`:
   
   ```java
   ProxyInfo proxyInfo = new ProxyInfo();
   proxyInfo.setNonProxyHosts(activeProxy.getNonProxyHosts());
   
   if (StringUtils.isNotEmpty(activeProxy.getHost())
           && (url == null || !ProxyUtils.validateNonProxyHosts(proxyInfo, 
url.getHost()))) {
   ```
   
   The matching is a handful of lines with nothing Maven-specific in it — split 
on `|`, treat `*` as a wildcard and escape `.` — so it is done here and the 
dependency goes. Nothing else in plugin-tools touches Wagon.
   
   Tests cover the four things worth pinning: an exact host, the wildcard with 
its escaped dot (so `*.example.com` must not match `docsXexample.com`), the 
pipe separator, and the null cases.
   
   ### Verification
   
   `mvn -pl maven-plugin-tools-api test`: 44 tests before, 48 after — same 44 
plus the 4 new ones, 0 failures throughout.
   
   ### Background
   
   This came out of a survey of how Maven projects actually depend on Wagon. 
Three projects used `wagon-provider-api` purely as a utility library rather 
than as a transport. This is one; apache/maven-javadoc-plugin#1354 is the 
second.
   
   The third, maven-jxr-plugin, is deliberately **not** being changed. It uses 
`Repository` to split a site URL into host and basedir, and Wagon's own source 
explains why that cannot move to `java.net.URI`:
   
   > can't use URL class as is because it won't recognise our protocols
   
   Site URLs are routinely `scp://` or `dav:https://`, so that parsing is 
genuinely Wagon's job.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to