mirror of https://github.com/apache/maven.git
Add build method that can disable distributionManagement status for file that come from repository
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@312840 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
342ce8cd02
commit
83b8cafc33
|
@ -167,7 +167,7 @@ public class DefaultMavenProjectBuilder
|
|||
ProfileManager profileManager, TransferListener transferListener )
|
||||
throws ProjectBuildingException, ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
MavenProject project = buildFromSourceFile( projectDescriptor, localRepository, profileManager );
|
||||
MavenProject project = build( projectDescriptor, localRepository, profileManager );
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Typically when the project builder is being used from maven proper
|
||||
|
@ -265,11 +265,20 @@ public class DefaultMavenProjectBuilder
|
|||
ProfileManager profileManager )
|
||||
throws ProjectBuildingException
|
||||
{
|
||||
return buildFromSourceFile( projectDescriptor, localRepository, profileManager );
|
||||
return buildFromSourceFile( projectDescriptor, localRepository, profileManager, true );
|
||||
}
|
||||
|
||||
public MavenProject build( File projectDescriptor, ArtifactRepository localRepository,
|
||||
ProfileManager profileManager, boolean checkDistributionManagementStatus )
|
||||
throws ProjectBuildingException
|
||||
{
|
||||
return buildFromSourceFile( projectDescriptor, localRepository, profileManager,
|
||||
checkDistributionManagementStatus );
|
||||
}
|
||||
|
||||
private MavenProject buildFromSourceFile( File projectDescriptor, ArtifactRepository localRepository,
|
||||
ProfileManager profileManager )
|
||||
ProfileManager profileManager,
|
||||
boolean checkDistributionManagementStatus )
|
||||
throws ProjectBuildingException
|
||||
{
|
||||
Model model = readModel( "unknown", projectDescriptor );
|
||||
|
@ -283,11 +292,14 @@ public class DefaultMavenProjectBuilder
|
|||
buildArtifactRepositories( getSuperModel() ),
|
||||
projectDescriptor.getAbsoluteFile().getParentFile(), profileManager );
|
||||
|
||||
if ( checkDistributionManagementStatus )
|
||||
{
|
||||
if ( project.getDistributionManagement() != null && project.getDistributionManagement().getStatus() != null )
|
||||
{
|
||||
throw new ProjectBuildingException( project.getId(),
|
||||
"Invalid project file: distribution status must not be specified for a project outside of the repository" );
|
||||
}
|
||||
}
|
||||
|
||||
// Only translate the base directory for files in the source tree
|
||||
pathTranslator.alignToBaseDirectory( project.getModel(), projectDescriptor.getParentFile() );
|
||||
|
|
Loading…
Reference in New Issue