Anyone able to create an executable and non extractable jar using gradle with Spring boot bootJar task and with following versions:
Spring boot 2.6.7 (2.6.x), gradle 6.9.0, Spring Cloud 2021.0.0, Java version 8
Here is the reference which may help:
Spring Boot + Gradle: how to build executable jar
Other references will be helpful.
I am unable to create a non extractable and executable jar. Though Spring boot documentation says we can create non extractable jar. But it is creating an extractable jar (Executable jar).
I tried with bootJar task using launchScript, even though executable is created successfully, but the generated jar is extractable. But I am looking for non-extractable jar.
I was able to create non-extractable jar using SpringBoot version 2.5.13. But after upgrading to SpringBoot 2.6.7 (2.6.x), the generated jar file is extractable, however it is executable jar. Here I do not want the jar to be extractable like previously. Here are the options I tried.
bootJar {
launchScript()
}
or
bootJar {
archiveClassifier = 'boot'
}