mirror of https://github.com/apache/maven.git
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:
parent
f684990abc
commit
c21cbfa66c
|
@ -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>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue