花了一整天的时间安装jira最新版,现在记录一下。
1.下载最新的jira4.1.2版本并解压
2.在mysql数据库中新建数据库:create database jiradb character set utf8;,新建mysql用户jirauser,并将jiradb的所有操作权限都赋给jirauser(GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON jiradb.* TO jirauser@'192.168.0.%' IDENTIFIED BY 'jira';),最后记得flush privileges;
3.设置环境变量
vi /etc/profile
export CATALINA_HOME="/usr/local/atlassian-jira-enterprise-4.1.2-standalone"
source /etc/profile
4.修改配置文件
/usr/local/atlassian-jira-enterprise-4.1.2-standalone/conf/server.xml
<Context path="" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true"> <Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource" username="jirauser" password="jira" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://10.10.20.170:3306/jiradb?autoReconnect=true&useUnicode=true&characterEncoding=UTF8"/>
/usr/local/atlassian-jira-enterprise-4.1.2-standalone/atlassian-jira/WEB-INF/classes/entityengine.xml
<datasource name="defaultDS" field-type-name="mysql" helper-class="org.ofbiz.core.entity.GenericHelperDAO" check-on-start="true" use-foreign-keys="false" use-foreign-key-indices="false" check-fks-on-start="false" check-fk-indices-on-start="false" add-missing-on-start="true" check-indices-on-start="true"> <jndi-jdbc jndi-server-name="default" jndi-name="java:comp/env/jdbc/JiraDS"/> <!-- Orion format: <jndi-jdbc jndi-server-name="default" jndi-name="jdbc/JiraDS"/> --> <!-- JBoss format: <jndi-jdbc jndi-server-name="default" jndi-name="java:/JiraDS"/> --> <!-- Weblogic format: <jndi-jdbc jndi-server-name="default" jndi-name="JiraDS"/> --> </datasource>
vi atlassian-jira/WEB-INF/classes/jira-application.properties jira.home =/usr/local/atlassian-jira-enterprise-4.1.2-standalone
5.启动tomcat,在浏览器输入:http://10.10.20.170:8899(ip为实际ip,port为tomcat的server.xml配置的,默认8080)开始jira安装页面,获取ServerID
6.破解jira4.1.2,将/usr/local/atlassian-jira-enterprise-4.1.2-standalone/atlassian-jira/WEB-INF/lib/atlassian-extras-2.2.2.jar复制到本地windows机子上,解压附件的crack.rar,双击keygen.bat,输入上一步获取的ServerID信息,点击gen,生成序列号,再 patch一下atlassian-extras-2.2.2.jar,patch成功后将atlassian-extras-2.2.2.jar拷贝覆盖服务器上的jar。
7.如果出现jira安装页面不可以访问,尝试重启,我遇到过第一次安装页面不可访问,重启即可。
8.汉化。下载汉化包:http://www.fangwai.net/software/jira/download/language_zh_CN.jar替换原有的简体中文语言包。
9.因为jira的描述官方不支持富文本,被很多用户诟病。现提供一种简单的方式实现,来源自jira官方评论。
1. Extract tinyMCE to the "\atlassian-jira\includes\js\" folder. 2. Edit "\atlassian-jira\secure\views\createissue-details.jsp" a. Add this under <body>, you may also want to remove the add comment on create (one line of code) if you don’t use it or exempt it using the tinyMCE editor_selector option. <script type="text/javascript" src="/includes/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ mode : "textareas", theme : "advanced", plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template", theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true }); </script> 3. Edit "atlassian-jira\secure\views\issue\editissue.jsp" a. Add this just under <body class="type-a"> <script type="text/javascript" src="/includes/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ mode : "textareas", theme : "advanced", plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template", theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true }); </script> 4. Edit "atlassian-jira\secure\views\issue\viewissue.jsp" a. Add the following below </fieldset> <script type="text/javascript" src="/includes/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init( { mode : "textareas", theme : "advanced", theme_advanced_resizing : true, readonly : true, editor_selector : "mceSimple" }); </script> 5. Edit "\atlassian-jira\includes\panels\issue_descriptiontable.jsp" a. Replace the contents of <ul class="item-details"> </ul> with the following: <li> <dl> <dt><webwork:text name="'issue.field.description'"/>:</dt> <webwork:if test="../string('description')/length > 255"> <dd class="twixified"> <div class="twixi-wrap verbose"> <a href="#" class="twixi"><span class="icon twixi-opened"><span><webwork:text name="'admin.common.words.hide'"/></span></span></a> <textarea name="content" class="mceSimple" style="width:100%;height:100%"> <div id="description-full" class="flooded"> <webwork:property value="/renderedContent('description', ../string('description'), @issue)" escape="'false'" /> </div> </textarea> </div> <div class="twixi-wrap concise"> <a href="#" class="twixi"><span class="icon twixi-closed"><span><webwork:text name="'admin.common.words.show'"/></span></span></a> <textarea name="content" class="mceSimple" style="width:100%;height:100%"> <div class="flooded"> <webwork:property value="/renderedContentNoBreaks('description', ../string('description'), @issue)" escape="'false'" /> </div> </textarea> </div> </dd> </webwork:if> <webwork:else> <dd id="description-full"> <textarea name="content" class="mceSimple" style="width:100%;height:100%"> <webwork:property value="/renderedContent('description', ../string('description'), @issue)" escape="'false'" /> </textarea> </dd> </webwork:else> </dl> </li> 6. 记得在修改文件前备份!!!
10.jira默认的日期习惯是西方的,我们大概经常使用的是yyyy-mm-dd HH:mm可以在《全局配置》->《系统界面配置》中修改,但是日历选择控件的格式必须直接修改配置文件jira-application.properties
jira.date.picker.java.format = yyyy-MM-dd jira.date.picker.javascript.format = %Y-%m-%e jira.date.time.picker.java.format = yyyy-MM-dd HH:mm jira.date.time.picker.javascript.format = %Y-%m-%e %H:%M
11.注意:虽然附件破解文件是4.1.1的,对于4.1.2也适用!!!是备忘不是教程,顺序会有点不一致。。