I'm working on a Tapestry component library and wanted to add javadoc using the maven javadoc plugin and Tapestry taglet.

I added the following to my pom.xml:

<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.8.1</version>
            <configuration>
                <linksource>true</linksource>
                <taglet>org.apache.tapestry5.javadoc.TapestryDocTaglet</taglet>
                <tagletArtifact>
                    <groupId>org.apache.tapestry</groupId>
                    <artifactId>tapestry-javadoc</artifactId>
                    <version>${tapestry-release-version}</version>
                </tagletArtifact>
            </configuration>
        </plugin>
    </plugins>
</reporting>

And added following to my components java classes:

/**
 * @tapestrydoc
 */
public class SomeComponent {
    ...
}

Then I ran:

mvn javadoc:javadoc

But get the following:

... warning - @tapestrydoc is an unknown tag.

And the component parameters are not added to the javadoc...


What am I doing wrong here?

有帮助吗?

解决方案

See this blog post for a howto: JavaDoc Plugin For Component Reference Documentation. You need to add the tapestry config to the reporting plugin.

If this configuration is put into the reporting tag, it will only be used when generating reports via mvn site. Calling mvn javadoc:javadoc does not use the reporting tag. However, you can easily solve your problem by putting it into the build tag.

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.8</version>
        <configuration>
          ...
          <taglet>org.apache.tapestry5.javadoc.TapestryDocTaglet</taglet>
          <tagletArtifact>
             <groupId>org.apache.tapestry</groupId>                       
             <artifactId>tapestry-javadoc</artifactId>                       
             <version>5.3-rc-3</version>                   
          </tagletArtifact>
          ...
        </configuration>
      </plugin>
    </plugins>
    ...
  </build>
  ...
</project>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top