From: Olivier Lamy Date: Tue, 13 Sep 2011 14:07:24 +0000 (+0000) Subject: get RID of file ~/.m2/archiva.xml created during tests with a new sysprops to use... X-Git-Tag: archiva-1.4-M1~319 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a71e2b06ec8287487814f5c202db4e38720069bc;p=archiva.git get RID of file ~/.m2/archiva.xml created during tests with a new sysprops to use for tests git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1170189 13f79535-47bb-0310-9956-ffa450edef68 --- 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 7e68ff9c6..ef78599b6 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 @@ -94,7 +94,6 @@ public class DefaultArchivaConfiguration /** * Plexus registry to read the configuration from. - * */ @Inject @Named( value = "commons-configuration" ) @@ -495,7 +494,6 @@ public class DefaultArchivaConfiguration } } - new ConfigurationRegistryWriter().write( configuration, section ); section.save(); @@ -537,9 +535,8 @@ public class DefaultArchivaConfiguration } // olamy hackish I know :-) - contents = "" - + ""; - + contents = "" + ""; ( (CommonsConfigurationRegistry) registry ).setProperties( contents ); @@ -655,7 +652,15 @@ public class DefaultArchivaConfiguration { ExpressionEvaluator expressionEvaluator = new DefaultExpressionEvaluator(); expressionEvaluator.addExpressionSource( new SystemPropertyExpressionSource() ); - userConfigFilename = expressionEvaluator.expand( userConfigFilename ); + String userConfigFileNameSysProps = System.getProperty( "archiva.user.configFileName" ); + if ( StringUtils.isNotBlank( userConfigFileNameSysProps ) ) + { + userConfigFilename = userConfigFileNameSysProps; + } + else + { + userConfigFilename = expressionEvaluator.expand( userConfigFilename ); + } altConfigFilename = expressionEvaluator.expand( altConfigFilename ); loadConfiguration(); } @@ -720,8 +725,6 @@ public class DefaultArchivaConfiguration c.setRefreshCronExpression( unescapeCronExpression( c.getRefreshCronExpression() ) ); } - - return config; } diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml index b080c2519..a4f77bbcf 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml @@ -115,6 +115,7 @@ ${basedir}/target/appserver-base ${project.build.outputDirectory} ${project.build.outputDirectory} + ${basedir}/target/archiva.xml diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/META-INF/spring-context.xml index 176462a2f..97517e92b 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/META-INF/spring-context.xml @@ -38,4 +38,19 @@ + + + + + + + + ]]> + + + + \ No newline at end of file diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context-cleanup-released-snapshots.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context-cleanup-released-snapshots.xml index 0a883cff4..60fb7d785 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context-cleanup-released-snapshots.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context-cleanup-released-snapshots.xml @@ -50,5 +50,19 @@ + + + + + + + + ]]> + + + \ No newline at end of file diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context-purge-consumer-test.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context-purge-consumer-test.xml index ff3c158ff..85f9eef3c 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context-purge-consumer-test.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context-purge-consumer-test.xml @@ -100,5 +100,20 @@ + + + + + + + + ]]> + + + + \ No newline at end of file diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context.xml index 914912938..438ff5574 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/spring-context.xml @@ -29,4 +29,19 @@ + + + + + + + + ]]> + + + + \ No newline at end of file