// TODO: only build this guy, then move the next part to a new phase using it for resolution
// Root POM
// buildProject( basedir, "", resolver, false );
// buildProject( basedir, "maven-artifact-manager", resolver );
Model mavenRootModel = bootstrapper.readModel(new File(basedir, "pom.xml"), false);
String finalName = "apache-maven-" + mavenRootModel.getVersion();
File destDirFile = new File(destDir);
if (!finalName.equals(destDirFile.getName())) {
throw new Exception("The Maven install destination directory must end with '" + finalName + "'.\n"
+ "Your destDir was = " + destDirFile.getAbsolutePath() + "\n"
+ "we recommend = " + new File(destDirFile.getParent(), finalName).getAbsolutePath());
}
bootstrapper.buildProject( new File( basedir ), true );
Model mavenCoreModel = bootstrapper.getCachedModel( MAVEN_GROUPID, "maven-core" );
File installation = new File( basedir, "bootstrap/target/installation" );
createInstallation( installation, mavenCoreModel );
// TODO: should just need assembly from basedir
runMaven( installation, new File( basedir ), new String[]{"clean", "install"} );
File mavenCoreDir = mavenCoreModel.getProjectFile().getParentFile();
runMaven( installation, mavenCoreDir, new String[]{"clean", "assembly:assembly"} );
File file = new File( mavenCoreDir, "target/" + finalName + "-bin.zip" );
File mavenHome = new File( destDir );