Author: vsiveton
Date: Sat Nov 4 15:27:21 2006
New Revision: 471296
URL: http://svn.apache.org/viewvc?view=rev&rev=471296
Log:
MNG-2306: mojo javadoc annotations support for IntelliJ Idea
Submitted by: Roald Bankras
Reviewed by: Vincent Siveton
o patch applied
Added:
maven/site/trunk/src/site/resources/developers/maven.xml (with props)
Modified:
maven/site/trunk/src/site/xdoc/developers/mojo-api-specification.xml
Added: maven/site/trunk/src/site/resources/developers/maven.xml
URL:
http://svn.apache.org/viewvc/maven/site/trunk/src/site/resources/developers/maven.xml?view=auto&rev=471296
==============================================================================
--- maven/site/trunk/src/site/resources/developers/maven.xml (added)
+++ maven/site/trunk/src/site/resources/developers/maven.xml Sat Nov 4
15:27:21 2006
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templateSet group="maven">
+ <template name="maven.class.aggregator" value="@aggregator $aggregator$"
description="aggregator" toReformat="false" toShortenFQNames="true">
+ <variable name="aggregator" expression="enum("true",
"false")" defaultValue="true, false" alwaysStopAt="true" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_COMMENT" value="true" />
+ <option name="JAVA_STRING" value="false" />
+ <option name="XML" value="false" />
+ <option name="HTML" value="false" />
+ <option name="JSP" value="false" />
+ <option name="COMPLETION" value="false" />
+ <option name="OTHER" value="false" />
+ </context>
+ </template>
+ <template name="maven.class.execute" value="@execute goal="$mojo$"
phase="$phase$" lifecycle="$lifecyle$""
description="executePhase, executeLifecycle, executeGoal" toReformat="false"
toShortenFQNames="true">
+ <variable name="mojo" expression="" defaultValue="" alwaysStopAt="true" />
+ <variable name="phase" expression="enum("validate",
"initialize", "generate-source",
"process-sources", "generate-resources",
"process-resources", "compile",
"process-classes", "generate-test-sources",
"process-test-sources",
"generate-test-resources","process-test-resources",
"test-compile", "test", "package",
"pre-integration-test", "integration-test",
"post-integration-test", "verify", "install",
"deploy")" defaultValue="" alwaysStopAt="true" />
+ <variable name="lifecyle" expression="enum("clean",
"default", "site")" defaultValue="" alwaysStopAt="true" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_COMMENT" value="true" />
+ <option name="JAVA_STRING" value="false" />
+ <option name="XML" value="false" />
+ <option name="HTML" value="false" />
+ <option name="JSP" value="false" />
+ <option name="COMPLETION" value="false" />
+ <option name="OTHER" value="false" />
+ </context>
+ </template>
+ <template name="maven.class.goal" value="@goal $goal$" description="goal"
toReformat="false" toShortenFQNames="true">
+ <variable name="goal" expression="" defaultValue="" alwaysStopAt="true" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_COMMENT" value="true" />
+ <option name="JAVA_STRING" value="false" />
+ <option name="XML" value="false" />
+ <option name="HTML" value="false" />
+ <option name="JSP" value="false" />
+ <option name="COMPLETION" value="false" />
+ <option name="OTHER" value="false" />
+ </context>
+ </template>
+ <template name="maven.class.phase" value="@phase $phase$"
description="phase" toReformat="false" toShortenFQNames="true">
+ <variable name="phase" expression="enum("validate",
"initialize", "generate-source",
"process-sources", "generate-resources",
"process-resources", "compile",
"process-classes", "generate-test-sources",
"process-test-sources",
"generate-test-resources","process-test-resources",
"test-compile", "test", "package",
"pre-integration-test", "integration-test",
"post-integration-test", "verify", "install",
"deploy")" defaultValue="" alwaysStopAt="true" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_COMMENT" value="true" />
+ <option name="JAVA_STRING" value="false" />
+ <option name="XML" value="false" />
+ <option name="HTML" value="false" />
+ <option name="JSP" value="false" />
+ <option name="COMPLETION" value="false" />
+ <option name="OTHER" value="false" />
+ </context>
+ </template>
+ <template name="maven.class.requiresDirectInvocation"
value="@requiresDirectInvocation $requiresDirectInvocation$ "
description="requiresDirectInvocation" toReformat="false"
toShortenFQNames="true">
+ <variable name="requiresDirectInvocation"
expression="enum("false", "true")"
defaultValue=""false"" alwaysStopAt="true" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_COMMENT" value="true" />
+ <option name="JAVA_STRING" value="false" />
+ <option name="XML" value="false" />
+ <option name="HTML" value="false" />
+ <option name="JSP" value="false" />
+ <option name="COMPLETION" value="false" />
+ <option name="OTHER" value="false" />
+ </context>
+ </template>
+ <template name="maven.class.requiresOnline" value="@requiresOnline
$requiresOnline$" description="requiresOnline" toReformat="false"
toShortenFQNames="true">
+ <variable name="requiresOnline" expression="enum("false",
"true")" defaultValue="" alwaysStopAt="true" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_COMMENT" value="true" />
+ <option name="JAVA_STRING" value="false" />
+ <option name="XML" value="false" />
+ <option name="HTML" value="false" />
+ <option name="JSP" value="false" />
+ <option name="COMPLETION" value="false" />
+ <option name="OTHER" value="false" />
+ </context>
+ </template>
+ <template name="maven.class.requiresProject" value="@requiresProject
$requiresProject$" description="requiresProject" toReformat="false"
toShortenFQNames="true">
+ <variable name="requiresProject" expression="enum("true",
"false")" defaultValue="" alwaysStopAt="true" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_COMMENT" value="true" />
+ <option name="JAVA_STRING" value="false" />
+ <option name="XML" value="false" />
+ <option name="HTML" value="false" />
+ <option name="JSP" value="false" />
+ <option name="COMPLETION" value="false" />
+ <option name="OTHER" value="false" />
+ </context>
+ </template>
+ <template name="maven.class.requiresReports" value="@requiresReports
$requiresReports$" description="requiresReports" toReformat="false"
toShortenFQNames="true">
+ <variable name="requiresReports" expression="enum("false",
"true")" defaultValue="" alwaysStopAt="true" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_COMMENT" value="true" />
+ <option name="JAVA_STRING" value="false" />
+ <option name="XML" value="false" />
+ <option name="HTML" value="false" />
+ <option name="JSP" value="false" />
+ <option name="COMPLETION" value="false" />
+ <option name="OTHER" value="false" />
+ </context>
+ </template>
+ <template name="maven.field.component" value="@component
roleHint="$roleHint$"" description="Requirements section"
toReformat="false" toShortenFQNames="true">
+ <variable name="roleHint" expression="" defaultValue=""
alwaysStopAt="true" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_COMMENT" value="true" />
+ <option name="JAVA_STRING" value="false" />
+ <option name="XML" value="false" />
+ <option name="HTML" value="false" />
+ <option name="JSP" value="false" />
+ <option name="COMPLETION" value="false" />
+ <option name="OTHER" value="false" />
+ </context>
+ </template>
+ <template name="maven.field.editable" value="@readonly"
description="editable" toReformat="false" toShortenFQNames="true">
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_COMMENT" value="true" />
+ <option name="JAVA_STRING" value="false" />
+ <option name="XML" value="false" />
+ <option name="HTML" value="false" />
+ <option name="JSP" value="false" />
+ <option name="COMPLETION" value="false" />
+ <option name="OTHER" value="false" />
+ </context>
+ </template>
+ <template name="maven.field.parameter" value="@parameter
expression="${$expression$}" alias="$alias$"
default-value="$value$"" description="alias, parameter configuration
section" toReformat="false" toShortenFQNames="true">
+ <variable name="expression" expression="" defaultValue=""
alwaysStopAt="true" />
+ <variable name="alias" expression="" defaultValue="" alwaysStopAt="true" />
+ <variable name="value" expression="" defaultValue="" alwaysStopAt="true" />
+ <context>
+ <option name="JAVA_CODE" value="false" />
+ <option name="JAVA_COMMENT" value="true" />
+ <option name="JAVA_STRING" value="false" />
+ <option name="XML" value="false" />
+ <option name="HTML" value="false" />
+ <option name="JSP" value="false" />
+ <option name="COMPLETION" value="false" />
+ <option name="OTHER" value="false" />
+ </context>
+ </template>
+ <template name="maven.field.required" value="@required"
description="required" toReformat="false" toShortenFQNames="true">
+ <context>
+ <option name="JAVA_CODE" value="true" />
+ <option name="JAVA_COMMENT" value="false" />
+ <option name="JAVA_STRING" value="false" />
+ <option name="XML" value="false" />
+ <option name="HTML" value="false" />
+ <option name="JSP" value="false" />
+ <option name="COMPLETION" value="false" />
+ <option name="OTHER" value="false" />
+ </context>
+ </template>
+</templateSet>
Propchange: maven/site/trunk/src/site/resources/developers/maven.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/site/trunk/src/site/resources/developers/maven.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified: maven/site/trunk/src/site/xdoc/developers/mojo-api-specification.xml
URL:
http://svn.apache.org/viewvc/maven/site/trunk/src/site/xdoc/developers/mojo-api-specification.xml?view=diff&rev=471296&r1=471295&r2=471296
==============================================================================
--- maven/site/trunk/src/site/xdoc/developers/mojo-api-specification.xml
(original)
+++ maven/site/trunk/src/site/xdoc/developers/mojo-api-specification.xml Sat
Nov 4 15:27:21 2006
@@ -1,14 +1,14 @@
<?xml version="1.0"?>
-<!--
+<!--
/*
* Copyright 2001-2006 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,22 +35,22 @@
each scripting language will present these same basic requirements with
various forms of implementation.</p>
<p>Although the requirements on Mojos are minimal by design, there are
- still a very few requirements that Mojo developers must keep in mind.
<!-- First, a Mojo must have a method named <code>execute</code> which
- declares no parameters, and has a void return type. If this method
- throws an exception, that exception must either be a derivative of
- <code>java.lang.RuntimeException</code>, or a derivative of
- <code>org.apache.maven.plugin.MojoExecutionException</code>. It goes
- without saying that in the latter case, the execute method must
declare
- that it throws this exception. Additionally, Mojos must declare a
field
- for each parameter they specify, and these parameter fields will be
- populated before execute() is called (Maven does support other
- mechanisms for parameter injection, but they are not considered part
of
- the preferred practice, and are therefore a topic for an advanced Mojo
- developer's guide). Finally, all Mojos must be accompanied by metadata
- describing parameters, lifecycle bindings, etc. This descriptor will
be
+ still a very few requirements that Mojo developers must keep in mind.
<!-- First, a Mojo must have a method named <code>execute</code> which
+ declares no parameters, and has a void return type. If this method
+ throws an exception, that exception must either be a derivative of
+ <code>java.lang.RuntimeException</code>, or a derivative of
+ <code>org.apache.maven.plugin.MojoExecutionException</code>. It goes
+ without saying that in the latter case, the execute method must declare
+ that it throws this exception. Additionally, Mojos must declare a field
+ for each parameter they specify, and these parameter fields will be
+ populated before execute() is called (Maven does support other
+ mechanisms for parameter injection, but they are not considered part of
+ the preferred practice, and are therefore a topic for an advanced Mojo
+ developer's guide). Finally, all Mojos must be accompanied by metadata
+ describing parameters, lifecycle bindings, etc. This descriptor will be
covered in more detail below.</p>
- <p>While this will satisfy the requirements for execution as a Mojo
- inside Maven, it is recommended that Mojos implement
+ <p>While this will satisfy the requirements for execution as a Mojo
+ inside Maven, it is recommended that Mojos implement
--> Basically, these Mojo requirements are embodied by the
<code>org.apache.maven.plugin.Mojo</code>
interface, which the Mojo
@@ -65,8 +65,8 @@
standard Maven user-feedback mechanism,
<code>org.apache.maven.monitor.logging.Log</code>
, so the Mojo can
- communicate important events to the console or other log sink.<!--
Using the
- Plugin/Mojo API will give that Mojo access to the Maven-integrated
Log,
+ communicate important events to the console or other log sink.<!--
Using the
+ Plugin/Mojo API will give that Mojo access to the Maven-integrated Log,
along with tighter integration into the Maven build. -->
</p>
<p>As mentioned before, each Plugin - or packaged set of Mojos - must
@@ -622,7 +622,7 @@
<td>Indicates to lookup and populate the field with an
implementation with a Plexus Component.
Similar to <code>@parameter
expression="${component.yourpackage.YourComponentClass}"</code>.
- <i>NOTE: 'YourComponentClass' should have a Plexus tag, for
instance
+ <i>NOTE: 'YourComponentClass' should have a Plexus tag, for
instance
<code>@plexus.component
role="yourpackage.YourComponentClass"</code>.</i>
</td>
</tr>
@@ -712,6 +712,26 @@
to install the plugin to
the local repository. (Any of the other standard lifecycle targets like
package, deploy, etc. are also available in like fashion.)
+ </p>
+ </section>
+ <section name="IDE integration">
+ <p>If you're using Jetbrains IntelliJ Idea to develop your plugin,
+ you can use the following to configure the javadoc annotations as live
+ templates.</p>
+ <p>
+ <ol>
+ <li>Download <a href="maven.xml">this file</a>,
+ and place it in $USER_HOME/.IntelliJIdea/config/templates</li>
+ <li>(re)startup IntelliJ (templates are loaded on startup)</li>
+ <li>add the following list to Settings -> IDE -> Errors -> General
+ -> Unknown javadoc tags -> Additional javadoc tags
+ <ul>
+ <li>aggregator, execute, goal, phase, requiresDirectInvocation,
+ requiresProject, requiresReports, requiresOnline, parameter,
+ component, required, readonly</li>
+ </ul>
+ </li>
+ </ol>
</p>
</section>
<section name="Resources">