You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gautham Pamu <ga...@gmail.com> on 2006/05/02 19:03:00 UTC

m2 tag a build using scm api overwrote the branch

Hi Everyone,

I had a branch ix_dev and when I tried to tag the head, it overwrote the
changes from the head to the branch.. why did it overwrite the branch with
the head code. I am missing some
argument ..
I was using this code in my plugin to tag the branch..

[INFO] [scm:tag]
[INFO] Executing: cvs -z3 -f -d
:ext:gpamu@cvs.cs.opensource.ibm.com:/cvsroot/csdp/ -q tag -F -c
b20060502-0914
[INFO] Working directory: /opt/continuum/apps/working-directory/2
[WARNING] Unknown status: '? '.
[WARNING] Unknown status: '? '.


cl.setExecutable( "mvn" );
        getLog().info("WorkingDirectory " + this.workingDirectory.getPath
());

        cl.setWorkingDirectory( this.workingDirectory.getPath());

        if ( this.goals != null )
        {
            String [] tokens = StringUtils.split( this.goals, ", " );

            for ( int i = 0; i < tokens.length; ++i )
            {
                cl.createArgument().setValue( tokens[i] );
            }
        }
        String buildDir = getBuildDir();
        String tagName = tagPrefix + buildDir;
        cl.createArgument().setValue("-Dtag=" + tagName);
        System.setProperty("csdp.buildDirectory", buildDir);

        StreamConsumer consumer = new DefaultConsumer();

        try
        {
            int result = CommandLineUtils.executeCommandLine( cl, consumer,
consumer );

            if ( result != 0 )
            {
                throw new MojoExecutionException( "Result of mvn execution
is: \'" + result + "\'. Release failed." );
            }
        }
        catch ( CommandLineException e )
        {
            throw new MojoExecutionException( "Can't run goal " + goals, e
);
        }

--
-Gautham Pamu