2013-02-16 51 views
0

我想爲我的Wicket Web應用程序建立一些文檔。我創建了一個頁面來抓取所有已安裝的頁面,並將它們顯示在/sitemap.xml中。 在文檔中,我爲文件<siteMap:Description> 添加了一個新標記,現在我想用描述類文件的javadoc條目填充該描述。如何在編譯時獲得Javadoc類的描述?

我知道有直接的方法可以在運行時訪問它們。所以相反,我希望將它們在編譯時複製到List中,然後可以從運行時訪問它們。我會怎麼做?

我爲我的構建使用Maven。

編輯
我應該還提到,我有一個AntTask已定義爲我的構建過程編譯日期/時間保存到一個屬性文件的一部分。
在我看來一個任務掃描我的類,然後把信息放入一個文件可能是要走的路。問題是我不知道如何繼續。

我的Ant任務是在我的pom.xml中這樣定義,如:

<plugin> 
    <artifactId>maven-antrun-plugin</artifactId> 
    <dependencies> 
     <dependency> 
     <groupId>ant</groupId> 
     <artifactId>ant-nodeps</artifactId> 
     <version>1.6.5</version> 
     </dependency> 
    </dependencies> 
    <executions> 
     <execution> 
     <id>set-build-time</id> 
     <phase>process-sources</phase> 
     <configuration> 
      <tasks> 
      <tstamp> 
       <format property="build.timestamp" pattern="yyyy/MM/dd HH:mm:ss"/> 
       <format property="build.time" pattern="HH:mm:ss" /> 
       <format property="build.date" pattern="MM/dd/yyyy" /> 
       <format property="build.year" pattern="yyyy"/> 
      </tstamp> 
      <replaceregexp byline="true"> 
       <regexp pattern="copyYear\=.*" /> 
       <!--suppress MavenModelInspection --> 
       <substitution expression="copyYear=${build.year}" /> 
       <fileset dir="src/main/java/" includes="**/*.properties" /> 
      </replaceregexp> 
      <replaceregexp byline="true"> 
       <regexp pattern="buildTime\=.*" /> 
       <!--suppress MavenModelInspection --> 
       <substitution expression="buildTime=${build.date} ${build.time}" /> 
       <fileset dir="src/main/java/" includes="**/*.properties" /> 
      </replaceregexp> 
      </tasks> 
     </configuration> 
     <goals> 
      <goal>run</goal> 
     </goals> 
     </execution> 
    </executions> 
    </plugin> 

回答

相關問題