- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
How to CREATE an EXECUTABLE JAR With Dependencies Using Maven
In this tutorial, we'll explore the process of creating a self-running Uber JAR using the Maven Shade Plugin. We start by setting up a Maven project using the quickstart archetype, resulting in a basic project structure with a pom.xml file and a HelloWorld main class. If you need detailed explanations of the parameters, you can find a linked video for reference.
After generating the project, we open it in VS Code and make essential configurations in the pom.xml file, ensuring that the Maven compiler is set to Java 17.
Next, we dive into the main application, which initially prints a "Hello World" message. We enhance it by adding a third-party dependency for working with JSON Web Tokens (JWTs). These tokens, often called "jots," are used for secure information exchange.
We then update our code to parse command line arguments, validate them, and create a JWT with specific claims. We set an expiration time for the token and print it to the console.
Moving on, we encounter an issue where our JAR doesn't include the necessary dependency. To resolve this, we introduce the Maven Shade Plugin to our pom.xml file, configure it to create an Uber JAR, and rebuild the project.
With our larger JAR, which now includes dependencies, we test the application to ensure it functions correctly.
Lastly, we make the JAR self-running by updating the pom.xml file to specify the Main-Class attribute using the Maven Shade Plugin. This allows the JAR to execute without specifying the main class explicitly.
Project Code: https://github.com/BeginSecure/JWTCreate.git
== TimeStamps ==
00:00 Generate a Maven Project
01:39 Create a JWT in Java
05:47 Add Shade Plugin to Maven
#maven #vscode #java
Видео How to CREATE an EXECUTABLE JAR With Dependencies Using Maven канала Begin Secure
After generating the project, we open it in VS Code and make essential configurations in the pom.xml file, ensuring that the Maven compiler is set to Java 17.
Next, we dive into the main application, which initially prints a "Hello World" message. We enhance it by adding a third-party dependency for working with JSON Web Tokens (JWTs). These tokens, often called "jots," are used for secure information exchange.
We then update our code to parse command line arguments, validate them, and create a JWT with specific claims. We set an expiration time for the token and print it to the console.
Moving on, we encounter an issue where our JAR doesn't include the necessary dependency. To resolve this, we introduce the Maven Shade Plugin to our pom.xml file, configure it to create an Uber JAR, and rebuild the project.
With our larger JAR, which now includes dependencies, we test the application to ensure it functions correctly.
Lastly, we make the JAR self-running by updating the pom.xml file to specify the Main-Class attribute using the Maven Shade Plugin. This allows the JAR to execute without specifying the main class explicitly.
Project Code: https://github.com/BeginSecure/JWTCreate.git
== TimeStamps ==
00:00 Generate a Maven Project
01:39 Create a JWT in Java
05:47 Add Shade Plugin to Maven
#maven #vscode #java
Видео How to CREATE an EXECUTABLE JAR With Dependencies Using Maven канала Begin Secure
create an uber jar fat jar executable jar maven shade plugin how to create a jar file with maven how to create an executable jar with maven create jar file how to create jar file execute jar file from cmd vs code vs code fat jar file vscode uber jars how to create a runnable jar file with maven create jar file in java jar file create jar file terminal runnable jar file not working runnable jar file jar files not working
Комментарии отсутствуют
Информация о видео
30 октября 2023 г. 16:30:15
00:09:17
Другие видео канала









![How to Compile Python Apps to Windows Executables [2024]](https://i.ytimg.com/vi/1Sd6JvQLJrQ/default.jpg)











