Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Maven User
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<p>With the current Mojo descriptor extractor, it is possible to inherit Mojo annotations from parent classes, but not across projects. With this, it is e.g. not possible to subclass a "built-in" Maven mojo and inherit the annotations, or to refactor common Mojo code into a separate "Base Mojo" project, because the subclass lives in a different project. Since the annotation inheritance also only looks at parent classes, it is not possible to have annotated Mojo interfaces, e.g. for a Compiler which has different implementations.</p> <p>To allow this, it should be possible to specify a list of prototypes for a Mojo. The descriptor extractor would then load the descriptors of these prototypes (from the plugin.xml) and merge them into a base descriptor for the Mojo, allowing it to inherit the annotations.</p> <p>Example with MNG-2521 annotations:</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> @Goal(goal = "clustered") public interface ClusteredMojo { @Parameter private void setClusterController(String controller) { //... } } @Goal(goal = "compile", prototypes = { @Prototype(groupId="org.apache.maven.plugin", artifactId="maven-compiler-plugin", goal="compile"), @Prototype(goal="clustered")} ) public class MyCompilerMojo extends CompilerMojo implements ClusteredMojo { // ... } </pre></td></tr></table> <p>For convenience, the groupId and artifactId default to the current project's values, and the goal to the current annotation's goal.</p> <p>For this to work, the descriptor extractors should also create descriptors for annotated interfaces and abstract classes. These should be written into the plugin.xml and filtered out by the PluginDiscoverer, so they cannot be accessed normally.</p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced