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