SlideShare a Scribd company logo
│©2022 VMware, Inc.
Spring CLI
A CLI focused on developer productivity
- Mark Pollack
- Janne Valkealahti
│©2022 VMware, Inc.
● A Spring developer wants to
○ Create a new web project
○ Later, add single sign on functionality to the project
● Spring OSS Survey indicates that documentation and getting started are the
most important areas to improve upon
● Conducted user interviews on ‘how to create app of type x’ using spring.io
○ Folks need some help getting started
Example Problem
│©2022 VMware, Inc.
A common solution
● Go to start.spring.io and select dependencies
● Code
○ Consult documentation, Stack Overflow, example repos, Baeldung..
○ Look for some sample code close to what you want to do
○ Spring guides are hard to navigate when you don’t want to follow all the
details
● The downsides:
○ Time consuming and error prone
○ Which in-house dependencies to add?
○ Can get stuck in a Google cut-n-paste loop
○ Hard to encapsulate company standards
● There should be a better way…
│©2022 VMware, Inc.
Spring CLI
● Takes the knowledge of a Spring expert and makes it generally available
● Not just for initial project creation, but part of your day to day workflow
● Sample workflow
○ spring boot new
○ spring boot add jpa
○ spring controller new --feature person
● Available as a native application on Windows, Mac, Linux and uber-jar
│©2022 VMware, Inc.
spring boot new
● Create a new project based off an existing working project
○ A "Plain Old Java Project"* hosted in GitHub or GitLab
● spring boot new
○ By default a simple web application
○ Can optionally specify your own project name, package name, etc.
* @SpringBootApplication at root of package hierarchy with no @Beans inside
│©2022 VMware, Inc.
spring boot new
● spring boot new jpa
○ The “jpa” is an alias for a GitHub URL
● Projects are registered with the CLI so that a simple name can refer to them
● A Project catalog is a collection of projects that share a common theme
○ Once a catalog is registered with the CLI, all the projects in the catalog
become available to use
● Note: you can also specify the URL instead of the name
│©2022 VMware, Inc.
Demo: spring boot new
│©2022 VMware, Inc.
spring boot add
● The same projects that you use to create a new project can also be added to
an existing project
● spring boot add jpa
○ Merges the Maven build file
○ Performs a package refactoring to match current project
○ Adds annotations on the Spring Boot main application class
○ Renames the README.adoc file to README-<project-name-added>.adoc
○ Merge application.yaml and application.properties files
│©2022 VMware, Inc.
Examples: spring boot add
● spring boot add scheduling
○ Add sample code with @Scheduled annotation
○ Adds test code
○ Add spring-boot starter, awaitility
○ Adds @EnableScheduling annotation to main boot class
● spring boot add feature
○ Add code for
■ Spring Data JPA, @Controller, @Service and @Repository in addition
to tests
│©2022 VMware, Inc.
Demo: spring boot add
│©2022 VMware, Inc.
User-defined commands
● Using an existing “Plain Old Java Project” is not always the best approach
● User-defined commands are defined declaratively
○ Integrated into the CLI
○ Live side by side with your code
○ Help you perform everyday tasks on your current project
○ Based off a templating engine of your choice
■ Handlebars and mustache for now
● Examples
○ Creating a new controller with tests
○ Adding test-container support based on project dependencies
■ In the spirit of “Auto-configuration”, but for code generation
○ Creating configuration files for your platform of choice, CI system, etc…
│©2022 VMware, Inc.
User-defined Commands
● Consist of
○ Command name
○ Sub-command name
○ Options file
■ What options does the command take, default values, etc.
○ Action file contains
■ What action to perform on the code base
● Generate a new file
● Inject into an existing file
○ Code, maven dependencies, …
● Execute an arbitrary program
■ Template text
■ Conditional SpEL expression determines if the action is executed
│©2022 VMware, Inc.
Creating user-defined commands
● Defined using directory structure convention
○ .spring/commands/<command>/<sub-command>
● Inside that directory
○ Optional command.yaml
○ Action file
■ No special name
■ Based on contents having a front matter section
│©2022 VMware, Inc.
.spring/commands/hello/new/command.yml
command:
description: Generate hello with greeting in a file
options:
#
- name: greeting
description: what word to use to say hello
dataType: string
defaultValue: Hello
inputType: text # TEXT
│©2022 VMware, Inc.
.spring/commands/hello/new/hello.txt
---
action:
generate: hello.txt
---
Hello {{greeting}} at {{now}} on {{os-name}}.
│©2022 VMware, Inc.
Executing a user-defined command
$ spring hello new
$ cat hello.txt
Hello World at Tue Jun 07 18:25:02 EDT 2022
│©2022 VMware, Inc.
Template Model
● The model exposed to the template engine has many useful variables
○ All command option names
○ project-root
○ project-name
○ artifact-name
○ os-name
○ maven model and easy access to the most common, eg artifactId
│©2022 VMware, Inc.
Demo: User Defined Commands
│©2022 VMware, Inc.
Action Files
---
action:
generate:
inject:
exec:
injectMavenDependency:
injectMavenPlugin:
injectProperties:
engine: mustache
conditional:
onDependency:
---
<< Template text goes here >>
│©2022 VMware, Inc.
Other features
● Spring Initializr client with Q/A
● GitHub authentication
○ Important due to rate-limiting!
● Configuration enabling setting of default values
○ Instead of “spring boot new –packageName=com.xkcd”
○ “config set boot new packageName com.xkcd”
○ “spring boot new” - now uses com.xkcd as the default package
│©2022 VMware, Inc.
Spring Shell Enhancements
● New built in interactive user question flow
○ Example: spring initializr
● Colors!
● Fluent API to define commands
● Command logic can be implemented as a Function or Consumer
● Many other improvements
● See https://spring.io/blog/2022/05/30/spring-shell-2-1-0-m4-is-now-available
│©2022 VMware, Inc.
Future areas
● Incorporate the Spring Boot migrator project into the CLI
○ spring boot upgrade
● Refinements around the user-defined commands
○ Execute open-rewrite recipes
○ SpEL conditional execution expressions
● Gradle support
● Multi-module
● Import .spring/config command
● bitbucket
│©2022 VMware, Inc.
Wrapping up
● A goal of the Spring CLI is for a collection of curated projects and
user-provided commands to emerge in a company.
● The Spring CLI project offers many examples of projects and user-provided
commands to help you get started.
● Hope to get feedback and contributions to tackle new important areas
○ spring add graphql
○ spring add native
○ spring test-containers add
○ …
● Not yet a milestone release, aiming for a few weeks
│©2022 VMware, Inc.
Where to get it
● https://github.com/spring-projects-experimental/spring-cli
● https://spring-projects-experimental.github.io/spring-cli/spring-cli/
│©2022 VMware, Inc.
Thank You!
│©2022 VMware, Inc.
Appendix Slides
│©2022 VMware, Inc.
Cities
Chicago New York Seattle Atlanta
Toronto Amsterdam
│©2022 VMware, Inc.
City Stamps
Chicago
New York Seattle Atlanta
Toronto Amsterdam
│©2022 VMware, Inc.
Logos

More Related Content

What's hot

Introduction to Github Actions
Introduction to Github ActionsIntroduction to Github Actions
Introduction to Github Actions
Knoldus Inc.
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to MavenVadym Lotar
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
Tilton2
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
Bob Killen
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVM
Romain Schlick
 
Gitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a proGitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a pro
sparkfabrik
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
Suresh Kumar
 
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
Akihiro Suda
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
DivineOmega
 
Git 입문자를 위한 가이드
Git 입문자를 위한 가이드Git 입문자를 위한 가이드
Git 입문자를 위한 가이드
chandler0201
 
왕초보를 위한 도커 사용법
왕초보를 위한 도커 사용법왕초보를 위한 도커 사용법
왕초보를 위한 도커 사용법
GeunCheolYeom
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerization
Balint Pato
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
Valentin Buryakov
 
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Simplilearn
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
Knoldus Inc.
 
Git and github
Git and githubGit and github
Git and github
Sayantika Banik
 
DevOps Meetup ansible
DevOps Meetup   ansibleDevOps Meetup   ansible
DevOps Meetup ansible
sriram_rajan
 
GitHub Actions with Node.js
GitHub Actions with Node.jsGitHub Actions with Node.js
GitHub Actions with Node.js
Stefan Stölzle
 
Modern Java web applications with Spring Boot and Thymeleaf
Modern Java web applications with Spring Boot and ThymeleafModern Java web applications with Spring Boot and Thymeleaf
Modern Java web applications with Spring Boot and Thymeleaf
LAY Leangsros
 
Quarkus k8s
Quarkus   k8sQuarkus   k8s

What's hot (20)

Introduction to Github Actions
Introduction to Github ActionsIntroduction to Github Actions
Introduction to Github Actions
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to Maven
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVM
 
Gitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a proGitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a pro
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
 
Git 입문자를 위한 가이드
Git 입문자를 위한 가이드Git 입문자를 위한 가이드
Git 입문자를 위한 가이드
 
왕초보를 위한 도커 사용법
왕초보를 위한 도커 사용법왕초보를 위한 도커 사용법
왕초보를 위한 도커 사용법
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerization
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
 
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
Git and github
Git and githubGit and github
Git and github
 
DevOps Meetup ansible
DevOps Meetup   ansibleDevOps Meetup   ansible
DevOps Meetup ansible
 
GitHub Actions with Node.js
GitHub Actions with Node.jsGitHub Actions with Node.js
GitHub Actions with Node.js
 
Modern Java web applications with Spring Boot and Thymeleaf
Modern Java web applications with Spring Boot and ThymeleafModern Java web applications with Spring Boot and Thymeleaf
Modern Java web applications with Spring Boot and Thymeleaf
 
Quarkus k8s
Quarkus   k8sQuarkus   k8s
Quarkus k8s
 

Similar to A New CLI for Spring Developer Productivity

Gradle
GradleGradle
Gradle
Han Yin
 
Jbake workshop (Greach 2019)
Jbake workshop (Greach 2019)Jbake workshop (Greach 2019)
Jbake workshop (Greach 2019)
Mario García
 
Code-Hub
Code-HubCode-Hub
Code-Hub
Curran Kelleher
 
ICONUK 2015 - Gradle Up!
ICONUK 2015 - Gradle Up!ICONUK 2015 - Gradle Up!
ICONUK 2015 - Gradle Up!
René Winkelmeyer
 
Introduction to gradle
Introduction to gradleIntroduction to gradle
Introduction to gradle
NexThoughts Technologies
 
Spring Native and Spring AOT
Spring Native and Spring AOTSpring Native and Spring AOT
Spring Native and Spring AOT
VMware Tanzu
 
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular application
Suresh Patidar
 
Drools & jBPM Workshop London 2013
Drools & jBPM Workshop London 2013Drools & jBPM Workshop London 2013
Drools & jBPM Workshop London 2013
Mauricio (Salaboy) Salatino
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento Development
Abid Malik
 
Understanding Codenvy - for Containerized Developer Workspaces
Understanding Codenvy - for Containerized Developer WorkspacesUnderstanding Codenvy - for Containerized Developer Workspaces
Understanding Codenvy - for Containerized Developer Workspaces
Lynn Langit
 
Introduction to package manager
Introduction to package managerIntroduction to package manager
Introduction to package manager
yashobantabai
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
Kalkey
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper API
Chang W. Doh
 
Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless world
Matthias Luebken
 
O'Leary - Using GitHub for Enterprise and Open Source Documentation
O'Leary - Using GitHub for Enterprise and Open Source DocumentationO'Leary - Using GitHub for Enterprise and Open Source Documentation
O'Leary - Using GitHub for Enterprise and Open Source Documentation
LavaCon
 
Enhance Your Kubernetes CI/CD Pipelines With GitLab & Open Source
Enhance Your Kubernetes CI/CD Pipelines With GitLab & Open SourceEnhance Your Kubernetes CI/CD Pipelines With GitLab & Open Source
Enhance Your Kubernetes CI/CD Pipelines With GitLab & Open Source
Nico Meisenzahl
 
White Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and PrimeWhite Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and Prime
Hamida Rebai Trabelsi
 
Iteria lowcode 2022-01-10
Iteria lowcode 2022-01-10Iteria lowcode 2022-01-10
Iteria lowcode 2022-01-10
Jozef Slezak
 
Gradle build automation tool
Gradle   build automation toolGradle   build automation tool
Gradle build automation tool
Ioan Eugen Stan
 
Jenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with JenkinsJenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with Jenkins
All Things Open
 

Similar to A New CLI for Spring Developer Productivity (20)

Gradle
GradleGradle
Gradle
 
Jbake workshop (Greach 2019)
Jbake workshop (Greach 2019)Jbake workshop (Greach 2019)
Jbake workshop (Greach 2019)
 
Code-Hub
Code-HubCode-Hub
Code-Hub
 
ICONUK 2015 - Gradle Up!
ICONUK 2015 - Gradle Up!ICONUK 2015 - Gradle Up!
ICONUK 2015 - Gradle Up!
 
Introduction to gradle
Introduction to gradleIntroduction to gradle
Introduction to gradle
 
Spring Native and Spring AOT
Spring Native and Spring AOTSpring Native and Spring AOT
Spring Native and Spring AOT
 
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular application
 
Drools & jBPM Workshop London 2013
Drools & jBPM Workshop London 2013Drools & jBPM Workshop London 2013
Drools & jBPM Workshop London 2013
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento Development
 
Understanding Codenvy - for Containerized Developer Workspaces
Understanding Codenvy - for Containerized Developer WorkspacesUnderstanding Codenvy - for Containerized Developer Workspaces
Understanding Codenvy - for Containerized Developer Workspaces
 
Introduction to package manager
Introduction to package managerIntroduction to package manager
Introduction to package manager
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper API
 
Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless world
 
O'Leary - Using GitHub for Enterprise and Open Source Documentation
O'Leary - Using GitHub for Enterprise and Open Source DocumentationO'Leary - Using GitHub for Enterprise and Open Source Documentation
O'Leary - Using GitHub for Enterprise and Open Source Documentation
 
Enhance Your Kubernetes CI/CD Pipelines With GitLab & Open Source
Enhance Your Kubernetes CI/CD Pipelines With GitLab & Open SourceEnhance Your Kubernetes CI/CD Pipelines With GitLab & Open Source
Enhance Your Kubernetes CI/CD Pipelines With GitLab & Open Source
 
White Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and PrimeWhite Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and Prime
 
Iteria lowcode 2022-01-10
Iteria lowcode 2022-01-10Iteria lowcode 2022-01-10
Iteria lowcode 2022-01-10
 
Gradle build automation tool
Gradle   build automation toolGradle   build automation tool
Gradle build automation tool
 
Jenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with JenkinsJenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with Jenkins
 

More from VMware Tanzu

Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14
VMware Tanzu
 
What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About It
VMware Tanzu
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023
VMware Tanzu
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at Scale
VMware Tanzu
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023
VMware Tanzu
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a Product
VMware Tanzu
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready Apps
VMware Tanzu
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
VMware Tanzu
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
VMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
VMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
VMware Tanzu
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptx
VMware Tanzu
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - French
VMware Tanzu
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - English
VMware Tanzu
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
VMware Tanzu
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - French
VMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
VMware Tanzu
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
VMware Tanzu
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software Engineer
VMware Tanzu
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs Practice
VMware Tanzu
 

More from VMware Tanzu (20)

Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14
 
What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About It
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at Scale
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a Product
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready Apps
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptx
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - French
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - English
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - French
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software Engineer
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs Practice
 

Recently uploaded

Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 

Recently uploaded (20)

Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 

A New CLI for Spring Developer Productivity

  • 1. │©2022 VMware, Inc. Spring CLI A CLI focused on developer productivity - Mark Pollack - Janne Valkealahti
  • 2. │©2022 VMware, Inc. ● A Spring developer wants to ○ Create a new web project ○ Later, add single sign on functionality to the project ● Spring OSS Survey indicates that documentation and getting started are the most important areas to improve upon ● Conducted user interviews on ‘how to create app of type x’ using spring.io ○ Folks need some help getting started Example Problem
  • 3. │©2022 VMware, Inc. A common solution ● Go to start.spring.io and select dependencies ● Code ○ Consult documentation, Stack Overflow, example repos, Baeldung.. ○ Look for some sample code close to what you want to do ○ Spring guides are hard to navigate when you don’t want to follow all the details ● The downsides: ○ Time consuming and error prone ○ Which in-house dependencies to add? ○ Can get stuck in a Google cut-n-paste loop ○ Hard to encapsulate company standards ● There should be a better way…
  • 4. │©2022 VMware, Inc. Spring CLI ● Takes the knowledge of a Spring expert and makes it generally available ● Not just for initial project creation, but part of your day to day workflow ● Sample workflow ○ spring boot new ○ spring boot add jpa ○ spring controller new --feature person ● Available as a native application on Windows, Mac, Linux and uber-jar
  • 5. │©2022 VMware, Inc. spring boot new ● Create a new project based off an existing working project ○ A "Plain Old Java Project"* hosted in GitHub or GitLab ● spring boot new ○ By default a simple web application ○ Can optionally specify your own project name, package name, etc. * @SpringBootApplication at root of package hierarchy with no @Beans inside
  • 6. │©2022 VMware, Inc. spring boot new ● spring boot new jpa ○ The “jpa” is an alias for a GitHub URL ● Projects are registered with the CLI so that a simple name can refer to them ● A Project catalog is a collection of projects that share a common theme ○ Once a catalog is registered with the CLI, all the projects in the catalog become available to use ● Note: you can also specify the URL instead of the name
  • 8. │©2022 VMware, Inc. spring boot add ● The same projects that you use to create a new project can also be added to an existing project ● spring boot add jpa ○ Merges the Maven build file ○ Performs a package refactoring to match current project ○ Adds annotations on the Spring Boot main application class ○ Renames the README.adoc file to README-<project-name-added>.adoc ○ Merge application.yaml and application.properties files
  • 9. │©2022 VMware, Inc. Examples: spring boot add ● spring boot add scheduling ○ Add sample code with @Scheduled annotation ○ Adds test code ○ Add spring-boot starter, awaitility ○ Adds @EnableScheduling annotation to main boot class ● spring boot add feature ○ Add code for ■ Spring Data JPA, @Controller, @Service and @Repository in addition to tests
  • 10. │©2022 VMware, Inc. Demo: spring boot add
  • 11. │©2022 VMware, Inc. User-defined commands ● Using an existing “Plain Old Java Project” is not always the best approach ● User-defined commands are defined declaratively ○ Integrated into the CLI ○ Live side by side with your code ○ Help you perform everyday tasks on your current project ○ Based off a templating engine of your choice ■ Handlebars and mustache for now ● Examples ○ Creating a new controller with tests ○ Adding test-container support based on project dependencies ■ In the spirit of “Auto-configuration”, but for code generation ○ Creating configuration files for your platform of choice, CI system, etc…
  • 12. │©2022 VMware, Inc. User-defined Commands ● Consist of ○ Command name ○ Sub-command name ○ Options file ■ What options does the command take, default values, etc. ○ Action file contains ■ What action to perform on the code base ● Generate a new file ● Inject into an existing file ○ Code, maven dependencies, … ● Execute an arbitrary program ■ Template text ■ Conditional SpEL expression determines if the action is executed
  • 13. │©2022 VMware, Inc. Creating user-defined commands ● Defined using directory structure convention ○ .spring/commands/<command>/<sub-command> ● Inside that directory ○ Optional command.yaml ○ Action file ■ No special name ■ Based on contents having a front matter section
  • 14. │©2022 VMware, Inc. .spring/commands/hello/new/command.yml command: description: Generate hello with greeting in a file options: # - name: greeting description: what word to use to say hello dataType: string defaultValue: Hello inputType: text # TEXT
  • 15. │©2022 VMware, Inc. .spring/commands/hello/new/hello.txt --- action: generate: hello.txt --- Hello {{greeting}} at {{now}} on {{os-name}}.
  • 16. │©2022 VMware, Inc. Executing a user-defined command $ spring hello new $ cat hello.txt Hello World at Tue Jun 07 18:25:02 EDT 2022
  • 17. │©2022 VMware, Inc. Template Model ● The model exposed to the template engine has many useful variables ○ All command option names ○ project-root ○ project-name ○ artifact-name ○ os-name ○ maven model and easy access to the most common, eg artifactId
  • 18. │©2022 VMware, Inc. Demo: User Defined Commands
  • 19. │©2022 VMware, Inc. Action Files --- action: generate: inject: exec: injectMavenDependency: injectMavenPlugin: injectProperties: engine: mustache conditional: onDependency: --- << Template text goes here >>
  • 20. │©2022 VMware, Inc. Other features ● Spring Initializr client with Q/A ● GitHub authentication ○ Important due to rate-limiting! ● Configuration enabling setting of default values ○ Instead of “spring boot new –packageName=com.xkcd” ○ “config set boot new packageName com.xkcd” ○ “spring boot new” - now uses com.xkcd as the default package
  • 21. │©2022 VMware, Inc. Spring Shell Enhancements ● New built in interactive user question flow ○ Example: spring initializr ● Colors! ● Fluent API to define commands ● Command logic can be implemented as a Function or Consumer ● Many other improvements ● See https://spring.io/blog/2022/05/30/spring-shell-2-1-0-m4-is-now-available
  • 22. │©2022 VMware, Inc. Future areas ● Incorporate the Spring Boot migrator project into the CLI ○ spring boot upgrade ● Refinements around the user-defined commands ○ Execute open-rewrite recipes ○ SpEL conditional execution expressions ● Gradle support ● Multi-module ● Import .spring/config command ● bitbucket
  • 23. │©2022 VMware, Inc. Wrapping up ● A goal of the Spring CLI is for a collection of curated projects and user-provided commands to emerge in a company. ● The Spring CLI project offers many examples of projects and user-provided commands to help you get started. ● Hope to get feedback and contributions to tackle new important areas ○ spring add graphql ○ spring add native ○ spring test-containers add ○ … ● Not yet a milestone release, aiming for a few weeks
  • 24. │©2022 VMware, Inc. Where to get it ● https://github.com/spring-projects-experimental/spring-cli ● https://spring-projects-experimental.github.io/spring-cli/spring-cli/
  • 27. │©2022 VMware, Inc. Cities Chicago New York Seattle Atlanta Toronto Amsterdam
  • 28. │©2022 VMware, Inc. City Stamps Chicago New York Seattle Atlanta Toronto Amsterdam