make script executable

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@344861 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-11-16 03:23:18 +00:00
parent f684990abc
commit c21cbfa66c
5 changed files with 33 additions and 7 deletions

View File

@ -12,5 +12,10 @@
<artifactId>bootstrap-mini</artifactId>
<version>2.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>1.0.4</version>
</dependency>
</dependencies>
</project>

View File

@ -20,6 +20,9 @@ import org.apache.maven.bootstrap.model.Dependency;
import org.apache.maven.bootstrap.model.ModelReader;
import org.apache.maven.bootstrap.util.FileUtils;
import org.apache.maven.bootstrap.Bootstrap;
import org.codehaus.plexus.util.Os;
import org.codehaus.plexus.util.cli.Commandline;
import org.codehaus.plexus.util.cli.CommandLineException;
import java.io.File;
import java.io.IOException;
@ -71,7 +74,7 @@ public class BootstrapInstaller
}
private void createInstallation( File dir )
throws IOException
throws IOException, CommandLineException, InterruptedException
{
FileUtils.deleteDirectory( dir );
@ -117,5 +120,18 @@ public class BootstrapInstaller
File srcBinDirectory = new File( reader.getProjectFile().getParentFile(), "src/bin" );
FileUtils.copyDirectory( srcBinDirectory, binDirectory, null, "**/.svn/**" );
if ( Os.isFamily( "unix" ) )
{
Commandline cli = new Commandline();
cli.setExecutable( "chmod" );
cli.createArgument().setValue( "+x" );
cli.createArgument().setValue( new File( binDirectory, "mvn" ).getAbsolutePath() );
cli.execute().waitFor();
}
}
}

View File

@ -1,2 +1,3 @@
Manifest-Version: 1.0
Main-Class: org.apache.maven.bootstrap.installer.BootstrapInstaller
Class-Path: bootstrap-mini-2.0.1-SNAPSHOT.jar plexus-utils-1.0.4.jar

View File

@ -138,16 +138,20 @@ public class Bootstrap
String basedir = System.getProperty( "user.dir" );
File pom = new File( basedir, "pom.xml" );
ModelReader reader = readModel( resolver, pom, true );
File jar = buildProject( reader );
if ( "install".equals( goal ) )
{
File pom = new File( basedir, "pom.xml" );
ModelReader reader = readModel( resolver, pom, true );
File jar = buildProject( reader );
install( reader, pom, jar );
}
else
for ( Iterator i = reader.getDependencies().iterator(); i.hasNext(); )
{
buildProject( new File( basedir ), false );
Dependency dep = (Dependency) i.next();
FileUtils.copyFileToDirectory( resolver.getArtifactFile( dep ), jar.getParentFile() );
}
stats( fullStart, new Date() );

View File

@ -17,6 +17,6 @@ BOOTSTRAP_JAR=../bootstrap-mini/target/bootstrap-mini-2.0.1-SNAPSHOT.jar
(
cd ..
java -classpath bootstrap/bootstrap-installer/target/bootstrap-installer-2.0.1-SNAPSHOT.jar:bootstrap/bootstrap-mini/target/bootstrap-mini-2.0.1-SNAPSHOT.jar org.apache.maven.bootstrap.installer.BootstrapInstaller
java -jar bootstrap/bootstrap-installer/target/bootstrap-installer-2.0.1-SNAPSHOT.jar
)