Hacking on WildFly 9
Kabir Khan, Principal Software Engineer, Red Hat
kabir.khan@jboss.com
Darran Lofthouse, Principal Software Engineer, Red Hat
darran.lofthouse@jboss.com
Agenda
• Getting set up
• Open source community
• Fix a bug
• Useful Maven tricks
GitHub, Build, IDE
Getting set up
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
• The ‘bible’ of git, ‘Pro Git’: http://git-scm.com/book/en/v2
• Wildfly
• Core https://github.com/wildfly/wildfly-core
• EE/Clustering/console etc. https://github.com/wildfly/wildfly
• Fork into your repository
• Clone your fork!
• $git clone git@github.com:londonjbug/wildfly.git
Build
• Pre-requisites:
• JDK 7
• Maven 3.2.3+
• export $MAVEN_OPTS=-Xmx768m
• Set up ~/.m2/settings.xml to include jboss-public-repository-group from
https://developer.jboss.org/wiki/MavenSettingsExample-Users
• Do the build
• Wait!
$cd checkout/folder/wildfly-core
$mvn install
IDE Setup
• IntelliJ - import as Maven project
• Eclipse - Mmmm plugins!
• m2e - bleeding edge
• m2e - http://download.eclipse.org/technology/m2e/releases
• > 1.50
• m2e-apt (optional)
• Annotation processing
• Logger interface implementation
• m2e - http://download.eclipse.org/technology/m2e/releases
More than meets the eye!
Open source community
What is an Open Source Community?
• 99.9%(*) of people NOT involved in open source say:
• Developers!
* Totally made up statistic!
Open Source Community
• Helping each other
• Early testing of features
• Bug reporting
• Feature requests
• Documentation
• Code contributions
• www.jboss.org entry point
• www.wildfly.org
Forums
• If you have a problem ask!
• Include necessary information
• Don’t post same question multiple times!
• Search first
• 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
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
• https://issues.jboss.org/browse/WFLY
• https://issues.jboss.org/browse/WFCORE
Documentation/Wiki
• All our documentation is open for direct contribution
• Less contributors
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!
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
Time saving
Useful Maven Tricks
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
assembles
server
• 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
Debugging and submitting a PR
Demo
Commands/useful stuff
• build/ - assembles WF
• build/target/wildfly-xxx-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
Wrap-up
• Git clone
• Build & import into IDE
• Found + fixed bug in Jira
• Opened PR
• Community is more than just code!

Hacking on WildFly 9

  • 1.
    Hacking on WildFly9 Kabir Khan, Principal Software Engineer, Red Hat [email protected] Darran Lofthouse, Principal Software Engineer, Red Hat [email protected]
  • 2.
    Agenda • Getting setup • Open source community • Fix a bug • Useful Maven tricks
  • 3.
  • 4.
    GitHub • Log into 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 • The ‘bible’ of git, ‘Pro Git’: http://git-scm.com/book/en/v2 • Wildfly • Core https://github.com/wildfly/wildfly-core • EE/Clustering/console etc. https://github.com/wildfly/wildfly • Fork into your repository • Clone your fork! • $git clone [email protected]:londonjbug/wildfly.git
  • 5.
    Build • Pre-requisites: • JDK7 • Maven 3.2.3+ • export $MAVEN_OPTS=-Xmx768m • Set up ~/.m2/settings.xml to include jboss-public-repository-group from https://developer.jboss.org/wiki/MavenSettingsExample-Users • Do the build • Wait! $cd checkout/folder/wildfly-core $mvn install
  • 6.
    IDE Setup • IntelliJ- import as Maven project • Eclipse - Mmmm plugins! • m2e - bleeding edge • m2e - http://download.eclipse.org/technology/m2e/releases • > 1.50 • m2e-apt (optional) • Annotation processing • Logger interface implementation • m2e - http://download.eclipse.org/technology/m2e/releases
  • 7.
    More than meetsthe eye! Open source community
  • 8.
    What is anOpen Source Community? • 99.9%(*) of people NOT involved in open source say: • Developers! * Totally made up statistic!
  • 9.
    Open Source Community •Helping each other • Early testing of features • Bug reporting • Feature requests • Documentation • Code contributions • www.jboss.org entry point • www.wildfly.org
  • 10.
    Forums • If youhave a problem ask! • Include necessary information • Don’t post same question multiple times! • Search first • 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
  • 11.
    Jira • Our issuetracker • Forum posts with new bugs -> Jira issue • Not a replacement for forums! • If in doubt, start in the forums • Medium volume of contributors • https://issues.jboss.org/browse/WFLY • https://issues.jboss.org/browse/WFCORE
  • 12.
    Documentation/Wiki • All ourdocumentation is open for direct contribution • Less contributors
  • 13.
    Code contributions • Finda 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!
  • 14.
    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
  • 15.
  • 16.
    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 assembles server
  • 17.
    • By defaultwe 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
  • 18.
  • 19.
    Commands/useful stuff • build/- assembles WF • build/target/wildfly-xxx-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
  • 20.
    Wrap-up • Git clone •Build & import into IDE • Found + fixed bug in Jira • Opened PR • Community is more than just code!