public void execute()

in src/main/java/org/apache/maven/artifact/ant/Mvn.java [56:92]


    public void execute()
        throws BuildException
    {
        if ( batchMode )
        {
            this.createArg().setValue( BATCH_MODE );
        }
        
        if ( pom != null )
        {
            createArg().setValue( "-f" + pom.getAbsolutePath() );
        }
        
        if ( localRepository != null )
        {
            this.createJvmarg().setValue( "-Dmaven.repo.local=" + localRepository.getPath().getAbsolutePath() );
        }
        
        if ( mavenHome == null )
        {
            Pattern oldMaven = Pattern.compile("(2\\.0)|(2\\.0-.*)|(2\\.0\\.[1-9])");
            if ( oldMaven.matcher( getMavenVersion() ).matches() )
            {
                throw new BuildException( "The requested Maven version '" + getMavenVersion() + "' is prior to " +
                                          "version '2.0.10'. In order to launch the requested version you need to " +
                                          "use a local Maven installation and point to that installation with the " +
                                          "mavenHome attribute." );
            }
            downloadAndConfigureMaven();
        }
        else
        {
            setupLocalMaven();
        }
        
        super.execute();
    }