一、修改atlassian-extras方案
1、将atlassian-extras-decoder-v2-3.3.0.jar(Confluence 6.7.2)或atlassian-extras-decoder-v2-3.4.1.jar(Confluence 7.4.6)重命名为atlassian-extras-2.4.jar,大致是:
Linux在:mv /opt/atlassian/confluence/confluence/WEB-INF/lib/atlassian-extras-decoder-v2-3.3.0.jar /opt/atlassian-extras-2.4.jar
Windows在:C:\Program Files\Atlassian\Confluence\confluence\WEB-INF\lib\atlassian-extras-decoder-v2-3.3.0.jar,将其改名为atlassian-extras-2.4.jar
2、运行confluence_keygen.jar
1 |
java -jar confluence_keygen.jar |
点击.patch,选择atlassian-extras-2.4.jar文件,然后破解成功,老的atlassian-extras-2.4.jar会被命名为atlassian-extras-2.4.jar.bak,然后新生成一个atlassian-extras-2.4.jar:
3、把新生成的atlassian-extras-2.4.jar改名回atlassian-extras-decoder-v2-3.3.0.jar或atlassian-extras-decoder-v2-3.4.1.jar
重启服务,Linux下使用:
1 2 |
service confluence stop service confluence start |
4、把MySQL Connector放到C:\Program Files\Atlassian\Confluence\confluence\WEB-INF\lib中,实测Confluence 7.19.1+MySQL 8.0.27+mysql-connector-java-5.1.49无问题(Confluence 7.3.6+MySQL 8.0.27+mysql-connector-java-8.0.22运行时会有找不到表的诡异报错且备份失败,换mysql-connector-java-5.1.49)。数据库配置必须按照官方文档的配置,否则容易有诡异的问题(https://confluence.atlassian.com/doc/database-setup-for-mysql-128747.html)。使用utf8编码、utf8_bin,直接使用形如下面的连接字符串,否则要自己修改默认隔离级别:
1 |
<del>jdbc:mysql://localhost:3306/confluence?sessionVariables=tx_isolation='READ-COMMITTED'&useUnicode=true&characterEncoding=utf8</del> |
如果是MySQL 8.x的话,新版本已经弃用了tx_isolation,所以会报错:
1 2 3 4 5 |
<del>Problem connecting to your database SQLState - HY000 Error Code - 1193 java.sql.SQLException: Unknown system variable 'tx_isolation'</del> |
把tx_isolation换成transaction_isolation即可:
1 |
<del>jdbc:mysql://localhost:3306/confluence?sessionVariables=transaction_isolation='READ-COMMITTED'&useUnicode=true&characterEncoding=utf8</del> |
另外,强烈建议confluce、jira、bitbucket均使用独立的数据库用户,否则导出时容易有问题:
1 2 3 4 5 6 7 8 9 |
CREATE SCHEMA `confluence` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; create user 'confluence'@'localhost' IDENTIFIED BY 'confluence'; GRANT ALL on confluence.* TO 'confluence'@'localhost'; flush privileges; CREATE SCHEMA `bitbucket` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ; create user 'bitbucket'@'localhost' IDENTIFIED BY 'bitbucket'; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,REFERENCES,ALTER,INDEX on bitbucket.* TO 'bitbucket'@'localhost'; flush privileges; |
5、然后使用对应的Server ID激活即可:
二、atlassian-agent方案
上述方案无法破解插件,如果想破解插件的话可以使用atlassian-agent。在启动命令中增加:
1 |
-javaagent:D:\atlassian-agent.jar |
路径中不要有空格。如果不是服务模式方式启动的话,可以常在setenv.bat中的最后增加形如下面的一行(注意其中的路径被引号引起来了):
1 |
set CATALINA_OPTS=-javaagent:"D:\Atlassian\atlassian-agent-v1.2.2\atlassian-agent.jar" %CATALINA_OPTS% |
启动后报错:
1 |
LicenseException: Failed to verify the license. |
根据参考文档找到configure.cfg.xml,修改其中的atlassian.license.message为atlassian-agent算出的值。注意,atlassian-agent算出key是有换行的,将换行去掉。必须注意,atlassian-agent.jar算Confluence的key时,-p后面的参数是conf而非想当然的confluence,注意直接运行一下java -jar atlassian-agent.jar看一下参数!
参考文档:
1、https://confluence.atlassian.com/confkb/how-to-change-the-confluence-license-in-confluence-cfg-xml-720405151.html
2、https://confluence.atlassian.com/confkb/how-do-i-find-my-license-from-the-file-system-181534762.html
3、https://confluence.atlassian.com/confkb/how-to-set-system-properties-for-confluence-running-as-a-service-on-windows-873858384.html
转载时请保留出处,违法转载追究到底:进城务工人员小梅 » Confluence 6.7.2、7.4.6、7.19.1破解