1 /*
2 The MIT License
3
4 Copyright (c) 2004, The Codehaus
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy of
7 this software and associated documentation files (the "Software"), to deal in
8 the Software without restriction, including without limitation the rights to
9 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10 of the Software, and to permit persons to whom the Software is furnished to do
11 so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in all
14 copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 SOFTWARE.
23 */
24 package org.codehaus.mojo.scmchangelog.scm.util;
25
26 import java.util.List;
27 import org.apache.maven.plugin.MojoExecutionException;
28 import org.apache.maven.scm.ScmException;
29 import org.apache.maven.scm.ScmFileSet;
30 import org.apache.maven.scm.ScmVersion;
31 import org.apache.maven.scm.manager.ScmManager;
32 import org.apache.maven.scm.repository.ScmRepository;
33 import org.codehaus.mojo.scmchangelog.changelog.log.grammar.GrammarEnum;
34
35 /**
36 * Empty Adapter to be used as a defaut scm adapter throwing UnsupportedOperationException.
37 * @author ehsavoie
38 * @version $Id$
39 */
40 public class DefaultScmAdapter extends ScmAdapter
41 {
42
43 /**
44 * Constructor of ScmAdapter.
45 * @param currentManager the ScmManager to access SCM elements.
46 * @param currentGrammar the grammar used to extract elements from the comments.
47 */
48 public DefaultScmAdapter( ScmManager currentManager, GrammarEnum currentGrammar )
49 {
50 super( currentManager, currentGrammar );
51 }
52
53 /**
54 * Returns the list of releases defined in a SCM repository.
55 * @param repository the SCM repository.
56 * @param fileSet the base fileset.
57 * @return the list of releases defined in the SCM. <code>List<Release></code>
58 * @throws org.apache.maven.scm.ScmException in case of an error with the SCM.
59 * @throws org.apache.maven.plugin.MojoExecutionException in case of an error in executing the Mojo.
60 */
61 public List getListOfReleases( ScmRepository repository,
62 ScmFileSet fileSet )
63 throws MojoExecutionException, ScmException
64 {
65 throw new MojoExecutionException( "Unsupported SCM" );
66 }
67
68 /**
69 * Returns the Scm version.
70 * @param versionType the type of version (tag, trunk, branch).
71 * @param version the tag/branche name.
72 * @return the corresponding ScmVersion.
73 * @throws org.apache.maven.plugin.MojoExecutionException in case of an error in executing the Mojo.
74 */
75 public ScmVersion getScmVersion( ScmTarget versionType, String version )
76 throws MojoExecutionException
77 {
78 throw new MojoExecutionException( "Unsupported SCM" );
79 }
80 }