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

Micronaut - Productivité développeur

Micronaut - Productivité développeur

Cédric Champeau

May 11, 2022
Tweet

More Decks by Cédric Champeau

Other Decks in Technology

Transcript

  1. • Working at Oracle Labs on Micronaut  Main focus

    on build plugins and dev productivitity • Formerly working at Gradle Inc • Author of static compiler of Groovy • Amateur astronomer  @CedricChampeau  https://www.astrobin.com/users/melix/ About me Copyright © 2022, Oracle and/or its affiliates micronaut.io github.com/micronaut-projects/micronaut-core https://melix.github.io/blog/2022/05/astro-twitch.html
  2. • Micronaut is focused on modern architectures like Serverless and

    Microservices • Also a complete framework for any type of application • Lightweight, reactive (HTTP Client/Server based on Netty) • Annotation processor to compute framework infrastructure at compile time Micronaut Copyright © 2022, Oracle and/or its affiliates micronaut.io github.com/micronaut-projects/micronaut-core
  3. Micronaut = Build Time Framework Infrastructure Copyright © 2022, Oracle

    and/or its affiliates Micronaut computes: • All dependency & configuration injection • Annotation metadata, meta-annotations • AOP proxies • Bean introspections • And all other framework infrastructure • Reflection, runtime proxy, and dynamic classloader free
  4. Micronaut is Open Source Copyright © 2022, Oracle and/or its

    affiliates • Hosted at GitHub • Managed by the Micronaut Foundation • 92 Git repositories  ~60 modules • Each project versioned independently
  5. Micronaut releases Copyright © 2022, Oracle and/or its affiliates •

    Core version drives a “Micronaut release” • Micronaut Core BOM includes many Micronaut modules • Gradle and Maven plugin integrate with the BOM
  6. GitHub Workflows Copyright © 2022, Oracle and/or its affiliates •

    Micronaut Project Template  Used to create new modules  Defines project “template”  Defines files to be sync’ed on all projects  Shared configuration (checkstyle rules, ...)
  7. GitHub Workflows: custom GitHub Actions Copyright © 2022, Oracle and/or

    its affiliates See https://github.com/micronaut-projects/github-actions - release note generation - BOM updates - Micronaut Launch deployment helpers
  8. Micronaut Build Copyright © 2022, Oracle and/or its affiliates •

    An internal plugin suite • Models how Micronaut modules are built • Configures common behavior  Quality checks  Sonar  Publication to Maven Central  Build cache  Test selection  ...
  9. Gradle “convention plugins” Copyright © 2022, Oracle and/or its affiliates

    • For Maven users, think of “composite parent POMs” • Take care of shared configuration, aka conventions • Different plugins  From Micronaut Build Plugins (internal)  io.micronaut.build.internal.module : typical Micronaut module, with annotation processing enabled, published on Maven Central, etc.  io.micronaut.build.internal.bom: a “platform”, or BOM for Maven
  10. Gradle “convention plugins” Copyright © 2022, Oracle and/or its affiliates

    Root project: plugins { id("io.micronaut.build.internal.docs") id("io.micronaut.build.internal.quality-reporting") } Module: plugins { id("io.micronaut.build.internal.aot-project") } description = "Micronaut AOT API, for integration in build/CLI tools" dependencies { implementation(projects.aotCore) }
  11. Gradle “convention plugins” Copyright © 2022, Oracle and/or its affiliates

    “Local” convention plugin: // build-logic/src/main/groovy/io.micronaut.build.internal.aot-project.gradle plugins { id "io.micronaut.build.internal.base-module" } micronautBuild { enableProcessing = false enableBom = false }
  12. Gradle “convention plugins” Copyright © 2022, Oracle and/or its affiliates

    • For Maven users, think of “composite parent POMs” • Take care of shared configuration, aka conventions • Different plugins  From Micronaut Build Plugins (internal)  io.micronaut.build.internal.module : typical Micronaut module, with annotation processing enabled, published on Maven Central, etc.  io.micronaut.build.internal.bom: a “platform”, or BOM for Maven
  13. Gradle task wiring Copyright © 2022, Oracle and/or its affiliates

    • Forget about Maven lifecycle • In Gradle, lifecycle is dynamic A task (compileJava, test, ...) inputs outputs https://melix.github.io/blog/2021/10/gradle-quickie-dependson.html https://melix.github.io/blog/2022/01/understanding-provider-api.html
  14. Gradle Entreprise : Build Scans Copyright © 2022, Oracle and/or

    its affiliates Visit https://ge.micronaut.io
  15. Gradle Entreprise : Build Scans Copyright © 2022, Oracle and/or

    its affiliates Visit https://ge.micronaut.io
  16. Gradle Entreprise : Build Cache Copyright © 2022, Oracle and/or

    its affiliates Visit https://ge.micronaut.io
  17. Gradle Entreprise : Flaky Test Detection Copyright © 2022, Oracle

    and/or its affiliates Visit https://ge.micronaut.io
  18. What about users? Copyright © 2022, Oracle and/or its affiliates

    • Gradle plugins are designed with the same composition model in mind • io.micronaut.application = micronaut + application + docker + GraalVM • io.micronaut.library = micronaut + library + docker + GraalVM • io.micronaut.minimal.application = micronaut + application • io.micronaut.minimal.library = micronaut + library • Declarative as much as possible