[ 
https://issues.apache.org/jira/browse/MNG-7733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James Nord updated MNG-7733:
----------------------------
    Description: 
I have a settings file in my home directory (~/.m2/settings.xml) that works 
fine with maven 3.x

containing

{code}
  <mirrors>
    <mirror>
      <id>myco-internal</id>
      <mirrorOf>external:*</mirrorOf>
      <url>https://nexus-cache.mycorp.com/content/groups/staged</url>
    </mirror>
  </mirrors>
{code}

with maven 4.0.0-alpha4 when building a project it will fail in dependency 
resolution due to the `maven-default-http-blocker` mirror.


{noformat}
unable to create flattened dependencies: caught exception when flattening 
dependencies: Failed to read artifact descriptor for 
javax.servlet:javax.servlet-api::3.1.0: Could not transfer artifact 
net.java:jvnet-parent:pom:3 from/to maven-default-http-blocker 
(http://0.0.0.0/): Blocked mirror for repositories: [glassfish-repository 
(http://download.java.net/maven/glassfish, default, releases+snapshots)] -
{noformat}


However I expect that my user settings should override global settings.

as `external:*` used in my local settings should also match anything that is 
matched by `external:http:*` in the global settings I would not expect that the 
global settings mirror would be used.

However this is infact the case.

if I use --global-settings to specify my local settings file then the builds 
work

Additionally changing my mirror defintion to be 
{{<mirrorOf>external:*,external:http:*</mirrorOf>}} still does not work


initial output from {{mvn -x install}}

{noformat}
[DEBUG] Reading global settings from 
'c:\java\maven-4.0.0-alpha-4\conf\settings.xml'
[DEBUG] Reading user settings from 'C:\Users\me\.m2\settings.xml'
[DEBUG] Created adapter factory; available factories [file-lock, rwlock-local, 
semaphore-local, noop]; available name mappers [discriminating, file-gav, 
file-hgav, gav, static]
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for 
C:\Users\me\.m2\repository
[DEBUG] Creating adapter using nameMapper 'gav' and factory 'rwlock-local'
[DEBUG] Using mirror myco-internal 
(https://nexus-cache.mycorp.com/content/groups/staged) for central 
(https://repo.maven.apache.org/maven2).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for 
apache.snapshots (http://repository.apache.org/snapshots).
[DEBUG] Using mirror myco-internal 
(https://nexus-cache.mycorp.com/content/groups/staged) for apache.snapshots 
(https://repository.apache.org/snapshots).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for 
codehaus.snapshots (http://snapshots.repository.codehaus.org).
[DEBUG] Using mirror myco-internal 
(https://nexus-cache.mycorp.com/content/groups/staged) for 
sonatype-nexus-snapshots 
(https://oss.sonatype.org/content/repositories/snapshots).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for 
repository.jboss.org (http://repository.jboss.org/maven2).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for 
snapshots.jboss.org (http://snapshots.jboss.org/maven2).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for 
oss.sonatype.org/jboss-snapshots 
(http://oss.sonatype.org/content/repositories/jboss-snapshots).
[DEBUG] Using mirror myco-internal 
(https://nexus-cache.mycorp.com/content/groups/staged) for jgit-repository 
(https://repo.eclipse.org/content/repositories/jgit-releases/).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for spy 
(http://files.couchbase.com/maven2/).
{noformat}

  was:
I have a settings file in my home directory (~/.m2/settings.xml) that works 
fine with maven 3.x

containing

{code}
  <mirrors>
    <mirror>
      <id>myco-internal</id>
      <mirrorOf>external:*</mirrorOf>
      <url>https://nexus-cache.mycorp.com/content/groups/staged</url>
    </mirror>
  </mirrors>
{code}

with maven 4.0.0-alpha4 when building a project it will fail in dependency 
resolution due to the `maven-default-http-blocker` mirror.


{noformat}
unable to create flattened dependencies: caught exception when flattening 
dependencies: Failed to read artifact descriptor for 
javax.servlet:javax.servlet-api::3.1.0: Could not transfer artifact 
net.java:jvnet-parent:pom:3 from/to maven-default-http-blocker 
(http://0.0.0.0/): Blocked mirror for repositories: [glassfish-repository 
(http://download.java.net/maven/glassfish, default, releases+snapshots)] -
{noformat}


However I expect that my user settings should override global settings.

as `external:*` used in my local settings should also match anything that is 
matched by `external:http:*` in the global settings I would not expect that the 
global settings mirror would be used.

However this is infact the case.

if I use --global-settings to specify my local settings file then the builds 
work

Additionally changing my mirror defintion to be 
{{<mirrorOf>external:*,external:http:*</mirrorOf>}} still does not work


> maven4 user settings mirrorOf-external:* does not override global settings 
> external:http:* 
> -------------------------------------------------------------------------------------------
>
>                 Key: MNG-7733
>                 URL: https://issues.apache.org/jira/browse/MNG-7733
>             Project: Maven
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 4.0.0-alpha-4
>            Reporter: James Nord
>            Priority: Major
>
> I have a settings file in my home directory (~/.m2/settings.xml) that works 
> fine with maven 3.x
> containing
> {code}
>   <mirrors>
>     <mirror>
>       <id>myco-internal</id>
>       <mirrorOf>external:*</mirrorOf>
>       <url>https://nexus-cache.mycorp.com/content/groups/staged</url>
>     </mirror>
>   </mirrors>
> {code}
> with maven 4.0.0-alpha4 when building a project it will fail in dependency 
> resolution due to the `maven-default-http-blocker` mirror.
> {noformat}
> unable to create flattened dependencies: caught exception when flattening 
> dependencies: Failed to read artifact descriptor for 
> javax.servlet:javax.servlet-api::3.1.0: Could not transfer artifact 
> net.java:jvnet-parent:pom:3 from/to maven-default-http-blocker 
> (http://0.0.0.0/): Blocked mirror for repositories: [glassfish-repository 
> (http://download.java.net/maven/glassfish, default, releases+snapshots)] -
> {noformat}
> However I expect that my user settings should override global settings.
> as `external:*` used in my local settings should also match anything that is 
> matched by `external:http:*` in the global settings I would not expect that 
> the global settings mirror would be used.
> However this is infact the case.
> if I use --global-settings to specify my local settings file then the builds 
> work
> Additionally changing my mirror defintion to be 
> {{<mirrorOf>external:*,external:http:*</mirrorOf>}} still does not work
> initial output from {{mvn -x install}}
> {noformat}
> [DEBUG] Reading global settings from 
> 'c:\java\maven-4.0.0-alpha-4\conf\settings.xml'
> [DEBUG] Reading user settings from 'C:\Users\me\.m2\settings.xml'
> [DEBUG] Created adapter factory; available factories [file-lock, 
> rwlock-local, semaphore-local, noop]; available name mappers [discriminating, 
> file-gav, file-hgav, gav, static]
> [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for 
> C:\Users\me\.m2\repository
> [DEBUG] Creating adapter using nameMapper 'gav' and factory 'rwlock-local'
> [DEBUG] Using mirror myco-internal 
> (https://nexus-cache.mycorp.com/content/groups/staged) for central 
> (https://repo.maven.apache.org/maven2).
> [DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for 
> apache.snapshots (http://repository.apache.org/snapshots).
> [DEBUG] Using mirror myco-internal 
> (https://nexus-cache.mycorp.com/content/groups/staged) for apache.snapshots 
> (https://repository.apache.org/snapshots).
> [DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for 
> codehaus.snapshots (http://snapshots.repository.codehaus.org).
> [DEBUG] Using mirror myco-internal 
> (https://nexus-cache.mycorp.com/content/groups/staged) for 
> sonatype-nexus-snapshots 
> (https://oss.sonatype.org/content/repositories/snapshots).
> [DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for 
> repository.jboss.org (http://repository.jboss.org/maven2).
> [DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for 
> snapshots.jboss.org (http://snapshots.jboss.org/maven2).
> [DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for 
> oss.sonatype.org/jboss-snapshots 
> (http://oss.sonatype.org/content/repositories/jboss-snapshots).
> [DEBUG] Using mirror myco-internal 
> (https://nexus-cache.mycorp.com/content/groups/staged) for jgit-repository 
> (https://repo.eclipse.org/content/repositories/jgit-releases/).
> [DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for spy 
> (http://files.couchbase.com/maven2/).
> {noformat}



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

Reply via email to