From 139efa3bdf929946e6eb0e55c779ea2ece5e8b81 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Fri, 16 Sep 2005 01:11:42 +0000 Subject: [PATCH] finish correcting spelling of prerequisites git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@289355 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/maven/DefaultMaven.java | 25 +++++++++------- .../maven/plugin/DefaultPluginManager.java | 4 +-- .../version/DefaultPluginVersionManager.java | 29 ++++++++++--------- .../apache/maven/project/MavenProject.java | 14 ++++----- 4 files changed, 39 insertions(+), 33 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java index d10f537104..27894e7b2e 100644 --- a/maven-core/src/main/java/org/apache/maven/DefaultMaven.java +++ b/maven-core/src/main/java/org/apache/maven/DefaultMaven.java @@ -136,7 +136,7 @@ public class DefaultMaven List files = getProjectFiles( request ); List projects = collectProjects( files, request.getLocalRepository(), request.isRecursive(), - request.getSettings(), globalProfileManager ); + request.getSettings(), globalProfileManager ); // the reasoning here is that the list is still unsorted according to dependency, so the first project // SHOULD BE the top-level, or the one we want to start with if we're doing an aggregated build. @@ -193,7 +193,8 @@ public class DefaultMaven // TODO: yuck! Revisit when cleaning up the exception handling from the top down Throwable exception = response.getException(); - if ( ReactorManager.FAIL_AT_END.equals( rm.getFailureBehavior() ) && ( exception instanceof ReactorException ) ) + if ( ReactorManager.FAIL_AT_END.equals( rm.getFailureBehavior() ) && + ( exception instanceof ReactorException ) ) { logFailure( response, exception, null ); @@ -311,7 +312,8 @@ public class DefaultMaven getLogger().info( messageBuffer.toString() ); } - private MavenExecutionResponse dispatchErrorResponse( EventDispatcher dispatcher, String event, String baseDirectory, Exception e ) + private MavenExecutionResponse dispatchErrorResponse( EventDispatcher dispatcher, String event, + String baseDirectory, Exception e ) { dispatcher.dispatchError( event, baseDirectory, e ); @@ -325,8 +327,9 @@ public class DefaultMaven } private List collectProjects( List files, ArtifactRepository localRepository, boolean recursive, Settings settings, - ProfileManager globalProfileManager ) - throws ProjectBuildingException, ReactorException, IOException, ArtifactResolutionException, ProfileActivationException + ProfileManager globalProfileManager ) + throws ProjectBuildingException, ReactorException, IOException, ArtifactResolutionException, + ProfileActivationException { List projects = new ArrayList( files.size() ); @@ -341,9 +344,9 @@ public class DefaultMaven MavenProject project = getProject( file, localRepository, settings, globalProfileManager ); - if ( project.getPrerequesites() != null && project.getPrerequesites().getMaven() != null ) + if ( project.getPrerequisites() != null && project.getPrerequisites().getMaven() != null ) { - DefaultArtifactVersion version = new DefaultArtifactVersion( project.getPrerequesites().getMaven() ); + DefaultArtifactVersion version = new DefaultArtifactVersion( project.getPrerequisites().getMaven() ); if ( runtimeInformation.getApplicationVersion().compareTo( version ) < 0 ) { throw new ProjectBuildingException( "Unable to build project '" + project.getFile() + @@ -366,7 +369,8 @@ public class DefaultMaven moduleFiles.add( new File( basedir, name + "/pom.xml" ) ); } - List collectedProjects = collectProjects( moduleFiles, localRepository, recursive, settings, globalProfileManager ); + List collectedProjects = collectProjects( moduleFiles, localRepository, recursive, settings, + globalProfileManager ); projects.addAll( collectedProjects ); project.setCollectedProjects( collectedProjects ); } @@ -377,7 +381,7 @@ public class DefaultMaven } public MavenProject getProject( File pom, ArtifactRepository localRepository, Settings settings, - ProfileManager globalProfileManager ) + ProfileManager globalProfileManager ) throws ProjectBuildingException, ArtifactResolutionException, ProfileActivationException { if ( pom.exists() ) @@ -426,8 +430,7 @@ public class DefaultMaven protected MavenSession createSession( MavenExecutionRequest request, ReactorManager rpm ) { return new MavenSession( container, request.getSettings(), request.getLocalRepository(), - request.getEventDispatcher(), rpm, request.getGoals(), - request.getBaseDirectory() ); + request.getEventDispatcher(), rpm, request.getGoals(), request.getBaseDirectory() ); } /** diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java index 76bfbfc78c..4ad2686dd3 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java @@ -231,10 +231,10 @@ public class DefaultPluginManager MavenProject project = mavenProjectBuilder.buildFromRepository( artifact, remoteRepositories, localRepository ); // if we don't have the required Maven version, then ignore an update - if ( project.getPrerequesites() != null && project.getPrerequesites().getMaven() != null ) + if ( project.getPrerequisites() != null && project.getPrerequisites().getMaven() != null ) { DefaultArtifactVersion requiredVersion = new DefaultArtifactVersion( - project.getPrerequesites().getMaven() ); + project.getPrerequisites().getMaven() ); if ( runtimeInformation.getApplicationVersion().compareTo( requiredVersion ) < 0 ) { throw new PluginVersionResolutionException( plugin.getGroupId(), plugin.getArtifactId(), diff --git a/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java b/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java index 17a11b00fa..b2f5e512fe 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java @@ -79,7 +79,7 @@ public class DefaultPluginVersionManager { return resolvePluginVersion( groupId, artifactId, project, settings, localRepository, false ); } - + public String resolvePluginVersion( String groupId, String artifactId, MavenProject project, Settings settings, ArtifactRepository localRepository, boolean resolveAsReportPlugin ) throws PluginVersionResolutionException @@ -148,9 +148,10 @@ public class DefaultPluginVersionManager // are we using the LATEST metadata to resolve plugin version? Boolean rtCheckLatest = settingsRTInfo.getCheckLatestPluginVersion(); - boolean checkLatestMetadata = Boolean.TRUE.equals( rtCheckLatest ) || - ( !Boolean.FALSE.equals( rtCheckLatest ) && Boolean.valueOf( getPluginRegistry( groupId, artifactId ).getCheckLatest() ) - .booleanValue() ); + boolean checkLatestMetadata = Boolean.TRUE.equals( rtCheckLatest ) || ( + !Boolean.FALSE.equals( rtCheckLatest ) && + Boolean.valueOf( getPluginRegistry( groupId, artifactId ).getCheckLatest() ) + .booleanValue() ); // third pass...if we're checking for latest install/deploy, retrieve the version for LATEST metadata and also // set that resolved version as the in settings.xml. @@ -478,7 +479,8 @@ public class DefaultPluginVersionManager return groupId + ":" + artifactId; } - private String getVersionFromPluginConfig( String groupId, String artifactId, MavenProject project, boolean resolveAsReportPlugin ) + private String getVersionFromPluginConfig( String groupId, String artifactId, MavenProject project, + boolean resolveAsReportPlugin ) { String version = null; @@ -622,15 +624,16 @@ public class DefaultPluginVersionManager Artifact artifact = artifactFactory.createProjectArtifact( groupId, artifactId, metaVersionId ); String version = null; - + try { - ResolutionGroup resolutionGroup = artifactMetadataSource.retrieve( artifact, localRepository, remoteRepositories ); - + ResolutionGroup resolutionGroup = artifactMetadataSource.retrieve( artifact, localRepository, + remoteRepositories ); + // switching this out with the actual resolved artifact instance, since the MMSource re-creates the pom // artifact. artifact = resolutionGroup.getPomArtifact(); - + // make sure this artifact was actually resolved to a file in the repo... if ( artifact.getFile() != null ) { @@ -640,11 +643,11 @@ public class DefaultPluginVersionManager boolean pluginValid = true; // if we don't have the required Maven version, then ignore an update - if ( project.getPrerequesites() != null && project.getPrerequesites().getMaven() != null ) + if ( project.getPrerequisites() != null && project.getPrerequisites().getMaven() != null ) { DefaultArtifactVersion requiredVersion = new DefaultArtifactVersion( - project.getPrerequesites().getMaven() ); - + project.getPrerequisites().getMaven() ); + if ( runtimeInformation.getApplicationVersion().compareTo( requiredVersion ) < 0 ) { getLogger().info( "Ignoring available plugin update: " + artifact.getVersion() + @@ -673,7 +676,7 @@ public class DefaultPluginVersionManager throw new PluginVersionResolutionException( groupId, artifactId, "Unable to determine Maven version for comparison", e ); } - + return version; } diff --git a/maven-project/src/main/java/org/apache/maven/project/MavenProject.java b/maven-project/src/main/java/org/apache/maven/project/MavenProject.java index 063dc4dfbb..bf2d8c6ffb 100644 --- a/maven-project/src/main/java/org/apache/maven/project/MavenProject.java +++ b/maven-project/src/main/java/org/apache/maven/project/MavenProject.java @@ -39,7 +39,7 @@ import org.apache.maven.model.Organization; import org.apache.maven.model.Plugin; import org.apache.maven.model.PluginExecution; import org.apache.maven.model.PluginManagement; -import org.apache.maven.model.Prerequesites; +import org.apache.maven.model.Prerequisites; import org.apache.maven.model.ReportPlugin; import org.apache.maven.model.ReportSet; import org.apache.maven.model.Reporting; @@ -158,7 +158,7 @@ public class MavenProject this.pluginArtifacts = Collections.unmodifiableSet( project.pluginArtifacts ); this.reportArtifacts = Collections.unmodifiableSet( project.reportArtifacts ); this.extensionArtifacts = Collections.unmodifiableSet( project.extensionArtifacts ); - + this.remoteArtifactRepositories = Collections.unmodifiableList( project.remoteArtifactRepositories ); this.pluginArtifactRepositories = Collections.unmodifiableList( project.pluginArtifactRepositories ); this.collectedProjects = Collections.unmodifiableList( project.collectedProjects ); @@ -798,9 +798,9 @@ public class MavenProject return model.getUrl(); } - public Prerequesites getPrerequesites() + public Prerequisites getPrerequisites() { - return model.getPrerequesites(); + return model.getPrerequisites(); } public void setIssueManagement( IssueManagement issueManagement ) @@ -996,7 +996,7 @@ public class MavenProject public void setPluginArtifacts( Set pluginArtifacts ) { this.pluginArtifacts = pluginArtifacts; - + this.pluginArtifactMap = null; } @@ -1018,7 +1018,7 @@ public class MavenProject public void setReportArtifacts( Set reportArtifacts ) { this.reportArtifacts = reportArtifacts; - + this.reportArtifactMap = null; } @@ -1040,7 +1040,7 @@ public class MavenProject public void setExtensionArtifacts( Set extensionArtifacts ) { this.extensionArtifacts = extensionArtifacts; - + this.extensionArtifactMap = null; }