diff options
author | Maria Odea B. Ching <oching@apache.org> | 2008-04-18 04:38:48 +0000 |
---|---|---|
committer | Maria Odea B. Ching <oching@apache.org> | 2008-04-18 04:38:48 +0000 |
commit | fada72428ff488944372047ad53df0ce3ce981a4 (patch) | |
tree | 6dcbe48708e6cfaaf163d3d8f2de1e39a1784149 /archiva-modules | |
parent | f35058290526cd2c79c6cb10f5d2e4dae4bf4678 (diff) | |
download | archiva-fada72428ff488944372047ad53df0ce3ce981a4.tar.gz archiva-fada72428ff488944372047ad53df0ce3ce981a4.zip |
[MRM-694]
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
Diffstat (limited to 'archiva-modules')
5 files changed, 52 insertions, 3 deletions
diff --git a/archiva-modules/archiva-base/archiva-configuration/pom.xml b/archiva-modules/archiva-base/archiva-configuration/pom.xml index f5bb1c9f7..3833eddf0 100644 --- a/archiva-modules/archiva-base/archiva-configuration/pom.xml +++ b/archiva-modules/archiva-base/archiva-configuration/pom.xml @@ -87,7 +87,7 @@ </execution> </executions> <configuration> - <version>1.1.0</version> + <version>1.2.0</version> <model>src/main/mdo/configuration.mdo</model> </configuration> </plugin> diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java index cc8636531..2e86bde8d 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java +++ b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java @@ -416,7 +416,7 @@ public class DefaultArchivaConfiguration 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; } @@ -455,6 +455,10 @@ public class DefaultArchivaConfiguration { section.removeSubset( "legacyArtifactPaths" ); } + if ( configuration.getRepositoryGroups().isEmpty() ) + { + section.removeSubset( "repositoryGroups" ); + } if ( configuration.getRepositoryScanning() != null ) { if ( configuration.getRepositoryScanning().getKnownContentConsumers().isEmpty() ) diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo b/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo index 773674384..041e3b8f2 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo +++ b/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo @@ -57,6 +57,15 @@ </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> <association> @@ -511,6 +520,28 @@ </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> <!-- ____ _ diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-single-list-elements.xml b/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-single-list-elements.xml index a7bb686d8..3e3d4dc97 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-single-list-elements.xml +++ b/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-single-list-elements.xml @@ -20,6 +20,14 @@ <configuration> <version>2</version> + <repositoryGroups> + <repositoryGroup> + <id>default</id> + <repositories> + <repository>snapshots</repository> + </repositories> + </repositoryGroup> + </repositoryGroups> <managedRepositories> <managedRepository> <id>snapshots</id> diff --git a/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java b/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java index 82b79fc93..1143a671c 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java +++ b/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java @@ -686,7 +686,12 @@ public class ArchivaConfigurationTest (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 ); @@ -740,6 +745,7 @@ public class ArchivaConfigurationTest (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" ) ); |