OpenGrok 的安装

原文:http://blog.163.com/huang_xin163/blog/static/175156597201112672535335/

1、安装 Java EE 6 SDK,附带了GlassFish

2、打开OpenGrok目录,将opengrok.jar,source.war 和 run.bat 拷贝出来放到c:\OpenGrok目录下

3、下载 ctags并解压到OpenGrok目录

4、下载Astyle,并将Astyle.exe复制到OpenGrok目录

5、新建两个文件夹 data, source

现在C:\OpenGrok 看起来应该是这样

+data
+source
+ctags
astyle.exe
opengrok.jar
source.war
run.bat

6、修改run.bat,用你的源码目录替换 proj

REM Get the name of the directory this run.bat script is living in.
set PROGDIR=%~dp0

REM 这里是源文件目录,将源代码目录拷贝进来
set SRC_ROOT=%PROGDIR%source\ proj

REM 这里是输出目录
set DATA_ROOT=%PROGDIR%data\proj

REM ctags所在路径
set EXUB_CTAGS=%PROGDIR%ctags\ctags.exe

REM 使用astyle格式化代码
astyle.exe --style=allman --indent=tab=8 --suffix=none --quiet --recursive %SRC_ROOT%\*.c %SRC_ROOT%\*.h %SRC_ROOT%\*.cpp
REM OPTIONAL
REM A tab separated file that contains small
REM descriptions for paths in the source tree
set PATH_DESC=%PROGDIR%paths.tsv set LOGGER="-Djava.util.logging.config.file=logging.properties" java %LOGGER% -jar %PROGDIR%opengrok.jar -W %DATA_ROOT%\configuration.xml -P -S -v -c %EXUB_CTAGS% -s %SRC_ROOT% -d %DATA_ROOT% REM OPTIONAL
java %LOGGER% -classpath %PROGDIR%opengrok.jar org.opensolaris.opengrok.web.EftarFile %PATH_DESC% %DATA_ROOT%\index\dtags.eftar
7、修改source.war source.war\WEB-INF\web.xml <context-param>
  <param-name>CONFIGURATION</param-name>
  <param-value>C:\OpenGrok\data\ proj\configuration.xml</param-value> <!-- 替换掉的部分 -–>;
  <description>Full path to the configuration file where OpenGrok can read it's configuration</description>
</context-param> source.war\default\style.css body
{
background-color: #ffffff;
font-size: 16px;  <!-- 字体大小-->
color: black;
font-family: arial, sans-serif;
/*padding: 1em;
margin: 0em;*/
}
8、运行run.bat并在glassfish中部署应用程序 运行run.bat将格式化代码,并生成交叉引用信息,将source.war添加到应用程序路径 9、在ie中打开 http://localhost:8080/proj

image

image
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值