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.tools.plugin.extractor; 20 21 import java.util.List; 22 23 import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException; 24 import org.apache.maven.plugin.descriptor.MojoDescriptor; 25 import org.apache.maven.tools.plugin.PluginToolsRequest; 26 27 /** 28 * @author jdcasey 29 */ 30 public interface MojoDescriptorExtractor { 31 /** 32 * Returns the "name" (id) of the extractor. 33 * 34 * @since 3.7.0 35 */ 36 String getName(); 37 38 /** 39 * Returns {@code true} if extractor is deprecated. 40 * 41 * @since 3.7.0 42 */ 43 boolean isDeprecated(); 44 45 /** 46 * Returns the {@link GroupKey} of extractor, as {@link org.apache.maven.tools.plugin.scanner.MojoScanner} will 47 * execute them grouped, and ordered within groups. Must never return {@code null}. 48 * 49 * @since 3.7.0 50 */ 51 GroupKey getGroupKey(); 52 53 /** 54 * Execute the mojo extraction. 55 * 56 * @param request The {@link PluginToolsRequest} containing information for the extraction process. 57 * @return a list of mojo descriptors. These may return HTML values for some fields. 58 * @throws ExtractionException if any 59 * @throws InvalidPluginDescriptorException if any 60 * @since 2.5 61 */ 62 List<MojoDescriptor> execute(PluginToolsRequest request) 63 throws ExtractionException, InvalidPluginDescriptorException; 64 65 /** 66 * The default implementation returns {@code null}. 67 * @return the required java version or {@code null} if unknown 68 * 69 * @since 3.8.0 70 */ 71 default String getRequiredJavaVersion() { 72 return null; 73 } 74 }