hacking on wildfly 9

20
Hacking on WildFly 9 Darran Lofthouse, Principal Software Engineer, Red Hat [email protected] Kabir Khan, Principal Software Engineer, Red Hat [email protected]

Upload: jbug-london

Post on 13-Jan-2015

848 views

Category:

Technology


0 download

DESCRIPTION

Presentation delivered by Darran Lofthouse, Principal Software Engineer, Red Hat & Kabir Khan, Principal Software Engineer, Red Hat, during London JBoss User Group event on the 21st of May 2014.

TRANSCRIPT

Page 1: Hacking on WildFly 9

Hacking on WildFly 9

Darran Lofthouse, Principal Software Engineer, Red [email protected]

Kabir Khan, Principal Software Engineer, Red [email protected]

Page 2: Hacking on WildFly 9

Agenda

• Getting set up• Open source community• Useful Maven tricks• Fix a bug

Page 3: Hacking on WildFly 9

GitHub, Build, IDE

Getting set up

Page 4: Hacking on WildFly 9

GitHub

• Log in to www.github.com• Set up local git + SSH as described in

• https://help.github.com/articles/set-up-git• https://help.github.com/articles/generating-ssh-keys

• Wildfly @ https://github.com/wildfly/wildfly• Fork into https://github.com/londonjbug/wildfly

• Clone your fork!• $git clone [email protected]:londonjbug/wildfly.git

Page 5: Hacking on WildFly 9

Build

• Pre-requisites:• JDK 7• Maven 3.2+• export $MAVEN_OPTS=-Xmx768m

• Do the build

• Wait!

$cd checkout/folder/wildfly$mvn install

Page 6: Hacking on WildFly 9

IDE Setup

• IntelliJ - import as Maven project• Eclipse - Mmmm plugins!

• m2e - bleeding edge• http://repository.takari.io:8081/nexus/content/sites/m2e.

extras/m2e/1.5.0/N/LATEST/• m2e-apt (optional)

• Annotation processing • Logger interface implementation• http://download.jboss.org/jbosstools/builds/staging/m2e-

apt/all/repo/

Page 7: Hacking on WildFly 9

More than meets the eye!

Open source community

Page 8: Hacking on WildFly 9

What is an Open Source Community?

• 99.9%(*) of people NOT involved in open source say:• Coders!

* Totally made up statistic!

Page 9: Hacking on WildFly 9

Open Source Community

• Helping each other• Early testing of features• Bug reporting• Issue requests• Documentation• Code contributions

Page 10: Hacking on WildFly 9

Forums

• If you have a problem ask! • Include necessary information• Don’t post same question multiple times!

• People tend to be helpful• Others might have had the same problem• Very important way for us to find out about bugs

• Rapid feedback of user testing• A lot of contributors, low barrier to entry

• Normally first way people get involved

Page 11: Hacking on WildFly 9

Jira

• Our issue tracker• Forum posts with new bugs -> Jira issue• Not a replacement for forums!

• If in doubt, start in the forums• Medium volume of contributors

Page 12: Hacking on WildFly 9

Documentation/Wiki

• All our documentation is open for direct contribution• Less contributors

Page 13: Hacking on WildFly 9

Code contributions

• Find a Jira issue you would like to work on• Or create one!

• Get in touch with the team• Mailing list • IRC #wildfly-dev on freenode

• We’ll demo the process• Less contributors, “hardest”

• But often not as hard as you might think!

Page 14: Hacking on WildFly 9

jboss.org + wildfly.org

• Your entry points• jboss.org - all JBoss projects

• Account used for Jira/Forums etc.• wildfly.org - more relevant for WildFly

• Downloads• Get Help -> Forum, Wiki, IRC• Documentation - hint, hint, you can edit ;-)• Join Us

• development mailing list• http://jira.jboss.org/browse/WFLY• https://community.jboss.org/wiki/HackingOnWildFly

Page 15: Hacking on WildFly 9

Time saving

Useful Maven Tricks

Page 16: Hacking on WildFly 9

Useful maven tricks

• A full rebuild takes a long time• Want to avoid that for the code-test-code cycle

• Only build a set of modules• mvn clean install -pl controller/,build

• Only build a set of modules and their deps• mvn clean install -pl controller,build -am

• Restart the build from a location• mvn clean install -rf controller

• Can combine• mvn clean install -pl testsuite/integration/smoke -am -

rf jmx/

build assemblesserver

Page 17: Hacking on WildFly 9

• By default we run • unit test for each module• the ‘smoke’ tests

• To build without running tests do• mvn clean install -DskipTests

• We don’t just have ‘smoke’ tests!• mvn clean install -DallTests

• Most tests are in testsuite/integration/basic• Good command to run before submitting PR:

• mvn clean install -DallTests -pl testsuite/integration/basic -am

Useful testsuite tricks

Page 18: Hacking on WildFly 9

Debugging and submitting a PR

Demo

Page 19: Hacking on WildFly 9

Commands/useful stuff• build/ - assembles WF• build/target/wildfly-9.0.0.Alpha1-SNAPSHOT/ - the built WF

instance• bin/ - the startup scripts

• standalone.sh - start a standalone instance• standalone.conf - enable debug• domain.sh - start up a domain (more advanced…)

• standalone/configuration/standalone.xml - the config of a standalone instance

• domain/configuration/domain.xml and host.xml - the config of a domain and its hosts

• https://docs.jboss.org/author/display/WFLY8/Getting+Started+Guide

Page 20: Hacking on WildFly 9

Wrap-up

• Git clone• Build & import into IDE• Found bug in Jira• Fixed bug• Opened PR• Community is more than just code!