1

TLDGenライブラリを使用して、クラスの注釈から TLD ファイルを構築するのに役立つtaglib プロジェクトがあります。次に、Maven JavaDoc プラグインにプラグインして、javadoc:javadoc Maven ゴールを介して TLD ファイルをビルドしました。これを処理する Pom 部分は次のとおりです。

<build>
    ...
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.7</version>
            <configuration>
                <doclet>org.tldgen.TldDoclet</doclet>
                <docletArtifact>
                    <groupId>com.google.code.tldgen</groupId>
                    <artifactId>tldgen-all</artifactId>
                    <version>1.0.0</version>
                </docletArtifact>
                <show>private</show>
                <additionalparam>-name test
                    -uri "http://www.mycompany.com/tags/wibble"
                    -tldFile ..\..\..\src\main\resources\META-INF\w.tld
                </additionalparam>
                <useStandardDocletOptions>true</useStandardDocletOptions>
                <author>false</author>
                <encoding>utf-8</encoding>
            </configuration>
        </plugin>
    </plugins>
</build>

そして、これは素晴らしく機能します。問題は、このプロジェクトから 2 つの TLD を作成したいということです。-subpackages 属性を addtionalparam 要素に渡すことができるので、必要なものだけで TLD を作成できます。

しかし、その時点で設定できる要素は 1 つだけです。構成を pom のレポート セクションに移動して、2 つのレポートセットを使用して、それが役立つかどうかを確認しましたが、うまくいきませんでした。

これまでに誰かがこれを試みたことがありますか? 乾杯!

4

1 に答える 1

0

この質問が投稿されてからしばらく経ちましたが、TLDGen で複数の tld 生成を行った方法を次に示します。プロジェクトの人たちがあなたの答えを参照として使用したので、私はあなたの質問から始めました:)。

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>2.7</version>
    <configuration>
        <includes>
            <include>**</include>
        </includes>
        <doclet>org.tldgen.TldDoclet</doclet>
        <docletArtifacts>
            <!-- listing all dependencies for tldgen: 
            the tldgen library, commons-logging, commons-io, 
            commons-lang, geronimo-jsp_2.1_spec, log4j, saxon, stax
            not sure if they have to be listed here, will have to check; if I
            don't set them I get class not found errors, but I'm guessing I 
            have a misconfiguration -->
        </docletArtifacts>
        <show>private</show>
        <additionalparam>
            -htmlFolder ${basedir}/target/docs
            -tldFolder ${basedir}/src/main/java/META-INF
            -license NONE
        </additionalparam>
        <useStandardDocletOptions>true</useStandardDocletOptions>
        <author>false</author>
        <encoding>utf-8</encoding>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jsr173_api</artifactId>
            <version>1.0</version>
        </dependency>
    </dependencies>
    <executions>
        <execution>
            <phase>generate-resources</phase>                            
            <goals>
                <goal>javadoc</goal>
            </goals>
        </execution>
    </executions>
</plugin>
于 2011-06-20T14:57:15.143 に答える