MNG-3274: Adding a flag to the metadata source so that at some point soon we can start turning on a strict mode that is just not going to allow a system without POMs.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@592260 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2007-11-06 03:59:37 +00:00
parent a1f995029a
commit c141200c39
1 changed files with 9 additions and 3 deletions

View File

@ -88,6 +88,9 @@ public class MavenMetadataSource
private PlexusContainer container;
/** Unfortunately we have projects that are still sending us JARs without the accompanying POMs. */
private boolean strictlyEnforceThePresenceOfAValidMavenPOM = false;
/**
* Retrieve the metadata for the project from the repository.
* Uses the ProjectBuilder, to enable post-processing and inheritance calculation before retrieving the
@ -110,6 +113,7 @@ public class MavenMetadataSource
MavenProject project = null;
Artifact pomArtifact;
boolean done = false;
do
{
@ -157,12 +161,14 @@ public class MavenMetadataSource
}
catch ( ProjectBuildingException e )
{
throw new ArtifactMetadataRetrievalException( "Unable to read the metadata file for artifact '" +
artifact.getDependencyConflictId() + "': " + e.getMessage(), e, artifact );
if ( strictlyEnforceThePresenceOfAValidMavenPOM )
{
throw new ArtifactMetadataRetrievalException( "Unable to read the metadata file for artifact '" +
artifact.getDependencyConflictId() + "': " + e.getMessage(), e, artifact );
}
}
}
if ( project != null )
{
Relocation relocation = null;