From d31da596eeec6d77fbbcca0cf05d06083562d064 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Wed, 14 Sep 2005 23:45:29 +0000 Subject: [PATCH] set eol style git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@280967 13f79535-47bb-0310-9956-ffa450edef68 --- .../plugins/release/PerformReleaseMojo.java | 274 +++++++++--------- 1 file changed, 137 insertions(+), 137 deletions(-) diff --git a/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java b/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java index 19b29fa9fe..7f2babe6b3 100644 --- a/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java +++ b/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java @@ -1,137 +1,137 @@ -package org.apache.maven.plugins.release; - -/* - * Copyright 2001-2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugins.release.helpers.ReleaseProgressTracker; -import org.apache.maven.plugins.release.helpers.ScmHelper; -import org.codehaus.plexus.util.cli.CommandLineException; -import org.codehaus.plexus.util.cli.CommandLineUtils; -import org.codehaus.plexus.util.cli.Commandline; -import org.codehaus.plexus.util.cli.DefaultConsumer; -import org.codehaus.plexus.util.cli.StreamConsumer; - -import java.io.IOException; - -/** - * Perform a release from SCM - * - * @author Emmanuel Venisse - * @version $Id: DoxiaMojo.java 169372 2005-05-09 22:47:34Z evenisse $ - * @aggregator - * @goal perform - */ -public class PerformReleaseMojo - extends AbstractReleaseMojo -{ - /** - * @parameter expression="${basedir}" - * @required - * @readonly - */ - private String basedir; - - /** - * @parameter expression="${goals}" - */ - private String goals = "deploy"; - - /** - * @parameter expression="${project.build.directory}/checkout" - * @required - */ - protected String workingDirectory; - - private ReleaseProgressTracker releaseProgress; - - protected void executeTask() - throws MojoExecutionException - { - checkout(); - - runGoals(); - } - - private void checkout() - throws MojoExecutionException - { - getLog().info( "Checking out the project to perform the release ..." ); - - try - { - ScmHelper scm = getScm( workingDirectory ); - - scm.checkout(); - } - catch ( Exception e ) - { - throw new MojoExecutionException( "An error is occurred in the checkout process.", e ); - } - } - - private void runGoals() - throws MojoExecutionException - { - // TODO: we need to get a reference to the maven component and use that so this - // will work purely in an embedded mode. Not sure how to pass the release setting to the plugin in that - // instance though - still via -D, or is there a better way? - - Commandline cl = new Commandline(); - - cl.setExecutable( "m2" ); - - cl.setWorkingDirectory( workingDirectory ); - - cl.createArgument().setLine( goals ); - - cl.createArgument().setLine( "-DperformRelease=true" ); - - cl.createArgument().setLine( "--no-plugin-updates" ); - - cl.createArgument().setLine( "--batch-mode" ); - - StreamConsumer consumer = new DefaultConsumer(); - - try - { - CommandLineUtils.executeCommandLine( cl, consumer, consumer ); - } - catch ( CommandLineException e ) - { - throw new MojoExecutionException( "Can't run goal " + goals, e ); - } - } - - protected ReleaseProgressTracker getReleaseProgress() - throws MojoExecutionException - { - if ( releaseProgress == null ) - { - try - { - releaseProgress = ReleaseProgressTracker.load( basedir ); - } - catch ( IOException e ) - { - throw new MojoExecutionException( "Failed to load release information from file: " + - ReleaseProgressTracker.getReleaseProgressFilename(), e ); - } - } - - return releaseProgress; - } -} +package org.apache.maven.plugins.release; + +/* + * Copyright 2001-2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.release.helpers.ReleaseProgressTracker; +import org.apache.maven.plugins.release.helpers.ScmHelper; +import org.codehaus.plexus.util.cli.CommandLineException; +import org.codehaus.plexus.util.cli.CommandLineUtils; +import org.codehaus.plexus.util.cli.Commandline; +import org.codehaus.plexus.util.cli.DefaultConsumer; +import org.codehaus.plexus.util.cli.StreamConsumer; + +import java.io.IOException; + +/** + * Perform a release from SCM + * + * @author Emmanuel Venisse + * @version $Id: DoxiaMojo.java 169372 2005-05-09 22:47:34Z evenisse $ + * @aggregator + * @goal perform + */ +public class PerformReleaseMojo + extends AbstractReleaseMojo +{ + /** + * @parameter expression="${basedir}" + * @required + * @readonly + */ + private String basedir; + + /** + * @parameter expression="${goals}" + */ + private String goals = "deploy"; + + /** + * @parameter expression="${project.build.directory}/checkout" + * @required + */ + protected String workingDirectory; + + private ReleaseProgressTracker releaseProgress; + + protected void executeTask() + throws MojoExecutionException + { + checkout(); + + runGoals(); + } + + private void checkout() + throws MojoExecutionException + { + getLog().info( "Checking out the project to perform the release ..." ); + + try + { + ScmHelper scm = getScm( workingDirectory ); + + scm.checkout(); + } + catch ( Exception e ) + { + throw new MojoExecutionException( "An error is occurred in the checkout process.", e ); + } + } + + private void runGoals() + throws MojoExecutionException + { + // TODO: we need to get a reference to the maven component and use that so this + // will work purely in an embedded mode. Not sure how to pass the release setting to the plugin in that + // instance though - still via -D, or is there a better way? + + Commandline cl = new Commandline(); + + cl.setExecutable( "m2" ); + + cl.setWorkingDirectory( workingDirectory ); + + cl.createArgument().setLine( goals ); + + cl.createArgument().setLine( "-DperformRelease=true" ); + + cl.createArgument().setLine( "--no-plugin-updates" ); + + cl.createArgument().setLine( "--batch-mode" ); + + StreamConsumer consumer = new DefaultConsumer(); + + try + { + CommandLineUtils.executeCommandLine( cl, consumer, consumer ); + } + catch ( CommandLineException e ) + { + throw new MojoExecutionException( "Can't run goal " + goals, e ); + } + } + + protected ReleaseProgressTracker getReleaseProgress() + throws MojoExecutionException + { + if ( releaseProgress == null ) + { + try + { + releaseProgress = ReleaseProgressTracker.load( basedir ); + } + catch ( IOException e ) + { + throw new MojoExecutionException( "Failed to load release information from file: " + + ReleaseProgressTracker.getReleaseProgressFilename(), e ); + } + } + + return releaseProgress; + } +}