yeikel opened a new issue, #396:
URL: https://github.com/apache/maven-wrapper/issues/396
### New feature, improvement proposal
In the current Maven Wrapper plugin implementation, mirrors are only used
when the mirror is configured with `mirrorOf=*`. That means that a mirror like
`mirrorOf=central` is not picked up by the plugin today, even though it is a
common Maven pattern.
From what I've seen, it is often less common to mirror everything with `*`,
because teams usually want tighter control over which repositories are
redirected and a blanket mirror can unintentionally override internal
repositories or other configured remotes, while a targeted mirror such as
`central` is more explicit and safer to manage.
Since this project is primarily published to Maven Central, I think that it
would make sense to extend the current logic to also detect and apply a
`central` mirror when available.
For example, this configuration does not work right now:
```xml
<settings>
<mirrors>
<mirror>
<id>central-mirror</id>
<url>https://maven-central.storage.googleapis.com/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
</settings>
```
Instead, users are expected to configure it as:
```xml
<settings>
<mirrors>
<mirror>
<id>central-mirror</id>
<url>https://maven-central.storage.googleapis.com/maven2</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
</settings>
```
## Relevant snippet that can be updated
https://github.com/apache/maven-wrapper/blob/92da30cd3931c20ec9bf342e42785082279d003d/maven-wrapper-plugin/src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java#L398-L401
## Suggested change
```java
if ("*".equals(current.getMirrorOf() ||
"central".equals(current.getMirrorOf())) {
getLog().debug("Using repo URL from * mirror in settings
file.");
return current.getUrl();
}
```
## Note to maintainers
Given that this is a small-enough change, if the future request is accepted,
I'd be happy to send a patch
--
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]