o actually put a valid GAV in the super pom

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@727290 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2008-12-17 05:39:18 +00:00
parent 084d0b3ed4
commit f869413e44
4 changed files with 22 additions and 17 deletions

View File

@ -20,8 +20,10 @@ under the License.
<!-- START SNIPPET: superpom -->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven</groupId>
<artifactId>super-pom</artifactId>
<version>3.0-SNAPSHOT</version>
<name>Maven Default Project</name>
<repositories>
<repository>
<id>central</id>

View File

@ -22,6 +22,8 @@ package org.apache.maven.project;
import java.io.File;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.io.StringWriter;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@ -44,6 +46,7 @@ import org.apache.maven.model.Build;
import org.apache.maven.model.Model;
import org.apache.maven.model.Profile;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
import org.apache.maven.profiles.MavenProfilesBuilder;
import org.apache.maven.profiles.ProfileManager;
import org.apache.maven.profiles.activation.DefaultProfileActivationContext;
@ -137,8 +140,12 @@ public class DefaultMavenProjectBuilder
public MavenProject build( File projectDescriptor, ProjectBuilderConfiguration config )
throws ProjectBuildingException
{
MavenProject project = readModelFromLocalPath( "unknown", projectDescriptor, new DefaultPomArtifactResolver( config.getLocalRepository(), mavenTools
.buildArtifactRepositories( getSuperModel() ), artifactResolver ), config );
List repositories = mavenTools.buildArtifactRepositories( getSuperModel() );
MavenProject project = readModelFromLocalPath( "unknown",
projectDescriptor,
new DefaultPomArtifactResolver( config.getLocalRepository(),
repositories, artifactResolver ), config );
project.setFile( projectDescriptor );
@ -209,19 +216,14 @@ public class DefaultMavenProjectBuilder
return project;
}
/**
* This is used for pom-less execution like running archetype:generate.
*/
public MavenProject buildStandaloneSuperProject( ProjectBuilderConfiguration config )
throws ProjectBuildingException
{
Model superModel = getSuperModel();
superModel.setGroupId( STANDALONE_SUPERPOM_GROUPID );
superModel.setArtifactId( STANDALONE_SUPERPOM_ARTIFACTID );
superModel.setVersion( STANDALONE_SUPERPOM_VERSION );
superModel = superModel;
ProfileManager profileManager = config.getGlobalProfileManager();
List activeProfiles = new ArrayList();
@ -277,7 +279,7 @@ public class DefaultMavenProjectBuilder
try
{
superModel = Interpolator.interpolateModel(superModel, interpolatorProperties, basedir);
superModel = Interpolator.interpolateModel(superModel, interpolatorProperties, basedir );
}
catch (IOException e)
{
@ -461,8 +463,8 @@ public class DefaultMavenProjectBuilder
try
{
reader = ReaderFactory.newXmlReader( getClass().getResource( "pom-" + MAVEN_MODEL_VERSION + ".xml" ) );
superModel = modelReader.read( reader, STRICT_MODEL_PARSING );
superModel = modelReader.read( reader, STRICT_MODEL_PARSING );
}
catch ( Exception e )
{

View File

@ -47,4 +47,3 @@ public final class PomClassicTransformer
Interpolator.interpolateModelProperties( modelProperties, interpolatorProperties, (PomClassicDomainModel) domainModel);
}
}

View File

@ -20,8 +20,10 @@ under the License.
<!-- START SNIPPET: superpom -->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven</groupId>
<artifactId>super-pom</artifactId>
<version>3.0-SNAPSHOT</version>
<name>Maven Default Project</name>
<repositories>
<repository>
<id>central</id>