@@ -0,0 +1,2815 @@
+/*%0A * Bach - Java Shell Builder%0A * Copyright (C) 2020 Christian Stein%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     https://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage de.sormuras.bach.project;%0A%0Aimport de.sormuras.bach.internal.Maven;%0A%0A/** A module-uri pair used to resolve external modules. */%0Apublic final class Locator implements Comparable%3CLocator%3E %7B%0A%0A  public static Resource of(String module) %7B%0A    return new Resource(module);%0A  %7D%0A%0A  private final String module;%0A  private final String uri;%0A%0A  public Locator(String module, String uri) %7B%0A    this.module = module;%0A    this.uri = uri;%0A  %7D%0A%0A  public String module() %7B%0A    return module;%0A  %7D%0A%0A  public String uri() %7B%0A    return uri;%0A  %7D%0A%0A  @Override%0A  public int compareTo(Locator other) %7B%0A    return module.compareTo(other.module);%0A  %7D%0A%0A  public static class Resource %7B%0A    private final String module;%0A%0A    public Resource(String module) %7B%0A      this.module = module;%0A    %7D%0A%0A    /**%0A     * Create a new locator pointing to an artifact built by JitPack.%0A     *%0A     * @param user GitHub username or the complete group like %7B@code %22com.azure.$%7BUSER%7D%22%7D%0A     * @param repository Name of the repository or project%0A     * @param version The version string of the repository or project, which is either a release%0A     *     tag, a commit hash, or %7B@code %22$%7BBRANCH%7D-SNAPSHOT%22%7D for a version that has not been%0A     *     released.%0A     * @return A new JitPack-based %7B@code Locator%7D instance%0A     * @see %3Ca href=%22https://jitpack.io/docs%22%3Ejitpack.io%3C/a%3E%0A     */%0A    public Locator fromJitPack(String user, String repository, String version) %7B%0A      var group = user.indexOf('.') == -1 ? %22com.github.%22 + user : user;%0A      var joiner = Maven.Joiner.of(group, repository, version);%0A      return new Locator(module, joiner.repository(%22https://jitpack.io%22).toString());%0A    %7D%0A%0A    /**%0A     * Create a new locator pointing to an artifact hosted at Maven Central.%0A     *%0A     * @param group Maven Group ID%0A     * @param artifact Maven Artifact ID%0A     * @param version The version string%0A     * @return A new Maven Central-based %7B@code Locator%7D instance%0A     * @see %3Ca href=%22https://search.maven.org%22%3Esearch.maven.org%3C/a%3E%0A     */%0A    public Locator fromMavenCentral(String group, String artifact, String version) %7B%0A      return new Locator(module, Maven.central(group, artifact, version));%0A    %7D%0A  %7D%0A%7D%0A

Introduce project module locator