String errMsg = "Unable to load default archiva configuration for FileTypes: ";
try
{
CommonsConfigurationRegistry commonsRegistry = new CommonsConfigurationRegistry();
// Configure commonsRegistry
Field fld = commonsRegistry.getClass().getDeclaredField( "configuration" );
fld.setAccessible( true );
fld.set( commonsRegistry, new CombinedConfiguration() );
commonsRegistry.enableLogging( new Slf4JPlexusLogger( FileTypes.class ) );
commonsRegistry.addConfigurationFromResource( "org/apache/maven/archiva/configuration/default-archiva.xml" );
// Read configuration as it was intended.
ConfigurationRegistryReader configReader = new ConfigurationRegistryReader();
Configuration defaultConfig = configReader.read( commonsRegistry );