From the course: Gradle for Java-Based Applications and Libraries
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
Packaging a JAR file
From the course: Gradle for Java-Based Applications and Libraries
Packaging a JAR file
- [Instructor] Java programs are usually not executed by pointing the Java executable to just a set of classes and resource files. It's best practice to create an archive that contains all necessary files to operate the application. The most common archive is the JAR, the Java archive file. In this video, you will learn how to create a JAR file for a Java application. The JAR task provided by the Java plugin understands how to bundle classes and resource files into the JAR file. It knows where to find the necessary files we compiled earlier and triggers compilation as a task dependency if the user didn't execute compilation yet. There's nothing special you have to configure in the build script to execute the JAR task. So let's try it out. Run the command gradlew jar and watch Gradle do its job. After the build finished, you will find the produced archive file in the directory build libs. That's one of these standard…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
(Locked)
Anatomy of a simple Java project2m 34s
-
(Locked)
Applying the Java plugin2m 37s
-
(Locked)
Compiling Java source code2m 49s
-
(Locked)
Packaging a JAR file2m 51s
-
(Locked)
Exploring the Java Application plugin3m 10s
-
(Locked)
Challenge: Generating Javadocs for a Java project1m 42s
-
(Locked)
Solution: Generating Javadocs for a Java project5m 25s
-
(Locked)
-
-
-