You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2008/02/29 02:35:28 UTC
svn commit: r632196 [2/3] - in
/maven/plugin-tools/trunk/maven-plugin-tools-javadoc: ./ src/ src/main/
src/main/java/ src/main/java/org/ src/main/java/org/apache/
src/main/java/org/apache/maven/ src/main/java/org/apache/maven/tools/
src/main/java/org/a...
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoReadOnlyFieldTaglet.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoReadOnlyFieldTaglet.java?rev=632196&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoReadOnlyFieldTaglet.java (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoReadOnlyFieldTaglet.java Thu Feb 28 17:35:16 2008
@@ -0,0 +1,119 @@
+package org.apache.maven.tools.plugin.javadoc;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Map;
+
+import org.apache.maven.tools.plugin.extractor.java.JavaMojoAnnotation;
+
+import com.sun.tools.doclets.Taglet;
+
+/**
+ * The <tt>@readonly</tt> tag is used to specify that this parameter cannot be configured directly by the
+ * user and has no parameter.
+ * <br/>
+ * The following is a sample declaration:
+ * <pre>
+ * public class MyMojo extends AbstractMojo
+ * {
+ * /**
+ *  * Dummy parameter.
+ *  *
+ *  * @readonly
+ *  * ...
+ *  */
+ * private Object parameterName;
+ * }
+ * </pre>
+ * To use it, calling the <code>Javadoc</code> tool with the following:
+ * <pre>
+ * javadoc ... -taglet 'org.apache.maven.tools.plugin.javadoc.MojoReadOnlyFieldTaglet'
+ * </pre>
+ * <b>Note</b>: This taglet is similar to call the <code>Javadoc</code> tool with the following:
+ * <pre>
+ * javadoc ... -tag 'readonly:f:Is readonly.'
+ * </pre>
+ *
+ * @see <a href="package-summary.html#package_description">package-summary.html</a>
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class MojoReadOnlyFieldTaglet
+ extends AbstractMojoFieldTaglet
+{
+ private static final String NAME = JavaMojoAnnotation.READONLY;
+
+ protected static final String HEADER = "Is readonly.";
+
+ /**
+ * @return By default, return the string defined in {@linkplain #HEADER}.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getHeader()
+ * @see #HEADER
+ */
+ public String getHeader()
+ {
+ return HEADER;
+ }
+
+ /**
+ * @return <code>null</code> since <code>@readonly</code> has no value.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getAllowedValue()
+ */
+ public String getAllowedValue()
+ {
+ return null;
+ }
+
+ /**
+ * @return <code>null</code> since <code>@readonly</code> has no parameter.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getAllowedParameterNames()
+ */
+ public String[] getAllowedParameterNames()
+ {
+ return null;
+ }
+
+ /**
+ * @return By default, return the name of this taglet.
+ * @see com.sun.tools.doclets.Taglet#getName()
+ * @see MojoReadOnlyFieldTaglet#NAME
+ */
+ public String getName()
+ {
+ return NAME;
+ }
+
+ /**
+ * Register this Taglet.
+ *
+ * @param tagletMap the map to register this tag to.
+ */
+ public static void register( Map tagletMap )
+ {
+ MojoReadOnlyFieldTaglet tag = new MojoReadOnlyFieldTaglet();
+ Taglet t = (Taglet) tagletMap.get( tag.getName() );
+ if ( t != null )
+ {
+ tagletMap.remove( tag.getName() );
+ }
+ tagletMap.put( tag.getName(), tag );
+ }
+}
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoReadOnlyFieldTaglet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoReadOnlyFieldTaglet.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiredFieldTaglet.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiredFieldTaglet.java?rev=632196&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiredFieldTaglet.java (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiredFieldTaglet.java Thu Feb 28 17:35:16 2008
@@ -0,0 +1,119 @@
+package org.apache.maven.tools.plugin.javadoc;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Map;
+
+import org.apache.maven.tools.plugin.extractor.java.JavaMojoAnnotation;
+
+import com.sun.tools.doclets.Taglet;
+
+/**
+ * The <tt>@required</tt> tag is used to specify that this parameter is required for the Mojo
+ * and has no parameter.
+ * <br/>
+ * The following is a sample declaration:
+ * <pre>
+ * public class MyMojo extends AbstractMojo
+ * {
+ * /**
+ *  * Dummy parameter.
+ *  *
+ *  * @required
+ *  * ...
+ *  */
+ * private Object parameterName;
+ * }
+ * </pre>
+ * To use it, calling the <code>Javadoc</code> tool with the following:
+ * <pre>
+ * javadoc ... -taglet 'org.apache.maven.tools.plugin.javadoc.MojoRequiredFieldTaglet'
+ * </pre>
+ * <b>Note</b>: This taglet is similar to call the <code>Javadoc</code> tool with the following:
+ * <pre>
+ * javadoc ... -tag 'required:f:Is required.'
+ * </pre>
+ *
+ * @see <a href="package-summary.html#package_description">package-summary.html</a>
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class MojoRequiredFieldTaglet
+ extends AbstractMojoFieldTaglet
+{
+ private static final String NAME = JavaMojoAnnotation.REQUIRED;
+
+ protected static final String HEADER = "Is required.";
+
+ /**
+ * @return By default, return the string defined in {@linkplain #HEADER}.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getHeader()
+ * @see #HEADER
+ */
+ public String getHeader()
+ {
+ return HEADER;
+ }
+
+ /**
+ * @return <code>null</code> since <code>@required</code> has no value.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getAllowedValue()
+ */
+ public String getAllowedValue()
+ {
+ return null;
+ }
+
+ /**
+ * @return <code>null</code> since <code>@required</code> has no parameter.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getAllowedParameterNames()
+ */
+ public String[] getAllowedParameterNames()
+ {
+ return null;
+ }
+
+ /**
+ * @return By default, return the name of this taglet.
+ * @see com.sun.tools.doclets.Taglet#getName()
+ * @see MojoRequiredFieldTaglet#NAME
+ */
+ public String getName()
+ {
+ return NAME;
+ }
+
+ /**
+ * Register this Taglet.
+ *
+ * @param tagletMap the map to register this tag to.
+ */
+ public static void register( Map tagletMap )
+ {
+ MojoRequiredFieldTaglet tag = new MojoRequiredFieldTaglet();
+ Taglet t = (Taglet) tagletMap.get( tag.getName() );
+ if ( t != null )
+ {
+ tagletMap.remove( tag.getName() );
+ }
+ tagletMap.put( tag.getName(), tag );
+ }
+}
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiredFieldTaglet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiredFieldTaglet.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresDependencyResolutionTypeTaglet.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresDependencyResolutionTypeTaglet.java?rev=632196&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresDependencyResolutionTypeTaglet.java (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresDependencyResolutionTypeTaglet.java Thu Feb 28 17:35:16 2008
@@ -0,0 +1,116 @@
+package org.apache.maven.tools.plugin.javadoc;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Map;
+
+import org.apache.maven.tools.plugin.extractor.java.JavaMojoAnnotation;
+
+import com.sun.tools.doclets.Taglet;
+
+/**
+ * The <tt>@requiresDependencyResolution</tt> tag is used to specify the required dependencies in the specified scope
+ * and has parameter.
+ * <br/>
+ * The following is a sample declaration:
+ * <pre>
+ * /**
+ *  * Dummy Mojo.
+ *  *
+ *  * @requiresDependencyResolution <requiredScope>
+ *  * ...
+ *  */
+ * public class MyMojo extends AbstractMojo{}
+ * </pre>
+ * To use it, calling the <code>Javadoc</code> tool with the following:
+ * <pre>
+ * javadoc ... -taglet 'org.apache.maven.tools.plugin.javadoc.MojoRequiresDependencyResolutionTypeTaglet'
+ * </pre>
+ * <b>Note</b>: This taglet is similar to call the <code>Javadoc</code> tool with the following:
+ * <pre>
+ * javadoc ... -tag 'requiresDependencyResolution:t:Requires the dependencies in this specified scope:'
+ * </pre>
+ *
+ * @see <a href="package-summary.html#package_description">package-summary.html</a>
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class MojoRequiresDependencyResolutionTypeTaglet
+ extends AbstractMojoTypeTaglet
+{
+ private static final String NAME = JavaMojoAnnotation.REQUIRES_DEPENDENCY_RESOLUTION;
+
+ protected static final String HEADER = "Requires the dependencies in this specified scope";
+
+ /**
+ * @return By default, return the string defined in {@linkplain #HEADER}.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getHeader()
+ * @see #HEADER
+ */
+ public String getHeader()
+ {
+ return HEADER;
+ }
+
+ /**
+ * @return <code>"*"</code> since <code>@requiresDependencyResolution</code> has value.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getAllowedValue()
+ */
+ public String getAllowedValue()
+ {
+ return "*";
+ }
+
+ /**
+ * @return <code>null</code> since <code>@requiresDependencyResolution</code> has no parameter.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getAllowedParameterNames()
+ */
+ public String[] getAllowedParameterNames()
+ {
+ return null;
+ }
+
+ /**
+ * @return By default, return the name of this taglet.
+ * @see com.sun.tools.doclets.Taglet#getName()
+ * @see MojoRequiresDependencyResolutionTypeTaglet#NAME
+ */
+ public String getName()
+ {
+ return NAME;
+ }
+
+ /**
+ * Register this Taglet.
+ *
+ * @param tagletMap the map to register this tag to.
+ */
+ public static void register( Map tagletMap )
+ {
+ MojoRequiresDependencyResolutionTypeTaglet tag = new MojoRequiresDependencyResolutionTypeTaglet();
+ Taglet t = (Taglet) tagletMap.get( tag.getName() );
+ if ( t != null )
+ {
+ tagletMap.remove( tag.getName() );
+ }
+ tagletMap.put( tag.getName(), tag );
+ }
+}
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresDependencyResolutionTypeTaglet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresDependencyResolutionTypeTaglet.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresDirectInvocationTypeTaglet.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresDirectInvocationTypeTaglet.java?rev=632196&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresDirectInvocationTypeTaglet.java (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresDirectInvocationTypeTaglet.java Thu Feb 28 17:35:16 2008
@@ -0,0 +1,116 @@
+package org.apache.maven.tools.plugin.javadoc;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Map;
+
+import org.apache.maven.tools.plugin.extractor.java.JavaMojoAnnotation;
+
+import com.sun.tools.doclets.Taglet;
+
+/**
+ * The <tt>@requiresDirectInvocation</tt> tag is used to allow this Mojo to be direct invoked by the user.
+ * and has parameter.
+ * <br/>
+ * The following is a sample declaration:
+ * <pre>
+ * /**
+ *  * Dummy Mojo.
+ *  *
+ *  * @requiresDirectInvocation <true|false>
+ *  * ...
+ *  */
+ * public class MyMojo extends AbstractMojo{}
+ * </pre>
+ * To use it, calling the <code>Javadoc</code> tool with the following:
+ * <pre>
+ * javadoc ... -taglet 'org.apache.maven.tools.plugin.javadoc.MojoRequiresDirectInvocationTypeTaglet'
+ * </pre>
+ * <b>Note</b>: This taglet is similar to call the <code>Javadoc</code> tool with the following:
+ * <pre>
+ * javadoc ... -tag 'requiresDirectInvocation:t:Requires a direct invocation by the user'
+ * </pre>
+ *
+ * @see <a href="package-summary.html#package_description">package-summary.html</a>
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class MojoRequiresDirectInvocationTypeTaglet
+ extends AbstractMojoTypeTaglet
+{
+ private static final String NAME = JavaMojoAnnotation.REQUIRES_DIRECT_INVOCATION;
+
+ protected static final String HEADER = "Requires a direct invocation by the user";
+
+ /**
+ * @return By default, return the string defined in {@linkplain #HEADER}.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getHeader()
+ * @see #HEADER
+ */
+ public String getHeader()
+ {
+ return HEADER;
+ }
+
+ /**
+ * @return <code>"false|true"</code> since <code>@requiresDirectInvocation</code> has value.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getAllowedValue()
+ */
+ public String getAllowedValue()
+ {
+ return "false|true";
+ }
+
+ /**
+ * @return <code>null</code> since <code>@requiresDirectInvocation</code> has no parameter.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getAllowedParameterNames()
+ */
+ public String[] getAllowedParameterNames()
+ {
+ return null;
+ }
+
+ /**
+ * @return By default, return the name of this taglet.
+ * @see com.sun.tools.doclets.Taglet#getName()
+ * @see MojoRequiresDirectInvocationTypeTaglet#NAME
+ */
+ public String getName()
+ {
+ return NAME;
+ }
+
+ /**
+ * Register this Taglet.
+ *
+ * @param tagletMap the map to register this tag to.
+ */
+ public static void register( Map tagletMap )
+ {
+ MojoRequiresDirectInvocationTypeTaglet tag = new MojoRequiresDirectInvocationTypeTaglet();
+ Taglet t = (Taglet) tagletMap.get( tag.getName() );
+ if ( t != null )
+ {
+ tagletMap.remove( tag.getName() );
+ }
+ tagletMap.put( tag.getName(), tag );
+ }
+}
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresDirectInvocationTypeTaglet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresDirectInvocationTypeTaglet.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresOnLineTypeTaglet.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresOnLineTypeTaglet.java?rev=632196&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresOnLineTypeTaglet.java (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresOnLineTypeTaglet.java Thu Feb 28 17:35:16 2008
@@ -0,0 +1,116 @@
+package org.apache.maven.tools.plugin.javadoc;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Map;
+
+import org.apache.maven.tools.plugin.extractor.java.JavaMojoAnnotation;
+
+import com.sun.tools.doclets.Taglet;
+
+/**
+ * The <tt>@requiresOnline</tt> tag is used to specify that this Mojo should be online
+ * and has parameter.
+ * <br/>
+ * The following is a sample declaration:
+ * <pre>
+ * /**
+ *  * Dummy Mojo.
+ *  *
+ *  * @requiresOnline <true|false>
+ *  * ...
+ *  */
+ * public class MyMojo extends AbstractMojo{}
+ * </pre>
+ * To use it, calling the <code>Javadoc</code> tool with the following:
+ * <pre>
+ * javadoc ... -taglet 'org.apache.maven.tools.plugin.javadoc.MojoRequiresOnLineTypeTaglet'
+ * </pre>
+ * <b>Note</b>: This taglet is similar to call the <code>Javadoc</code> tool with the following:
+ * <pre>
+ * javadoc ... -tag 'requiresOnline:t:Requires to be online to run'
+ * </pre>
+ *
+ * @see <a href="package-summary.html#package_description">package-summary.html</a>
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class MojoRequiresOnLineTypeTaglet
+ extends AbstractMojoTypeTaglet
+{
+ private static final String NAME = JavaMojoAnnotation.REQUIRES_ONLINE;
+
+ protected static final String HEADER = "Requires to be online to run";
+
+ /**
+ * @return By default, return the string defined in {@linkplain #HEADER}.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getHeader()
+ * @see #HEADER
+ */
+ public String getHeader()
+ {
+ return HEADER;
+ }
+
+ /**
+ * @return <code>true|false</code> since <code>@requiresOnline</code> has value.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getAllowedValue()
+ */
+ public String getAllowedValue()
+ {
+ return "true|false";
+ }
+
+ /**
+ * @return <code>null</code> since <code>@requiresOnline</code> has no parameter.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getAllowedParameterNames()
+ */
+ public String[] getAllowedParameterNames()
+ {
+ return null;
+ }
+
+ /**
+ * @return By default, return the name of this taglet.
+ * @see com.sun.tools.doclets.Taglet#getName()
+ * @see MojoRequiresOnLineTypeTaglet#NAME
+ */
+ public String getName()
+ {
+ return NAME;
+ }
+
+ /**
+ * Register this Taglet.
+ *
+ * @param tagletMap the map to register this tag to.
+ */
+ public static void register( Map tagletMap )
+ {
+ MojoRequiresOnLineTypeTaglet tag = new MojoRequiresOnLineTypeTaglet();
+ Taglet t = (Taglet) tagletMap.get( tag.getName() );
+ if ( t != null )
+ {
+ tagletMap.remove( tag.getName() );
+ }
+ tagletMap.put( tag.getName(), tag );
+ }
+}
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresOnLineTypeTaglet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresOnLineTypeTaglet.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresProjectTypeTaglet.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresProjectTypeTaglet.java?rev=632196&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresProjectTypeTaglet.java (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresProjectTypeTaglet.java Thu Feb 28 17:35:16 2008
@@ -0,0 +1,116 @@
+package org.apache.maven.tools.plugin.javadoc;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Map;
+
+import org.apache.maven.tools.plugin.extractor.java.JavaMojoAnnotation;
+
+import com.sun.tools.doclets.Taglet;
+
+/**
+ * The <tt>@requiresProject</tt> tag is used to run this Mojo inside of a project
+ * and has parameter.
+ * <br/>
+ * The following is a sample declaration:
+ * <pre>
+ * /**
+ *  * Dummy Mojo.
+ *  *
+ *  * @requiresProject <true|false>
+ *  * ...
+ *  */
+ * public class MyMojo extends AbstractMojo{}
+ * </pre>
+ * To use it, calling the <code>Javadoc</code> tool with the following:
+ * <pre>
+ * javadoc ... -taglet 'org.apache.maven.tools.plugin.javadoc.MojoRequiresProjectTypeTaglet'
+ * </pre>
+ * <b>Note</b>: This taglet is similar to call the <code>Javadoc</code> tool with the following:
+ * <pre>
+ * javadoc ... -tag 'requiresProject:t:Requires a Maven project to run'
+ * </pre>
+ *
+ * @see <a href="package-summary.html#package_description">package-summary.html</a>
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class MojoRequiresProjectTypeTaglet
+ extends AbstractMojoTypeTaglet
+{
+ private static final String NAME = JavaMojoAnnotation.REQUIRES_PROJECT;
+
+ protected static final String HEADER = "Requires a Maven project to run";
+
+ /**
+ * @return By default, return the string defined in {@linkplain #HEADER}.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getHeader()
+ * @see #HEADER
+ */
+ public String getHeader()
+ {
+ return HEADER;
+ }
+
+ /**
+ * @return <code>true|false</code> since <code>@requiresProject</code> has value.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getAllowedValue()
+ */
+ public String getAllowedValue()
+ {
+ return "true|false";
+ }
+
+ /**
+ * @return <code>null</code> since <code>@requiresProject</code> has no parameter.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getAllowedParameterNames()
+ */
+ public String[] getAllowedParameterNames()
+ {
+ return null;
+ }
+
+ /**
+ * @return By default, return the name of this taglet.
+ * @see com.sun.tools.doclets.Taglet#getName()
+ * @see MojoRequiresProjectTypeTaglet#NAME
+ */
+ public String getName()
+ {
+ return NAME;
+ }
+
+ /**
+ * Register this Taglet.
+ *
+ * @param tagletMap the map to register this tag to.
+ */
+ public static void register( Map tagletMap )
+ {
+ MojoRequiresProjectTypeTaglet tag = new MojoRequiresProjectTypeTaglet();
+ Taglet t = (Taglet) tagletMap.get( tag.getName() );
+ if ( t != null )
+ {
+ tagletMap.remove( tag.getName() );
+ }
+ tagletMap.put( tag.getName(), tag );
+ }
+}
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresProjectTypeTaglet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresProjectTypeTaglet.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresReportsTypeTaglet.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresReportsTypeTaglet.java?rev=632196&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresReportsTypeTaglet.java (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresReportsTypeTaglet.java Thu Feb 28 17:35:16 2008
@@ -0,0 +1,116 @@
+package org.apache.maven.tools.plugin.javadoc;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Map;
+
+import org.apache.maven.tools.plugin.extractor.java.JavaMojoAnnotation;
+
+import com.sun.tools.doclets.Taglet;
+
+/**
+ * The <tt>@requiresReports</tt> tag is used to run this Mojo inside reports
+ * and has parameter.
+ * <br/>
+ * The following is a sample declaration:
+ * <pre>
+ * /**
+ *  * Dummy Mojo.
+ *  *
+ *  * @requiresReports <true|false>
+ *  * ...
+ *  */
+ * public class MyMojo extends AbstractMojo{}
+ * </pre>
+ * To use it, calling the <code>Javadoc</code> tool with the following:
+ * <pre>
+ * javadoc ... -taglet 'org.apache.maven.tools.plugin.javadoc.MojoRequiresReportsTypeTaglet'
+ * </pre>
+ * <b>Note</b>: This taglet is similar to call the <code>Javadoc</code> tool with the following:
+ * <pre>
+ * javadoc ... -tag 'requiresReports:t:Requires Maven reports to run'
+ * </pre>
+ *
+ * @see <a href="package-summary.html#package_description">package-summary.html</a>
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class MojoRequiresReportsTypeTaglet
+ extends AbstractMojoTypeTaglet
+{
+ private static final String NAME = JavaMojoAnnotation.REQUIRES_REPORTS;
+
+ protected static final String HEADER = "Requires Maven reports to run";
+
+ /**
+ * @return By default, return the string defined in {@linkplain #HEADER}.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getHeader()
+ * @see #HEADER
+ */
+ public String getHeader()
+ {
+ return HEADER;
+ }
+
+ /**
+ * @return <code>false|true</code> since <code>@requiresReports</code> has value.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getAllowedValue()
+ */
+ public String getAllowedValue()
+ {
+ return "false|true";
+ }
+
+ /**
+ * @return <code>null</code> since <code>@requiresReports</code> has no parameter.
+ * @see org.apache.maven.tools.plugin.javadoc.AbstractMojoTaglet#getAllowedParameterNames()
+ */
+ public String[] getAllowedParameterNames()
+ {
+ return null;
+ }
+
+ /**
+ * @return By default, return the name of this taglet.
+ * @see com.sun.tools.doclets.Taglet#getName()
+ * @see MojoRequiresReportsTypeTaglet#NAME
+ */
+ public String getName()
+ {
+ return NAME;
+ }
+
+ /**
+ * Register this Taglet.
+ *
+ * @param tagletMap the map to register this tag to.
+ */
+ public static void register( Map tagletMap )
+ {
+ MojoRequiresReportsTypeTaglet tag = new MojoRequiresReportsTypeTaglet();
+ Taglet t = (Taglet) tagletMap.get( tag.getName() );
+ if ( t != null )
+ {
+ tagletMap.remove( tag.getName() );
+ }
+ tagletMap.put( tag.getName(), tag );
+ }
+}
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresReportsTypeTaglet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/java/org/apache/maven/tools/plugin/javadoc/MojoRequiresReportsTypeTaglet.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/javadoc/org/apache/maven/tools/plugin/javadoc/package.html
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/javadoc/org/apache/maven/tools/plugin/javadoc/package.html?rev=632196&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/javadoc/org/apache/maven/tools/plugin/javadoc/package.html (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/javadoc/org/apache/maven/tools/plugin/javadoc/package.html Thu Feb 28 17:35:16 2008
@@ -0,0 +1,328 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<body>
+ <style type="text/css">
+ table.bodyTable th {
+ color: white;
+ background-color: #bbb;
+ text-align: left;
+ font-weight: bold;
+ }
+
+ table.bodyTable th, table.bodyTable td {
+ font-size: 11px;
+ }
+
+ table.bodyTable tr.a {
+ background-color: #ddd;
+ }
+
+ table.bodyTable tr.b {
+ background-color: #eee;
+ }
+ </style>
+
+ <h1>Mojo Javadoc Tags used by Maven Plugins</h1>
+ <p>Here is a reference of the Javadoc annotations that can be used to 'decorate' the Java sources
+ to allow Mojo to generate descriptors.</p>
+
+ <h2>Annotations specified at the class level</h2>
+ <table class="bodyTable">
+ <!-- Annotations listed by specific, autodetect and Javadoc, all alphabetical -->
+ <tr class="b">
+ <th>Descriptor Element</th>
+ <th>Annotation</th>
+ <th>Required?</th>
+ <th>Notes</th>
+ </tr>
+ <tr class="a">
+ <td>aggregator</td>
+ <td>@aggregator</td>
+ <td>No</td>
+ <td>Flags this Mojo to run it in a multi module way, i.e. aggregate the build with the set of
+ projects listed as modules.</td>
+ </tr>
+ <tr class="b">
+ <td>configurator</td>
+ <td>@configurator <roleHint></td>
+ <td>No</td>
+ <td>The configurator type to use when injecting parameter values into this Mojo. The value is
+ normally deduced from the Mojo's implementation language, but can be specified to allow a
+ custom ComponentConfigurator implementation to be used. <i>NOTE: This will only be used in
+ very special cases, using a highly controlled vocabulary of possible values. (Elements
+ like this are why it's a good idea to use the descriptor tools.)</i>
+ </td>
+ </tr>
+ <tr class="a">
+ <td>execute</td>
+ <td>
+ <ul>
+ <li>@execute phase="<phaseName>"
+ lifecycle="<lifecycleId>"</li>
+ <li>@execute phase="<phaseName>"</li>
+
+ <li>@execute goal="<goalName>"</li>
+ </ul>
+ </td>
+ <td>No</td>
+ <td>When this goal is invoked, it will first invoke a parallel lifecycle, ending at the given
+ phase. If a goal is provided instead of a phase, that goal will be executed in isolation.
+ The execution of either will not affect the current project, but instead make available the
+ <code>${executedProject}</code> expression if required. An alternate lifecycle can also be
+ provided: for more information see the documentation on the
+ <a href="../guides/introduction/introduction-to-the-lifecycle.html">build lifecycle</a>.</td>
+ </tr>
+ <tr class="b">
+ <td>executionStrategy</td>
+ <td>@executionStrategy <strategy></td>
+ <td>No</td>
+ <td>Specify the execution strategy. <i>NOTE: Currently supports <b>once-per-session</b>,
+ <b>always</b>.</i>
+ </td>
+ </tr>
+ <tr class="a">
+ <td>goal</td>
+ <td>@goal <goalName></td>
+ <td>Yes</td>
+ <td>The name for the Mojo that users will reference from the command line to execute the Mojo
+ directly, or inside a POM in order to provide Mojo-specific configuration.</td>
+ </tr>
+ <tr class="b">
+ <td>inheritByDefault</td>
+ <td>@inheritByDefault <true|false></td>
+ <td>No. Default: <code>true</code></td>
+ <td>Specify that the Mojo is inherited.</td>
+ </tr>
+ <tr class="a">
+ <td>instantiationStrategy </td>
+ <td>@instantiationStrategy <per-lookup></td>
+ <td>No. Default: <code>per-lookup</code></td>
+ <td>Specify the instantiation strategy.</td>
+ </tr>
+ <tr class="b">
+ <td>phase</td>
+ <td>@phase <phaseName></td>
+ <td>No</td>
+ <td>Binds this Mojo to a particular phase of the standard build lifecycle, if specified.
+ <i>NOTE: This is only required if this Mojo is to participate in the standard build
+ process.</i>
+ </td>
+ </tr>
+ <tr class="a">
+ <td>requiresDependencyResolution</td>
+ <td>@requiresDependencyResolution <requiredScope></td>
+ <td>No</td>
+ <td>Flags this Mojo as requiring the dependencies in the specified scope (or an implied scope)
+ to be resolved before it can execute. <i>NOTE: Currently supports <b>compile</b> ,
+ <b>runtime</b> , and <b>test</b> scopes. </i>
+ </td>
+ </tr>
+ <tr class="b">
+ <td>requiresDirectInvocation</td>
+ <td>@requiresDirectInvocation <true|false></td>
+ <td>No. Default: <code>false</code></td>
+ <td>Flags this Mojo to be invoke directly.</td>
+ </tr>
+ <tr class="a">
+ <td>requiresOnline</td>
+ <td>@requiresOnline <true|false></td>
+ <td>No. Default: <code>true</code></td>
+ <td>Flags this Mojo to be run in online mode.</td>
+ </tr>
+ <tr class="b">
+ <td>requiresProject</td>
+ <td>@requiresProject <true|false></td>
+ <td>No. Default: <code>true</code></td>
+ <td>Flags this Mojo to run inside of a project.</td>
+ </tr>
+ <tr class="a">
+ <td>requiresReports</td>
+ <td>@requiresReports <true|false></td>
+ <td>No. Default: <code>false</code></td>
+ <td>Flags this Mojo to require reports.</td>
+ </tr>
+
+ <!-- Autodetect -->
+ <tr class="b">
+ <td>description</td>
+ <td>none (detected)</td>
+ <td>No</td>
+ <td>The description of this Mojo's functionality. <i>Using the toolset, this will be the
+ class-level Javadoc description provided. NOTE: While this is not a required part of the
+ Mojo specification, it SHOULD be provided to enable future tool support for browsing, etc.
+ and for clarity.</i>
+ </td>
+ </tr>
+ <tr class="a">
+ <td>implementation</td>
+ <td>none (detected)</td>
+ <td>Yes</td>
+ <td>The Mojo's fully-qualified class name (or script path in the case of non-Java Mojos).</td>
+ </tr>
+ <tr class="b">
+ <td>language</td>
+ <td>none (detected)</td>
+ <td>No. Default: <code>java</code></td>
+ <td>The implementation language for this Mojo (Java, beanshell, etc.).</td>
+ </tr>
+
+ <!-- Javadoc -->
+ <tr class="a">
+ <td>deprecated</td>
+ <td>@deprecated <deprecated-text></td>
+ <td>No</td>
+ <td>Specify the version when the Mojo was deprecated to the API. Similar to Javadoc deprecated.
+ This will trigger a warning when a user tries to configure a parameter
+ marked as deprecated.</td>
+ </tr>
+ <tr class="b">
+ <td>since</td>
+ <td>@since <since-text></td>
+ <td>No</td>
+ <td>Specify the version when the Mojo was added to the API. Similar to Javadoc since.</td>
+ </tr>
+ </table>
+
+ <h2>Annotations specified at the field level</h2>
+ <table class="bodyTable">
+ <!-- Annotations listed by specific, autodetect and Javadoc, all alphabetical -->
+ <tr class="b">
+ <th>Descriptor Element</th>
+ <th>Annotation</th>
+ <th>Required?</th>
+ <th>Notes</th>
+ </tr>
+ <tr class="a">
+ <td>alias</td>
+ <td>@parameter alias="myAlias"</td>
+ <td>No</td>
+ <td>Specifies an alias which can be used to configure this parameter from the POM. This is
+ primarily useful to improve user-friendliness, where Mojo field names are not intuitive to
+ the user or are otherwise not conducive to configuration via the POM.</td>
+ </tr>
+ <tr class="b">
+ <td>configuration</td>
+ <td>@component role="..." roleHint="..."</td>
+ <td>No</td>
+ <td> Populates the field with an instance of a Plexus component. This is like declaring a
+ <i>requirement</i> in a Plexus component. The default requirement will have a role equal
+ to the declared type of the field, and will use the default role hint. You can customise
+ either of these by providing a <code>role</code> and/or <code>roleHint</code> parameter.
+ <i>e.g.</i>
+ <code>@component role="org.apache.maven.artifact.ArtifactHandler"
+ roleHint="ear"</code><b>Note:</b> This is identical to the deprecated
+ form of parameter: <code>@parameter
+ expression="${component.yourpackage.YourComponentClass}"</code>. </td>
+ </tr>
+ <tr class="a">
+ <td>configuration</td>
+ <td>@parameter expression="${someExpression}"
+ default-value="value"</td>
+ <td>No</td>
+ <td>Specifies the expression used to calculate the value to be injected into this parameter of
+ the Mojo at buildtime. This is commonly used to refer to specific elements in the POM, such
+ as ${project.build.resources}, which refers to the List of resources meant to accompany the
+ classes in the resulting jar file. The default value is used when the expression evaluates
+ to <code>null</code> . <i>NOTE: If not specified, an expression of ${<name>}
+ is assumed, which can only be satisfied from POM configuration or System properties. The
+ use of '${' and '}' is required to delimit actual expressions which may be evaluated.</i>
+ </td>
+ </tr>
+ <tr class="b">
+ <td>editable</td>
+ <td>@readonly</td>
+ <td>No</td>
+ <td>Specifies that this parameter cannot be configured directly by the user (as in the case of
+ POM-specified configuration). This is useful when you want to force the user to use common
+ POM elements rather than plugin configurations, as in the case where you want to use the
+ artifact's final name as a parameter. In this case, you want the user to modify
+ <build><finalName/></build> rather than specifying
+ a value for finalName directly in the plugin configuration section. It is also useful to
+ ensure that - for example - a List-typed parameter which expects items of type Artifact
+ doesn't get a List full of Strings. <i>NOTE: Specification of this annotation flags the
+ parameter as non-editable; there is no true/false value.</i>
+ </td>
+ </tr>
+ <tr class="a">
+ <td>required</td>
+ <td>@required</td>
+ <td>No</td>
+ <td>Whether this parameter is required for the Mojo to function. This is used to validate the
+ configuration for a Mojo before it is injected, and before the Mojo is executed from some
+ half-state. <i>NOTE: Specification of this annotation flags the parameter as required; there
+ is no true/false value.</i>
+ </td>
+ </tr>
+
+ <!-- Autodetect -->
+ <tr class="b">
+ <td>description</td>
+ <td>none (detected)</td>
+ <td>No</td>
+ <td>The description of this parameter's use inside the Mojo. <i>Using the toolset, this is
+ detected as the Javadoc description for the field. NOTE: While this is not a required part
+ of the parameter specification, it SHOULD be provided to enable future tool support for
+ browsing, etc. and for clarity.</i>
+ </td>
+ </tr>
+ <tr class="a">
+ <td>name</td>
+ <td>none (detected)</td>
+ <td>Yes</td>
+ <td>The name of the parameter, to be used in configuring this parameter from the Mojo's
+ declared defaults (discussed below) or from the POM. <i>Using the toolset, this is detected
+ as the Java field name.</i>
+ </td>
+ </tr>
+ <tr class="b">
+ <td>type</td>
+ <td>none (detected)</td>
+ <td>Yes</td>
+ <td>The Java type for this parameter. This is used to validate the result of any expressions
+ used to calculate the value which should be injected into the Mojo for this parameter.
+ <i>Using the toolset, this is detected as the class of the Java field corresponding to
+ this parameter.</i>
+ </td>
+ </tr>
+
+ <!-- Javadoc -->
+ <tr class="a">
+ <td>deprecated</td>
+ <td>@deprecated <deprecated-text></td>
+ <td>No</td>
+ <td>Specify the version when the Mojo was deprecated to the API. Similar to Javadoc deprecated.
+ This will trigger a warning when a user tries to configure a parameter
+ marked as deprecated.</td>
+ </tr>
+ <tr class="b">
+ <td>since</td>
+ <td>@since <since-text></td>
+ <td>No</td>
+ <td>Specify the version when the Mojo was added to the API. Similar to Javadoc since.</td>
+ </tr>
+ </table>
+
+ <h2>Resources</h2>
+ <ul>
+ <li><a href="http://maven.apache.org/developers/mojo-api-specification.html#The_Descriptor_and_Annotations">Mojo API Specification</a></li>
+ </ul>
+</body>
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/javadoc/org/apache/maven/tools/plugin/javadoc/package.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/main/javadoc/org/apache/maven/tools/plugin/javadoc/package.html
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/index.apt?rev=632196&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/index.apt (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/index.apt Thu Feb 28 17:35:16 2008
@@ -0,0 +1,39 @@
+ ------
+ Introduction
+ ------
+ Vincent Siveton
+ ------
+ February 2008
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you 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. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
+Maven Plugin Tools Javadoc
+
+ The Maven Plugin Tools Javadoc project is a collection of several
+ {{{http://java.sun.com/j2se/1.4.2/docs/tooldocs/javadoc/taglet/overview.html}taglets}} which are used by
+ the Plugin tool.
+ For more information about the standard Javadoc tool, please refer to
+ {{{http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html}Reference Guide}}.
+
+* Usage
+
+ Instructions on how to use this project can be found {{{usage.html}here}}.
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/index.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/index.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/screenshots.apt
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/screenshots.apt?rev=632196&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/screenshots.apt (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/screenshots.apt Thu Feb 28 17:35:16 2008
@@ -0,0 +1,33 @@
+ ------
+ Screenshots From Javadoc
+ ------
+ Vincent Siveton
+ ------
+ February 2008
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you 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. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
+Screenshots From Javadoc
+
+ The following Screenshots have been taken from a JavaDoc displayed.
+
+[images/javadoc.png] Examples
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/screenshots.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/screenshots.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/usage.apt
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/usage.apt?rev=632196&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/usage.apt (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/usage.apt Thu Feb 28 17:35:16 2008
@@ -0,0 +1,119 @@
+ ------
+ Usage
+ ------
+ Vincent Siveton
+ ------
+ February 2008
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you 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. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
+
+Usage
+
+ The taglets could be use directly in the {{{http://maven.apache.org/plugins/maven-javadoc-plugin/}maven-javadoc-plugin}}.
+
++-----+
+<project>
+ ...
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+
+ <!-- To allow Javadoc Tool to generate annotation for Mojo fields -->
+ <show>private</show>
+
+ <taglets>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoAggregatorTypeTaglet</tagletClass>
+ </taglet>
+ ...
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresReportsTypeTaglet</tagletClass>
+ </taglet>
+ </taglets>
+
+ <tagletArtifact>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </tagletArtifact>
+ ...
+ </configuration>
+ </plugin>
+ </plugins>
+ ...
+ </reporting>
+ ...
+</project>
++-----+
+
+ <<Note>>: Several taglets are similars to the Javadoc
+ {{{http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/javadoc.html#tag}-tag}} option, i.e.:
+
+*--------------------------------------------+---------------------------------+
+|| Taglet Class || Javadoc -tag option
+*--------------------------------------------+---------------------------------+
+| MojoAggregatorTypeTaglet | -tag 'aggregator:t:Aggregates the Maven project and its child modules.'
+*--------------------------------------------+---------------------------------+
+| MojoComponentFieldTaglet | none
+*--------------------------------------------+---------------------------------+
+| MojoConfiguratorTypeTaglet | -tag 'configurator:t:Is configured to the role hint:'
+*--------------------------------------------+---------------------------------+
+| MojoExecuteTypeTaglet | none
+*--------------------------------------------+---------------------------------+
+| MojoExecutionStrategyTypeTaglet | -tag 'executionStrategy:t:Is executed with the strategy:'
+*--------------------------------------------+---------------------------------+
+| MojoGoalTypeTaglet | -tag 'goal:t:This Mojo is defined by the goal name:'
+*--------------------------------------------+---------------------------------+
+| MojoInheritedByDefaultTypeTaglet | -tag 'inheritedByDefault:t:Is this Mojo inherited'
+*--------------------------------------------+---------------------------------+
+| MojoInstantiationStrategyTypeTaglet | -tag 'instantiationStrategy:t:Is instantiated with the strategy:'
+*--------------------------------------------+---------------------------------+
+| MojoParameterFieldTaglet | none
+*--------------------------------------------+---------------------------------+
+| MojoPhaseTypeTaglet | -tag 'phase:t:Is binded to the specified phase of the standard build lifecycle:'
+*--------------------------------------------+---------------------------------+
+| MojoReadOnlyFieldTaglet | -tag 'readonly:f:Is readonly.'
+*--------------------------------------------+---------------------------------+
+| MojoRequiredFieldTaglet | -tag 'required:f:Is required.'
+*--------------------------------------------+---------------------------------+
+| MojoRequiresDependencyResolutionTypeTaglet | -tag 'requiresDependencyResolution:t:Requires the dependencies in this specified scope:'
+*--------------------------------------------+---------------------------------+
+| MojoRequiresDirectInvocationTypeTaglet | -tag 'requiresDirectInvocation:t:Requires a direct invocation by the user'
+*--------------------------------------------+---------------------------------+
+| MojoRequiresOnLineTypeTaglet | -tag 'requiresProject:t:Requires to be online to run'
+*--------------------------------------------+---------------------------------+
+| MojoRequiresProjectTypeTaglet | -tag 'requiresProject:t:Requires a Maven project to run'
+*--------------------------------------------+---------------------------------+
+| MojoRequiresReportsTypeTaglet | -tag 'requiresReports:t:Requires Maven reports to run'
+*--------------------------------------------+---------------------------------+
+
+* Resources
+
+ * {{{apidocs/index.html}API}}
+
+ * {{{http://maven.apache.org/developers/mojo-api-specification.html#The_Descriptor_and_Annotations}Mojo API Specification}}
+
+ []
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/usage.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/apt/usage.apt
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/resources/images/javadoc.png
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/resources/images/javadoc.png?rev=632196&view=auto
==============================================================================
Binary file - no diff available.
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/resources/images/javadoc.png
------------------------------------------------------------------------------
svn:mime-type = image/png
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/site.xml?rev=632196&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/site.xml (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/site.xml Thu Feb 28 17:35:16 2008
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you 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. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project name="Maven Plugin Tools Javadoc">
+ <body>
+ <menu name="Overview">
+ <item name="Introduction" href="index.html"/>
+ <item name="Usage" href="usage.html"/>
+ <item name="Screenshots From Javadoc" href="screenshots.html"/>
+ </menu>
+
+ <menu ref="reports" inherit="bottom" />
+ </body>
+</project>
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/site.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/site/site.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/java/org/apache/maven/tools/plugin/javadoc/JavadocReportTest.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/java/org/apache/maven/tools/plugin/javadoc/JavadocReportTest.java?rev=632196&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/java/org/apache/maven/tools/plugin/javadoc/JavadocReportTest.java (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/java/org/apache/maven/tools/plugin/javadoc/JavadocReportTest.java Thu Feb 28 17:35:16 2008
@@ -0,0 +1,164 @@
+package org.apache.maven.tools.plugin.javadoc;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Collections;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.DefaultArtifactRepository;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.plugin.javadoc.JavadocReport;
+import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+import org.codehaus.plexus.configuration.PlexusConfiguration;
+import org.codehaus.plexus.util.FileUtils;
+
+/**
+ * Test the taglets by running Maven Javadoc Plugin.
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class JavadocReportTest
+ extends AbstractMojoTestCase
+{
+ private static final String LINE_SEPARATOR = "";
+
+ /** {@inheritDoc} */
+ protected void setUp()
+ throws Exception
+ {
+ // required for mojo lookups to work
+ super.setUp();
+ createTestRepo();
+ }
+
+ /** {@inheritDoc} */
+ protected void tearDown()
+ throws Exception
+ {
+ super.tearDown();
+ }
+
+ /**
+ * Create test repository in target directory.
+ */
+ private void createTestRepo()
+ {
+ File f = new File( getBasedir(), "target/local-repo/" );
+ f.mkdirs();
+ }
+
+ /**
+ * Convenience method that reads the contents of the specified file object into a string with a
+ * <code>""</code> as line separator.
+ *
+ * @see #LINE_SEPARATOR
+ * @param file the file to be read
+ * @return a String object that contains the contents of the file
+ * @throws IOException if any
+ */
+ private static String readFile( File file )
+ throws IOException
+ {
+ String str = "", strTmp = "";
+ BufferedReader in = new BufferedReader( new FileReader( file ) );
+
+ while ( ( strTmp = in.readLine() ) != null )
+ {
+ str = str + LINE_SEPARATOR + strTmp;
+ }
+ in.close();
+
+ return str;
+ }
+
+ /**
+ * Test the default javadoc renderer using the Maven plugin
+ * <code>org.apache.maven.plugins:maven-javadoc-plugin:2.3</code>
+ *
+ * @throws Exception
+ */
+ public void testMojoTaglets()
+ throws Exception
+ {
+ File testPom = new File( getBasedir(), "src/test/resources/unit/javadoc/javadoc-plugin-config.xml" );
+ PlexusConfiguration pluginConfiguration = extractPluginConfiguration( "maven-javadoc-plugin", testPom );
+
+ JavadocReport mojo = (JavadocReport) lookupMojo( "org.apache.maven.plugins", "maven-javadoc-plugin", "2.3",
+ "javadoc", pluginConfiguration );
+
+ // Don't know why we need to specify that
+ ArtifactRepository remoteRepositories = new DefaultArtifactRepository( "central",
+ "http://repo1.maven.org/maven2",
+ new DefaultRepositoryLayout() );
+ setVariableValueToObject( mojo, "remoteRepositories", Collections.singletonList( remoteRepositories ) );
+
+ ArtifactRepository localRepository = (ArtifactRepository) getVariableValueFromObject( mojo, "localRepository" );
+ ArtifactResolver resolver = (ArtifactResolver) getVariableValueFromObject( mojo, "resolver" );
+ ArtifactFactory factory = (ArtifactFactory) getVariableValueFromObject( mojo, "factory" );
+ Artifact artifact = factory.createArtifact( "org.apache.maven", "maven-plugin-api", "2.0", "compile", "jar" );
+ resolver.resolve( artifact, Collections.singletonList( remoteRepositories ), localRepository );
+
+ mojo.execute();
+
+ File generatedFile = new File( getBasedir(),
+ "target/test/unit/javadoc/target/site/apidocs/org/apache/maven/plugin/my/MyMojo.html" );
+ assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
+
+ String str = readFile( generatedFile );
+
+ // Verify mojo type
+ String mojoType = "<dl><dt><b>" + MojoAggregatorTypeTaglet.HEADER + "</b></dt><dd></dd><dt><b>"
+ + MojoConfiguratorTypeTaglet.HEADER + ":</b></dt><dd>roleHint</dd><dt><b>" + MojoExecuteTypeTaglet.HEADER
+ + ":</b></dt><dd><dl><dt><b>phase:</b></dt><dd>validate</dd>"
+ + "<dt><b>lifecycle:</b></dt><dd>default</dd></dl></dd><dt><b>" + MojoExecutionStrategyTypeTaglet.HEADER
+ + ":</b></dt><dd>always</dd>" + "<dt><b>" + MojoGoalTypeTaglet.HEADER + ":</b></dt><dd>touch</dd>"
+ + "<dt><b>" + MojoInheritByDefaultTypeTaglet.HEADER + ":</b></dt><dd>true</dd><dt><b>"
+ + MojoInstantiationStrategyTypeTaglet.HEADER + ":</b></dt><dd>per-lookup</dd><dt><b>"
+ + MojoPhaseTypeTaglet.HEADER + ":</b></dt><dd>phaseName</dd><dt><b>"
+ + MojoRequiresDependencyResolutionTypeTaglet.HEADER + ":</b></dt><dd>compile</dd><dt><b>"
+ + MojoRequiresDirectInvocationTypeTaglet.HEADER + ":</b></dt><dd>false</dd><dt><b>"
+ + MojoRequiresOnLineTypeTaglet.HEADER + ":</b></dt><dd>true</dd><dt><b>"
+ + MojoRequiresProjectTypeTaglet.HEADER + ":</b></dt><dd>true</dd><dt><b>"
+ + MojoRequiresReportsTypeTaglet.HEADER + ":</b></dt><dd>false</dd></dl>";
+ assertTrue( str.toLowerCase().indexOf( ( mojoType ).toLowerCase() ) != -1 );
+
+ // Verify mojo fields
+ String mojoField = "<dl><dt><b>" + MojoParameterFieldTaglet.HEADER
+ + ":</b></dt><dd><dl><dt><b>default-value:</b></dt>"
+ + "<dd>value</dd><dt><b>expression:</b></dt><dd>${project.build.directory}</dd><dt><b>alias:</b>"
+ + "</dt><dd>myAlias</dd></dl></dd><dt><b>" + MojoReadOnlyFieldTaglet.HEADER + "</b></dt><dd></dd><dt><b>"
+ + MojoRequiredFieldTaglet.HEADER + "</b></dt><dd>" + "</dd></dl>";
+ assertTrue( str.toLowerCase().indexOf( ( mojoField ).toLowerCase() ) != -1 );
+
+ mojoField = "<dl><dt><b>" + MojoComponentFieldTaglet.HEADER + ":</b></dt><dd><dl><dt><b>role:</b>"
+ + "</dt><dd>org.apacha.maven.MyComponent</dd><dt><b>roleHint:</b></dt><dd>default</dd></dl></dd>"
+ + "<dt><b>" + MojoReadOnlyFieldTaglet.HEADER + "</b></dt><dd></dd><dt><b>" + MojoRequiredFieldTaglet.HEADER
+ + "</b></dt><dd>" + "</dd></dl>";
+ assertTrue( str.toLowerCase().indexOf( ( mojoField ).toLowerCase() ) != -1 );
+ }
+}
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/java/org/apache/maven/tools/plugin/javadoc/JavadocReportTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/java/org/apache/maven/tools/plugin/javadoc/JavadocReportTest.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/java/org/apache/maven/tools/plugin/javadoc/stubs/DefaultMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/java/org/apache/maven/tools/plugin/javadoc/stubs/DefaultMavenProjectStub.java?rev=632196&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/java/org/apache/maven/tools/plugin/javadoc/stubs/DefaultMavenProjectStub.java (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/java/org/apache/maven/tools/plugin/javadoc/stubs/DefaultMavenProjectStub.java Thu Feb 28 17:35:16 2008
@@ -0,0 +1,131 @@
+package org.apache.maven.tools.plugin.javadoc.stubs;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.io.FileReader;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.DefaultArtifact;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.DefaultArtifactRepository;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.model.Build;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Resource;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
+
+/**
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
+public class DefaultMavenProjectStub
+ extends MavenProjectStub
+{
+ private Build build;
+
+ public DefaultMavenProjectStub()
+ {
+ MavenXpp3Reader pomReader = new MavenXpp3Reader();
+ Model model = null;
+
+ try
+ {
+ model = pomReader.read( new FileReader( new File( getBasedir(), "javadoc-plugin-config.xml" ) ) );
+ setModel( model );
+ }
+ catch ( Exception e )
+ {
+ throw new RuntimeException( e );
+ }
+
+ setGroupId( model.getGroupId() );
+ setArtifactId( model.getArtifactId() );
+ setVersion( model.getVersion() );
+ setName( model.getName() );
+ setUrl( model.getUrl() );
+ setPackaging( model.getPackaging() );
+
+ Build build = new Build();
+
+ build.setFinalName( model.getArtifactId() );
+ build.setSourceDirectory( getBasedir() + "/src/main/java" );
+
+ Resource resource = new Resource();
+ resource.setDirectory( getBasedir() + "/src/main/resources" );
+ build.setResources( Collections.singletonList( resource ) );
+ build.setDirectory( super.getBasedir() + "/target/test/unit/javadoc/target" );
+ build.setOutputDirectory( super.getBasedir() + "/target/test/unit/javadoc/target/classes" );
+
+ build.setTestSourceDirectory( getBasedir() + "/src/test/java" );
+ resource = new Resource();
+ resource.setDirectory( getBasedir() + "/src/test/resources" );
+ build.setTestResources( Collections.singletonList( resource ) );
+ build.setTestOutputDirectory( super.getBasedir() + "/target/test/unit/javadoc/target/test-classes" );
+
+ setBuild( build );
+
+ List compileSourceRoots = new ArrayList();
+ compileSourceRoots.add( getBasedir() + "/src/main/java" );
+ setCompileSourceRoots( compileSourceRoots );
+ }
+
+ /** {@inheritDoc} */
+ public Build getBuild()
+ {
+ return build;
+ }
+
+ /** {@inheritDoc} */
+ public void setBuild( Build build )
+ {
+ this.build = build;
+ }
+
+ /** {@inheritDoc} */
+ public File getBasedir()
+ {
+ return new File( super.getBasedir() + "/src/test/resources/unit/javadoc" );
+ }
+
+ /** {@inheritDoc} */
+ public List getRemoteArtifactRepositories()
+ {
+ ArtifactRepository repository = new DefaultArtifactRepository( "central", "http://repo1.maven.org/maven2",
+ new DefaultRepositoryLayout() );
+
+ return Collections.singletonList( repository );
+ }
+
+ /** {@inheritDoc} */
+ public List getCompileArtifacts()
+ {
+ Artifact art = new DefaultArtifact( "org.apache.maven", "maven-plugin-api", VersionRange.createFromVersion( "2.0" ),
+ Artifact.SCOPE_COMPILE, "jar", null, new DefaultArtifactHandler( "jar" ), false );
+ art.setFile( new File( super.getBasedir() + "/target/local-repo/org/apache/maven/maven-plugin-api/2.0/maven-plugin-api-2.0.jar" ) );
+ return Collections.singletonList( art );
+ }
+}
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/java/org/apache/maven/tools/plugin/javadoc/stubs/DefaultMavenProjectStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/java/org/apache/maven/tools/plugin/javadoc/stubs/DefaultMavenProjectStub.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/resources/unit/javadoc/javadoc-plugin-config.xml
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/resources/unit/javadoc/javadoc-plugin-config.xml?rev=632196&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/resources/unit/javadoc/javadoc-plugin-config.xml (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/resources/unit/javadoc/javadoc-plugin-config.xml Thu Feb 28 17:35:16 2008
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.tools.plugin.javadoc</groupId>
+ <artifactId>test</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <inceptionYear>2008</inceptionYear>
+ <name>Test Mojo Tags</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <project implementation="org.apache.maven.tools.plugin.javadoc.stubs.DefaultMavenProjectStub"/>
+ <localRepository>${localRepository}</localRepository>
+ <outputDirectory>${basedir}/target/test/unit/javadoc/target/site/apidocs</outputDirectory>
+
+ <debug>true</debug>
+ <show>private</show>
+
+ <taglets>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoAggregatorTypeTaglet</tagletClass>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoComponentFieldTaglet</tagletClass>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoConfiguratorTypeTaglet</tagletClass>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoExecuteTypeTaglet</tagletClass>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoExecutionStrategyTypeTaglet</tagletClass>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoGoalTypeTaglet</tagletClass>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInheritByDefaultTypeTaglet</tagletClass>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoInstantiationStrategyTypeTaglet</tagletClass>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoParameterFieldTaglet</tagletClass>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoPhaseTypeTaglet</tagletClass>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoReadOnlyFieldTaglet</tagletClass>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiredFieldTaglet</tagletClass>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDependencyResolutionTypeTaglet</tagletClass>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresDirectInvocationTypeTaglet</tagletClass>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresOnLineTypeTaglet</tagletClass>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresProjectTypeTaglet</tagletClass>
+ </taglet>
+ <taglet>
+ <tagletClass>org.apache.maven.tools.plugin.javadoc.MojoRequiresReportsTypeTaglet</tagletClass>
+ </taglet>
+ </taglets>
+
+ <tagletArtifact>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </tagletArtifact>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/resources/unit/javadoc/javadoc-plugin-config.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/resources/unit/javadoc/javadoc-plugin-config.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/resources/unit/javadoc/src/main/java/org/apache/maven/plugin/my/MyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/resources/unit/javadoc/src/main/java/org/apache/maven/plugin/my/MyMojo.java?rev=632196&view=auto
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/resources/unit/javadoc/src/main/java/org/apache/maven/plugin/my/MyMojo.java (added)
+++ maven/plugin-tools/trunk/maven-plugin-tools-javadoc/src/test/resources/unit/javadoc/src/main/java/org/apache/maven/plugin/my/MyMojo.java Thu Feb 28 17:35:16 2008
@@ -0,0 +1,114 @@
+package org.apache.maven.plugin.my;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * Goal which touches a timestamp file.
+ *
+ * @aggregator
+ * @configurator roleHint
+ * @execute phase="validate" lifecycle="default"
+ * @executionStrategy always
+ * @goal touch
+ * @inheritByDefault true
+ * @instantiationStrategy per-lookup
+ * @phase phaseName
+ * @requiresDependencyResolution compile
+ * @requiresDirectInvocation
+ * @requiresOnline
+ * @requiresProject
+ * @requiresReports
+ */
+public class MyMojo
+ extends AbstractMojo
+{
+ /**
+ * Location of the file.
+ *
+ * @parameter expression="${project.build.directory}"
+ * @required
+ */
+ private File outputDirectory;
+
+ /**
+ * Dummy parameter.
+ *
+ * @parameter expression="${project.build.directory}" default-value="value" alias="myAlias"
+ * @required
+ * @readonly
+ */
+ private String dummy;
+
+ /**
+ * Dummy component.
+ *
+ * @component role="org.apacha.maven.MyComponent" roleHint="default"
+ * @required
+ * @readonly
+ */
+ private String component;
+
+ /** {@inheritDoc} */
+ public void execute()
+ throws MojoExecutionException
+ {
+ File f = outputDirectory;
+
+ if ( !f.exists() )
+ {
+ f.mkdirs();
+ }
+
+ File touch = new File( f, "touch.txt" );
+
+ FileWriter w = null;
+ try
+ {
+ w = new FileWriter( touch );
+
+ w.write( "touch.txt" );
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException( "Error creating file " + touch, e );
+ }
+ finally
+ {
+ if ( w != null )
+ {
+ try
+ {
+ w.close();
+ }
+ catch ( IOException e )
+ {
+ // ignore
+ }
+ }
+ }
+ }
+}