mirror of https://github.com/apache/maven.git
finish correcting spelling of prerequisites
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@289355 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9262d5171e
commit
139efa3bdf
|
@ -136,7 +136,7 @@ public class DefaultMaven
|
||||||
List files = getProjectFiles( request );
|
List files = getProjectFiles( request );
|
||||||
|
|
||||||
List projects = collectProjects( files, request.getLocalRepository(), request.isRecursive(),
|
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
|
// 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.
|
// 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
|
// TODO: yuck! Revisit when cleaning up the exception handling from the top down
|
||||||
Throwable exception = response.getException();
|
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 );
|
logFailure( response, exception, null );
|
||||||
|
|
||||||
|
@ -311,7 +312,8 @@ public class DefaultMaven
|
||||||
getLogger().info( messageBuffer.toString() );
|
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 );
|
dispatcher.dispatchError( event, baseDirectory, e );
|
||||||
|
|
||||||
|
@ -325,8 +327,9 @@ public class DefaultMaven
|
||||||
}
|
}
|
||||||
|
|
||||||
private List collectProjects( List files, ArtifactRepository localRepository, boolean recursive, Settings settings,
|
private List collectProjects( List files, ArtifactRepository localRepository, boolean recursive, Settings settings,
|
||||||
ProfileManager globalProfileManager )
|
ProfileManager globalProfileManager )
|
||||||
throws ProjectBuildingException, ReactorException, IOException, ArtifactResolutionException, ProfileActivationException
|
throws ProjectBuildingException, ReactorException, IOException, ArtifactResolutionException,
|
||||||
|
ProfileActivationException
|
||||||
{
|
{
|
||||||
List projects = new ArrayList( files.size() );
|
List projects = new ArrayList( files.size() );
|
||||||
|
|
||||||
|
@ -341,9 +344,9 @@ public class DefaultMaven
|
||||||
|
|
||||||
MavenProject project = getProject( file, localRepository, settings, globalProfileManager );
|
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 )
|
if ( runtimeInformation.getApplicationVersion().compareTo( version ) < 0 )
|
||||||
{
|
{
|
||||||
throw new ProjectBuildingException( "Unable to build project '" + project.getFile() +
|
throw new ProjectBuildingException( "Unable to build project '" + project.getFile() +
|
||||||
|
@ -366,7 +369,8 @@ public class DefaultMaven
|
||||||
moduleFiles.add( new File( basedir, name + "/pom.xml" ) );
|
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 );
|
projects.addAll( collectedProjects );
|
||||||
project.setCollectedProjects( collectedProjects );
|
project.setCollectedProjects( collectedProjects );
|
||||||
}
|
}
|
||||||
|
@ -377,7 +381,7 @@ public class DefaultMaven
|
||||||
}
|
}
|
||||||
|
|
||||||
public MavenProject getProject( File pom, ArtifactRepository localRepository, Settings settings,
|
public MavenProject getProject( File pom, ArtifactRepository localRepository, Settings settings,
|
||||||
ProfileManager globalProfileManager )
|
ProfileManager globalProfileManager )
|
||||||
throws ProjectBuildingException, ArtifactResolutionException, ProfileActivationException
|
throws ProjectBuildingException, ArtifactResolutionException, ProfileActivationException
|
||||||
{
|
{
|
||||||
if ( pom.exists() )
|
if ( pom.exists() )
|
||||||
|
@ -426,8 +430,7 @@ public class DefaultMaven
|
||||||
protected MavenSession createSession( MavenExecutionRequest request, ReactorManager rpm )
|
protected MavenSession createSession( MavenExecutionRequest request, ReactorManager rpm )
|
||||||
{
|
{
|
||||||
return new MavenSession( container, request.getSettings(), request.getLocalRepository(),
|
return new MavenSession( container, request.getSettings(), request.getLocalRepository(),
|
||||||
request.getEventDispatcher(), rpm, request.getGoals(),
|
request.getEventDispatcher(), rpm, request.getGoals(), request.getBaseDirectory() );
|
||||||
request.getBaseDirectory() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -231,10 +231,10 @@ public class DefaultPluginManager
|
||||||
MavenProject project = mavenProjectBuilder.buildFromRepository( artifact, remoteRepositories,
|
MavenProject project = mavenProjectBuilder.buildFromRepository( artifact, remoteRepositories,
|
||||||
localRepository );
|
localRepository );
|
||||||
// if we don't have the required Maven version, then ignore an update
|
// 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(
|
DefaultArtifactVersion requiredVersion = new DefaultArtifactVersion(
|
||||||
project.getPrerequesites().getMaven() );
|
project.getPrerequisites().getMaven() );
|
||||||
if ( runtimeInformation.getApplicationVersion().compareTo( requiredVersion ) < 0 )
|
if ( runtimeInformation.getApplicationVersion().compareTo( requiredVersion ) < 0 )
|
||||||
{
|
{
|
||||||
throw new PluginVersionResolutionException( plugin.getGroupId(), plugin.getArtifactId(),
|
throw new PluginVersionResolutionException( plugin.getGroupId(), plugin.getArtifactId(),
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class DefaultPluginVersionManager
|
||||||
{
|
{
|
||||||
return resolvePluginVersion( groupId, artifactId, project, settings, localRepository, false );
|
return resolvePluginVersion( groupId, artifactId, project, settings, localRepository, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
public String resolvePluginVersion( String groupId, String artifactId, MavenProject project, Settings settings,
|
public String resolvePluginVersion( String groupId, String artifactId, MavenProject project, Settings settings,
|
||||||
ArtifactRepository localRepository, boolean resolveAsReportPlugin )
|
ArtifactRepository localRepository, boolean resolveAsReportPlugin )
|
||||||
throws PluginVersionResolutionException
|
throws PluginVersionResolutionException
|
||||||
|
@ -148,9 +148,10 @@ public class DefaultPluginVersionManager
|
||||||
// are we using the LATEST metadata to resolve plugin version?
|
// are we using the LATEST metadata to resolve plugin version?
|
||||||
Boolean rtCheckLatest = settingsRTInfo.getCheckLatestPluginVersion();
|
Boolean rtCheckLatest = settingsRTInfo.getCheckLatestPluginVersion();
|
||||||
|
|
||||||
boolean checkLatestMetadata = Boolean.TRUE.equals( rtCheckLatest ) ||
|
boolean checkLatestMetadata = Boolean.TRUE.equals( rtCheckLatest ) || (
|
||||||
( !Boolean.FALSE.equals( rtCheckLatest ) && Boolean.valueOf( getPluginRegistry( groupId, artifactId ).getCheckLatest() )
|
!Boolean.FALSE.equals( rtCheckLatest ) &&
|
||||||
.booleanValue() );
|
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
|
// third pass...if we're checking for latest install/deploy, retrieve the version for LATEST metadata and also
|
||||||
// set that resolved version as the <useVersion/> in settings.xml.
|
// set that resolved version as the <useVersion/> in settings.xml.
|
||||||
|
@ -478,7 +479,8 @@ public class DefaultPluginVersionManager
|
||||||
return groupId + ":" + artifactId;
|
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;
|
String version = null;
|
||||||
|
|
||||||
|
@ -622,15 +624,16 @@ public class DefaultPluginVersionManager
|
||||||
Artifact artifact = artifactFactory.createProjectArtifact( groupId, artifactId, metaVersionId );
|
Artifact artifact = artifactFactory.createProjectArtifact( groupId, artifactId, metaVersionId );
|
||||||
|
|
||||||
String version = null;
|
String version = null;
|
||||||
|
|
||||||
try
|
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
|
// switching this out with the actual resolved artifact instance, since the MMSource re-creates the pom
|
||||||
// artifact.
|
// artifact.
|
||||||
artifact = resolutionGroup.getPomArtifact();
|
artifact = resolutionGroup.getPomArtifact();
|
||||||
|
|
||||||
// make sure this artifact was actually resolved to a file in the repo...
|
// make sure this artifact was actually resolved to a file in the repo...
|
||||||
if ( artifact.getFile() != null )
|
if ( artifact.getFile() != null )
|
||||||
{
|
{
|
||||||
|
@ -640,11 +643,11 @@ public class DefaultPluginVersionManager
|
||||||
boolean pluginValid = true;
|
boolean pluginValid = true;
|
||||||
|
|
||||||
// if we don't have the required Maven version, then ignore an update
|
// 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(
|
DefaultArtifactVersion requiredVersion = new DefaultArtifactVersion(
|
||||||
project.getPrerequesites().getMaven() );
|
project.getPrerequisites().getMaven() );
|
||||||
|
|
||||||
if ( runtimeInformation.getApplicationVersion().compareTo( requiredVersion ) < 0 )
|
if ( runtimeInformation.getApplicationVersion().compareTo( requiredVersion ) < 0 )
|
||||||
{
|
{
|
||||||
getLogger().info( "Ignoring available plugin update: " + artifact.getVersion() +
|
getLogger().info( "Ignoring available plugin update: " + artifact.getVersion() +
|
||||||
|
@ -673,7 +676,7 @@ public class DefaultPluginVersionManager
|
||||||
throw new PluginVersionResolutionException( groupId, artifactId,
|
throw new PluginVersionResolutionException( groupId, artifactId,
|
||||||
"Unable to determine Maven version for comparison", e );
|
"Unable to determine Maven version for comparison", e );
|
||||||
}
|
}
|
||||||
|
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ import org.apache.maven.model.Organization;
|
||||||
import org.apache.maven.model.Plugin;
|
import org.apache.maven.model.Plugin;
|
||||||
import org.apache.maven.model.PluginExecution;
|
import org.apache.maven.model.PluginExecution;
|
||||||
import org.apache.maven.model.PluginManagement;
|
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.ReportPlugin;
|
||||||
import org.apache.maven.model.ReportSet;
|
import org.apache.maven.model.ReportSet;
|
||||||
import org.apache.maven.model.Reporting;
|
import org.apache.maven.model.Reporting;
|
||||||
|
@ -158,7 +158,7 @@ public class MavenProject
|
||||||
this.pluginArtifacts = Collections.unmodifiableSet( project.pluginArtifacts );
|
this.pluginArtifacts = Collections.unmodifiableSet( project.pluginArtifacts );
|
||||||
this.reportArtifacts = Collections.unmodifiableSet( project.reportArtifacts );
|
this.reportArtifacts = Collections.unmodifiableSet( project.reportArtifacts );
|
||||||
this.extensionArtifacts = Collections.unmodifiableSet( project.extensionArtifacts );
|
this.extensionArtifacts = Collections.unmodifiableSet( project.extensionArtifacts );
|
||||||
|
|
||||||
this.remoteArtifactRepositories = Collections.unmodifiableList( project.remoteArtifactRepositories );
|
this.remoteArtifactRepositories = Collections.unmodifiableList( project.remoteArtifactRepositories );
|
||||||
this.pluginArtifactRepositories = Collections.unmodifiableList( project.pluginArtifactRepositories );
|
this.pluginArtifactRepositories = Collections.unmodifiableList( project.pluginArtifactRepositories );
|
||||||
this.collectedProjects = Collections.unmodifiableList( project.collectedProjects );
|
this.collectedProjects = Collections.unmodifiableList( project.collectedProjects );
|
||||||
|
@ -798,9 +798,9 @@ public class MavenProject
|
||||||
return model.getUrl();
|
return model.getUrl();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Prerequesites getPrerequesites()
|
public Prerequisites getPrerequisites()
|
||||||
{
|
{
|
||||||
return model.getPrerequesites();
|
return model.getPrerequisites();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIssueManagement( IssueManagement issueManagement )
|
public void setIssueManagement( IssueManagement issueManagement )
|
||||||
|
@ -996,7 +996,7 @@ public class MavenProject
|
||||||
public void setPluginArtifacts( Set pluginArtifacts )
|
public void setPluginArtifacts( Set pluginArtifacts )
|
||||||
{
|
{
|
||||||
this.pluginArtifacts = pluginArtifacts;
|
this.pluginArtifacts = pluginArtifacts;
|
||||||
|
|
||||||
this.pluginArtifactMap = null;
|
this.pluginArtifactMap = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1018,7 +1018,7 @@ public class MavenProject
|
||||||
public void setReportArtifacts( Set reportArtifacts )
|
public void setReportArtifacts( Set reportArtifacts )
|
||||||
{
|
{
|
||||||
this.reportArtifacts = reportArtifacts;
|
this.reportArtifacts = reportArtifacts;
|
||||||
|
|
||||||
this.reportArtifactMap = null;
|
this.reportArtifactMap = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1040,7 +1040,7 @@ public class MavenProject
|
||||||
public void setExtensionArtifacts( Set extensionArtifacts )
|
public void setExtensionArtifacts( Set extensionArtifacts )
|
||||||
{
|
{
|
||||||
this.extensionArtifacts = extensionArtifacts;
|
this.extensionArtifacts = extensionArtifacts;
|
||||||
|
|
||||||
this.extensionArtifactMap = null;
|
this.extensionArtifactMap = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue