View Javadoc
1   package org.codehaus.plexus.maven.plugin;
2   
3   /*
4    * The MIT License
5    *
6    * Copyright (c) 2004-2006, The Codehaus
7    *
8    * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
9    * associated documentation files (the "Software"), to deal in the Software without restriction,
10   * including without limitation the rights to use, copy, modify, merge, publish, distribute,
11   * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
12   * furnished to do so, subject to the following conditions:
13   *
14   * The above copyright notice and this permission notice shall be included in all copies or
15   * substantial portions of the Software.
16   *
17   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
18   * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19   * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20   * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22   */
23  
24  import java.util.List;
25  
26  import org.apache.maven.plugin.AbstractMojo;
27  import org.apache.maven.plugins.annotations.Component;
28  import org.apache.maven.plugins.annotations.Parameter;
29  import org.apache.maven.project.MavenProject;
30  import org.apache.maven.project.MavenProjectHelper;
31  import org.codehaus.plexus.metadata.MetadataGenerator;
32  
33  /**
34   * Base class for Plexus Metadata mojos.
35   *
36   * @author Jason van Zyl
37   */
38  public abstract class AbstractDescriptorMojo extends AbstractMojo {
39  
40      /**
41       * Current project
42       */
43      @Parameter(defaultValue = "${project}", required = true, readonly = true)
44      protected MavenProject mavenProject;
45  
46      /**
47       * The file encoding of the source files.
48       */
49      @Parameter(defaultValue = "${project.build.sourceEncoding}")
50      protected String sourceEncoding;
51  
52      /**
53       * The extractors to use. By default all available extractors will be used.
54       * Known extractors:
55       * <ul>
56       * <li>source</li>
57       * <li>class</li>
58       * </ul>
59       */
60      @Parameter
61      protected List<String> extractors;
62  
63      @Component
64      protected MavenProjectHelper mavenProjectHelper;
65  
66      @Component
67      protected MetadataGenerator metadataGenerator;
68  }