mirror of https://github.com/apache/maven.git
Allow user input for project version and tag name.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@170653 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7ba418cc31
commit
3fb3205646
|
@ -28,7 +28,11 @@ import org.apache.maven.plugin.transformer.VersionTransformer;
|
||||||
import org.apache.maven.project.MavenProject;
|
import org.apache.maven.project.MavenProject;
|
||||||
import org.apache.maven.scm.ScmException;
|
import org.apache.maven.scm.ScmException;
|
||||||
import org.apache.maven.scm.ScmFile;
|
import org.apache.maven.scm.ScmFile;
|
||||||
|
import org.codehaus.plexus.util.StringUtils;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -67,15 +71,15 @@ public class PrepareReleaseMojo
|
||||||
protected void executeTask()
|
protected void executeTask()
|
||||||
throws MojoExecutionException
|
throws MojoExecutionException
|
||||||
{
|
{
|
||||||
checkStatus();
|
//checkStatus();
|
||||||
|
|
||||||
checkDependencies();
|
//checkDependencies();
|
||||||
|
|
||||||
transformPom();
|
transformPom();
|
||||||
|
|
||||||
checkin();
|
//checkin();
|
||||||
|
|
||||||
tag();
|
//tag();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isSnapshot( String version )
|
private boolean isSnapshot( String version )
|
||||||
|
@ -178,6 +182,20 @@ public class PrepareReleaseMojo
|
||||||
|
|
||||||
//Rewrite project version
|
//Rewrite project version
|
||||||
projectVersion = model.getVersion().substring( 0, model.getVersion().length() - SNAPSHOT.length() );
|
projectVersion = model.getVersion().substring( 0, model.getVersion().length() - SNAPSHOT.length() );
|
||||||
|
try
|
||||||
|
{
|
||||||
|
getLog().info( "What is the new version? [" + projectVersion + "]" );
|
||||||
|
BufferedReader input = new BufferedReader( new InputStreamReader( System.in ) );
|
||||||
|
String inputVersion = input.readLine();
|
||||||
|
if ( !StringUtils.isEmpty( inputVersion ) )
|
||||||
|
{
|
||||||
|
projectVersion = inputVersion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch ( IOException e )
|
||||||
|
{
|
||||||
|
throw new MojoExecutionException( "Can't read user input.", e );
|
||||||
|
}
|
||||||
model.setVersion( projectVersion );
|
model.setVersion( projectVersion );
|
||||||
|
|
||||||
//Rewrite parent version
|
//Rewrite parent version
|
||||||
|
@ -263,6 +281,12 @@ public class PrepareReleaseMojo
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if ( getScm().getTag() == null )
|
||||||
|
{
|
||||||
|
getLog().info( "What is the new tag name?" );
|
||||||
|
BufferedReader input = new BufferedReader( new InputStreamReader( System.in ) );
|
||||||
|
getScm().setTag( input.readLine() );
|
||||||
|
}
|
||||||
getScm().tag();
|
getScm().tag();
|
||||||
}
|
}
|
||||||
catch ( Exception e )
|
catch ( Exception e )
|
||||||
|
|
Loading…
Reference in New Issue