Modified: maven/release/trunk/maven-release-plugin/src/it/setup/maven-wagon-provider-dummy/src/main/java/org/apache/maven/wagon/providers/dummy/DummyWagonProvider.java URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/setup/maven-wagon-provider-dummy/src/main/java/org/apache/maven/wagon/providers/dummy/DummyWagonProvider.java?rev=1531451&r1=1531450&r2=1531451&view=diff ============================================================================== --- maven/release/trunk/maven-release-plugin/src/it/setup/maven-wagon-provider-dummy/src/main/java/org/apache/maven/wagon/providers/dummy/DummyWagonProvider.java (original) +++ maven/release/trunk/maven-release-plugin/src/it/setup/maven-wagon-provider-dummy/src/main/java/org/apache/maven/wagon/providers/dummy/DummyWagonProvider.java Fri Oct 11 22:18:49 2013 @@ -1,183 +1,183 @@ -package org.apache.maven.wagon.providers.dummy; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 java.io.File; -import java.util.List; - -import org.apache.maven.wagon.ConnectionException; -import org.apache.maven.wagon.ResourceDoesNotExistException; -import org.apache.maven.wagon.TransferFailedException; -import org.apache.maven.wagon.Wagon; -import org.apache.maven.wagon.authentication.AuthenticationException; -import org.apache.maven.wagon.authentication.AuthenticationInfo; -import org.apache.maven.wagon.authorization.AuthorizationException; -import org.apache.maven.wagon.events.SessionListener; -import org.apache.maven.wagon.events.TransferListener; -import org.apache.maven.wagon.proxy.ProxyInfo; -import org.apache.maven.wagon.proxy.ProxyInfoProvider; -import org.apache.maven.wagon.repository.Repository; - -/** - * DummyWagonProvider which does absolutely nothing - * - * @author Robert Scholte - * - * @plexus.component role="org.apache.maven.wagon.Wagon" role-hint="dummy" instantiation-strategy="per-lookup" - */ -public class DummyWagonProvider implements Wagon -{ - - public void get( String resourceName, File destination ) - throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException - { - } - - public boolean getIfNewer( String resourceName, File destination, long timestamp ) - throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException - { - return false; - } - - public void put( File source, String destination ) - throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException - { - } - - public void putDirectory( File sourceDirectory, String destinationDirectory ) - throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException - { - } - - public boolean resourceExists( String resourceName ) - throws TransferFailedException, AuthorizationException - { - return false; - } - - public List<String> getFileList( String destinationDirectory ) - throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException - { - return null; - } - - public boolean supportsDirectoryCopy() - { - return false; - } - - public Repository getRepository() - { - return null; - } - - public void connect( Repository source ) - throws ConnectionException, AuthenticationException - { - } - - public void connect( Repository source, ProxyInfo proxyInfo ) - throws ConnectionException, AuthenticationException - { - } - - public void connect( Repository source, ProxyInfoProvider proxyInfoProvider ) - throws ConnectionException, AuthenticationException - { - } - - public void connect( Repository source, AuthenticationInfo authenticationInfo ) - throws ConnectionException, AuthenticationException - { - } - - public void connect( Repository source, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo ) - throws ConnectionException, AuthenticationException - { - } - - public void connect( Repository source, AuthenticationInfo authenticationInfo, ProxyInfoProvider proxyInfoProvider ) - throws ConnectionException, AuthenticationException - { - } - - public void openConnection() - throws ConnectionException, AuthenticationException - { - } - - public void disconnect() - throws ConnectionException - { - } - - public void setTimeout( int timeoutValue ) - { - } - - public int getTimeout() - { - return 0; - } - - public void setReadTimeout( int timeoutValue ) - { - } - - public int getReadTimeout() - { - return 0; - } - - public void addSessionListener( SessionListener listener ) - { - } - - public void removeSessionListener( SessionListener listener ) - { - } - - public boolean hasSessionListener( SessionListener listener ) - { - return false; - } - - public void addTransferListener( TransferListener listener ) - { - } - - public void removeTransferListener( TransferListener listener ) - { - } - - public boolean hasTransferListener( TransferListener listener ) - { - return false; - } - - public boolean isInteractive() - { - return false; - } - - public void setInteractive( boolean interactive ) - { - } +package org.apache.maven.wagon.providers.dummy; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 java.io.File; +import java.util.List; + +import org.apache.maven.wagon.ConnectionException; +import org.apache.maven.wagon.ResourceDoesNotExistException; +import org.apache.maven.wagon.TransferFailedException; +import org.apache.maven.wagon.Wagon; +import org.apache.maven.wagon.authentication.AuthenticationException; +import org.apache.maven.wagon.authentication.AuthenticationInfo; +import org.apache.maven.wagon.authorization.AuthorizationException; +import org.apache.maven.wagon.events.SessionListener; +import org.apache.maven.wagon.events.TransferListener; +import org.apache.maven.wagon.proxy.ProxyInfo; +import org.apache.maven.wagon.proxy.ProxyInfoProvider; +import org.apache.maven.wagon.repository.Repository; + +/** + * DummyWagonProvider which does absolutely nothing + * + * @author Robert Scholte + * + * @plexus.component role="org.apache.maven.wagon.Wagon" role-hint="dummy" instantiation-strategy="per-lookup" + */ +public class DummyWagonProvider implements Wagon +{ + + public void get( String resourceName, File destination ) + throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException + { + } + + public boolean getIfNewer( String resourceName, File destination, long timestamp ) + throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException + { + return false; + } + + public void put( File source, String destination ) + throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException + { + } + + public void putDirectory( File sourceDirectory, String destinationDirectory ) + throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException + { + } + + public boolean resourceExists( String resourceName ) + throws TransferFailedException, AuthorizationException + { + return false; + } + + public List<String> getFileList( String destinationDirectory ) + throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException + { + return null; + } + + public boolean supportsDirectoryCopy() + { + return false; + } + + public Repository getRepository() + { + return null; + } + + public void connect( Repository source ) + throws ConnectionException, AuthenticationException + { + } + + public void connect( Repository source, ProxyInfo proxyInfo ) + throws ConnectionException, AuthenticationException + { + } + + public void connect( Repository source, ProxyInfoProvider proxyInfoProvider ) + throws ConnectionException, AuthenticationException + { + } + + public void connect( Repository source, AuthenticationInfo authenticationInfo ) + throws ConnectionException, AuthenticationException + { + } + + public void connect( Repository source, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo ) + throws ConnectionException, AuthenticationException + { + } + + public void connect( Repository source, AuthenticationInfo authenticationInfo, ProxyInfoProvider proxyInfoProvider ) + throws ConnectionException, AuthenticationException + { + } + + public void openConnection() + throws ConnectionException, AuthenticationException + { + } + + public void disconnect() + throws ConnectionException + { + } + + public void setTimeout( int timeoutValue ) + { + } + + public int getTimeout() + { + return 0; + } + + public void setReadTimeout( int timeoutValue ) + { + } + + public int getReadTimeout() + { + return 0; + } + + public void addSessionListener( SessionListener listener ) + { + } + + public void removeSessionListener( SessionListener listener ) + { + } + + public boolean hasSessionListener( SessionListener listener ) + { + return false; + } + + public void addTransferListener( TransferListener listener ) + { + } + + public void removeTransferListener( TransferListener listener ) + { + } + + public boolean hasTransferListener( TransferListener listener ) + { + return false; + } + + public boolean isInteractive() + { + return false; + } + + public void setInteractive( boolean interactive ) + { + } } \ No newline at end of file
Propchange: maven/release/trunk/maven-release-plugin/src/it/setup/maven-wagon-provider-dummy/src/main/java/org/apache/maven/wagon/providers/dummy/DummyWagonProvider.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractScmReleaseMojo.java URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractScmReleaseMojo.java?rev=1531451&r1=1531450&r2=1531451&view=diff ============================================================================== --- maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractScmReleaseMojo.java (original) +++ maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractScmReleaseMojo.java Fri Oct 11 22:18:49 2013 @@ -1,146 +1,146 @@ -package org.apache.maven.plugins.release; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 java.util.Map; - -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.MojoFailureException; -import org.apache.maven.plugins.annotations.Component; -import org.apache.maven.plugins.annotations.Parameter; -import org.apache.maven.scm.manager.ScmManager; -import org.apache.maven.shared.release.config.ReleaseDescriptor; - -/** - * Abstract Mojo containing SCM parameters - * - * @author Robert Scholte - */ -// Extra layer since 2.4. Don't use @since doclet, these would be inherited by the subclasses -public abstract class AbstractScmReleaseMojo - extends AbstractReleaseMojo -{ - /** - * The SCM username to use. - */ - @Parameter( property = "username" ) - private String username; - - /** - * The SCM password to use. - */ - @Parameter( property = "password" ) - private String password; - - /** - * The SCM tag to use. - */ - @Parameter( alias = "releaseLabel", property = "tag" ) - private String tag; - - /** - * Format to use when generating the tag name if none is specified. Property interpolation is performed on the - * tag, but in order to ensure that the interpolation occurs during release, you must use <code>@{...}</code> - * to reference the properties rather than <code>${...}</code>. The following properties are available: - * <ul> - * <li><code>groupId</code> or <code>project.groupId</code> - The groupId of the root project. - * <li><code>artifactId</code> or <code>project.artifactId</code> - The artifactId of the root project. - * <li><code>version</code> or <code>project.version</code> - The release version of the root project. - * </ul> - * - * @since 2.2.0 - */ - @Parameter( defaultValue = "@{project.artifactId}-@{project.version}", property = "tagNameFormat" ) - private String tagNameFormat; - - /** - * The tag base directory in SVN, you must define it if you don't use the standard svn layout (trunk/tags/branches). - * For example, <code>http://svn.apache.org/repos/asf/maven/plugins/tags</code>. The URL is an SVN URL and does not - * include the SCM provider and protocol. - */ - @Parameter( property = "tagBase" ) - private String tagBase; - - /** - * The message prefix to use for all SCM changes. - * - * @since 2.0-beta-5 - */ - @Parameter( defaultValue = "[maven-release-plugin] ", property = "scmCommentPrefix" ) - private String scmCommentPrefix; - - /** - * Implemented with git will or not push changes to the upstream repository. - * <code>true</code> by default to preserve backward compatibility. - * @since 2.1 - */ - @Parameter( defaultValue = "true", property = "pushChanges" ) - private boolean pushChanges = true; - - /** - * Add a new or overwrite the default implementation per provider. - * The key is the scm prefix and the value is the role hint of the {@link org.apache.maven.scm.provider.ScmProvider}. - * - * @since 2.0-beta-6 - * @see ScmManager#setScmProviderImplementation(String, String) - */ - @Parameter - private Map<String, String> providerImplementations; - - /** - * The SCM manager. - */ - @Component - private ScmManager scmManager; - - /** - * {@inheritDoc} - */ - public void execute() - throws MojoExecutionException, MojoFailureException - { - if ( providerImplementations != null ) - { - for ( Map.Entry<String, String> providerEntry : providerImplementations.entrySet() ) - { - getLog().info( "Change the default '" + providerEntry.getKey() + "' provider implementation to '" - + providerEntry.getValue() + "'." ); - scmManager.setScmProviderImplementation( providerEntry.getKey(), providerEntry.getValue() ); - } - } - } - - @Override - protected ReleaseDescriptor createReleaseDescriptor() - { - ReleaseDescriptor descriptor = super.createReleaseDescriptor(); - - descriptor.setScmPassword( password ); - descriptor.setScmReleaseLabel( tag ); - descriptor.setScmTagNameFormat( tagNameFormat ); - descriptor.setScmTagBase( tagBase ); - descriptor.setScmUsername( username ); - descriptor.setScmCommentPrefix( scmCommentPrefix ); - - descriptor.setPushChanges( pushChanges ); - - return descriptor; - } -} +package org.apache.maven.plugins.release; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 java.util.Map; + +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.scm.manager.ScmManager; +import org.apache.maven.shared.release.config.ReleaseDescriptor; + +/** + * Abstract Mojo containing SCM parameters + * + * @author Robert Scholte + */ +// Extra layer since 2.4. Don't use @since doclet, these would be inherited by the subclasses +public abstract class AbstractScmReleaseMojo + extends AbstractReleaseMojo +{ + /** + * The SCM username to use. + */ + @Parameter( property = "username" ) + private String username; + + /** + * The SCM password to use. + */ + @Parameter( property = "password" ) + private String password; + + /** + * The SCM tag to use. + */ + @Parameter( alias = "releaseLabel", property = "tag" ) + private String tag; + + /** + * Format to use when generating the tag name if none is specified. Property interpolation is performed on the + * tag, but in order to ensure that the interpolation occurs during release, you must use <code>@{...}</code> + * to reference the properties rather than <code>${...}</code>. The following properties are available: + * <ul> + * <li><code>groupId</code> or <code>project.groupId</code> - The groupId of the root project. + * <li><code>artifactId</code> or <code>project.artifactId</code> - The artifactId of the root project. + * <li><code>version</code> or <code>project.version</code> - The release version of the root project. + * </ul> + * + * @since 2.2.0 + */ + @Parameter( defaultValue = "@{project.artifactId}-@{project.version}", property = "tagNameFormat" ) + private String tagNameFormat; + + /** + * The tag base directory in SVN, you must define it if you don't use the standard svn layout (trunk/tags/branches). + * For example, <code>http://svn.apache.org/repos/asf/maven/plugins/tags</code>. The URL is an SVN URL and does not + * include the SCM provider and protocol. + */ + @Parameter( property = "tagBase" ) + private String tagBase; + + /** + * The message prefix to use for all SCM changes. + * + * @since 2.0-beta-5 + */ + @Parameter( defaultValue = "[maven-release-plugin] ", property = "scmCommentPrefix" ) + private String scmCommentPrefix; + + /** + * Implemented with git will or not push changes to the upstream repository. + * <code>true</code> by default to preserve backward compatibility. + * @since 2.1 + */ + @Parameter( defaultValue = "true", property = "pushChanges" ) + private boolean pushChanges = true; + + /** + * Add a new or overwrite the default implementation per provider. + * The key is the scm prefix and the value is the role hint of the {@link org.apache.maven.scm.provider.ScmProvider}. + * + * @since 2.0-beta-6 + * @see ScmManager#setScmProviderImplementation(String, String) + */ + @Parameter + private Map<String, String> providerImplementations; + + /** + * The SCM manager. + */ + @Component + private ScmManager scmManager; + + /** + * {@inheritDoc} + */ + public void execute() + throws MojoExecutionException, MojoFailureException + { + if ( providerImplementations != null ) + { + for ( Map.Entry<String, String> providerEntry : providerImplementations.entrySet() ) + { + getLog().info( "Change the default '" + providerEntry.getKey() + "' provider implementation to '" + + providerEntry.getValue() + "'." ); + scmManager.setScmProviderImplementation( providerEntry.getKey(), providerEntry.getValue() ); + } + } + } + + @Override + protected ReleaseDescriptor createReleaseDescriptor() + { + ReleaseDescriptor descriptor = super.createReleaseDescriptor(); + + descriptor.setScmPassword( password ); + descriptor.setScmReleaseLabel( tag ); + descriptor.setScmTagNameFormat( tagNameFormat ); + descriptor.setScmTagBase( tagBase ); + descriptor.setScmUsername( username ); + descriptor.setScmCommentPrefix( scmCommentPrefix ); + + descriptor.setPushChanges( pushChanges ); + + return descriptor; + } +} Propchange: maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractScmReleaseMojo.java ------------------------------------------------------------------------------ svn:eol-style = native