mirror of https://github.com/apache/maven.git
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:
parent
a1f995029a
commit
c141200c39
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue