changes by Nap Ramirez, Maria Catherine Tan, Henry Isidro, Brett Porter and myself
-add repositoryGroups in configuration
-updated ArchivaConfiguration and added test for this change
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@649364
13f79535-47bb-0310-9956-
ffa450edef68
</execution>
</executions>
<configuration>
- <version>1.1.0</version>
+ <version>1.2.0</version>
<model>src/main/mdo/configuration.mdo</model>
</configuration>
</plugin>
if ( key.startsWith( "repositories" ) || key.startsWith( "proxyConnectors" )
|| key.startsWith( "networkProxies" ) || key.startsWith( "repositoryScanning" )
|| key.startsWith( "databaseScanning" ) || key.startsWith( "remoteRepositories" )
- || key.startsWith( "managedRepositories" ) )
+ || key.startsWith( "managedRepositories" ) || key.startsWith( "repositoryGroups" ) )
{
foundList = true;
}
{
section.removeSubset( "legacyArtifactPaths" );
}
+ if ( configuration.getRepositoryGroups().isEmpty() )
+ {
+ section.removeSubset( "repositoryGroups" );
+ }
if ( configuration.getRepositoryScanning() != null )
{
if ( configuration.getRepositoryScanning().getKnownContentConsumers().isEmpty() )
<multiplicity>*</multiplicity>
</association>
</field>
+ <field>
+ <name>repositoryGroups</name>
+ <version>1.2.0+</version>
+ <association>
+ <type>RepositoryGroupConfiguration</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>The list of repository groups.</description>
+ </field>
<field>
<name>managedRepositories</name>
<version>1.0.0+</version>
</codeSegment>
</codeSegments>
</class>
+ <class>
+ <name>RepositoryGroupConfiguration</name>
+ <version>1.2.0+</version>
+ <fields>
+ <field>
+ <name>id</name>
+ <version>1.2.0+</version>
+ <type>String</type>
+ <required>true</required>
+ <description>The id of the repository group.</description>
+ </field>
+ <field>
+ <name>repositories</name>
+ <version>1.2.0+</version>
+ <association>
+ <type>String</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>The list of repository ids under the group.</description>
+ </field>
+ </fields>
+ </class>
<!--
____ _
<configuration>
<version>2</version>
+ <repositoryGroups>
+ <repositoryGroup>
+ <id>default</id>
+ <repositories>
+ <repository>snapshots</repository>
+ </repositories>
+ </repositoryGroup>
+ </repositoryGroups>
<managedRepositories>
<managedRepository>
<id>snapshots</id>
(ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-remove-central" );
Configuration configuration = archivaConfiguration.getConfiguration();
-
+
+ RepositoryGroupConfiguration repositoryGroup = ( RepositoryGroupConfiguration ) configuration.getRepositoryGroups().get( 0 );
+ assertNotNull( repositoryGroup );
+ configuration.removeRepositoryGroup( repositoryGroup );
+ assertTrue( configuration.getRepositoryGroups().isEmpty() );
+
RemoteRepositoryConfiguration repository = configuration.getRemoteRepositoriesAsMap().get( "central" );
assertNotNull( repository );
configuration.removeRemoteRepository( repository );
(ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-read-saved" );
configuration = archivaConfiguration.getConfiguration();
assertNull( configuration.getRemoteRepositoriesAsMap().get( "central" ) );
+ assertTrue( configuration.getRepositoryGroups().isEmpty() );
assertNull( configuration.getManagedRepositoriesAsMap().get( "snapshots" ) );
assertTrue( configuration.getProxyConnectors().isEmpty() );
assertNull( configuration.getNetworkProxiesAsMap().get( "proxy" ) );