SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
│©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

Contenu connexe

Tendances

.NET MAUI with .NET 6 (December 2021, Preview 10)
.NET MAUI with .NET 6 (December 2021, Preview 10).NET MAUI with .NET 6 (December 2021, Preview 10)
.NET MAUI with .NET 6 (December 2021, Preview 10)Alex Pshul
 
Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1Omar Fathy
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub ActionsBo-Yi Wu
 
Jenkins tutorial for beginners
Jenkins tutorial for beginnersJenkins tutorial for beginners
Jenkins tutorial for beginnersBugRaptors
 
Angular Interview Questions-PDF.pdf
Angular Interview Questions-PDF.pdfAngular Interview Questions-PDF.pdf
Angular Interview Questions-PDF.pdfJohnLeo57
 
Gitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitGitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitMaulik Shah
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Eliran Eliassy
 
Intégration continue et déploiement continue avec Jenkins
Intégration continue et déploiement continue avec JenkinsIntégration continue et déploiement continue avec Jenkins
Intégration continue et déploiement continue avec JenkinsKokou Gaglo
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJSKnoldus Inc.
 
Asynchronous javascript
 Asynchronous javascript Asynchronous javascript
Asynchronous javascriptEman Mohamed
 
Git slides
Git slidesGit slides
Git slidesNanyak S
 
The Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.jsThe Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.jsHolly Schinsky
 

Tendances (20)

.NET MAUI with .NET 6 (December 2021, Preview 10)
.NET MAUI with .NET 6 (December 2021, Preview 10).NET MAUI with .NET 6 (December 2021, Preview 10)
.NET MAUI with .NET 6 (December 2021, Preview 10)
 
Overview of github
Overview of githubOverview of github
Overview of github
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
Jenkins tutorial for beginners
Jenkins tutorial for beginnersJenkins tutorial for beginners
Jenkins tutorial for beginners
 
Angular Interview Questions-PDF.pdf
Angular Interview Questions-PDF.pdfAngular Interview Questions-PDF.pdf
Angular Interview Questions-PDF.pdf
 
Gitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitGitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for Git
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
 
Docker Tutorial.pdf
Docker Tutorial.pdfDocker Tutorial.pdf
Docker Tutorial.pdf
 
Intégration continue et déploiement continue avec Jenkins
Intégration continue et déploiement continue avec JenkinsIntégration continue et déploiement continue avec Jenkins
Intégration continue et déploiement continue avec Jenkins
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
Asynchronous javascript
 Asynchronous javascript Asynchronous javascript
Asynchronous javascript
 
Angular.pdf
Angular.pdfAngular.pdf
Angular.pdf
 
cours-gratuit.com--id-4422.pdf
cours-gratuit.com--id-4422.pdfcours-gratuit.com--id-4422.pdf
cours-gratuit.com--id-4422.pdf
 
Git slides
Git slidesGit slides
Git slides
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
 
The Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.jsThe Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.js
 
Dockerfile
Dockerfile Dockerfile
Dockerfile
 

Similaire à A New CLI for Spring Developer Productivity

Jbake workshop (Greach 2019)
Jbake workshop (Greach 2019)Jbake workshop (Greach 2019)
Jbake workshop (Greach 2019)Mario García
 
Spring Native and Spring AOT
Spring Native and Spring AOTSpring Native and Spring AOT
Spring Native and Spring AOTVMware Tanzu
 
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular applicationSuresh Patidar
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentAbid Malik
 
Understanding Codenvy - for Containerized Developer Workspaces
Understanding Codenvy - for Containerized Developer WorkspacesUnderstanding Codenvy - for Containerized Developer Workspaces
Understanding Codenvy - for Containerized Developer WorkspacesLynn Langit
 
Introduction to package manager
Introduction to package managerIntroduction to package manager
Introduction to package manageryashobantabai
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topicKalkey
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChang 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 worldMatthias 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 DocumentationLavaCon
 
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 SourceNico 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 PrimeHamida Rebai Trabelsi
 
Iteria lowcode 2022-01-10
Iteria lowcode 2022-01-10Iteria lowcode 2022-01-10
Iteria lowcode 2022-01-10Jozef Slezak
 
Gradle build automation tool
Gradle   build automation toolGradle   build automation tool
Gradle build automation toolIoan Eugen Stan
 
Jenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with JenkinsJenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with JenkinsAll Things Open
 

Similaire à 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
 

Plus de 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 ItVMware 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 2023VMware 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 ScaleVMware Tanzu
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023VMware 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 ProductVMware Tanzu
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready AppsVMware Tanzu
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And BeyondVMware 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.pdfVMware 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 2023VMware 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 2023VMware Tanzu
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptxVMware Tanzu
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchVMware Tanzu
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishVMware Tanzu
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVMware Tanzu
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - FrenchVMware 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 2023VMware 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 BootVMware Tanzu
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerVMware 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 PracticeVMware Tanzu
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsVMware Tanzu
 

Plus de VMware Tanzu (20)

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
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
 

Dernier

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 

Dernier (20)

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

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