发布于 2024-12-23 17:09:05 字数 3709 浏览 2 评论 0原文

My team is working on a webservice project, and I am working on creating the documentation for the web service API. I have used a custom JavaDoc doclet to create two xml outputs of the available methods, one for internal developers and one for external developers.

Now, we are using the Jboss Maven Jdocbook plugin to create a DocBook output, along with other xml files, to create a users guide for our webservices.

What I want to do is run the Maven JdocBook plugin twice, once using the internal methods and once on the external methods, to create two separate users guides for either internal or external developers, using two different master.xml files. The pom file:

<build>
  <defaultGoal>generate</defaultGoal>
  <plugins>
     <plugin>
        <groupId>org.jboss.maven.plugins</groupId>
        <artifactId>maven-jdocbook-plugin</artifactId>
        <extensions>true</extensions>
        <goals>
           <goal>generate</goal>
        </goals>
        <configuration>
           <formats>
              <format>
                 <formatName>html</formatName>
              </format>
              <format>
                 <formatName>html_single</formatName>
              </format>
           </formats>
        </configuration>
        <executions>
           <execution>
              <id>internal</id>
              <phase>compile</phase>
              <configuration>
                 <baseOutputDirectory>../../Test/JavaDocTest/internal/</baseOutputDirectory>
                 <sourceDocumentName>masterInternal.xml</sourceDocumentName>
              </configuration>
           </execution>
           <execution>
              <id>external</id>
              <phase>compile</phase>
              <configuration>
                 <baseOutputDirectory>../../Test/JavaDocTest/external/</baseOutputDirectory>
                 <sourceDocumentName>masterExternal.xml</sourceDocumentName>
              </configuration>
           </execution>
        </executions>
     </plugin>
     <plugin>
        <groupId>org.jboss.maven.plugins</groupId>
        <artifactId>maven-jdocbook-style-plugin</artifactId>
        <version>1.0.0</version>
        <extensions>true</extensions>
     </plugin>
  </plugins>

The problem I am running in to is that unless I put the sourceDocumentName in the base configuration (outside of the execution section and in the section with the formats) the build does not recognize the different source document name. The standard master file is called master.xml, and on compiling in NetBeans, it says it is looking for master.xml, which it can't find because it does not exist, and then skips the generation 。

It is appearing to just skip the execution sections altogether, as when I try to run the build with multiple executions (such as above) it still just runs once. Any ideas why it's skipping the execution sections?

I believe it might have something to do with the phase tag of the execution, but according to http:/ /www.jboss.org/maven-jdocbook-plugin/ there are only a few phases (process-resources, compile, package, install, deploy), and I've tried all of them and none of them seem到 work.
提前致谢。

My team is working on a webservice project, and I am working on creating the documentation for the web service API. I have used a custom JavaDoc doclet to create two xml outputs of the available methods, one for internal developers and one for external developers.

Now, we are using the Jboss Maven Jdocbook plugin to create a DocBook output, along with other xml files, to create a users guide for our webservices.

What I want to do is run the Maven JdocBook plugin twice, once using the internal methods and once on the external methods, to create two separate users guides for either internal or external developers, using two different master.xml files. The pom file:

<build>
  <defaultGoal>generate</defaultGoal>
  <plugins>
     <plugin>
        <groupId>org.jboss.maven.plugins</groupId>
        <artifactId>maven-jdocbook-plugin</artifactId>
        <extensions>true</extensions>
        <goals>
           <goal>generate</goal>
        </goals>
        <configuration>
           <formats>
              <format>
                 <formatName>html</formatName>
              </format>
              <format>
                 <formatName>html_single</formatName>
              </format>
           </formats>
        </configuration>
        <executions>
           <execution>
              <id>internal</id>
              <phase>compile</phase>
              <configuration>
                 <baseOutputDirectory>../../Test/JavaDocTest/internal/</baseOutputDirectory>
                 <sourceDocumentName>masterInternal.xml</sourceDocumentName>
              </configuration>
           </execution>
           <execution>
              <id>external</id>
              <phase>compile</phase>
              <configuration>
                 <baseOutputDirectory>../../Test/JavaDocTest/external/</baseOutputDirectory>
                 <sourceDocumentName>masterExternal.xml</sourceDocumentName>
              </configuration>
           </execution>
        </executions>
     </plugin>
     <plugin>
        <groupId>org.jboss.maven.plugins</groupId>
        <artifactId>maven-jdocbook-style-plugin</artifactId>
        <version>1.0.0</version>
        <extensions>true</extensions>
     </plugin>
  </plugins>

The problem I am running in to is that unless I put the sourceDocumentName in the base configuration (outside of the execution section and in the section with the formats) the build does not recognize the different source document name. The standard master file is called master.xml, and on compiling in NetBeans, it says it is looking for master.xml, which it can't find because it does not exist, and then skips the generation.

It is appearing to just skip the execution sections altogether, as when I try to run the build with multiple executions (such as above) it still just runs once. Any ideas why it's skipping the execution sections?

I believe it might have something to do with the phase tag of the execution, but according to http://www.jboss.org/maven-jdocbook-plugin/ there are only a few phases (process-resources, compile, package, install, deploy), and I've tried all of them and none of them seem to work.
Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

卖梦商人 2024-12-30 17:09:05

My group figured out that you need to set sourceDocumentName in the main configuration area. It turns out that the docbook is generated once using the main config section, and then it looks for any other executions and runs those using the specific sub-configuration for that execution.

希望这对将来的人有帮助。

My group figured out that you need to set sourceDocumentName in the main configuration area. It turns out that the docbook is generated once using the main config section, and then it looks for any other executions and runs those using the specific sub-configuration for that execution.

Hope this helps someone in the future.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文