attempt to fix CI by forcing the use of mboot built snapshots

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163725 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-03-31 10:54:32 +00:00
parent 369eb05569
commit c700675257
1 changed files with 18 additions and 32 deletions

View File

@ -11,6 +11,7 @@ import org.xml.sax.helpers.DefaultHandler;
import test.SurefirePlugin; import test.SurefirePlugin;
import util.Commandline; import util.Commandline;
import util.FileUtils; import util.FileUtils;
import util.IOUtil;
import util.IsolatedClassLoader; import util.IsolatedClassLoader;
import util.Os; import util.Os;
@ -19,7 +20,9 @@ import javax.xml.parsers.SAXParserFactory;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.Serializable; import java.io.Serializable;
import java.io.StringReader;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.ArrayList; import java.util.ArrayList;
@ -81,10 +84,10 @@ public class MBoot
String[] pluginBuilds = new String[]{"maven-plugins/maven-assemble-plugin", "maven-plugins/maven-clean-plugin", String[] pluginBuilds = new String[]{"maven-plugins/maven-assemble-plugin", "maven-plugins/maven-clean-plugin",
"maven-plugins/maven-compiler-plugin", "maven-plugins/maven-deploy-plugin", "maven-plugins/maven-compiler-plugin", "maven-plugins/maven-deploy-plugin",
"maven-plugins/maven-ejb-plugin", "maven-plugins/maven-install-plugin", "maven-plugins/maven-ejb-plugin", /*"maven-plugins/maven-idea-plugin",*/
"maven-plugins/maven-jar-plugin", "maven-plugins/maven-plugin-plugin", "maven-plugins/maven-install-plugin", "maven-plugins/maven-jar-plugin",
"maven-plugins/maven-resources-plugin", "maven-plugins/maven-surefire-plugin", "maven-plugins/maven-plugin-plugin", "maven-plugins/maven-resources-plugin",
"maven-plugins/maven-war-plugin"}; "maven-plugins/maven-surefire-plugin", "maven-plugins/maven-war-plugin"};
private static final Map MODELLO_TARGET_VERSIONS; private static final Map MODELLO_TARGET_VERSIONS;
@ -659,11 +662,11 @@ public class MBoot
if ( !reader.artifactId.equals( "maven-plugin" ) && reader.artifactId.endsWith( "plugin" ) ) if ( !reader.artifactId.equals( "maven-plugin" ) && reader.artifactId.endsWith( "plugin" ) )
{ {
installPlugin( basedir, repoLocal, reader ); install( basedir, repoLocal, reader, "maven-plugin" );
} }
else else
{ {
installJar( basedir, repoLocal, reader ); install( basedir, repoLocal, reader, "jar" );
} }
return reader; return reader;
@ -850,7 +853,7 @@ public class MBoot
FileUtils.copyFile( new File( basedir, "pom.xml" ), pom ); FileUtils.copyFile( new File( basedir, "pom.xml" ), pom );
} }
private void installJar( String basedir, String repoLocal, ModelReader reader ) private void install( String basedir, String repoLocal, ModelReader reader, String type )
throws Exception throws Exception
{ {
String artifactId = reader.artifactId; String artifactId = reader.artifactId;
@ -869,37 +872,20 @@ public class MBoot
version = reader.parentVersion; version = reader.parentVersion;
} }
File jar = new File( repoLocal, "/" + groupId + "/jars/" + artifactId + "-" + version + ".jar" ); String finalName = artifactId + "-" + version;
System.out.println( "Installing JAR: " + jar ); File file = new File( repoLocal, "/" + groupId + "/" + type + "s/" + finalName + ".jar" );
FileUtils.copyFile( new File( basedir, BUILD_DIR + "/" + artifactId + "-" + version + ".jar" ), jar ); System.out.println( "Installing: " + file );
}
private void installPlugin( String basedir, String repoLocal, ModelReader reader ) FileUtils.copyFile( new File( basedir, BUILD_DIR + "/" + finalName + ".jar" ), file );
throws Exception
if ( version.indexOf( "SNAPSHOT" ) >= 0 )
{ {
String artifactId = reader.artifactId; File metadata = new File( repoLocal, "/" + groupId + "/poms/" + finalName + ".version.txt" );
String version = reader.version; IOUtil.copy( new StringReader( version ), new FileWriter( metadata ) );
String groupId = reader.groupId;
if ( groupId == null )
{
groupId = reader.parentGroupId;
} }
if ( version == null )
{
version = reader.parentVersion;
}
File jar = new File( repoLocal, "/" + groupId + "/maven-plugins/" + artifactId + "-" + version + ".jar" );
System.out.println( "Installing Plugin: " + jar );
FileUtils.copyFile( new File( basedir, BUILD_DIR + "/" + artifactId + "-" + version + ".jar" ), jar );
} }
private void runTests( String basedir, String classes, String testClasses, ModelReader reader ) private void runTests( String basedir, String classes, String testClasses, ModelReader reader )