Use IntelliJ IDEA to create an EXECUTABLE JAR With Dependencies Using Maven
Begin Secure
View ChannelAbout
Welcome to Begin Secure My name is Brian. With 20+ years in software development, from startups to Fortune 500s, I now focus on application security in finance. My background in computer science drives the essence of this channel. Our Focus Begin Secure emphasizes security in software development. We delve into Java, Spring, Python, and DevOps, but our core is a security-first coding approach. Why Us? Security isn't an afterthought—it's vital. We bridge software development and application security, equipping developers for secure coding. For Whom? From seasoned developers to newcomers, our content is universally relevant. Join discussions in comments, our community tab, or on Discord.
Latest Posts
Video Description
In this video, we will use IntelliJ IDEA to create an executable jar file using Maven. Keep watching until the end of the video to see a second way to create an executable jar that will take up less space in your deployments, so you can optimize your images. We're using IntelliJ IDEA Community Edition, which is free. Using IntelliJ is a great way to make programming more productive and enjoyable. ▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬ 00:00 *Create the project* 02:30 *Review Maven setup* 03:10 *Add first dependency* 03:40 *Security Alert* 05:45 *Add second dependency* 07:41 *Execute the jar file* 09:19 *Modify the code to include the dependency* 11:15 *Package the dependency* 12:19 *Build the artifact* 14:02 *Add Maven plugin to project* 15:10 *Build the code with the new plugin* When IntelliJ is working, I have sped up the boring parts, so we can focus on what's interesting IntelliJ creates our project and provides us with a very basic pom.xml. We see the group and artifact id we provided earlier in our pom file, along with the default version of the 1.0 snapshot. Any recent version of java will be fine, we’ll be using version 11. In the project tool window, we’ll right click on source, main, java and select new java class We’ll supply the name of the package and the class file name at one time Let’s call it com dot beginsecure dot app and press return Intellij creates our class Lets use the live template psvm to generate our main method And we’ll use the live template sout to generate our printline statement In our message, let’s put in the string hello world because of course And let’s run that code just to show that everything is working correctly We see the code runs, prints our message and exits with a return code of 0 Great, everything is working as expected, Let’s take a moment and look at the maven tool window On top we see a list of the lifecycle phases, clean, validate, compile and so forth. A phase is a step in the build lifecycle which is an ordered sequence of steps When a phase, like package, is specified, every phase in the sequence up to and including the one specified is run Below is a list of the plugins that are available to use by default from IntelliJ IDEA When we invoke plugins, we specify a goal to perform. For example, the plugin we might invoke is compiler and the goal is compile Back in the Project tool window, we see the external libraries this project is dependent on For now, JDK 11 is the only thing necessary to build this project Let’s change that and explore how we can add a dependency to our project You can find the code here: https://github.com/BeginSecure/IntelliJExecutableJar.git
Transform Your Space Today
AI-recommended products based on this video
![Command Medium Picture Hanging Strips [Removable]: 12 Pairs (White)](https://m.media-amazon.com/images/I/61IChX1hbML._AC_UL960_FMwebp_QL65_.jpg)
Command Medium Picture Hanging Strips [Removable]: 12 Pairs (White)

Paint Sprayer Electric Spray Gun: 700W Spray Paint Gun with 1200ml Container, 4 Nozzles & 3 Patterns, Adjustable Air Flow, Easy Cleaning for House Painting, Furniture, Fence, Walls, Door (Red)

Paint Sprayer Electric Spray Gun: 700W Spray Paint Gun with 1200ml Container, 4 Nozzles & 3 Patterns, Adjustable Air Flow, Easy Cleaning for House Painting, Furniture, Fence, Walls, Door (Royal Blue)

Cordless Paint Sprayer for Dewalt 20V MAX Battery.Paint Spray Gun with Powerful Motor and 4 Copper Nozzle.650w Electric HVIP Sprayer for House Painting,Furniture, Wall, Door.(NOT Battery)

Handmade Custom Reusable Stencils, Personalized Text Stencil for Spray Painting & Sign Making, Durable Plastic, Metal & Wood Stencils, Multiple Material Options, Custom Stencil

RoboSeal Rechargeable Mason Jar Vacuum Sealer for Mason Jars Wide and Regular, One Touch Vacuum Sealer for Jars, 10 Lids Included, Digital Battery Indicator, As Seen on TV

LEGO Icons Bonsai Tree Building Set - Artificial Bonsai Tree Plants for Home Decor, Adults Ages 18+ - Faux, Fake Plants for Table, Desk, Office - Birthday Gift for Men & Women - 10281

2 Pack Outdoor Solar Firework Lights, 240 LED Solar Powered Hanging Lights Outdoor Waterproof Hanging Fairy Garden Lights Landscape Lights(Warm White)

Generic Collapsible Washing up Bowl Folding Dish Basin Bucket Portable Dish Pan Foldable Wash Basin for Camping Beach RV Backpacking, Green 38x23.5x11.5cm

FANGOR 10.1 Inch WiFi Digital Picture Frame 1280x800 HD IPS Touch Screen, Electronic Smart Photo Frame with 32GB Storage, Auto-Rotate, Instantly Share Photos/Videos via Uhale App from Anywhere

Skylight Digital Picture Frame - WiFi Enabled with Load from Phone Capability, Touch Screen Digital Photo Frame Display - Customizable Gift for Friends and Family - 10 Inch Black

Aura Carver WiFi Digital Picture Frame | The Best Digital Frame for Gifting | Send Photos from Your Phone | Quick, Easy Setup in Aura App | Free Unlimited Storage | Gravel with White Mat

Frameo 10.1 Inch WiFi Digital Picture Frame, 1280x800 HD IPS Touch Screen Photo Frame Electronic, 32GB Memory, Auto-Rotate, Wall Mountable, Share Photos/Videos Instantly via Frameo App from Anywhere Global Recycled Standard

UMI 110V to 220V Step Up Voltage Converter LX-300C Toroidal Transformer for 220V Appliances to Be Used in US, Simple White Plastic Shell, Safe and Effective

4-Ft Vertical Garden Planter for Outdoor and Indoor Plants - Elevated Planter with 4 Rectangular Plastic Planter Boxes for Patio and Balcony (1-Pack/Espresso Brown)

echo-ove 8 Oz (250ml) White Plastic Cosmetic Jars with Inner Liners and Dome Lids Refillable Make-up Cosmetic Containers Pot Case for Scrubs Oils Salves Creams Lip Balm Lotions Nail Accessories Pack of 6

TP-Link 5 Port Gigabit Ethernet Network Switch (TL-SG1005D) - Plug and Play, Desktop or Wall Mount, Plastic Case, Ethernet Splitter, Fanless, Traffic Optimization, Unmanaged (TL-SG1005D)

HONYUEYIM 2 PCS Handmade Boho Coasters,100% Cotton Woven Macrame Absorbent Coasters for Drinks,Heat Resistant Office Cotton Coasters for Coffee Table,Desk Kitchen Dining Room Kitchen,Housewarming Gift (Pink)


