Better, Faster, Lighter Java with Java 12 and JHipster 6
Video Title: Better, Faster, Lighter Java with Java 12 and JHipster 6
hello my name is Matt Raven today I would like to show you how to make better faster lighter Java applications with Java 12 and JE hipster 6 this screencast will be based on this tutorial I wrote back in early April showing you how to use je hipster 6 I recently updated it for the release of je hipster sixth which happened on May 3rd just last week so let’s get started the first thing that you’re going to want to do is make sure you have Java 11 or 12 installed so you can do that with SDK man SDK Man is a great software development kit manager that allows you to manage things like Java groovy Scala Kotlin Ceylon ant maven Grails Gradle all that good kind of stuff so you can see here this is what you need to actually install it you just use a curl command and it’ll install in your terminal so I already have it installed and that means I can run SDK List Java and it will show me all the different options that I can use and if I look at the current version you’ll see I’m using Java 11 let’s go ahead and upgrade to Java 12 so you can do SDK install Java 12.0.0 – open and that will install it I already have installed so it’ll give me that message but I can say SDK default Java and make that my default and now if I do Java dash version it’ll say that I’m running Java 12 so J hipster is available at J hipster Tech has all kinds of information on the site about what it is and if you look at its release notes you’ll notice at least 6 0 0 was the latest one and so there’s a lot of improvements in this the biggest one is migrating to spring boot 2.1 and that brings java 11 and 12 support and you can read all the other stuff on there I’m particularly proud of this one this spring security 5.1 oh I DC support and that’s what I’ll be highlighting today creating an app that uses OID C for login so let’s get started to install J hipster you simply need to do MPM install – G generator J – J hipster six dot 0 dot 0 okay once you have that installed you can create a new app the first thing you’ll want to do especially if you’re creating a monolith is create a directory so I’m going to just call mine hip app and CD into there and J hipster ships with a sweet feature called JD l JD l stands for J hipster domain language that’s how you know it’s hip right if it has its own domain language and this allows you to define applications so if I wanted to do VI app J H for instance I could define the whole application using a syntax like this and that would be my app dot J H and that would actually use all the defaults that are specified in J hipster so if we look at or search or jdl here takes us here and so JD LS available options shows you all the defaults so you can see application type of be monolith so to use a base name of J hipster to use a package name of calm dot my company they would basically use GWT is the default and then all these other things so if I was to create you know a app with that app dot JH this is what it would default to and I’m going to customize that just a little bit so it uses OAuth 2 and renames the app to hip-hop so in the config section we can go in here and do application or start with base name we’ll just call it hip app and then the authentication type is a lot – and so once we have that in place you can do a hipster import GDL app page so the app is been created if we were to we can open that up and IntelliJ for instance if we wanted to so before you can run this app you actually have to start key cloak so there’s a docker compose file for that the reason for that is because we use oh I DC discovery now with spring 5.1 and that requires an endpoint to be available so it can discover all the various authorization and token validation endpoints that it uses for authentication so you can do that with close up – D so it runs as a daemon this uses key cloaks 6.0.1 and then we can start our app and all the app starting I just wanted to show you a bit about the directory structure you’ll see it looks like a normal job application source main Java and then this is where all our files live from our configuration through our domain classes to some repositories for spring data and finally all of our rest endpoints and then the application the angular app lives in this directory source main web app app and it looks like a normal angular app so everything should be up and running now or it’s still compiling it uses a front-end maven plug-in to do the compilation of the angular app from typescript to JavaScript when you start it up and it’s smart enough to detect if it needs to run that or not and so when I said the well-known end point you can actually see this right here this is talking to key cloak at that well-known open ID configuration this part right here is a standard URL for open ID Connect and so even when we switch it to talk to a different identity provider it’ll still use that endpoint to get the information so if we were to go to localhost 8080 and login using admin admin or user user they could browse around and see the metrics that it offers so under administration there’s all kinds of performance metrics that it records using Springs actuator among other things as well as micrometer health of the application the configuration for all the different spring properties auditing for who logged in as well as log configuration settings so if you want to tweak spring framework for instance you could do org spring framework and change it to error you could also look at the API via swagger and get the current users information for example and so key clock works great in development but in production you might actually want to use something that’s always on like octa so if you go to developer.com it shows you how to sign up to create a free developer account I already have one mine is at dev one three three three two zero look up my password in one password it is login and you’ll need to create a new web application so we’ll call this J hipster six and then for the login redirect URI you want to use login go up to code o IDC and then you’ll also need to add a logout URI so click done to save that one and then click edit and add localhost 8080 as a logout redirect you alright the other thing you’ll likely want to do is to add groups so i’ve already configured them in here you see i have a role admin and role user that’s what je hipster expects by default and then you’ll want to go into your authorization server we created a fall one for you and specify a groups claim i already have one here but if you look at it it’s basically we put it ID token we match the value type of groups matches a regex of dot star and then it includes it in any scoop so if you were to create a new one you would name it groups but in the ID token and do it very similarly like that and if you want to look at J hipster security it has all these steps in there for you so just showing you that open ID Connect talks about key cloak and octa and so it has all these steps for actually configuring that groups claim in there and that will allow J hipster to know who you are and what groups you’re in and assign permissions accordingly so the cool thing is all you really need to change is a few environment variables because if you’re storing secrets in your source code that’s not a good idea so that’s why I recommend you do them in environment variables instead so we can stop the app we could create an octa env and paste that in there and then we’ll go back and get our values so from RJ hipster six application we’ll start with the client ID and next the client secret and then our issue or URI so the easiest place to find that is right under API authorization servers and then grabbing it right there it does tend to put a space so watch for that okay now we’ve set all that up and then you’ll need to source that file alright to set all those variables and then you can run the application and now instead of using key cloak it’ll use octa so now if we hit localhost 8080 and click Sign In since we’re already logged into octa it automatically logged us in and since my user account has administrator rights I get an administration menu so if I were to log out sign in again I could use a different account that’s just a user and now I have no admin menu so everything’s set up correctly if you do create an env file one thing to make sure of is to add it to your get ignore so up here we’ll do like star G and V and now that file actually won’t be checked into source control so it’s pretty sweet spring security actually does all the work here spring security 5.1 adds first-class OID see support and it’s the one that makes it very easy to switch between providers from Q oak doctor or you could even use Google or something like github as well and it’s pretty cool because jdl allows you to create full-on crud applications so J hipster jdl shows you all the different documentation on how you create it but it also has we have a bunch of samples out there so jdl samples will show you for instance one of my favorites a blog example so we don’t need the application configure this case but you can see you can override the defaults and maybe use you know post grass instead of my sequel and you could also grab just the entities if you want it so fun to create a new blog page put everything in there then I could do J hipster import jdl blog page and that would create entities relationships and tie everything together as you would expect on the UI I won’t run that because it’ll take a little bit but I think it’s pretty cool and also I wrote up another blog post a hipster spring security 5.1 eyes of a java hipster maybe yes upgrading spring security OAuth & jayen test through the eyes of a java hipster I found an unread at first in our blog but basically it shows you what I did to upgrade from spring security 5.0 to 5.1 and implement a number of different features including logout and a few other things so I invite you to take a look at those blog posts my name is matt rebel again you can find me on twitter at m rebel you can find my whole team at octa dev friends don’t let friends build authentication and if you like more videos like this one please hit our youtube channel and subscribe for more updates thanks for watching
-
Sale!
Wireless WIFI Repeater Extender Amplifier Booster 300Mbps
$29.99$14.99 Add to cartWireless WIFI Repeater Extender Amplifier Booster 300Mbps
Categories: Electronics, Wi-Fi Router, Wireless Wi-Fi Extender Tags: 300Mbps, 802.11N, Amplifier, Booster, Extender, mobile wi-fi booster, Remote, WIFI, Wireless, Wireless WIFI, Wireless WIFI Repeater, Wireless WIFI Repeater Extender, Wireless WIFI Repeater Extender Amplifier, Wireless WIFI Repeater Extender Amplifier Booster, Wireless WIFI Repeater Extender Amplifier Booster 300Mbps$29.99$14.99 -
Sale!
Full RGB Light Design Gaming Headset Headphones with Mic
$24.99$14.99 Add to cartFull RGB Light Design Gaming Headset Headphones with Mic
Categories: Electronics, Gaming, Gaming Headsets Tags: Design, Full, Full RGB Light Design Gaming Headset, Full RGB Light Design Gaming Headset Headphones, Full RGB Light Design Gaming Headset Headphones with Mic, Gamer, Gaming, Gaming Headset Headphones, gaming headset wireless, Headphone, Headphones, Headset, Light, Mic, Package, RGB$24.99$14.99 -
Sale!
Wireless BlueTooth Multi-Device Keyboard Mouse Combo
$39.99$19.99 Add to cartWireless BlueTooth Multi-Device Keyboard Mouse Combo
Categories: Electronics, Gaming, Gaming Keyboards, Keyboard Mouse Combos Tags: Combo, Keyboard, keyboard mouse combos, Mouse, MultiDevice, Set, WireKeyboard Mouse Combo, Wireless, Wireless BlueTooth Keyboard Mouse Combo, Wireless BlueTooth Keyboard Mouse Combos, Wireless BlueTooth Multi-Device Keyboard Mouse Combo, Wireless BlueTooth Multi-Device Keyboard Mouse Combos$39.99$19.99 -
Sale!
High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
$199.99$139.99 Add to cartHigh Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
Categories: Gaming, Gaming Chairs Tags: Adjustable, Chair, computer chairs, Desk, Executive, Gaming, Girl, Headrest, High, High Back Leather Executive Adjustable Swivel Gaming Chair, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar, High Back Leather Executive Adjustable Swivel Gaming Chairs, Leather, Lumbar, Office, Racing, Swivel$199.99$139.99 -
Sale!
Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
$29.99$19.99 Select optionsProfessional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
SKU: N/A Categories: Electronics, Gaming, Gaming Headsets Tags: Cancelling, Gaming, Gaming Headphones with Noise Cancelling Microphone, gaming headset, Headphones, Headset, LED, Light, Mic, Microphone, Noise, Professional, Professional LED Light Wired Gaming Headphones, Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone, Wired, Wired Gaming Headphones, Wired Gaming Headphones with Noise Cancelling Microphone$29.99$19.99 -
Sale!
Gaming Desk with LED Lights USB Power Outlets and Charging Ports
$349.99$249.99 Select optionsGaming Desk with LED Lights USB Power Outlets and Charging Ports
SKU: N/A Categories: Computer Desk, Gaming, Gaming Desk Tags: and Charging Ports, Charging, Desk, Desks, Gaming, gaming desk with led lights, Gaming Desks with LED Lights, Home, LED, Lights, Monitor, Office, Outlets, Port, Power, Room, Stand, USB, USB Power Outlets, White, Workstation$349.99$249.99 -
Sale!
Wired Mixed Backlit Anti-Ghosting Gaming Keyboard
$99.99$79.99 Add to cartWired Mixed Backlit Anti-Ghosting Gaming Keyboard
Categories: Electronics, Gaming, Gaming Keyboards Tags: Antighosting, Backlit, Blue, brown, Gaming, Gaming Keyboard, gaming keyboards, gaming keyboards and mouse, Keyboard, Laptop, Switch, Wired, Wired Mixed Backlit Anti-Ghosting Gaming Keyboard, Wired Mixed Backlit Anti-Ghosting Gaming Keyboards, Wired Mixed Backlit Gaming Keyboard$99.99$79.99 -
Sale!
Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
$119.99$59.99 Add to cartWireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
Categories: Electronics, Gaming, Gaming Headsets Tags: 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, ANC, Audio, Bluetooth, Cancellation, Ear, Earphone, gaming headset, Headphones, Headset, Hi-Res Over the Ear Headphones Headset, HiRes, Noise, Wireless, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Headphones, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headsets$119.99$59.99 -
Sale!
Wired Sports Gaming Headset Earbuds with Microphone
$19.99$9.99 Select optionsWired Sports Gaming Headset Earbuds with Microphone
SKU: N/A Categories: Gaming, Gaming Headsets Tags: Accessories, Earbud, Earphone, Earphones, Gaming, gaming headset with microphone, Headphones, Headset, IOS, Microphone, Sports, Wired, Wired Sports Gaming Headset Earbuds, Wired Sports Gaming Headset Earbuds with Microphone, Wired Sports Headset Earbuds$19.99$9.99 -
Sale!
150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
$49.99$29.99 Add to cart150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
Categories: Charging Stations, Electronics Tags: 150W, 150W Charging Station, 150W Universal Multi USB Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Stations, 150W Universal Multi USB MAX Charging Station, 16 Port MAX Charging Station, 3.5A, Charger, Charging, Fast, laptop charging stations, Max, Multi, Port, Stand, Station, Universal, USB$49.99$29.99
Status: Internal Server Error (Internal Server Error), I get this error when sign out and try to sign in again
So awesome to see JHipster rolling along. Homerun lunch and learn presentation deploying to Heroku and writing down the url before hand for people to hit on phone. Thanks!
This awesome 🙂 Thank you so much
Great screencast! JHipster, you have enjoyed an awesome journey since 2014! 💖👏👏👏👍