2011-12-15 34 views

回答

5

你有2个解决方案,使用Maven插件的Javadoc与

<reporting> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-javadoc-plugin</artifactId> 
      <configuration> 
        <header>&lt;b&gt;test test&lt;/b&gt</header>  
      </configuration> 
     </plugin> 
    </plugins> 
</reporting> 

你改变我的“考试考试”与您的谷歌分析脚本,不要忘记更改<与<和>与> 然后你叫

MVN干净的javadoc:javadoc的

或使用旧方法http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#header与HTML脚本

+0

嗯,你要链接的文档,基本上说,该文本将进入生成的HTML文档的BODY。但为了包含Google Analytics(分析)Javascript代码,它需要进入生成的HTML文档的HEAD,还是我在这里误解了一些东西? – 2012-01-24 18:12:40

9

使用CData的

<configuration> 
    <!-- GA Tracking code --> 
    <header> 
    <![CDATA[ 
     <script type="text/javascript"> 
      var _gaq = _gaq || []; 
      _gaq.push(['_setAccount', 'UA-XXXXXXXX-1']); 
      _gaq.push(['_trackPageview']); 

      (function() { 
      var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; 
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); 
      })(); 

     </script> 
    ]]> 
    </header> 
</configuration> 
相关问题