【问题标题】:Documentation with Doxia + AntDoxia + Ant 文档
【发布时间】:2009-10-09 17:47:15
【问题描述】:

我想使用Doxia 生成一些文档,但使用 Ant 调用它(不,Maven 不是一个选项)。我一直在寻找一些指针,但经过几次 Google 搜索后什么都没有弹出。

有人已经在 Ant 环境中使用过 Doxia 吗?结果如何?

【问题讨论】:

    标签: documentation ant doxia


    【解决方案1】:

    我不知道任何 Ant Doxia 任务,使用 Maven 或在 Ant 构建中调用 Mvn ant task 来调用 Doxia 确实会更简单...

    如果这真的不可行,那么拼凑一个custom ant task 来调用 Doxia 应该是相当简单的。

    根据要求,一些入门指南:

    Maven 基于Plexus,Doxia 组件可从 Plexus 容器中用于应用程序。
    getting started with Plexus 上有一个教程,您可能会发现对创建包装器的一些背景很有帮助。

    以下示例显示了如何在独立应用程序中获取SiteTools 组件。正如上面提到的 Ant 教程,将执行包装在 Ant 任务中会很简单。

    public class DoxiaPlexusTest
    {
        public static void main( String[] args )
            throws Exception {
            // create a new container
            PlexusContainer container = new DefaultPlexusContainer();
    
            SiteTool siteTool = container.lookup( SiteTool.class );
    
            try {
                new DoxiaPlexusTest().letsDoDoxia(siteTool);
            finally {
                // stop the components and container
                container.dispose();
            }
        }
    
        public void letsDoDoxia(SiteTool siteTool) {
            List localesList = siteTool.getAvailableLocales( locales );
            String relativePath = siteTool.getRelativePath( "C:/foo/child",
                                "C:/foo/master" );
            ...
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-08-09
      • 2011-10-12
      • 2011-07-09
      • 1970-01-01
      • 1970-01-01
      • 2010-10-08
      • 2010-11-13
      相关资源
      最近更新 更多