I upgraded my spring boot app to 2.5.0, then is app.jar and app-plain.jar is created by gradle.
I would like to the difference between these jars.
thanks
app-plain. jar is the archive produced by the jar task. This is a plain or standard jar file that contains only the module's classes and resources. You can learn a bit more about this in the documentation for Spring Boot's Gradle plugin. Follow this answer to receive notifications.
as per the link, "simple" JAR is one that ain't any of: standalone EJB module, standalone Web application module, multiple EJB modules packaged in an Enterprise Application, multiple Web application modules package in an Enterprise Application; if the app is not packaged as any of those, then the JAR is "plain".
JAR files allow us to package multiple files in order to use it as a library, plugin, or any kind of application. On the other hand, WAR files are used only for web applications.
A package is a mechanism in Java for organizing classes into namespaces. A jar is a Java ARchive, a file that aggregates multiple Java classes into one.
It can be run using java -jar. app-plain.jar is the archive produced by the jar task. This is a plain or standard jar file that contains only the module's classes and resources. You can learn a bit more about this in the documentation for Spring Boot's Gradle plugin.
demo-0.0.1-SNAPSHOT-plain.jar Spring Boot fat jarで、全てのモジュールのdependenciesを含んでいるため、 java -jar demo-0.0.1-SNAPSHOT.jar で実行できる。 plain jarファイルで、このモジュールのclassとresourceのみを含んでいる。
This is a Spring Boot fat jar that contains all of the module's dependencies as well as its classes and resources. It can be run using java -jar. app-plain.jar is the archive produced by the jar task. This is a plain or standard jar file that contains only the module's classes and resources.
Inside the War Manifest As mentioned before, the Maven Spring Boot plugin finds the main class and generates the configuration needed for running the java command. The resulting MANIFEST.MF has some additional lines: In particular, we can observe that the last one specifies the Spring Boot class loader launcher to use. 4.5. Inside a Jar File
app.jar
is the archive produced by the bootJar
task. This is a Spring Boot fat jar that contains all of the module's dependencies as well as its classes and resources. It can be run using java -jar
.
app-plain.jar
is the archive produced by the jar
task. This is a plain or standard jar file that contains only the module's classes and resources.
You can learn a bit more about this in the documentation for Spring Boot's Gradle plugin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With