You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/10/17 06:46:04 UTC

[GitHub] [maven-plugin-tools] pzygielo commented on a diff in pull request #152: [MPLUGIN-426] add @Description annotation

pzygielo commented on code in PR #152:
URL: https://github.com/apache/maven-plugin-tools/pull/152#discussion_r996665939


##########
maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Description.java:
##########
@@ -0,0 +1,79 @@
+package org.apache.maven.plugins.annotations;
+
+/*
+ * 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.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Describes a {@code Mojo} or a Mojo’s {@code Parameter} when JavaDoc extraction is not feasible (because of deviating
+ * documentation goals) or not possible (e.g. for other JVM languages like Scala, Groovy or Kotlin).
+ */
+@Documented
+@Retention( RetentionPolicy.CLASS )
+@Target( { ElementType.TYPE, ElementType.FIELD } )
+@Inherited
+public @interface Description
+{
+    /**
+     * Description content for the {@code Mojo} or Mojo {@code Parameter}.
+     *
+     * <p>A &quot;Safe HTML&quot; subset can be used. This is achieved by running
+     * the content through the <a href="https://github.com/owasp/java-html-sanitizer"<OWASP Java HTML Sanitizer</a>
+     * before rendering.</p>
+     *
+     * @return a description of the Mojo or the parameter.
+     */
+    String content();

Review Comment:
   With this named as `value`, could annotation be used as `@Description("xxx yyy")`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org