[ 
https://issues.apache.org/jira/browse/MNG-6763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17761811#comment-17761811
 ] 

dennis lucero edited comment on MNG-6763 at 9/4/23 12:40 PM:
-------------------------------------------------------------

The "Remote Repository Filtering" feature using 
[prefixes|https://maven.apache.org/resolver/remote-repository-filtering.html#The_Prefixes_Filter]
 (introduced with Maven Resolver 1.9.0/Maven 3.9.0) works well and avoids the 
unnecessary requests I complained about. Big thanks to everyone involved in the 
implementation.

However, there would still be value in the ability to specify such prefix 
filters directly in the settings.xml as it is a bit cumbersome to configure and 
enable such prefixes using the resolver. Maven needs to be called with the 
correct parameters (- Daether.remoteRepositoryFilter.prefixes=true) and 
additional files (prefixes-*.txt) and their parent directories have to be 
created at specific paths. The installation on a workstation only needs this 
once, but when writing (Docker) containers it's easy to forget something or 
make a mistake (e. g. writing the prefix filters to a wrong directory). It 
would be much easier to configure and to review these filters if they were 
specified at the same location where the repositories are configured, that is 
the settings.xml.


was (Author: striderapache):
The "Remote Repository Filtering" feature using 
[prefixes|https://maven.apache.org/resolver/remote-repository-filtering.html#The_Prefixes_Filter]
 (introduced with Maven Resolver 1.9.0/Maven 3.9.0) works well and avoids the 
unnecessary requests I complained about. Big thanks to everyone involved in the 
implementation.

However, there would still be value in the ability to specify such prefix 
filters directly in the settings.xml as it is a bit cumbersome to configure and 
enable such prefixes using the resolver. Maven needs to be called with the 
correct parameters (-​Daether.remoteRepositoryFilter.prefixes=true) and 
additional files (prefixes-*.txt) and their parent directories have to be 
created at specific paths. The installation on a workstation only needs this 
once, but when writing (Docker) containers it's easy to forget something or 
make a mistake (e. g. writing the prefix filters to a wrong directory). It 
would be much easier to configure and to review these filters if they were 
specified at the same location where the repositories are configured, that is 
the settings.xml.

> Restrict repositories to specific groupIds
> ------------------------------------------
>
>                 Key: MNG-6763
>                 URL: https://issues.apache.org/jira/browse/MNG-6763
>             Project: Maven
>          Issue Type: New Feature
>            Reporter: dennis lucero
>            Priority: Major
>              Labels: intern
>
> It should be possible to restrict the repositories specified in settings.xml 
> to specific groupIds. Looking at 
> [https://maven.apache.org/ref/3.6.2/maven-settings/settings.html#class_repository],
>  it seems this is currently not the case.
> Background: We use Nexus to host our own artifacts. The settings.xml contains 
> our Nexus repository with <updatePolicy>always</updatePolicy> because 
> sometimes a project is built while a dependency is not yet in our Nexus repo 
> – without updatePolicy, it would take 24 hours or manual deletion of metadata 
> to make Maven re-check for the missing dependency.
> Additionally, we use versions-maven-plugin:2.7:display-dependency-updates in 
> our build process.
> This results in lots of queries (more than 300 in a simple Dropwizard 
> project) to our repo which will never succeed. If we could specify that our 
> repo only supplies groupIds beginning with org.example, Maven could skip 
> update checks for groupIds starting with com.fasterxml.jackson and so on, 
> speeding up the build process.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to