1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 package org.apache.maven.plugin.prefix; 20 21 import java.util.List; 22 23 import org.apache.maven.model.Model; 24 import org.eclipse.aether.RepositorySystemSession; 25 import org.eclipse.aether.repository.RemoteRepository; 26 27 /** 28 * Collects settings required to resolve a plugin prefix. 29 * 30 * @since 3.0 31 * @author Benjamin Bentmann 32 */ 33 public interface PluginPrefixRequest { 34 35 /** 36 * Gets the prefix of the plugin. 37 * 38 * @return The prefix of the plugin. 39 */ 40 String getPrefix(); 41 42 /** 43 * Sets the prefix of the plugin. 44 * 45 * @param prefix The prefix of the plugin. 46 * @return This request, never {@code null}. 47 */ 48 PluginPrefixRequest setPrefix(String prefix); 49 50 /** 51 * Gets the list of group ids to scan for the plugin prefix. 52 * 53 * @return The list of group ids to scan for the plugin prefix, never {@code null}. 54 */ 55 List<String> getPluginGroups(); 56 57 /** 58 * Sets the list of group ids to scan for the plugin prefix. 59 * 60 * @param pluginGroups The list of group ids to scan for the plugin prefix, may be {@code null}. 61 * @return This request, never {@code null}. 62 */ 63 PluginPrefixRequest setPluginGroups(List<String> pluginGroups); 64 65 /** 66 * Gets the POM whose build plugins are to be scanned for the prefix. 67 * 68 * @return The POM whose build plugins are to be scanned for the prefix or {@code null} to only search the plugin 69 * repositories. 70 */ 71 Model getPom(); 72 73 /** 74 * Sets the POM whose build plugins are to be scanned for the prefix. 75 * 76 * @param pom The POM whose build plugins are to be scanned for the prefix, may be {@code null} to only search the 77 * plugin repositories. 78 * @return This request, never {@code null}. 79 */ 80 PluginPrefixRequest setPom(Model pom); 81 82 /** 83 * Gets the remote repositories to use. 84 * 85 * @return The remote repositories to use, never {@code null}. 86 */ 87 List<RemoteRepository> getRepositories(); 88 89 /** 90 * Sets the remote repositories to use. <em>Note:</em> When creating a request from a project, be sure to use the 91 * plugin repositories and not the regular project repositories. 92 * 93 * @param repositories The remote repositories to use. 94 * @return This request, never {@code null}. 95 */ 96 PluginPrefixRequest setRepositories(List<RemoteRepository> repositories); 97 98 /** 99 * Gets the session to use for repository access. 100 * 101 * @return The repository session or {@code null} if not set. 102 */ 103 RepositorySystemSession getRepositorySession(); 104 105 /** 106 * Sets the session to use for repository access. 107 * 108 * @param repositorySession The repository session to use. 109 * @return This request, never {@code null}. 110 */ 111 PluginPrefixRequest setRepositorySession(RepositorySystemSession repositorySession); 112 }