1 package org.apache.maven.shared.release.scm; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 */ 21 22 import org.apache.maven.scm.manager.NoSuchScmProviderException; 23 import org.apache.maven.scm.provider.ScmProvider; 24 import org.apache.maven.scm.repository.ScmRepository; 25 import org.apache.maven.scm.repository.ScmRepositoryException; 26 import org.apache.maven.settings.Settings; 27 import org.apache.maven.shared.release.config.ReleaseDescriptor; 28 29 /** 30 * Configure an SCM repository using release configuration. 31 * 32 * @author <a href="mailto:brett@apache.org">Brett Porter</a> 33 */ 34 public interface ScmRepositoryConfigurator 35 { 36 /** 37 * Construct a configured SCM repository from a release configuration. 38 * 39 * @param releaseDescriptor the configuration to insert into the repository 40 * @param settings the settings.xml configuraiton 41 * @return the repository created 42 * @throws org.apache.maven.scm.repository.ScmRepositoryException if it is not possible to create a suitable 43 * SCM repository 44 * @throws org.apache.maven.scm.manager.NoSuchScmProviderException if the requested SCM provider is not available 45 */ 46 ScmRepository getConfiguredRepository( ReleaseDescriptor releaseDescriptor, Settings settings ) 47 throws ScmRepositoryException, NoSuchScmProviderException; 48 49 /** 50 * Get the SCM provider used for the given SCM repository. 51 * 52 * @param repository the SCM repository 53 * @return the SCM provider 54 * @throws org.apache.maven.scm.manager.NoSuchScmProviderException if the requested SCM provider is not available 55 */ 56 ScmProvider getRepositoryProvider( ScmRepository repository ) 57 throws NoSuchScmProviderException; 58 59 /** 60 * Construct a configured SCM repository from a release configuration with an overridden base SCM URL. 61 * 62 * @param url the SCM URL to use instead of the one from the release descriptor 63 * @param releaseDescriptor the configuration to insert into the repository 64 * @param settings the settings.xml configuraiton 65 * @return the repository created 66 * @throws org.apache.maven.scm.repository.ScmRepositoryException if it is not possible to create a suitable 67 * SCM repository 68 * @throws org.apache.maven.scm.manager.NoSuchScmProviderException if the requested SCM provider is not available 69 */ 70 ScmRepository getConfiguredRepository( String url, ReleaseDescriptor releaseDescriptor, Settings settings ) 71 throws ScmRepositoryException, NoSuchScmProviderException; 72 }