Java Archive (JAR): Packaging Java Apps Using Maven
Java
| Intermediate
- 11 videos | 1h 28m 16s
- Includes Assessment
- Earns a Badge
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 courseInstall and configure maven to create java archivesCreate a maven project which can then be packaged into a jar fileCreate a custom pom.xml file and build an executable jar with mavenExecute and view the contents of a java archive built with mavenCreate and run a java archive that has external dependencies
-
Recognize how dependencies are referenced from a pom fileCreate fat or uber jars that package external dependencies in the archive using the maven assembly pluginDescribe how dependencies are stored in fat or uber jarsBuild and execute a fat or uber jar file created with the maven shade pluginSummarize the key concepts covered in this course
IN THIS COURSE
-
2m 1sIn 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 41sIn 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
-
10m 55sIn 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
-
12m 55sIn 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
-
7m 11sIn 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
-
12m 54sIn 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
-
7m 38sIn 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
-
11m 4sIn 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
-
3m 23sIn 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
-
8m 46sIn 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
-
1m 48sIn 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.