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 */
32 public interface PluginPrefixRequest {
33
34 /**
35 * Gets the prefix of the plugin.
36 *
37 * @return The prefix of the plugin.
38 */
39 String getPrefix();
40
41 /**
42 * Sets the prefix of the plugin.
43 *
44 * @param prefix The prefix of the plugin.
45 * @return This request, never {@code null}.
46 */
47 PluginPrefixRequest setPrefix(String prefix);
48
49 /**
50 * Gets the list of group ids to scan for the plugin prefix.
51 *
52 * @return The list of group ids to scan for the plugin prefix, never {@code null}.
53 */
54 List<String> getPluginGroups();
55
56 /**
57 * Sets the list of group ids to scan for the plugin prefix.
58 *
59 * @param pluginGroups The list of group ids to scan for the plugin prefix, may be {@code null}.
60 * @return This request, never {@code null}.
61 */
62 PluginPrefixRequest setPluginGroups(List<String> pluginGroups);
63
64 /**
65 * Gets the POM whose build plugins are to be scanned for the prefix.
66 *
67 * @return The POM whose build plugins are to be scanned for the prefix or {@code null} to only search the plugin
68 * repositories.
69 */
70 Model getPom();
71
72 /**
73 * Sets the POM whose build plugins are to be scanned for the prefix.
74 *
75 * @param pom The POM whose build plugins are to be scanned for the prefix, may be {@code null} to only search the
76 * plugin repositories.
77 * @return This request, never {@code null}.
78 */
79 PluginPrefixRequest setPom(Model pom);
80
81 /**
82 * Gets the remote repositories to use.
83 *
84 * @return The remote repositories to use, never {@code null}.
85 */
86 List<RemoteRepository> getRepositories();
87
88 /**
89 * Sets the remote repositories to use. <em>Note:</em> When creating a request from a project, be sure to use the
90 * plugin repositories and not the regular project repositories.
91 *
92 * @param repositories The remote repositories to use.
93 * @return This request, never {@code null}.
94 */
95 PluginPrefixRequest setRepositories(List<RemoteRepository> repositories);
96
97 /**
98 * Gets the session to use for repository access.
99 *
100 * @return The repository session or {@code null} if not set.
101 */
102 RepositorySystemSession getRepositorySession();
103
104 /**
105 * Sets the session to use for repository access.
106 *
107 * @param repositorySession The repository session to use.
108 * @return This request, never {@code null}.
109 */
110 PluginPrefixRequest setRepositorySession(RepositorySystemSession repositorySession);
111 }