Building Java App in 2019

4ccf6c02807d06f043a71435c48ce86a?s=47 Kengo TODA
September 28, 2019

Building Java App in 2019

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

4ccf6c02807d06f043a71435c48ce86a?s=128

Kengo TODA

September 28, 2019
Tweet

Transcript

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

    1
  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
  3. Purpose Tell about ‘How we build Java app with FOSS

    culture’ 3
  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
  5. Popular Solutions Gradle, Maven, Bazel Travis CI, Circle CI, GitHub

    Actions Docker, docker-compose semantic-release, GitHub Probot 5
  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
  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
  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
  9. Check More Automatically Spotless, SonarQube (SonarCloud), revapi, LGTM, Google Errorprone,

    Dependabot (Maven only), Renovate textlint, RedPen, prh 9
  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
  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
  12. Other tools & services gitignore.io Plantuml with doclet selenium-jupiter, docker

    browsers? 12
  13. Enjoy Hacking! 13