maven:build-executable-jar
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
maven:build-executable-jar [2023/07/06 04:16] – removed - external edit (Unknown date) 127.0.0.1 | maven:build-executable-jar [2023/07/06 04:16] (current) – ↷ Page name changed from maven:build-executable-jar-with-all-dependencies to maven:build-executable-jar odefta | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Build a complete executable jar file containing all the other jar dependencies (as classes inside it) ====== | ||
+ | For this we can use the maven shade plugin, so we'll need to add something like this to our main pom.xml file: | ||
+ | |||
+ | <code xml> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== Create an executable jar but without any dependency ====== | ||
+ | |||
+ | For this we can use maven jar plugin - add this to main pom.xml file: | ||
+ | |||
+ | <code xml> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ |