Author: brett
Date: Thu Jul 21 23:32:06 2005
New Revision: 220250
URL: http://svn.apache.org/viewcvs?rev=220250&view=rev
Log:
PR: MNG-461
warn, but don't fail, when a POM is not in the repository
Modified:
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
Modified:
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=220250&r1=220249&r2=220250&view=diff
==============================================================================
---
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
(original)
+++
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
Thu Jul 21 23:32:06 2005
@@ -255,17 +255,26 @@
try
{
artifactResolver.resolve( artifact,
remoteArtifactRepositories, localRepository );
+
+ File file = artifact.getFile();
+ model = readModel( file );
}
catch ( ArtifactResolutionException e )
{
// TODO: a not found would be better vs other errors
- throw new ProjectBuildingException( "Unable to find the POM in
the repository", e );
- }
+ // only not found should have the below behaviour
+// throw new ProjectBuildingException( "Unable to find the POM
in the repository", e );
-// String path = localRepository.pathOfMetadata( new
ProjectArtifactMetadata( artifact, null ) );
-// File file = new File( localRepository.getBasedir(), path );
- File file = artifact.getFile();
- model = readModel( file );
+ getLogger().warn( "\n ***** Using defaults for missing POM "
+ artifact.getId() + " *****\n" );
+
+ model = new Model();
+ model.setModelVersion( "4.0.0" );
+ model.setArtifactId( artifact.getArtifactId() );
+ model.setGroupId( artifact.getGroupId() );
+ model.setVersion( artifact.getVersion() );
+ // TOOD: not correct in some instances
+ model.setPackaging( artifact.getType() );
+ }
}
// TODO: this is gross. Would like to give it the whole model, but
maven-artifact shouldn't depend on that
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]