Disable the pluginRepository deprecation message until the first release of 2.1 is imminent, to avoid confusion when using IDEs that use 2.1 snapshots (where the CLI still uses 2.0.x).

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@659236 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2008-05-22 20:15:52 +00:00
parent 9dd2e54583
commit e458d85616
1 changed files with 91 additions and 90 deletions

View File

@ -19,95 +19,96 @@ import java.util.Map;
public privileged aspect Maven20xProjectCompatAspect public privileged aspect Maven20xProjectCompatAspect
{ {
private pointcut reactorProjectBuilds(): // FIXME: Re-enable this when we're closer to a 2.1 release.
cflow( execution( * DefaultMavenProjectBuilder.buildFromSourceFileInternal( .. ) ) ) // private pointcut reactorProjectBuilds():
&& !cflow( execution( * MavenMetadataSource.*( .. ) ) ); // cflow( execution( * DefaultMavenProjectBuilder.buildFromSourceFileInternal( .. ) ) )
// && !cflow( execution( * MavenMetadataSource.*( .. ) ) );
private pointcut lineageBuildResumed( DefaultMavenProjectBuilder projectBuilder, ModelLineage lineage ): //
call( * ModelLineageBuilder.resumeBuildingModelLineage( ModelLineage, .. ) ) // private pointcut lineageBuildResumed( DefaultMavenProjectBuilder projectBuilder, ModelLineage lineage ):
&& this( projectBuilder ) // call( * ModelLineageBuilder.resumeBuildingModelLineage( ModelLineage, .. ) )
&& args( lineage, .. ); // && this( projectBuilder )
// && args( lineage, .. );
after( DefaultMavenProjectBuilder projectBuilder, ModelLineage lineage ): //
reactorProjectBuilds() // after( DefaultMavenProjectBuilder projectBuilder, ModelLineage lineage ):
&& lineageBuildResumed( projectBuilder, lineage ) // reactorProjectBuilds()
{ // && lineageBuildResumed( projectBuilder, lineage )
for ( ModelLineageIterator it = lineage.lineageIterator(); it.hasNext(); ) // {
{ // for ( ModelLineageIterator it = lineage.lineageIterator(); it.hasNext(); )
Model model = (Model) it.next(); // {
List pluginRepos = model.getPluginRepositories(); // Model model = (Model) it.next();
// List pluginRepos = model.getPluginRepositories();
if ( pluginRepos != null && !pluginRepos.isEmpty() ) //
{ // if ( pluginRepos != null && !pluginRepos.isEmpty() )
StringBuffer message = new StringBuffer(); // {
message.append( "The <pluginRepositories/> section of the POM has been deprecated. Please update your POM (" ); // StringBuffer message = new StringBuffer();
message.append( model.getId() ); // message.append( "The <pluginRepositories/> section of the POM has been deprecated. Please update your POM (" );
message.append( ")." ); // message.append( model.getId() );
// message.append( ")." );
projectBuilder.logger.warn( message.toString() ); //
} // projectBuilder.logger.warn( message.toString() );
} // }
} // }
// }
private pointcut externalProfilesApplied( DefaultProfileAdvisor advisor, ProfileManager profileManager ): //
execution( * DefaultProfileAdvisor.applyActivatedExternalProfiles( .., ProfileManager+ ) ) // private pointcut externalProfilesApplied( DefaultProfileAdvisor advisor, ProfileManager profileManager ):
&& this( advisor ) // execution( * DefaultProfileAdvisor.applyActivatedExternalProfiles( .., ProfileManager+ ) )
&& args( .., profileManager ); // && this( advisor )
// && args( .., profileManager );
//
private boolean settingsProfilesChecked = false; //
// private boolean settingsProfilesChecked = false;
before( DefaultProfileAdvisor advisor, ProfileManager profileManager ): //
reactorProjectBuilds() // before( DefaultProfileAdvisor advisor, ProfileManager profileManager ):
&& externalProfilesApplied( advisor, profileManager ) // reactorProjectBuilds()
{ // && externalProfilesApplied( advisor, profileManager )
if ( profileManager == null ) // {
{ // if ( profileManager == null )
return; // {
} // return;
// }
Map profilesById = profileManager.getProfilesById(); //
Set invalidProfiles = new HashSet(); // Map profilesById = profileManager.getProfilesById();
// Set invalidProfiles = new HashSet();
boolean settingsProfilesEncountered = false; //
for ( Iterator it = profilesById.values().iterator(); it.hasNext(); ) // boolean settingsProfilesEncountered = false;
{ // for ( Iterator it = profilesById.values().iterator(); it.hasNext(); )
Profile profile = (Profile) it.next(); // {
// Profile profile = (Profile) it.next();
if ( "settings.xml".equals( profile.getSource() ) ) //
{ // if ( "settings.xml".equals( profile.getSource() ) )
settingsProfilesEncountered = true; // {
// settingsProfilesEncountered = true;
if ( settingsProfilesChecked ) //
{ // if ( settingsProfilesChecked )
continue; // {
} // continue;
} // }
// }
List pluginRepos = profile.getPluginRepositories(); //
if ( pluginRepos != null && !pluginRepos.isEmpty() ) // List pluginRepos = profile.getPluginRepositories();
{ // if ( pluginRepos != null && !pluginRepos.isEmpty() )
invalidProfiles.add( profile ); // {
} // invalidProfiles.add( profile );
} // }
// }
if ( !invalidProfiles.isEmpty() ) //
{ // if ( !invalidProfiles.isEmpty() )
StringBuffer message = new StringBuffer(); // {
message.append( "The <pluginRepositories/> section of the POM has been deprecated. Please update the following profiles:\n" ); // StringBuffer message = new StringBuffer();
// message.append( "The <pluginRepositories/> section of the POM has been deprecated. Please update the following profiles:\n" );
for ( Iterator it = invalidProfiles.iterator(); it.hasNext(); ) //
{ // for ( Iterator it = invalidProfiles.iterator(); it.hasNext(); )
Profile profile = (Profile) it.next(); // {
message.append( "\n- " ).append( profile.getId() ).append( " (source: " ).append( profile.getSource() ).append( ")" ); // Profile profile = (Profile) it.next();
} // message.append( "\n- " ).append( profile.getId() ).append( " (source: " ).append( profile.getSource() ).append( ")" );
// }
message.append( "\n" ); //
// message.append( "\n" );
advisor.logger.warn( message.toString() ); //
} // advisor.logger.warn( message.toString() );
// }
settingsProfilesChecked = settingsProfilesChecked || settingsProfilesEncountered; //
} // settingsProfilesChecked = settingsProfilesChecked || settingsProfilesEncountered;
// }
} }