elharo opened a new issue, #167:
URL: https://github.com/apache/maven-resolver-ant-tasks/issues/167
## Summary
`Settings.getGlobalFile()` delegates to `getRef().getFile()` instead of
`getRef().getGlobalFile()`, so a `<settings refid="...">` returns the wrong
(user) settings file when the global settings path is requested.
## Affected code
`src/main/java/org/apache/maven/resolver/internal/ant/types/Settings.java`
lines 119-124 (master @ `df2908e`)
```java
public File getGlobalFile() {
if (isReference()) {
return getRef().getFile();
}
return globalFile;
}
```
## Problem
When `Settings` is used as a reference, `getGlobalFile()` returns the
referenced instance's **user** settings file instead of its global settings
file. `getFile()` (lines 92-97) correctly delegates to `getRef().getFile()`,
but `getGlobalFile()` wrongly calls `getRef().getFile()` as well.
## Expected behavior
```java
public File getGlobalFile() {
if (isReference()) {
return getRef().getGlobalFile();
}
return globalFile;
}
```
## Impact
Any caller asking for the global settings file of a referenced `<settings>`
element gets the wrong file (or `null`), silently losing global
mirrors/proxies/server configuration.
--
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]