ManagedRepositoryConfiguration repoConfig = new ManagedRepositoryConfiguration();
repoConfig.setId( TEST_REPO_ID );
repoConfig.setLocation( "src/test/repositories/test" );
configuration.addManagedRepository( repoConfig );
ArchivaConfiguration archivaConfiguration = applicationContext.getBean( ArchivaConfiguration.class );
archivaConfiguration.getConfiguration().setRepositoryScanning( new RepositoryScanningConfiguration() );
archivaConfiguration.save( configuration );
TestMetadataResolver metadataResolver = applicationContext.getBean( TestMetadataResolver.class );
ProjectVersionMetadata metadata = new ProjectVersionMetadata();
metadata.setId( TEST_VERSION );
metadataResolver.setProjectVersion( TEST_REPO_ID, TEST_GROUP_ID, TEST_ARTIFACT_ID, metadata );