001/*
002 * Copyright 2012-2018 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.boot.cli.compiler.dependencies;
018
019/**
020 * A resolver for artifacts' Maven coordinates, allowing group id, artifact id, or version
021 * to be obtained from a module identifier. A module identifier may be in the form
022 * {@code groupId:artifactId:version}, in which case coordinate resolution simply extracts
023 * the relevant piece from the identifier. Alternatively the identifier may be in the form
024 * {@code artifactId}, in which case coordinate resolution uses implementation-specific
025 * metadata to resolve the groupId and version.
026 *
027 * @author Andy Wilkinson
028 */
029public interface ArtifactCoordinatesResolver {
030
031        /**
032         * Gets the group id of the artifact identified by the given {@code module}. Returns
033         * {@code null} if the artifact is unknown to the resolver.
034         * @param module the id of the module
035         * @return the group id of the module
036         */
037        String getGroupId(String module);
038
039        /**
040         * Gets the artifact id of the artifact identified by the given {@code module}.
041         * Returns {@code null} if the artifact is unknown to the resolver.
042         * @param module the id of the module
043         * @return the artifact id of the module
044         */
045        String getArtifactId(String module);
046
047        /**
048         * Gets the version of the artifact identified by the given {@code module}. Returns
049         * {@code null} if the artifact is unknown to the resolver.
050         * @param module the id of the module
051         * @return the version of the module
052         */
053        String getVersion(String module);
054
055}