001    package org.apache.maven.tools.plugin.scanner;
002    
003    /*
004     * Licensed to the Apache Software Foundation (ASF) under one
005     * or more contributor license agreements.  See the NOTICE file
006     * distributed with this work for additional information
007     * regarding copyright ownership.  The ASF licenses this file
008     * to you under the Apache License, Version 2.0 (the
009     * "License"); you may not use this file except in compliance
010     * with the License.  You may obtain a copy of the License at
011     *
012     *   http://www.apache.org/licenses/LICENSE-2.0
013     *
014     * Unless required by applicable law or agreed to in writing,
015     * software distributed under the License is distributed on an
016     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017     * KIND, either express or implied.  See the License for the
018     * specific language governing permissions and limitations
019     * under the License.
020     */
021    
022    import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
023    import org.apache.maven.plugin.descriptor.PluginDescriptor;
024    import org.apache.maven.project.MavenProject;
025    import org.apache.maven.tools.plugin.PluginToolsRequest;
026    import org.apache.maven.tools.plugin.extractor.ExtractionException;
027    
028    import java.util.Set;
029    
030    /**
031     * @author jdcasey
032     * @version $Id: MojoScanner.java 1212905 2011-12-10 22:31:48Z hboutemy $
033     */
034    public interface MojoScanner
035    {
036        /** Plexus role for lookup */
037        String ROLE = MojoScanner.class.getName();
038    
039        /**
040         * @param project not null
041         * @param pluginDescriptor not null
042         * @throws ExtractionException if any
043         * @throws InvalidPluginDescriptorException if any
044         * 
045         * @deprecated Use {@link MojoScanner#populatePluginDescriptor(PluginToolsRequest)} instead. 
046         *     Provided for backward compatibility with maven-plugin-plugin < 2.5.
047         */
048        void populatePluginDescriptor( MavenProject project, PluginDescriptor pluginDescriptor )
049            throws ExtractionException, InvalidPluginDescriptorException;
050    
051        /**
052         * @param request not null
053         * @throws ExtractionException if any
054         * @throws InvalidPluginDescriptorException if any
055         * @since 2.5
056         */
057        void populatePluginDescriptor( PluginToolsRequest request )
058            throws ExtractionException, InvalidPluginDescriptorException;
059    
060        /**
061         * Sets the active extractors.
062         * <p/>
063         * Only the specified extractors will be used, all others will be skipped.
064         *
065         * @param extractors The names of the active extractors. If this parameter is <code>null</code>,
066         * all the scanner's extractors are considered active. Set entries that are <code>null</code> or
067         * empty ("") will be ignored.
068         */
069        void setActiveExtractors( Set<String> extractors );
070    
071    }