diff options
-rw-r--r-- | archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java index 665c80ab2..f37171afa 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java +++ b/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/DefaultArchivaConfiguration.java @@ -489,45 +489,50 @@ public class DefaultArchivaConfiguration escapeCronExpressions( configuration ); // [MRM-661] Due to a bug in the modello registry writer, we need to take these out by hand. They'll be put back by the writer. - if ( configuration.getManagedRepositories().isEmpty() && section != null ) - { - section.removeSubset( "managedRepositories" ); - } - if ( configuration.getRemoteRepositories().isEmpty() && section != null ) + if ( section != null ) { - section.removeSubset( "remoteRepositories" ); + if ( configuration.getManagedRepositories().isEmpty() ) + { + section.removeSubset( "managedRepositories" ); + } + if ( configuration.getRemoteRepositories().isEmpty() ) + { + section.removeSubset( "remoteRepositories" ); - } - if ( configuration.getProxyConnectors().isEmpty() && section != null ) - { - section.removeSubset( "proxyConnectors" ); - } - if ( configuration.getNetworkProxies().isEmpty() && section != null ) - { - section.removeSubset( "networkProxies" ); - } - if ( configuration.getLegacyArtifactPaths().isEmpty() && section != null ) - { - section.removeSubset( "legacyArtifactPaths" ); - } - if ( configuration.getRepositoryGroups().isEmpty() && section != null ) - { - section.removeSubset( "repositoryGroups" ); - } - if ( configuration.getRepositoryScanning() != null ) - { - if ( configuration.getRepositoryScanning().getKnownContentConsumers().isEmpty() && section != null ) + } + if ( configuration.getProxyConnectors().isEmpty() ) + { + section.removeSubset( "proxyConnectors" ); + } + if ( configuration.getNetworkProxies().isEmpty() ) + { + section.removeSubset( "networkProxies" ); + } + if ( configuration.getLegacyArtifactPaths().isEmpty() ) + { + section.removeSubset( "legacyArtifactPaths" ); + } + if ( configuration.getRepositoryGroups().isEmpty() ) { - section.removeSubset( "repositoryScanning.knownContentConsumers" ); + section.removeSubset( "repositoryGroups" ); } - if ( configuration.getRepositoryScanning().getInvalidContentConsumers().isEmpty() && section != null ) + if ( configuration.getRepositoryScanning() != null ) { - section.removeSubset( "repositoryScanning.invalidContentConsumers" ); + if ( configuration.getRepositoryScanning().getKnownContentConsumers().isEmpty() ) + { + section.removeSubset( "repositoryScanning.knownContentConsumers" ); + } + if ( configuration.getRepositoryScanning().getInvalidContentConsumers().isEmpty() ) + { + section.removeSubset( "repositoryScanning.invalidContentConsumers" ); + } } + + new ConfigurationRegistryWriter().write( configuration, section ); + section.save(); } - new ConfigurationRegistryWriter().write( configuration, section ); - section.save(); + this.configuration = unescapeExpressions( configuration ); |