mirror of https://github.com/apache/maven.git
[MNG-4367] Consider layout for mirror selection
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@818442 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4648efa59b
commit
f4bd89f38d
|
@ -181,7 +181,7 @@ END SNIPPET: ant-bootstrap -->
|
||||||
<modello file="maven-model/src/main/mdo/maven.mdo" version="4.0.0" />
|
<modello file="maven-model/src/main/mdo/maven.mdo" version="4.0.0" />
|
||||||
<modello file="maven-plugin-api/src/main/mdo/lifecycle.mdo" />
|
<modello file="maven-plugin-api/src/main/mdo/lifecycle.mdo" />
|
||||||
<modello file="maven-model-builder/src/main/mdo/profiles.mdo" />
|
<modello file="maven-model-builder/src/main/mdo/profiles.mdo" />
|
||||||
<modello file="maven-compat/src/main/mdo/settings.mdo" />
|
<modello file="maven-compat/src/main/mdo/settings.mdo" version="1.1.0" />
|
||||||
<modello file="maven-core/src/main/mdo/toolchains.mdo" />
|
<modello file="maven-core/src/main/mdo/toolchains.mdo" />
|
||||||
<modello file="maven-compat/src/main/mdo/metadata.mdo" />
|
<modello file="maven-compat/src/main/mdo/metadata.mdo" />
|
||||||
<modello file="maven-compat/src/main/mdo/profiles.mdo" />
|
<modello file="maven-compat/src/main/mdo/profiles.mdo" />
|
||||||
|
|
|
@ -79,9 +79,24 @@
|
||||||
<model>src/main/mdo/metadata.mdo</model>
|
<model>src/main/mdo/metadata.mdo</model>
|
||||||
<model>src/main/mdo/profiles.mdo</model>
|
<model>src/main/mdo/profiles.mdo</model>
|
||||||
<model>src/main/mdo/paramdoc.mdo</model>
|
<model>src/main/mdo/paramdoc.mdo</model>
|
||||||
<model>src/main/mdo/settings.mdo</model>
|
|
||||||
</models>
|
</models>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>settings</id>
|
||||||
|
<goals>
|
||||||
|
<goal>java</goal>
|
||||||
|
<goal>xpp3-reader</goal>
|
||||||
|
<goal>xpp3-writer</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<version>1.1.0</version>
|
||||||
|
<models>
|
||||||
|
<model>src/main/mdo/settings.mdo</model>
|
||||||
|
</models>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
|
@ -26,6 +26,7 @@ import java.util.List;
|
||||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||||
import org.apache.maven.settings.Mirror;
|
import org.apache.maven.settings.Mirror;
|
||||||
import org.codehaus.plexus.component.annotations.Component;
|
import org.codehaus.plexus.component.annotations.Component;
|
||||||
|
import org.codehaus.plexus.util.StringUtils;
|
||||||
|
|
||||||
@Component( role = MirrorSelector.class )
|
@Component( role = MirrorSelector.class )
|
||||||
public class DefaultMirrorSelector
|
public class DefaultMirrorSelector
|
||||||
|
@ -44,7 +45,7 @@ public class DefaultMirrorSelector
|
||||||
{
|
{
|
||||||
for ( Mirror mirror : mirrors )
|
for ( Mirror mirror : mirrors )
|
||||||
{
|
{
|
||||||
if ( repoId.equals( mirror.getMirrorOf() ) )
|
if ( repoId.equals( mirror.getMirrorOf() ) && matchesLayout( repository, mirror ) )
|
||||||
{
|
{
|
||||||
return mirror;
|
return mirror;
|
||||||
}
|
}
|
||||||
|
@ -52,7 +53,7 @@ public class DefaultMirrorSelector
|
||||||
|
|
||||||
for ( Mirror mirror : mirrors )
|
for ( Mirror mirror : mirrors )
|
||||||
{
|
{
|
||||||
if ( matchPattern( repository, mirror.getMirrorOf() ) )
|
if ( matchPattern( repository, mirror.getMirrorOf() ) && matchesLayout( repository, mirror ) )
|
||||||
{
|
{
|
||||||
return mirror;
|
return mirror;
|
||||||
}
|
}
|
||||||
|
@ -139,4 +140,63 @@ public class DefaultMirrorSelector
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static boolean matchesLayout( ArtifactRepository repository, Mirror mirror )
|
||||||
|
{
|
||||||
|
return matchesLayout( repository.getLayout().getId(), mirror.getMirrorOfLayouts() );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the layouts configured for a mirror match with the layout of the repository.
|
||||||
|
*
|
||||||
|
* @param repoLayout The layout of the repository, may be {@code null}.
|
||||||
|
* @param mirrorLayout The layouts supported by the mirror, may be {@code null}.
|
||||||
|
* @return {@code true} if the layouts associated with the mirror match the layout of the original repository,
|
||||||
|
* {@code false} otherwise.
|
||||||
|
*/
|
||||||
|
static boolean matchesLayout( String repoLayout, String mirrorLayout )
|
||||||
|
{
|
||||||
|
boolean result = false;
|
||||||
|
|
||||||
|
// simple checks first to short circuit processing below.
|
||||||
|
if ( StringUtils.isEmpty( mirrorLayout ) || WILDCARD.equals( mirrorLayout ) )
|
||||||
|
{
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
else if ( mirrorLayout.equals( repoLayout ) )
|
||||||
|
{
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// process the list
|
||||||
|
String[] layouts = mirrorLayout.split( "," );
|
||||||
|
for ( String layout : layouts )
|
||||||
|
{
|
||||||
|
// see if this is a negative match
|
||||||
|
if ( layout.length() > 1 && layout.startsWith( "!" ) )
|
||||||
|
{
|
||||||
|
if ( layout.substring( 1 ).equals( repoLayout ) )
|
||||||
|
{
|
||||||
|
// explicitly exclude. Set result and stop processing.
|
||||||
|
result = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// check for exact match
|
||||||
|
else if ( layout.equals( repoLayout ) )
|
||||||
|
{
|
||||||
|
result = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if ( WILDCARD.equals( layout ) )
|
||||||
|
{
|
||||||
|
result = true;
|
||||||
|
// don't stop processing in case a future segment explicitly excludes this repo
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -474,6 +474,12 @@ public class LegacyRepositorySystem
|
||||||
{
|
{
|
||||||
repository.setId( mirror.getId() );
|
repository.setId( mirror.getId() );
|
||||||
repository.setUrl( mirror.getUrl() );
|
repository.setUrl( mirror.getUrl() );
|
||||||
|
|
||||||
|
ArtifactRepositoryLayout layout = layouts.get( mirror.getLayout() );
|
||||||
|
if ( layout != null )
|
||||||
|
{
|
||||||
|
repository.setLayout( layout );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,14 +46,14 @@
|
||||||
<classes>
|
<classes>
|
||||||
<class java.clone="deep">
|
<class java.clone="deep">
|
||||||
<name>TrackableBase</name>
|
<name>TrackableBase</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
common base class that contains code to track the source for
|
common base class that contains code to track the source for
|
||||||
this instance (USER|GLOBAL)
|
this instance (USER|GLOBAL)
|
||||||
</description>
|
</description>
|
||||||
<codeSegments>
|
<codeSegments>
|
||||||
<codeSegment>
|
<codeSegment>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<code>
|
<code>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
public static final String USER_LEVEL = "user-level";
|
public static final String USER_LEVEL = "user-level";
|
||||||
|
@ -91,7 +91,7 @@
|
||||||
<class>
|
<class>
|
||||||
<name>IdentifiableBase</name>
|
<name>IdentifiableBase</name>
|
||||||
<superClass>TrackableBase</superClass>
|
<superClass>TrackableBase</superClass>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
Base class for <code>Mirror</code>, <code>Profile</code>, <code>Proxy</code> and <code>Server</code>.
|
Base class for <code>Mirror</code>, <code>Profile</code>, <code>Proxy</code> and <code>Server</code>.
|
||||||
|
@ -99,7 +99,7 @@
|
||||||
<fields>
|
<fields>
|
||||||
<field>
|
<field>
|
||||||
<name>id</name>
|
<name>id</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<defaultValue>default</defaultValue>
|
<defaultValue>default</defaultValue>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
|
@ -108,7 +108,7 @@
|
||||||
</class>
|
</class>
|
||||||
<class rootElement="true" xml.tagName="settings">
|
<class rootElement="true" xml.tagName="settings">
|
||||||
<name>Settings</name>
|
<name>Settings</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<superClass>TrackableBase</superClass>
|
<superClass>TrackableBase</superClass>
|
||||||
<description>
|
<description>
|
||||||
Root element of the user configuration file.
|
Root element of the user configuration file.
|
||||||
|
@ -116,7 +116,7 @@
|
||||||
<fields>
|
<fields>
|
||||||
<field>
|
<field>
|
||||||
<name>localRepository</name>
|
<name>localRepository</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
@ -127,7 +127,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>interactiveMode</name>
|
<name>interactiveMode</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
Whether Maven should attempt to interact with the user for input.
|
Whether Maven should attempt to interact with the user for input.
|
||||||
|
@ -138,7 +138,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>usePluginRegistry</name>
|
<name>usePluginRegistry</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
Whether Maven should use the plugin-registry.xml file to manage plugin versions.
|
Whether Maven should use the plugin-registry.xml file to manage plugin versions.
|
||||||
|
@ -150,14 +150,14 @@
|
||||||
<!-- [JC] Not ready to use yet, so I'm making if unavailable for now. -->
|
<!-- [JC] Not ready to use yet, so I'm making if unavailable for now. -->
|
||||||
<!-- field>
|
<!-- field>
|
||||||
<name>passwordStore</name>
|
<name>passwordStore</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<required>false</required>
|
<required>false</required>
|
||||||
<description><![CDATA[The keystore used to store passwords.]]></description>
|
<description><![CDATA[The keystore used to store passwords.]]></description>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
</field -->
|
</field -->
|
||||||
<field>
|
<field>
|
||||||
<name>offline</name>
|
<name>offline</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<required>false</required>
|
<required>false</required>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
@ -170,7 +170,7 @@
|
||||||
<!-- [JC] Not ready to use yet, so I'm making if unavailable for now. -->
|
<!-- [JC] Not ready to use yet, so I'm making if unavailable for now. -->
|
||||||
<!-- field>
|
<!-- field>
|
||||||
<name>jdks</name>
|
<name>jdks</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description><![CDATA[
|
<description><![CDATA[
|
||||||
Configuration for different java environment profiles. One good use
|
Configuration for different java environment profiles. One good use
|
||||||
for this might be to configure both JDK 1.4 and JDK 1.5 to work with
|
for this might be to configure both JDK 1.4 and JDK 1.5 to work with
|
||||||
|
@ -185,7 +185,7 @@
|
||||||
</field -->
|
</field -->
|
||||||
<field>
|
<field>
|
||||||
<name>proxies</name>
|
<name>proxies</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
Configuration for different proxy profiles. Multiple proxy profiles
|
Configuration for different proxy profiles. Multiple proxy profiles
|
||||||
|
@ -202,7 +202,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>servers</name>
|
<name>servers</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
Configuration of server-specific settings, mainly authentication
|
Configuration of server-specific settings, mainly authentication
|
||||||
|
@ -217,7 +217,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>mirrors</name>
|
<name>mirrors</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
Configuration of download mirrors for repositories.
|
Configuration of download mirrors for repositories.
|
||||||
</description>
|
</description>
|
||||||
|
@ -228,7 +228,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>profiles</name>
|
<name>profiles</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
Configuration of build profiles for adjusting the build
|
Configuration of build profiles for adjusting the build
|
||||||
|
@ -242,7 +242,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>activeProfiles</name>
|
<name>activeProfiles</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
List of manually-activated build profiles, specified in the order in which
|
List of manually-activated build profiles, specified in the order in which
|
||||||
|
@ -256,7 +256,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>pluginGroups</name>
|
<name>pluginGroups</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
List of groupIds to search for a plugin when that plugin
|
List of groupIds to search for a plugin when that plugin
|
||||||
groupId is not explicitly provided.
|
groupId is not explicitly provided.
|
||||||
|
@ -269,7 +269,7 @@
|
||||||
</fields>
|
</fields>
|
||||||
<codeSegments>
|
<codeSegments>
|
||||||
<codeSegment>
|
<codeSegment>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<code>
|
<code>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
public Boolean getInteractiveMode()
|
public Boolean getInteractiveMode()
|
||||||
|
@ -415,13 +415,13 @@
|
||||||
<!-- [JC] Commenting out until we're ready to use it... -->
|
<!-- [JC] Commenting out until we're ready to use it... -->
|
||||||
<!-- class>
|
<!-- class>
|
||||||
<name>Jdk</name>
|
<name>Jdk</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<superClass>TrackableBase</superClass>
|
<superClass>TrackableBase</superClass>
|
||||||
<description><![CDATA[Describes one Java environment]]></description>
|
<description><![CDATA[Describes one Java environment]]></description>
|
||||||
<fields>
|
<fields>
|
||||||
<field>
|
<field>
|
||||||
<name>active</name>
|
<name>active</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<required>false</required>
|
<required>false</required>
|
||||||
<defaultValue>false</defaultValue>
|
<defaultValue>false</defaultValue>
|
||||||
<description><![CDATA[Whether this JDK is the active one.]]></description>
|
<description><![CDATA[Whether this JDK is the active one.]]></description>
|
||||||
|
@ -429,14 +429,14 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>version</name>
|
<name>version</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
<description><![CDATA[The JDK major version (eg. '1.4').]]></description>
|
<description><![CDATA[The JDK major version (eg. '1.4').]]></description>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>javaHome</name>
|
<name>javaHome</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
<description><![CDATA[The JDK home.]]></description>
|
<description><![CDATA[The JDK home.]]></description>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
|
@ -445,7 +445,7 @@
|
||||||
</class -->
|
</class -->
|
||||||
<class>
|
<class>
|
||||||
<name>Proxy</name>
|
<name>Proxy</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<superClass>IdentifiableBase</superClass>
|
<superClass>IdentifiableBase</superClass>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
@ -454,7 +454,7 @@
|
||||||
<fields>
|
<fields>
|
||||||
<field>
|
<field>
|
||||||
<name>active</name>
|
<name>active</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<required>false</required>
|
<required>false</required>
|
||||||
<defaultValue>true</defaultValue>
|
<defaultValue>true</defaultValue>
|
||||||
<description>
|
<description>
|
||||||
|
@ -466,7 +466,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>protocol</name>
|
<name>protocol</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The proxy protocol.
|
The proxy protocol.
|
||||||
|
@ -477,7 +477,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>username</name>
|
<name>username</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The proxy user.
|
The proxy user.
|
||||||
|
@ -487,7 +487,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>password</name>
|
<name>password</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The proxy password.
|
The proxy password.
|
||||||
|
@ -497,7 +497,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>port</name>
|
<name>port</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The proxy port.
|
The proxy port.
|
||||||
|
@ -508,7 +508,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>host</name>
|
<name>host</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The proxy host.
|
The proxy host.
|
||||||
|
@ -519,7 +519,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>nonProxyHosts</name>
|
<name>nonProxyHosts</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The list of non-proxied hosts (delimited by |).
|
The list of non-proxied hosts (delimited by |).
|
||||||
|
@ -531,7 +531,7 @@
|
||||||
</class>
|
</class>
|
||||||
<class>
|
<class>
|
||||||
<name>Server</name>
|
<name>Server</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<superClass>IdentifiableBase</superClass>
|
<superClass>IdentifiableBase</superClass>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
@ -540,7 +540,7 @@
|
||||||
<fields>
|
<fields>
|
||||||
<field>
|
<field>
|
||||||
<name>username</name>
|
<name>username</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The username used to authenticate.
|
The username used to authenticate.
|
||||||
|
@ -550,7 +550,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>password</name>
|
<name>password</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The password used in conjunction with the username to authenticate.
|
The password used in conjunction with the username to authenticate.
|
||||||
|
@ -560,7 +560,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>privateKey</name>
|
<name>privateKey</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The private key location used to authenticate.
|
The private key location used to authenticate.
|
||||||
|
@ -570,7 +570,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>passphrase</name>
|
<name>passphrase</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The passphrase used in conjunction with the privateKey to authenticate.
|
The passphrase used in conjunction with the privateKey to authenticate.
|
||||||
|
@ -580,7 +580,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>filePermissions</name>
|
<name>filePermissions</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The permissions for files when they are created.
|
The permissions for files when they are created.
|
||||||
|
@ -590,7 +590,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>directoryPermissions</name>
|
<name>directoryPermissions</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The permissions for directories when they are created.
|
The permissions for directories when they are created.
|
||||||
|
@ -611,7 +611,7 @@
|
||||||
</class>
|
</class>
|
||||||
<class>
|
<class>
|
||||||
<name>Mirror</name>
|
<name>Mirror</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<superClass>IdentifiableBase</superClass>
|
<superClass>IdentifiableBase</superClass>
|
||||||
<description>
|
<description>
|
||||||
A download mirror for a given repository.
|
A download mirror for a given repository.
|
||||||
|
@ -620,7 +620,7 @@
|
||||||
<field>
|
<field>
|
||||||
<name>mirrorOf</name>
|
<name>mirrorOf</name>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<description>
|
<description>
|
||||||
The server ID of the repository being mirrored, eg
|
The server ID of the repository being mirrored, eg
|
||||||
|
@ -630,7 +630,7 @@
|
||||||
<field>
|
<field>
|
||||||
<name>name</name>
|
<name>name</name>
|
||||||
<required>false</required>
|
<required>false</required>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<description>
|
<description>
|
||||||
The optional name that describes the mirror.
|
The optional name that describes the mirror.
|
||||||
|
@ -639,25 +639,30 @@
|
||||||
<field>
|
<field>
|
||||||
<name>url</name>
|
<name>url</name>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<description>The URL of the mirror repository.</description>
|
<description>The URL of the mirror repository.</description>
|
||||||
</field>
|
</field>
|
||||||
<!--
|
<field>
|
||||||
<field>
|
<name>layout</name>
|
||||||
<name>allowOriginal</name>
|
<version>1.1.0+</version>
|
||||||
<version>1.0.0</version>
|
<type>String</type>
|
||||||
<type>boolean</type>
|
<description>The layout of the mirror repository. Since Maven 3.</description>
|
||||||
<defaultValue>true</defaultValue>
|
</field>
|
||||||
|
<field>
|
||||||
|
<name>mirrorOfLayouts</name>
|
||||||
|
<version>1.1.0+</version>
|
||||||
|
<type>String</type>
|
||||||
<description>
|
<description>
|
||||||
Whether to allow the user of the original as a fallback if an artifact is not found on the mirror.
|
The layouts of repositories being mirrored. This value can be used to restrict the usage
|
||||||
|
of the mirror to repositories with a matching layout. If unspecified, the mirror can be used
|
||||||
|
for any repository regardless of its layout. Since Maven 3.
|
||||||
</description>
|
</description>
|
||||||
</field>
|
</field>
|
||||||
-->
|
|
||||||
</fields>
|
</fields>
|
||||||
<codeSegments>
|
<codeSegments>
|
||||||
<codeSegment>
|
<codeSegment>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<code>
|
<code>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
|
||||||
|
@ -680,7 +685,7 @@
|
||||||
<!-- Profile support -->
|
<!-- Profile support -->
|
||||||
<class>
|
<class>
|
||||||
<name>Profile</name>
|
<name>Profile</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<superClass>IdentifiableBase</superClass>
|
<superClass>IdentifiableBase</superClass>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
@ -691,7 +696,7 @@
|
||||||
<fields>
|
<fields>
|
||||||
<field>
|
<field>
|
||||||
<name>activation</name>
|
<name>activation</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The conditional logic which will automatically
|
The conditional logic which will automatically
|
||||||
|
@ -717,7 +722,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>repositories</name>
|
<name>repositories</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The lists of the remote repositories.
|
The lists of the remote repositories.
|
||||||
|
@ -730,7 +735,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>pluginRepositories</name>
|
<name>pluginRepositories</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The lists of the remote repositories for discovering plugins.
|
The lists of the remote repositories for discovering plugins.
|
||||||
|
@ -752,7 +757,7 @@
|
||||||
</class>
|
</class>
|
||||||
<class java.clone="deep">
|
<class java.clone="deep">
|
||||||
<name>Activation</name>
|
<name>Activation</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The conditions within the build runtime environment which will trigger
|
The conditions within the build runtime environment which will trigger
|
||||||
|
@ -762,7 +767,7 @@
|
||||||
<fields>
|
<fields>
|
||||||
<field>
|
<field>
|
||||||
<name>activeByDefault</name>
|
<name>activeByDefault</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<type>boolean</type>
|
<type>boolean</type>
|
||||||
<description>
|
<description>
|
||||||
Flag specifying whether this profile is active as a default.
|
Flag specifying whether this profile is active as a default.
|
||||||
|
@ -770,7 +775,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>jdk</name>
|
<name>jdk</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
@ -780,7 +785,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>os</name>
|
<name>os</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
Specifies that this profile will be activated when matching OS attributes are detected.
|
Specifies that this profile will be activated when matching OS attributes are detected.
|
||||||
|
@ -792,7 +797,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>property</name>
|
<name>property</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
Specifies that this profile will be activated when this System property is specified.
|
Specifies that this profile will be activated when this System property is specified.
|
||||||
|
@ -804,7 +809,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>file</name>
|
<name>file</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
Specifies that this profile will be activated based on existence of a file.
|
Specifies that this profile will be activated based on existence of a file.
|
||||||
|
@ -820,7 +825,7 @@
|
||||||
<!-- TODO: reproduced from maven-model/maven.mdo, instead should inherit code and link to external docs -->
|
<!-- TODO: reproduced from maven-model/maven.mdo, instead should inherit code and link to external docs -->
|
||||||
<class java.clone="deep">
|
<class java.clone="deep">
|
||||||
<name>RepositoryBase</name>
|
<name>RepositoryBase</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
Repository contains the information needed
|
Repository contains the information needed
|
||||||
|
@ -830,7 +835,7 @@
|
||||||
<fields>
|
<fields>
|
||||||
<field>
|
<field>
|
||||||
<name>id</name>
|
<name>id</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
A unique identifier for a repository.
|
A unique identifier for a repository.
|
||||||
|
@ -840,7 +845,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>name</name>
|
<name>name</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
Human readable name of the repository.
|
Human readable name of the repository.
|
||||||
|
@ -850,7 +855,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>url</name>
|
<name>url</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
The url of the repository.
|
The url of the repository.
|
||||||
|
@ -860,7 +865,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>layout</name>
|
<name>layout</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
The type of layout this repository uses for locating and
|
The type of layout this repository uses for locating and
|
||||||
storing artifacts - can be "legacy" or "default".
|
storing artifacts - can be "legacy" or "default".
|
||||||
|
@ -871,7 +876,7 @@
|
||||||
</fields>
|
</fields>
|
||||||
<codeSegments>
|
<codeSegments>
|
||||||
<codeSegment>
|
<codeSegment>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<code>
|
<code>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
/**
|
/**
|
||||||
|
@ -899,7 +904,7 @@
|
||||||
<class>
|
<class>
|
||||||
<name>Repository</name>
|
<name>Repository</name>
|
||||||
<superClass>RepositoryBase</superClass>
|
<superClass>RepositoryBase</superClass>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
Repository contains the information needed for establishing
|
Repository contains the information needed for establishing
|
||||||
connections with remote repoistory
|
connections with remote repoistory
|
||||||
|
@ -907,7 +912,7 @@
|
||||||
<fields>
|
<fields>
|
||||||
<field>
|
<field>
|
||||||
<name>releases</name>
|
<name>releases</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
How to handle downloading of releases from this repository
|
How to handle downloading of releases from this repository
|
||||||
</description>
|
</description>
|
||||||
|
@ -917,7 +922,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>snapshots</name>
|
<name>snapshots</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
How to handle downloading of snapshots from this repository
|
How to handle downloading of snapshots from this repository
|
||||||
</description>
|
</description>
|
||||||
|
@ -929,7 +934,7 @@
|
||||||
<!-- prevent modello generation of an incorrect equals method. Could be avoided by using <identity/> tags to mark ID as the only identity field -->
|
<!-- prevent modello generation of an incorrect equals method. Could be avoided by using <identity/> tags to mark ID as the only identity field -->
|
||||||
<codeSegments>
|
<codeSegments>
|
||||||
<codeSegment>
|
<codeSegment>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<code>
|
<code>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
/**
|
/**
|
||||||
|
@ -947,12 +952,12 @@
|
||||||
|
|
||||||
<class java.clone="deep">
|
<class java.clone="deep">
|
||||||
<name>RepositoryPolicy</name>
|
<name>RepositoryPolicy</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>Download policy</description>
|
<description>Download policy</description>
|
||||||
<fields>
|
<fields>
|
||||||
<field>
|
<field>
|
||||||
<name>enabled</name>
|
<name>enabled</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
Whether to use this repository for downloading this type of
|
Whether to use this repository for downloading this type of
|
||||||
artifact.
|
artifact.
|
||||||
|
@ -962,7 +967,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>updatePolicy</name>
|
<name>updatePolicy</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
The frequency for downloading updates - can be "always",
|
The frequency for downloading updates - can be "always",
|
||||||
"daily" (default), "interval:XXX" (in minutes) or "never"
|
"daily" (default), "interval:XXX" (in minutes) or "never"
|
||||||
|
@ -972,7 +977,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>checksumPolicy</name>
|
<name>checksumPolicy</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
What to do when verification of an artifact checksum fails -
|
What to do when verification of an artifact checksum fails -
|
||||||
warn, fail, etc. Valid values are "fail" or "warn".
|
warn, fail, etc. Valid values are "fail" or "warn".
|
||||||
|
@ -984,7 +989,7 @@
|
||||||
|
|
||||||
<class java.clone="deep">
|
<class java.clone="deep">
|
||||||
<name>ActivationProperty</name>
|
<name>ActivationProperty</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
This is the property specification used to activate a profile. If the value field is empty,
|
This is the property specification used to activate a profile. If the value field is empty,
|
||||||
|
@ -995,7 +1000,7 @@
|
||||||
<fields>
|
<fields>
|
||||||
<field>
|
<field>
|
||||||
<name>name</name>
|
<name>name</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<required>true</required>
|
<required>true</required>
|
||||||
<description>
|
<description>
|
||||||
|
@ -1004,7 +1009,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>value</name>
|
<name>value</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<description>
|
<description>
|
||||||
The value of the property to be used to activate a profile.
|
The value of the property to be used to activate a profile.
|
||||||
|
@ -1014,7 +1019,7 @@
|
||||||
</class>
|
</class>
|
||||||
<class java.clone="deep">
|
<class java.clone="deep">
|
||||||
<name>ActivationOS</name>
|
<name>ActivationOS</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
This is an activator which will detect an operating system's attributes in order to activate
|
This is an activator which will detect an operating system's attributes in order to activate
|
||||||
|
@ -1024,7 +1029,7 @@
|
||||||
<fields>
|
<fields>
|
||||||
<field>
|
<field>
|
||||||
<name>name</name>
|
<name>name</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<description>
|
<description>
|
||||||
The name of the OS to be used to activate a profile.
|
The name of the OS to be used to activate a profile.
|
||||||
|
@ -1032,7 +1037,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>family</name>
|
<name>family</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<description>
|
<description>
|
||||||
The general family of the OS to be used to activate a
|
The general family of the OS to be used to activate a
|
||||||
|
@ -1041,7 +1046,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>arch</name>
|
<name>arch</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<description>
|
<description>
|
||||||
The architecture of the OS to be used to activate a profile.
|
The architecture of the OS to be used to activate a profile.
|
||||||
|
@ -1049,7 +1054,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>version</name>
|
<name>version</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<description>
|
<description>
|
||||||
The version of the OS to be used to activate a profile.
|
The version of the OS to be used to activate a profile.
|
||||||
|
@ -1059,7 +1064,7 @@
|
||||||
</class>
|
</class>
|
||||||
<class java.clone="deep">
|
<class java.clone="deep">
|
||||||
<name>ActivationFile</name>
|
<name>ActivationFile</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<description>
|
<description>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
This is the file specification used to activate a profile. The missing value will be a the location
|
This is the file specification used to activate a profile. The missing value will be a the location
|
||||||
|
@ -1070,7 +1075,7 @@
|
||||||
<fields>
|
<fields>
|
||||||
<field>
|
<field>
|
||||||
<name>missing</name>
|
<name>missing</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<description>
|
<description>
|
||||||
The name of the file that should be missing to activate a
|
The name of the file that should be missing to activate a
|
||||||
|
@ -1079,7 +1084,7 @@
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>exists</name>
|
<name>exists</name>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0+</version>
|
||||||
<type>String</type>
|
<type>String</type>
|
||||||
<description>
|
<description>
|
||||||
The name of the file that should exist to activate a profile.
|
The name of the file that should exist to activate a profile.
|
||||||
|
|
|
@ -180,6 +180,42 @@ public class MirrorProcessorTest
|
||||||
assertTrue( DefaultMirrorSelector.matchPattern( getRepo( "c", "http://somehost" ), "!a,external:*" ) );
|
assertTrue( DefaultMirrorSelector.matchPattern( getRepo( "c", "http://somehost" ), "!a,external:*" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testLayoutPattern()
|
||||||
|
{
|
||||||
|
assertTrue( DefaultMirrorSelector.matchesLayout( "default", null ) );
|
||||||
|
assertTrue( DefaultMirrorSelector.matchesLayout( "default", "" ) );
|
||||||
|
assertTrue( DefaultMirrorSelector.matchesLayout( "default", "*" ) );
|
||||||
|
|
||||||
|
assertTrue( DefaultMirrorSelector.matchesLayout( "default", "default" ) );
|
||||||
|
assertFalse( DefaultMirrorSelector.matchesLayout( "default", "legacy" ) );
|
||||||
|
|
||||||
|
assertTrue( DefaultMirrorSelector.matchesLayout( "default", "legacy,default" ) );
|
||||||
|
assertTrue( DefaultMirrorSelector.matchesLayout( "default", "default,legacy" ) );
|
||||||
|
|
||||||
|
assertFalse( DefaultMirrorSelector.matchesLayout( "default", "legacy,!default" ) );
|
||||||
|
assertFalse( DefaultMirrorSelector.matchesLayout( "default", "!default,legacy" ) );
|
||||||
|
|
||||||
|
assertFalse( DefaultMirrorSelector.matchesLayout( "default", "*,!default" ) );
|
||||||
|
assertFalse( DefaultMirrorSelector.matchesLayout( "default", "!default,*" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testMirrorLayoutConsideredForMatching()
|
||||||
|
{
|
||||||
|
ArtifactRepository repo = getRepo( "a" );
|
||||||
|
|
||||||
|
Mirror mirrorA = newMirror( "a", "a", null, "http://a" );
|
||||||
|
Mirror mirrorB = newMirror( "b", "a", "p2", "http://b" );
|
||||||
|
|
||||||
|
Mirror mirrorC = newMirror( "c", "*", null, "http://c" );
|
||||||
|
Mirror mirrorD = newMirror( "d", "*", "p2", "http://d" );
|
||||||
|
|
||||||
|
assertSame( mirrorA, mirrorSelector.getMirror( repo, Arrays.asList( mirrorA ) ) );
|
||||||
|
assertNull( mirrorSelector.getMirror( repo, Arrays.asList( mirrorB ) ) );
|
||||||
|
|
||||||
|
assertSame( mirrorC, mirrorSelector.getMirror( repo, Arrays.asList( mirrorC ) ) );
|
||||||
|
assertNull( mirrorSelector.getMirror( repo, Arrays.asList( mirrorD ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build an ArtifactRepository object.
|
* Build an ArtifactRepository object.
|
||||||
*
|
*
|
||||||
|
@ -204,11 +240,17 @@ public class MirrorProcessorTest
|
||||||
}
|
}
|
||||||
|
|
||||||
private Mirror newMirror( String id, String mirrorOf, String url )
|
private Mirror newMirror( String id, String mirrorOf, String url )
|
||||||
|
{
|
||||||
|
return newMirror( id, mirrorOf, null, url );
|
||||||
|
}
|
||||||
|
|
||||||
|
private Mirror newMirror( String id, String mirrorOf, String layouts, String url )
|
||||||
{
|
{
|
||||||
Mirror mirror = new Mirror();
|
Mirror mirror = new Mirror();
|
||||||
|
|
||||||
mirror.setId( id );
|
mirror.setId( id );
|
||||||
mirror.setMirrorOf( mirrorOf );
|
mirror.setMirrorOf( mirrorOf );
|
||||||
|
mirror.setMirrorOfLayouts( layouts );
|
||||||
mirror.setUrl( url );
|
mirror.setUrl( url );
|
||||||
|
|
||||||
return mirror;
|
return mirror;
|
||||||
|
|
Loading…
Reference in New Issue