You are viewing a plain text version of this content. The canonical link for it is here.
Posted to m2-dev@maven.apache.org by jv...@apache.org on 2004/07/27 00:02:58 UTC
cvs commit: maven-components/maven-mboot2/src/main/resources mboot.deps
jvanzyl 2004/07/26 15:02:58
Modified: maven-mboot2 build mboot.jar
maven-mboot2/src/main/java MBoot.java
Removed: maven-mboot2/src/main/resources mboot.deps
Log:
o some changes to make things work on windows, shouldn't have bothered
with files at all.
Revision Changes Path
1.2 +0 -2 maven-components/maven-mboot2/build
Index: build
===================================================================
RCS file: /home/cvs/maven-components/maven-mboot2/build,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- build 26 Jul 2004 03:53:13 -0000 1.1
+++ build 26 Jul 2004 22:02:57 -0000 1.2
@@ -8,6 +8,4 @@
javac -d ${buildDir} @sources.txt
-cp src/main/resources/mboot.deps ${buildDir}/mboot.deps
-
( cd ${buildDir} ; jar -cf ../mboot.jar -m ../manifest.txt * )
1.2 +108 -102 maven-components/maven-mboot2/mboot.jar
<<Binary file>>
1.2 +111 -106 maven-components/maven-mboot2/src/main/java/MBoot.java
Index: MBoot.java
===================================================================
RCS file: /home/cvs/maven-components/maven-mboot2/src/main/java/MBoot.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MBoot.java 26 Jul 2004 03:53:18 -0000 1.1
+++ MBoot.java 26 Jul 2004 22:02:58 -0000 1.2
@@ -12,7 +12,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
-import java.io.StringWriter;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
@@ -39,6 +38,37 @@
// maven-plugins
// ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ String[] deps = new String[]
+ {
+ "junit/jars/junit-3.8.1.jar",
+ "surefire/jars/surefire-booter-1.1.jar",
+ "surefire/jars/surefire-1.1.jar",
+ "modello/jars/modello-1.0-SNAPSHOT.jar",
+ "xpp3/jars/xpp3-1.1.3.3.jar",
+ "xstream/jars/xstream-1.0-SNAPSHOT.jar",
+ "qdox/jars/qdox-1.2.jar",
+ "maven/jars/maven-plugin-2.0-SNAPSHOT.jar"
+ };
+
+ String[] builds = new String[]
+ {
+ "maven-model",
+ "maven-plugin",
+ "maven-core",
+ "maven-plugins/maven-clean-plugin",
+ "maven-plugins/maven-compiler-plugin",
+ "maven-plugins/maven-install-plugin",
+ "maven-plugins/maven-jar-plugin",
+ "maven-plugins/maven-plugin-plugin",
+ "maven-plugins/maven-pom-plugin",
+ "maven-plugins/maven-resources-plugin",
+ "maven-plugins/maven-surefire-plugin"
+ };
+
+ // ----------------------------------------------------------------------
// Standard locations for resources in Maven projects.
// ----------------------------------------------------------------------
@@ -101,154 +131,137 @@
checkMBootDeps();
- File instructions = new File( basedir, "mboot.txt" );
-
- if ( instructions.exists() )
+ for ( int i = 0; i < builds.length; i++ )
{
- FileInputStream is = new FileInputStream( instructions );
+ String directory = new File( basedir, builds[i] ).getAbsolutePath();
- StringWriter w = new StringWriter();
+ System.out.println( "Building project in " + directory + " ..." );
- IOUtil.copy( is, w );
+ System.out.println( "--------------------------------------------------------------------" );
- String[] deps = StringUtils.split( w.toString(), "\n" );
+ System.setProperty( "basedir", directory );
- for ( int i = 0; i < deps.length; i++ )
- {
- String directory = new File( basedir, deps[i] ).getAbsolutePath();
-
- System.out.println( "Building project in " + directory + " ..." );
+ buildProject( directory );
- System.out.println( "--------------------------------------------------------------------" );
+ if ( reader.artifactId.equals( "maven-core" ) )
+ {
+ coreDeps = reader.getDependencies();
+ }
- System.setProperty( "basedir", directory );
+ reader.reset();
- buildProject( directory );
+ System.out.println( "--------------------------------------------------------------------" );
+ }
- if ( reader.artifactId.equals( "maven-core" ) )
- {
- coreDeps = reader.getDependencies();
- }
+ // build the installation
- reader.reset();
+ String mavenHome;
- System.out.println( "--------------------------------------------------------------------" );
- }
-
- // build the installation
+ if ( args.length == 1 )
+ {
+ mavenHome = args[0];
+ }
+ else
+ {
+ mavenHome = System.getProperty( "M2_HOME" );
- String mavenHome;
+ System.out.println( "mavenHome = " + mavenHome );
- if ( args.length == 1 )
+ if ( mavenHome == null )
{
- mavenHome = args[0];
+ mavenHome = new File( System.getProperty( "user.home" ), "m2" ).getAbsolutePath();
}
- else
- {
- mavenHome = System.getProperty( "M2_HOME" );
-
- System.out.println( "mavenHome = " + mavenHome );
+ }
- if ( mavenHome == null )
- {
- mavenHome = new File( System.getProperty( "user.home" ), "m2" ).getAbsolutePath();
- }
- }
+ File dist = new File( mavenHome );
- File dist = new File( mavenHome );
+ FileUtils.deleteDirectory( dist );
- FileUtils.deleteDirectory( dist );
+ // ----------------------------------------------------------------------
+ // bin
+ // ----------------------------------------------------------------------
- // ----------------------------------------------------------------------
- // bin
- // ----------------------------------------------------------------------
+ String bin = new File( dist, "bin" ).getAbsolutePath();
- String bin = new File( dist, "bin" ).getAbsolutePath();
+ FileUtils.mkdir( new File( bin ).getPath() );
- FileUtils.mkdir( new File( bin ).getPath() );
+ FileUtils.copyFileToDirectory( new File( basedir, "maven-core/src/bin/m2" ).getAbsolutePath(), bin );
- FileUtils.copyFileToDirectory( new File( basedir, "maven-core/src/bin/m2" ).getAbsolutePath(), bin );
+ FileUtils.copyFileToDirectory( new File( basedir, "maven-core/src/bin/m2.bat" ).getAbsolutePath(), bin );
- FileUtils.copyFileToDirectory( new File( basedir, "maven-core/src/bin/m2.bat" ).getAbsolutePath(), bin );
+ FileUtils.copyFileToDirectory( new File( basedir, "maven-core/src/bin/classworlds.conf" ).getAbsolutePath(), bin );
- FileUtils.copyFileToDirectory( new File( basedir, "maven-core/src/bin/classworlds.conf" ).getAbsolutePath(), bin );
+ if ( Os.isFamily( "unix" ) )
+ {
+ Commandline cli = new Commandline();
- if ( Os.isFamily( "unix" ) )
- {
- Commandline cli = new Commandline();
+ cli.setExecutable( "chmod" );
- cli.setExecutable( "chmod" );
+ cli.createArgument().setValue( "+x" );
- cli.createArgument().setValue( "+x" );
+ cli.createArgument().setValue( new File( dist, "bin/m2" ).getAbsolutePath() );
- cli.createArgument().setValue( new File( dist, "bin/m2" ).getAbsolutePath() );
+ cli.execute();
+ }
- cli.execute();
- }
+ // ----------------------------------------------------------------------
+ // core
+ // ----------------------------------------------------------------------
- // ----------------------------------------------------------------------
- // core
- // ----------------------------------------------------------------------
+ String core = new File( dist, "core" ).getAbsolutePath();
- String core = new File( dist, "core" ).getAbsolutePath();
+ FileUtils.mkdir( new File( core ).getPath() );
- FileUtils.mkdir( new File( core ).getPath() );
+ FileUtils.copyFileToDirectory( repoLocal + "/classworlds/jars/classworlds-1.1-SNAPSHOT.jar", core );
- FileUtils.copyFileToDirectory( repoLocal + "/classworlds/jars/classworlds-1.1-SNAPSHOT.jar", core );
+ FileUtils.copyFileToDirectory( repoLocal + "/plexus/jars/plexus-0.14-SNAPSHOT.jar", core );
- FileUtils.copyFileToDirectory( repoLocal + "/plexus/jars/plexus-0.14-SNAPSHOT.jar", core );
+ FileUtils.copyFileToDirectory( repoLocal + "/xpp3/jars/xpp3-1.1.3.3.jar", core );
- FileUtils.copyFileToDirectory( repoLocal + "/xpp3/jars/xpp3-1.1.3.3.jar", core );
+ FileUtils.copyFileToDirectory( repoLocal + "/xstream/jars/xstream-1.0-SNAPSHOT.jar", core );
- FileUtils.copyFileToDirectory( repoLocal + "/xstream/jars/xstream-1.0-SNAPSHOT.jar", core );
+ // ----------------------------------------------------------------------
+ // lib
+ // ----------------------------------------------------------------------
- // ----------------------------------------------------------------------
- // lib
- // ----------------------------------------------------------------------
+ String lib = new File( dist, "lib" ).getAbsolutePath();
- String lib = new File( dist, "lib" ).getAbsolutePath();
+ FileUtils.mkdir( new File( lib ).getPath() );
- FileUtils.mkdir( new File( lib ).getPath() );
+ for ( Iterator i = coreDeps.iterator(); i.hasNext(); )
+ {
+ Dependency d = (Dependency) i.next();
- for ( Iterator i = coreDeps.iterator(); i.hasNext(); )
+ if ( d.getArtifactId().equals( "classworlds" ) ||
+ d.artifactId.equals( "plexus" ) ||
+ d.artifactId.equals( "xstream" ) ||
+ d.artifactId.equals( "xpp3" ) )
{
- Dependency d = (Dependency) i.next();
-
- if ( d.getArtifactId().equals( "classworlds" ) ||
- d.artifactId.equals( "plexus" ) ||
- d.artifactId.equals( "xstream" ) ||
- d.artifactId.equals( "xpp3" ) )
- {
- continue;
- }
-
- FileUtils.copyFileToDirectory( repoLocal + "/" + getArtifactPath( d, "/" ), lib );
+ continue;
}
- // Copy maven itself
+ FileUtils.copyFileToDirectory( repoLocal + "/" + getArtifactPath( d, "/" ), lib );
+ }
- FileUtils.copyFileToDirectory( repoLocal + "/maven/jars/maven-core-2.0-SNAPSHOT.jar", lib );
+ // Copy maven itself
- // ----------------------------------------------------------------------
- // plugins
- // ----------------------------------------------------------------------
+ FileUtils.copyFileToDirectory( repoLocal + "/maven/jars/maven-core-2.0-SNAPSHOT.jar", lib );
- String plugins = new File( dist, "plugins" ).getAbsolutePath();
+ // ----------------------------------------------------------------------
+ // plugins
+ // ----------------------------------------------------------------------
- FileUtils.mkdir( new File( plugins ).getPath() );
+ String plugins = new File( dist, "plugins" ).getAbsolutePath();
- List libs = FileUtils.getFiles( new File( basedir, "maven-plugins" ), "**/target/*.jar", null );
+ FileUtils.mkdir( new File( plugins ).getPath() );
- for ( Iterator i = libs.iterator(); i.hasNext(); )
- {
- File f = (File) i.next();
+ List libs = FileUtils.getFiles( new File( basedir, "maven-plugins" ), "**/target/*.jar", null );
- FileUtils.copyFileToDirectory( f.getAbsolutePath(), plugins );
- }
- }
- else
+ for ( Iterator i = libs.iterator(); i.hasNext(); )
{
- buildProject( basedir );
+ File f = (File) i.next();
+
+ FileUtils.copyFileToDirectory( f.getAbsolutePath(), plugins );
}
}
@@ -441,14 +454,6 @@
throws Exception
{
System.out.println( "Checking for MBoot's dependencies ..." );
-
- InputStream is = MBoot.class.getClassLoader().getResourceAsStream( "mboot.deps" );
-
- StringWriter w = new StringWriter();
-
- IOUtil.copy( is, w );
-
- String[] deps = StringUtils.split( w.toString(), "\n" );
mbootDependencies = Arrays.asList( deps );