Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Java App in 2019

Kengo TODA
September 28, 2019

Building Java App in 2019

Javaアプリケーションのビルドについて様々な側面から語るLT

Kengo TODA

September 28, 2019
Tweet

More Decks by Kengo TODA

Other Decks in Programming

Transcript

  1. Building Java App in 2019
    2019-09-28 @Kengo_TODA / AliEaters٦ཕഈݚ #1
    1

    View Slide

  2. whoami
    KengoTODA @ Works Applications CHINA
    FOSS Creator (715 PRs)
    SpotBugs team core member
    Plugin: Jenkins, SonarQube, SpotBugs, Errorprone,
    Maven, Gradle, semantic-release, GitHub Actions etc.
    Launch Self-Organized Team for Problem Solving
    2

    View Slide

  3. Purpose
    Tell about ‘How we build Java app with FOSS culture’
    3

    View Slide

  4. FOSS culture?
    PR (patch) based development
    Let human focus on creative activity
    Bring code to discuss even unfinished work (WIP),
    to make topics clear (less face-to-face meeting)
    Automate continuous tasks such as code format,
    making release note, and tests before release
    4

    View Slide

  5. Popular Solutions
    Gradle, Maven, Bazel
    Travis CI, Circle CI, GitHub Actions
    Docker, docker-compose
    semantic-release, GitHub Probot
    5

    View Slide

  6. Which JDK?
    Much better situation than before!
    Java is still free, and you need to chose Oracle
    OpenJDK build or an alternative OpenJDK provider
    Consider which environment (especially cloud) you
    use to make your app running
    6

    View Slide

  7. Manage CI config by VCS
    Prefer Jenkinsfile and other YAML format configs
    than GUI config provided by CI tools
    Easy to create CI job dynamically
    Each support version (branch) needs different env
    and test
    Use Maven Wrapper or Gradle Wrapper to share the
    version of build tool
    7

    View Slide

  8. semantic-release
    Release every commits in the target branch
    No more SNAPSHOT version!
    Need to follow the Conventional Commits
    Effective even for Java tools (Maven, Gradle)
    Refer my blog post (2019-03-13) for detail
    8

    View Slide

  9. Check More Automatically
    Spotless, SonarQube (SonarCloud), revapi, LGTM,
    Google Errorprone, Dependabot (Maven only),
    Renovate
    textlint, RedPen, prh
    9

    View Slide

  10. Probot and Workflow
    Probot and GitHub Actions lets us trigger program by
    event (push, pull_request, schedule etc.)
    Example: rtd-bot (help for Read The Docs)
    Run CI tasks including test, code format checker,
    document generator, coverage checker and static
    analysis tool etc.
    10

    View Slide

  11. Container for portable env
    Run test everywhere, even browser test
    Launch your app with DB in container, then launch
    client (browser) in host machine or another container
    Contributor can run test even in local env
    Best match with build matrix
    Example: sonar-findbugs
    11

    View Slide

  12. Other tools & services
    gitignore.io
    Plantuml with doclet
    selenium-jupiter, docker browsers?
    12

    View Slide

  13. Enjoy Hacking!
    13

    View Slide