}
// normalize path
localRepo = repoDir.getAbsolutePath();
Profile profile = new Profile();
do
{
profile.setId( "stagedLocalRepo" + entropy.nextLong() );
}
while ( settings.getProfilesAsMap().containsKey( profile.getId() ) );
Repository repository = new Repository();
repository.setId( profile.getId() + entropy.nextLong() );
RepositoryPolicy policy = new RepositoryPolicy();
policy.setEnabled( true );
policy.setChecksumPolicy( "ignore" );
policy.setUpdatePolicy( "never" );
repository.setReleases( policy );
repository.setSnapshots( policy );
repository.setLayout( "default" );
repository.setName( "Original Local Repository" );
repository.setUrl( toUrl( localRepo ) );
profile.addPluginRepository( repository );
profile.addRepository( repository );
settings.addProfile( profile );
settings.addActiveProfile( profile.getId() );
settings.setLocalRepository( stagedLocalRepo.getAbsolutePath() );
for ( Iterator<Profile> it = settings.getProfiles().iterator(); it.hasNext(); )
{
profile = it.next();
disableUpdates( profile.getRepositories() );
disableUpdates( profile.getPluginRepositories() );
}
new SettingsXpp3Writer().write( WriterFactory.newXmlWriter( stagedSettingsXml ), settings );
}
catch ( XmlPullParserException e )