Java Archive (JAR): Packaging Java Apps Using Maven

Java    |    Intermediate
  • 11 videos | 1h 28m 16s
  • Includes Assessment
  • Earns a Badge
Rating 4.4 of 36 users Rating 4.4 of 36 users (36)
Based on the concept of a project object model (POM), Apache Maven is a project management software as well as build automation and comprehension tool. Explore the flexibility offered by Maven in the creation of Java archives or JAR files using this course. Try your hand at using Apache Maven to build a Java application and package it into an executable JAR file, create a JAR file for an app with external dependencies and ways to execute it, and package your Java app along with all of its external dependencies into a single package known as a fat or uber JAR. Having finished this course, you'll have the skills and knowledge to build lean as well as uber JAR files using Apache Maven.

WHAT YOU WILL LEARN

  • Discover the key concepts covered in this course
    Install and configure maven to create java archives
    Create a maven project which can then be packaged into a jar file
    Create a custom pom.xml file and build an executable jar with maven
    Execute and view the contents of a java archive built with maven
    Create and run a java archive that has external dependencies
  • Recognize how dependencies are referenced from a pom file
    Create fat or uber jars that package external dependencies in the archive using the maven assembly plugin
    Describe how dependencies are stored in fat or uber jars
    Build and execute a fat or uber jar file created with the maven shade plugin
    Summarize the key concepts covered in this course

IN THIS COURSE

  • 2m 1s
    In this video, you’ll learn more about your instructor and this course. In this course, you’ll learn to use Apache Maven to build a Java application and package it into an executable JAR file. You’ll then build a JAR file for an app with external dependencies and see how these are executed. Finally, you’ll package your Java app, with all of its external dependencies into a single package known as a fat or Uber JAR. FREE ACCESS
  • 9m 41s
    In this video, you’ll watch a demo. You’ll install and configure Maven. You’ll go to this URL, maven.apache.org/download.cgi. Maven is a build automation tool. It’s very popular among Java developers. Any large or medium scale project is likely to have multiple dependencies, and managing them can become complicated. It’s easier to use a utility such as Maven, which can simplify many operations. FREE ACCESS
  • Locked
    3.  Creating a Maven Project
    10m 55s
    In this video, you’ll watch a demo. You’ll construct a project that can be built using Maven and then packaged into a JAR file, which can then be distributed to end users. When developing a Java application using Maven, most developers use an IDE, such as IntelliJ or Eclipse. In this demo, you’ll use IntelliJ, which you’ve used previously to build an application that was packaged into a Java archive using the JAR utility. FREE ACCESS
  • Locked
    4.  Building a JAR File with Maven
    12m 55s
    In this video, you’ll watch a demo. You’ll build a JAR file with Maven. You’ll package your application into a JAR file and then make it an executable JAR. First, you’ll specify the EntryPoint class serves as the main class or entry point into your application. You’ll need to make changes to the default pom.xml file, which was generated when you created the project. Head to pom.xml and paste in the new configuration information. FREE ACCESS
  • Locked
    5.  Running and Examining a JAR File
    7m 11s
    In this video, you’ll watch a demo. You’ll run and examine a JAR file. Onscreen, you’ll see a classes subfolder and the JAR file whose name begins with java-archives. You’ll see the three classes, Employee, EntryPoint, and Person from your project are here. You’ll determine whether the JAR file, which has been generated, is executable and produces the output you expect. FREE ACCESS
  • Locked
    6.  Building a JAR File with Dependencies
    12m 54s
    In this video, you’ll watch a demo. You’ll create a JAR file with dependencies using Maven. The dependencies you’ll are on the Log4j 2 libraries. One of the features that will allow you to quickly view the contents of the logs, is to direct the log output over to the console. You’ll place the properties file inside a folder called Resources, which is inside the projects directory in your home folder. FREE ACCESS
  • Locked
    7.  Examining the Local Maven Repository
    7m 38s
    In this video, you’ll watch a demo. You’ll examine the local Maven repository.  The dependencies you’ll search for are in the current directory, in the same directory from which you execute the JAR. To test out its effects, you’ll repackage the JAR file. First, you’ll head to the workspace directory, and then you can run mvn clean package. The JAR file has been rebuilt. FREE ACCESS
  • Locked
    8.  Building an Uber JAR Using the Maven Assembly Plugin
    11m 4s
    In this video, you’ll watch a demo. You’ll build an Uber JAR using the Maven assembly plugin. You’ll see users expect that they can simply take your JAR as is, run it, and it will work. They may not want to set up their environment and download any dependencies which are required before they execute. To enable this, you can create an Uber JAR or fat JAR. FREE ACCESS
  • Locked
    9.  Exploring JARs with Dependencies
    3m 23s
    In this video, you’ll watch a demo. You’ll explore the contents of the JAR you’ve been working with. You’ve already extracted the contents. To view the contents of the fat JAR and make sure that the dependencies are in fact packaged here, you’ll expand the Maven directory inside META-INF. Then you’ll see that in addition to your own package, which is com.loonycorn, there’s also one for org.apache.logging.log4j. FREE ACCESS
  • Locked
    10.  Building an Uber JAR Using the Maven Shade Plugin
    8m 46s
    In this video, you’ll watch a demo. You’ll once again create a JAR file, which includes all of the dependencies packaged into a single unit. This time, though, you’ll use a different Maven plugin to achieve that goal, the Maven shade plugin. For that, you’ll need to change the pom.xml. You’ll paste in the new content now. FREE ACCESS
  • Locked
    11.  Course Summary
    1m 48s
    In this video, you’ll summarize what you’ve learned in this course. You installed Apache Maven, and created a project with Maven. You explored the use of the pom.xml file in Maven projects. Then, you created and executed a Java archive using the Maven build utility. After that, you learned the use of dependencies with Java archives, which are created using Maven. You covered the use of Maven to automatically retrieve dependencies during the build phase. FREE ACCESS

EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE

Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.

Digital badges are yours to keep, forever.

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE

Rating 4.4 of 155 users Rating 4.4 of 155 users (155)
Rating 3.7 of 12 users Rating 3.7 of 12 users (12)
Rating 4.5 of 194 users Rating 4.5 of 194 users (194)