JBoss Community

Hacking on AS7

modified by Jason Greene in JBoss AS7 Development - View the full document

1. Create a github account

http://github.com

 

2. Fork jboss-as into your account

http://github.com/jbossas/jboss-as

 

3. Clone your newly forked copy onto your local workspace


$ 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. Add a remote ref to upstream, for pulling future updates

git remote add upstream git://github.com/jbossas/jboss-as.git 

 

5. Use maven (or build.sh) (make sure you use maven 3)

$ mvn 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. Pulling later updates from upstream

$ git pull 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%)


7. Pushing pulled updates or local commits to your private github repo (origin)

$ 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

 

8. Discuss your planned changes (if you want feedback)

9. Make sure there is a JIRA somewhere for the enhancement/fix

http://jira.jboss.org

 

10. Make the changes and commit one or more times (Don't forget to push)

git commit -m 'JBAS-XXXX Frunubucate the Fromungulator'
git commit -m 'JBAS-YYYY Tripple Performance of Fromungulation'
git push

 

11. Get your changes merged into upstream

  1. Make sure your repo is in sync with other unrelated changes in upstream before requesting your changes be merged into upstream
    1. git pull upstream master
       
  2. Email a pull request to jbossas-pull-requests@lists.jboss.org (if I haven't subscribed the list, do it here) with a link to your repo, a description of the changes, and who reviewed (if any)
  3. If you have other work going on, consider using a branch to isolate the pull changes from the other work (git branch mychange)
  4. After review a maintainer will merge your patch, and reply

 

Appendix A.  Adding a new external dependency

  1. Edit pom.xml and add a property of the form "version.groupId.artifactId" which contains the Maven version of the dependency.  Add your dependency to the <dependencyManagement> section, and use the property for the version.  If your new dependency has any transitive dependencies, be sure to <exclude> them (or if possible, update the project so that all its dependencies are of provided scope).
  2. Add your dependency to any AS modules that require it, but only with group/artifact.
  3. Edit build/pom.xml and add your dependency with only group/artifact.
  4. Create a directory in build/src/modules corresponding to the module's name (which will differ from the Maven group/artifact name; look at other modules to get a feel for the naming scheme), with a version of "main", like this: "build/src/modules/org/jboss/foo/main".
  5. Create a module.xml file inside the "main" directory.  Use a module.xml from another similar module as a template.
  6. Edit build/build.xml and add a <module-def> element.  The name listed in the <module-def> element corresponds to the module name.  The group/artifact listed in the nested maven-resource element(s) refer to the Maven group/artifact name.
  7. Important: Make sure you did not introduce any transitive dependencies by using "mvn dependency:tree".  If you did, be sure to add <exclusion>s for each of them to your dependency as described above.

 

Please be sure to preserve the alphabetical ordering of all POMs and the build.xml file.

Appendix B.  Adding a new AS submodule

  1. Create the directory corresponding to the submodule and add it to the root pom.xml file.  The convention is to leave off the "jboss-as-" portion, so "jboss-as-remoting" becomes "remoting".
  2. Create a POM for your submodule (use another submodule as a template).  Make sure all dependencies you specify do not include a version.  The group ID should be "org.jboss.as", and the artifact ID should begin with "jboss-as-" and there should be a proper <name> for the new module.
  3. Add the new submodule to the top section of the <dependencyManagement> of bom/pom.xml.  The version should be set to "${project.version}".  This section is sorted alphabetically by artifact name so please preserve that ordering.
  4. Add your submodule dependency to any AS modules that require it, but only with group/artifact.
  5. Edit build/pom.xml and add the new submodule with only group/artifact.
  6. Create a directory in build/src/modules corresponding to the submodule, with a version of "main", like this: "build/src/modules/org/jboss/as/new-subsystem/main".
  7. Create a module.xml file inside the "main" directory.  Use a module.xml from another subsystem as a template.
  8. Edit build/build.xml and add a <module-def> element for the subsystem.  Use the module name and Maven coordinates from steps 6 and 2 respectively.  Use another submodule as a template.

 

Please be sure to preserve the alphabetical ordering of all POMs and the build.xml file.

Comment by going to Community

Create a new document in JBoss AS7 Development at Community