原文: Hacking on AS7 - http://community.jboss.org/wiki/HackingonAS7
注:jbossas 7 使用 github 来管理源代码,所以要求阅读者有基本的git知识,可以阅读一下<<pro git>>书籍。
1. 创建github帐号
http://github.com
2. Fork 你的jboss-as 副本
http://github.com/jbossas/jboss-as
3. 用Git克隆你的副本到本机工作区
$ git clone git@github.com:[your user]/jboss-as.git
Initialized empty Git repository in /devel/jboss-as/.git/
remote: Counting objects: 2444, done.
remote: Compressing objects: 100% (705/705), done.
remote: Total 2444 (delta 938), reused 2444 (delta 938)
Receiving objects: 100% (2444/2444), 1.71 MiB | 205 KiB/s, done.
Resolving deltas: 100% (938/938), done.
$ cd jboss-as
4. 将git远程引用添加为upstream, 为了以后使用pull来更新
git remote add upstream git://github.com/jbossas/jboss-as.git
5. 使用maven (通过命令 build.sh) (确实你在使用 maven 3)
$ ./build.sh install
.....
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] JBoss Application Server: BOM ..................... SUCCESS [1.834s]
[INFO] JBoss Application Server: Parent Aggregator ....... SUCCESS [0.022s]
[INFO] JBoss Application Server: Domain Core ............. SUCCESS [3.051s]
[INFO] JBoss Application Server: Server Manager .......... SUCCESS [0.204s]
[INFO] JBoss Application Server: Server .................. SUCCESS [0.283s]
[INFO] JBoss Application Server: Domain Controller ....... SUCCESS [0.084s]
[INFO] JBoss Application Server: Process Manager ......... SUCCESS [0.314s]
[INFO] JBoss Application Server: Remoting ................ SUCCESS [0.390s]
[INFO] JBoss Application Server: Build ................... SUCCESS [5.696s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
6. 从 upstream 拉取(pull)更新
写道
$ git pull --rebase upstream master
From git://github.com/jbossas/jboss-as
* branch master -> FETCH_HEAD
Updating 3382570..1fa25df
Fast-forward
{parent => bom}/pom.xml | 70 ++++----------
build/pom.xml | 13 +--
domain/pom.xml | 10 ++
.../src/main/resources/examples/host-example.xml | 2 +-
.../resources/examples/jboss-domain-example.xml | 28 +++---
.../main/resources/schema/jboss-domain-common.xsd | 12 +--
.../main/resources/schema/jboss-domain-host.xsd | 2 +-
domain/src/main/resources/schema/jboss-domain.xsd | 17 ++--
pom.xml | 100 ++++++++++++++++++--
process-manager/pom.xml | 3 +-
10 files changed, 156 insertions(+), 101 deletions(-)
rename {parent => bom}/pom.xml (85%)
(如果你有本地提交,--rebase 会自动将你本地的提交移动到分支的顶端,便于生成清晰的提交记录,方便他人合并,如果没有本地提交,可以不加 --rebase)。 请注意 --rebase 非常重要如果你确实有本地提交。如果git pull不能快速移动指针,它会合并提交,如果不是用--rebase它会给予你本地的修改进行合并,而--rebase则是将你的修改与upstream进行合并。也就是说,一个合并提交会产生修改history,rebase会让历史更加的清晰和简单。而一旦你做了本地提交,今后将很难重建在此此提交之前的历史, 在12中还会讨论。
有一个办法让你不会忘记 --rebase 选项就是给"pull --rebase'创建一个别名:
$ git config --global alias.up "pull --rebase"
然后使用新的别名,而不是 pull
$ git up upstream master
另一个更加推崇的办法,是避免同时使用 pull 和 rebase,而是用 fetch+rebase,不过这已经超过了该文的内容,可以参考git的文档。
$ git config --global alias.up "pull --rebase"
7. 推送(push) 你拉取(pull)的更新到你个人的github repo
$ git push
Counting objects: 192, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (44/44), done.
Writing objects: 100% (100/100), 10.67 KiB, done.
Total 100 (delta 47), reused 100 (delta 47)
To git@github.com:[your user]/jboss-as.git
3382570..1fa25df master -> master
你可能加上 -f 参数用来强行提交你的修改。参考注释12
8. 讨论你计划的修改 (如果你想要得到反馈)
9. 为你的修改(增强/修复bug)发布一个JIRA
http://jira.jboss.org
10. 创建一个简单的主题分支(branch)来隔离这项工作 (仅作为一个推荐方法)
git checkout -b my_cool_feature
Note: See tips section for how to use a nice git prompt for tracking what branch you are in!
11. 不断的修改并且提交你的修改 (不要忘了push)
git commit -m 'JBAS-XXXX Frunubucate the Fromungulator'
git commit -m 'JBAS-YYYY Tripple Performance of Fromungulation'
git push my_cool_feature
注意 git push 默认引用你正在push的branch,默认为 master,而不是你正在工作的branch.
12. 给予master分支的最新更新重建/衍合(rebase)你的分支(将你的提交更新到master的顶端)
git fetch upstream
git rebase -i upstream/master
# if you have conflicts fix them and rerun rebase
# The -f, forces the push, alters history, see note below
git push -f origin my_cool_feature
选
项-i会启动交互式的更新,它允许你组合提交,调整commit信息等。这是一个好的方法使得commit日志非常清晰对于外部的更新。注意这会修改提交
历史,产生干净的patch,对于其他已经fork你的分支的人并不友好。所以,你需要确认要么你工作在一个没有共享的分支上,或者你共享了则需要告诉他
们你将修订分支的历史(因此一旦是推送完毕之后,他们需要给予你分支的顶部做rebase)。
13. 将你的修改merge到upstream
- 在你请求将你的更新合并到upstream之前,请重复步骤12,确认你的repo和upstream是同步的。
-
发送一个pull request email to
jbossas-pull-requests@lists.jboss.org
(要加入这个list,参考
here
),附上你的repo的链接,描述你的修改,谁检查你的改动(如果有的话)
- 在检查之后,管理员会合并你的patch,update/resolve你请求中问题,并回复什么时候完成
- 不会忘了切换会master分支,并且拉取更新
git checkout master
git pull upstream master
分享到:
相关推荐
jboss as7 文档 内容非常全。 希望对大家有所帮助。
JBoss AS 7 Development
JBoss AS 7 简介 与之前版本的差异等
[Packt Publishing] JBoss AS 7 配置部署管理教程 (英文版) [Packt Publishing] JBoss AS 7 Configuration, Deployment and Administration (E-Book) ☆ 出版信息:☆ [作者信息] Francesco Marchioni [出版机构...
我总结的JBoss AS7教程资料,几全面的,对目前公司的项目都很有帮助的,希望对j2ee的人员进行jboss升级的掌握有帮助。
JBoss AS 5 Development
[Packt Publishing] JBoss AS 7 开发教程 (英文版) [Packt Publishing] JBoss AS 7 Development (E-Book) ☆ 出版信息:☆ [作者信息] Francesco Marchioni [出版机构] Packt Publishing [出版日期] 2013年06月...
myeclipse 远程调试jboss as7或者jboss eap6,包括windows运行环境和linux运行环境分别介绍,同时jboss as7和jboss eap6的配置也有所不同。
Nginx 1.2.1 + JBOSS AS 7 负载配置及Session处理
The latest JBoss AS 5 Development Guide book, very practical to any developer who is or is going to use JBoss AS
jboss application server7 命令简介,包含部署、启动等等
windows环境下Jboss as 7配置Https,与Jboss的低版本有所不同
jboss性能好,还有启动块
eclipse 远程调试jboss as7配置过程, 图文并茂
jboss 5的详细说明。对在jboss5上进行开发来说是很好的参考资料。
JbossAS7最新版的开发指南,学习jboss应用服务器不可不读的文档。
jbossas7及seamremoting,jpa hibernate搭建的简单小例子
Jboss应用服务器7.0最新版的管理指南,学习最新版的jbossAS不可不读。
Jboss_as_7_官方_配置指南高清版