From e458d85616e44400ab14319d585f85525bfd609b Mon Sep 17 00:00:00 2001 From: John Dennis Casey Date: Thu, 22 May 2008 20:15:52 +0000 Subject: [PATCH] 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 --- .../compat/Maven20xProjectCompatAspect.aj | 181 +++++++++--------- 1 file changed, 91 insertions(+), 90 deletions(-) diff --git a/maven-project/src/main/aspect/org/apache/maven/project/aspect/compat/Maven20xProjectCompatAspect.aj b/maven-project/src/main/aspect/org/apache/maven/project/aspect/compat/Maven20xProjectCompatAspect.aj index 6bdcd6a7aa..1bc9070ae6 100644 --- a/maven-project/src/main/aspect/org/apache/maven/project/aspect/compat/Maven20xProjectCompatAspect.aj +++ b/maven-project/src/main/aspect/org/apache/maven/project/aspect/compat/Maven20xProjectCompatAspect.aj @@ -19,95 +19,96 @@ import java.util.Map; public privileged aspect Maven20xProjectCompatAspect { - private pointcut reactorProjectBuilds(): - cflow( execution( * DefaultMavenProjectBuilder.buildFromSourceFileInternal( .. ) ) ) - && !cflow( execution( * MavenMetadataSource.*( .. ) ) ); - - private pointcut lineageBuildResumed( DefaultMavenProjectBuilder projectBuilder, ModelLineage lineage ): - call( * ModelLineageBuilder.resumeBuildingModelLineage( ModelLineage, .. ) ) - && this( projectBuilder ) - && args( lineage, .. ); - - after( DefaultMavenProjectBuilder projectBuilder, ModelLineage lineage ): - reactorProjectBuilds() - && lineageBuildResumed( projectBuilder, lineage ) - { - for ( ModelLineageIterator it = lineage.lineageIterator(); it.hasNext(); ) - { - Model model = (Model) it.next(); - List pluginRepos = model.getPluginRepositories(); - - if ( pluginRepos != null && !pluginRepos.isEmpty() ) - { - StringBuffer message = new StringBuffer(); - message.append( "The section of the POM has been deprecated. Please update your POM (" ); - message.append( model.getId() ); - message.append( ")." ); - - projectBuilder.logger.warn( message.toString() ); - } - } - } - - private pointcut externalProfilesApplied( DefaultProfileAdvisor advisor, ProfileManager profileManager ): - execution( * DefaultProfileAdvisor.applyActivatedExternalProfiles( .., ProfileManager+ ) ) - && this( advisor ) - && args( .., profileManager ); - - - private boolean settingsProfilesChecked = false; - - before( DefaultProfileAdvisor advisor, ProfileManager profileManager ): - reactorProjectBuilds() - && externalProfilesApplied( advisor, profileManager ) - { - if ( profileManager == null ) - { - return; - } - - Map profilesById = profileManager.getProfilesById(); - Set invalidProfiles = new HashSet(); - - boolean settingsProfilesEncountered = false; - for ( Iterator it = profilesById.values().iterator(); it.hasNext(); ) - { - Profile profile = (Profile) it.next(); - - if ( "settings.xml".equals( profile.getSource() ) ) - { - settingsProfilesEncountered = true; - - if ( settingsProfilesChecked ) - { - continue; - } - } - - List pluginRepos = profile.getPluginRepositories(); - if ( pluginRepos != null && !pluginRepos.isEmpty() ) - { - invalidProfiles.add( profile ); - } - } - - if ( !invalidProfiles.isEmpty() ) - { - StringBuffer message = new StringBuffer(); - message.append( "The section of the POM has been deprecated. Please update the following profiles:\n" ); - - for ( Iterator it = invalidProfiles.iterator(); it.hasNext(); ) - { - Profile profile = (Profile) it.next(); - message.append( "\n- " ).append( profile.getId() ).append( " (source: " ).append( profile.getSource() ).append( ")" ); - } - - message.append( "\n" ); - - advisor.logger.warn( message.toString() ); - } - - settingsProfilesChecked = settingsProfilesChecked || settingsProfilesEncountered; - } + // FIXME: Re-enable this when we're closer to a 2.1 release. +// private pointcut reactorProjectBuilds(): +// cflow( execution( * DefaultMavenProjectBuilder.buildFromSourceFileInternal( .. ) ) ) +// && !cflow( execution( * MavenMetadataSource.*( .. ) ) ); +// +// private pointcut lineageBuildResumed( DefaultMavenProjectBuilder projectBuilder, ModelLineage lineage ): +// call( * ModelLineageBuilder.resumeBuildingModelLineage( ModelLineage, .. ) ) +// && this( projectBuilder ) +// && args( lineage, .. ); +// +// after( DefaultMavenProjectBuilder projectBuilder, ModelLineage lineage ): +// reactorProjectBuilds() +// && lineageBuildResumed( projectBuilder, lineage ) +// { +// for ( ModelLineageIterator it = lineage.lineageIterator(); it.hasNext(); ) +// { +// Model model = (Model) it.next(); +// List pluginRepos = model.getPluginRepositories(); +// +// if ( pluginRepos != null && !pluginRepos.isEmpty() ) +// { +// StringBuffer message = new StringBuffer(); +// message.append( "The section of the POM has been deprecated. Please update your POM (" ); +// message.append( model.getId() ); +// message.append( ")." ); +// +// projectBuilder.logger.warn( message.toString() ); +// } +// } +// } +// +// private pointcut externalProfilesApplied( DefaultProfileAdvisor advisor, ProfileManager profileManager ): +// execution( * DefaultProfileAdvisor.applyActivatedExternalProfiles( .., ProfileManager+ ) ) +// && this( advisor ) +// && args( .., profileManager ); +// +// +// private boolean settingsProfilesChecked = false; +// +// before( DefaultProfileAdvisor advisor, ProfileManager profileManager ): +// reactorProjectBuilds() +// && externalProfilesApplied( advisor, profileManager ) +// { +// if ( profileManager == null ) +// { +// return; +// } +// +// Map profilesById = profileManager.getProfilesById(); +// Set invalidProfiles = new HashSet(); +// +// boolean settingsProfilesEncountered = false; +// for ( Iterator it = profilesById.values().iterator(); it.hasNext(); ) +// { +// Profile profile = (Profile) it.next(); +// +// if ( "settings.xml".equals( profile.getSource() ) ) +// { +// settingsProfilesEncountered = true; +// +// if ( settingsProfilesChecked ) +// { +// continue; +// } +// } +// +// List pluginRepos = profile.getPluginRepositories(); +// if ( pluginRepos != null && !pluginRepos.isEmpty() ) +// { +// invalidProfiles.add( profile ); +// } +// } +// +// if ( !invalidProfiles.isEmpty() ) +// { +// StringBuffer message = new StringBuffer(); +// message.append( "The section of the POM has been deprecated. Please update the following profiles:\n" ); +// +// for ( Iterator it = invalidProfiles.iterator(); it.hasNext(); ) +// { +// Profile profile = (Profile) it.next(); +// message.append( "\n- " ).append( profile.getId() ).append( " (source: " ).append( profile.getSource() ).append( ")" ); +// } +// +// message.append( "\n" ); +// +// advisor.logger.warn( message.toString() ); +// } +// +// settingsProfilesChecked = settingsProfilesChecked || settingsProfilesEncountered; +// } }