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