---
title: "Maven+Appfuse+Apache+Subversion+ViewVC+Jira+Confluence安装手记"
author: "tangtianguang"
date: "2007-11-07T11:01:23Z"
tags: []
categories: ["研发管理"]
slug: "maven-appfuse-apache-subversion-viewvc-jira-confluence"
draft: false
lastmod: "2007-11-07T11:01:23Z"
id: 138706
url: "https://ttg.iteye.com/blog/138706"
---

首先准备以下安装程序：

- [Maven 2.0.7![](http://192.168.1.106:8080/confluence/images/icons/link_attachment_7.gif)](http://192.168.1.106:8080/confluence/download/attachments/74/maven-2.0.7.rar?version=1 "maven-2.0.7.rar attached to Maven+Appfuse+Apache+Subversion+ViewVC+Jira+Confluence安装手记")
- [Collabnet Subversion-server-1.4.5-1.win32![](http://192.168.1.106:8080/confluence/images/icons/link_attachment_7.gif)](http://192.168.1.106:8080/confluence/download/attachments/74/CollabNetSubversion-server-1.4.5-1.win32.exe?version=1 "CollabNetSubversion-server-1.4.5-1.win32.exe attached to Maven+Appfuse+Apache+Subversion+ViewVC+Jira+Confluence安装手记")
- [TortoiseSVN-1.4.4.9706-win32-svn-1.4.4![](http://192.168.1.106:8080/confluence/images/icons/link_attachment_7.gif)](http://192.168.1.106:8080/confluence/download/attachments/74/TortoiseSVN-1.4.4.9706-win32-svn-1.4.4.msi?version=1 "TortoiseSVN-1.4.4.9706-win32-svn-1.4.4.msi attached to Maven+Appfuse+Apache+Subversion+ViewVC+Jira+Confluence安装手记")
- [svn-python-1.4.5.win32-py2.5![](http://192.168.1.106:8080/confluence/images/icons/link_attachment_7.gif)](http://192.168.1.106:8080/confluence/download/attachments/74/svn-python-1.4.5.win32-py2.5.exe?version=1 "svn-python-1.4.5.win32-py2.5.exe attached to Maven+Appfuse+Apache+Subversion+ViewVC+Jira+Confluence安装手记")
- [atlassian-jira-enterprise-3.6-standalone![](http://192.168.1.106:8080/confluence/images/icons/linkext7.gif)](http://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-enterprise-3.6.4-standalone.zip "Visit page outside Confluence")
- [confluence-2.2.9-std![](http://192.168.1.106:8080/confluence/images/icons/linkext7.gif)](http://www.atlassian.com/software/confluence/downloads/binary/confluence-2.2.9-std.zip "Visit page outside Confluence")
- [atlassian-jira-subversion-plugin-0.9.4(支持jira 3.6)![](http://192.168.1.106:8080/confluence/images/icons/link_attachment_7.gif)](http://192.168.1.106:8080/confluence/download/attachments/74/atlassian-jira-subversion-plugin-0.9.4.zip?version=1 "atlassian-jira-subversion-plugin-0.9.4.zip attached to Maven+Appfuse+Apache+Subversion+ViewVC+Jira+Confluence安装手记")
- [ActivePython 2.5.1.1![](http://192.168.1.106:8080/confluence/images/icons/linkext7.gif)](http://downloads.activestate.com/ActivePython/windows/2.5/ActivePython-2.5.1.1-win32-x86.msi "Visit page outside Confluence")
- [Highlight 2.6.5![](http://192.168.1.106:8080/confluence/images/icons/link_attachment_7.gif)](http://192.168.1.106:8080/confluence/download/attachments/74/highlight-setup-2.6.5.exe?version=1 "highlight-setup-2.6.5.exe attached to Maven+Appfuse+Apache+Subversion+ViewVC+Jira+Confluence安装手记")
- [cvsgraph 1.6.1![](http://192.168.1.106:8080/confluence/images/icons/link_attachment_7.gif)](http://192.168.1.106:8080/confluence/download/attachments/74/cvsgraph-1.6.1-Win32-binary.zip?version=1 "cvsgraph-1.6.1-Win32-binary.zip attached to Maven+Appfuse+Apache+Subversion+ViewVC+Jira+Confluence安装手记")

第一步：安装Maven

1. 解压缩Maven 2.0.7。
2. 添加环境变量M2\_HOME=%maven安装目录%，并在PATH中添加%maven安装目录%\\bin。
3. 测试Maven安装，在命令行输入maven --version，得到版本信息则安装成功。

第二步：安装Collabnet Subversion

1. 双击直接安装。在安装过程中选择将Apache以及SVN都作为系统服务安装，并且指定的Repository目录要一致。
2. 生成passwd文件，在命令行调用%Collabnet安装目录%\\httpd\\bin\\htpasswd。
3. 编写授权文件authz。
4. 配置Collabnet里面的Apache，修改%Collabnet安装目录%\\httpd\\conf\\httpd.conf文件，将

&lt;Location /repos&gt;  
    DAV svn  
    SVNParentPath G:/svn\_repository  
&lt;/Location&gt;

          修改为：

&lt;Location /repos&gt;  
    DAV svn  
    SVNParentPath G:/svn\_repository  
     
    AuthType Basic  
    AuthName "Subversion repository"  
    AuthUserFile passwd  
    AuthzSVNAccessFile authz  
   
    Satisfy Any  
    Require valid-user  
&lt;/Location&gt;

> 注意：上面的配置里面，passwd和authz等文件的默认路径是从apache的根目录开始的，在这里是%Collabnet安装目录%\\httpd，确保启用dav\_svn需要的几个模块：dav\_module.so, dav\_svn\_module.so, mod\_authz\_svn.so，否则启动Apache时会出错。

第三步：安装TortoiseSVN

第四步：安装MSSql Server 2000

第四步：创建svn repository

1. 进入G:/svn\_repository，单击右键选择"TortoiseSVN"-&gt;"Create repository here"即可。

第五步：安装Jira和Confluence

1. 解压缩Jira-standalone的zip包。
2. 解压缩Confluence的zip包，将其中的confluence目录拷贝到Jira的安装目录下。
3. 破解Jira，执行jira-keygen.class。
4. 破解Confluence，拷贝[atlassian-extras-0.7.20.jar![](http://192.168.1.106:8080/confluence/images/icons/link_attachment_7.gif)](http://192.168.1.106:8080/confluence/download/attachments/74/atlassian-extras-0.7.20.jar?version=1 "atlassian-extras-0.7.20.jar attached to Maven+Appfuse+Apache+Subversion+ViewVC+Jira+Confluence安装手记")到conflucen目录下WEB-INF\\lib下，执行[keygen.class![](http://192.168.1.106:8080/confluence/images/icons/link_attachment_7.gif)](http://192.168.1.106:8080/confluence/download/attachments/74/keygen.class?version=3 "keygen.class attached to Maven+Appfuse+Apache+Subversion+ViewVC+Jira+Confluence安装手记")。
5. 在MSSql Server 2000创建两个数据库，jiradb和confluencedb。
6. 创建用户jirauser，并将它作为jiradb和confluencedb的db\_owner角色。
7. 修改%Jira安装目录%\\conf\\server.xml，修改以下内容：

将以下内容：

&lt;Context path="" docBase="atlassian-jira" reloadable="false"&gt;  
                      username="sa"  
            password=""  
            driverClassName="org.hsqldb.jdbcDriver"  
            url="jdbc:hsqldb:database/jiradb"  
            minEvictableIdleTimeMillis="4000"  
            timeBetweenEvictionRunsMillis="5000"/&gt;

        &lt;Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction"  
            factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/&gt;  
          &lt;Manager pathname=""/&gt;  
        &lt;/Context&gt;

修改为：

&lt;Context path="" docBase="atlassian-jira" reloadable="false"&gt;  
          &lt;Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource"  
            username="jirauser"  
            password="jira"  
            driverClassName="net.sourceforge.jtds.jdbc.Driver"  
            url="jdbc:jtds:sqlserver://localhost:1433/jiradb"  
            minEvictableIdleTimeMillis="4000"  
            timeBetweenEvictionRunsMillis="5000"/&gt;  
          

        &lt;Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction"  
            factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/&gt;  
          &lt;Manager pathname=""/&gt;  
        &lt;/Context&gt;

配置Confluence，添加以下内容：

        &lt;Context path="/confluence" docBase="confluence" reloadable="false"&gt;  
         &lt;Resource name="jdbc/ConfluenceDS" auth="Container" type="javax.sql.DataSource"  
            username="jirauser"  
            password="jira"  
            driverClassName="net.sourceforge.jtds.jdbc.Driver"  
            url="jdbc:jtds:sqlserver://localhost:1433/confluencedb"  
            minEvictableIdleTimeMillis="4000"  
            timeBetweenEvictionRunsMillis="5000"/&gt;  
             
         &lt;Logger className="org.apache.catalina.logger.FileLogger"  
         prefix="atlassian-confluence." suffix=".log" timestamp="true"/&gt;  
        &lt;/Context&gt;

第六步：安装ViewVC

ViewVC除了支持CVS代码仓库浏览以外，还支持：

- SVN代码仓库浏览
- 代码语法加亮、颜色标注
- CVS代码修订历史图形显示
- CVS代码提交动作的记录、查询

为了实现上述功能，要求以下依赖项：

- Python运行时
- Subversion及Subversion Python绑定
- [Highlight![](http://192.168.1.106:8080/confluence/images/icons/linkext7.gif)](http://www.andre-simon.de/ "Visit page outside Confluence")
- [CVSGraph![](http://192.168.1.106:8080/confluence/images/icons/linkext7.gif)](http://www.akhphd.au.dk/~bertho/cvsgraph/ "Visit page outside Confluence")

安装步骤如下： 

01. 直接下载ActivePython 2.5.1.1的Windows版本，双击运行即可。
    
    > 在Windows平台上，由于viewvc使用了Python的Win32扩展模块，所以第一项依赖软件包除了安装官方发布的Python外，还需要Python Win32扩展模块(可以从[http://starship.python.net/crew/mhammond/win32/![](http://192.168.1.106:8080/confluence/images/icons/linkext7.gif)](http://starship.python.net/crew/mhammond/win32/ "Visit page outside Confluence")下载)。为了省去另行安装的麻烦，可以使用ActiveState提供的Windows版的ActivePython，它包含了Python Win32扩展模块，使得安装更为便捷。
02. 下载ViewVC：
    
    svn co [http://viewvc.tigris.org/svn/viewvc/trunk![](http://192.168.1.106:8080/confluence/images/icons/linkext7.gif)](http://viewvc.tigris.org/svn/viewvc/trunk "Visit page outside Confluence") ViewVC --username guest --password "" --no-auth-cache
03. 安装ViewVC：
    
    python viewcvs-install
04. 安装Subversion Python绑定。
05. 安装Highlight。
    
    > Enscript和highlight都可以对代码进行语法加亮、颜色标注，但由于Enscript相对比较旧，支持的语言相对较少，而且本身又有依赖，所以第三项依赖软件包采用功能更丰富、开发相对比较活跃的highlight。
06. 安装cvsgraph。
07. 配置ViewVC。配置的主要信息有cvs或svn的代码仓库的位置，cvsnt或rcs命令的位置。这些信息都配置在%ViewVC安装目录%\\viewcvs.conf文件中。  
    cvs\_roots指定cvs代码仓库的位置；svn\_roots指定svn代码库的位置，它们俩使用相同的语法：每个仓库指定一个名称，然后指定仓库的绝对路径，两者冒号隔开。如果每个代码仓库指定多个代码库，用逗号分隔。  
    示例代码如下：
    
    cvs\_roots = new technology: C:\\cvs\_repos\\new\_tech,  
                      legacy code: C:\\cvs\_repos\\legacy\_code,  
                      project1: C:\\cvs\_repos\\project1,  
                      porject2: C:\\cvs\_repos\\project2  
    svn\_roots = new technology: C:\\svn\_repos\\new\_tech,  
                      legacy code: C:\\svn\_repos\\legacy\_code,  
                      project1: C:\\svn\_repos\\project1,  
                      project2: C:\\svn\_repos\\project2
    
    如果有多个代码仓库需要让ViewVC来通过Web展示，使用roots\_parents参数，如：roots\_parents = C:\\cvs\_repos : cvs, C:\\svn\_repos : svn。  
    ViewVC需要使用cvs或svn的可执行程序访问代码仓库，相关参数为：cvsnt\_exe\_path和svn\_path。  
    启用CVS代码修订历史图形显示功能需要设置参数use\_cvsgraph = 1，并设置cvsgraph\_path为cvsgraph.exe的绝对路径（如果不在环境变量PATH中）。  
    启用Highlight与上面相似。
08. 整合ViewVC和Apache。在%apache安装目录%\\conf\\httpd.conf中添加以下内容：ScriptAlias /viewvc/ "%ViewVC安装目录%/bin/cgi/"
09. 安装Jira的SVN Plugin。  
    拷贝jira-svn-plugin到相关目录，并把subversion-jira-plugin.properties拷到%Jira文件目录%\\WEB-INF\\classes\\下。
10. 整合Jira、SVN和ViewVC。在%Jira文件目录%\\WEB-INF\\classes\\subversion-jira-plugin.properties中，配置svn.root和#ViewVC段的内容。见[示例配置文件![](http://192.168.1.106:8080/confluence/images/icons/link_attachment_7.gif)](http://192.168.1.106:8080/confluence/download/attachments/74/subversion-jira-plugin.properties?version=2 "subversion-jira-plugin.properties attached to Maven+Appfuse+Apache+Subversion+ViewVC+Jira+Confluence安装手记")。