eclipse中的Java文件自动根据svn版本号生成注释

    技术2022-05-20  34

     

    经常在java代码中看到以下的注释($Rev: $Date),是不是很酷,怎么生成的呢?

    /** * A FilterChain is an object provided by the servlet container to the developer * giving a view into the invocation chain of a filtered request for a resource. Filters * use the FilterChain to invoke the next filter in the chain, or if the calling filter * is the last filter in the chain, to invoke the rosource at the end of the chain. * * @see Filter * @since Servlet 2.3 * * @version $Rev: 46019 $ $Date: 2004-09-14 04:56:06 -0500 (Tue, 14 Sep 2004) $ */ public interface FilterChain {​ 

    一、eclipse中配置:

    windows-->preference  Java-->Code Style-->Code Templates  code-->new Java files  编辑它 

    * 更新: $$Date$$

     * 作者: $$Author$$

     * 版本: $$Rev$$

     * ID  :$$Id$$

    二、修改svb配置文件

    windows7 下 ,修改 C:/Users/your username/AppData/Roaming/Subversion 目录下

    xp下,修改C:/Documents and Settings/Administrator/Application Data/Subversion/ 目录下

    的 config文件,取消掉 “enable-auto-props = yes” 的注释

    在[auto-props]下,加入:

    *.java = svn:keywords=Date Rev Id  Author

    *.txt = svn:keywords=LastChangedDate LastChangedRevision

     


    最新回复(0)