Tooling for PropertiesLauncher in JAR archives
To use PropertiesLauncher instead of JarLauncher in an
executable JAR we have provided tooling support. In Maven
(using the starter parent to default some of the settings):
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<layout>ZIP</layout>
</configuration>
</plugin>
in Gradle:
apply plugin: "spring-boot"
springBoot {
layout = 'ZIP'
}
}
[Fixes #58837492] [bs-330] Add tooling for PropertiesLauncher
This commit is contained in:
@@ -43,6 +43,9 @@ public class Layouts {
|
||||
if (file.getName().toLowerCase().endsWith(".war")) {
|
||||
return new War();
|
||||
}
|
||||
if (file.isDirectory() || file.getName().toLowerCase().endsWith(".zip")) {
|
||||
return new Expanded();
|
||||
}
|
||||
throw new IllegalStateException("Unable to deduce layout for '" + file + "'");
|
||||
}
|
||||
|
||||
@@ -67,6 +70,18 @@ public class Layouts {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Executable expanded archive layout.
|
||||
*/
|
||||
public static class Expanded extends Jar {
|
||||
|
||||
@Override
|
||||
public String getLauncherClassName() {
|
||||
return "org.springframework.boot.loader.PropertiesLauncher";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Executable WAR layout.
|
||||
*/
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#Generated by Git-Commit-Id-Plugin
|
||||
#Tue Oct 15 11:07:33 EDT 2013
|
||||
git.commit.id.abbrev=d3fa609
|
||||
#Wed Oct 16 08:14:33 EDT 2013
|
||||
git.commit.id.abbrev=a7ba9ba
|
||||
git.commit.user.email=dsyer@gopivotal.com
|
||||
git.commit.message.full=Extend PropertiesLauncher to load nested archives\n\nPropertiesLauncher can now be used to run an executable jar, and by\ndefault it will pick up nested archives in lib/ (where the Boot\ntools puts them). User can provide loader.path (colon-separated)\nto change the nested path.\n\n[\#58837492] [bs-330] Add tooling for PropertiesLauncher\n
|
||||
git.commit.id=d3fa60955b06fe78bbf0c914928d794661aca312
|
||||
git.commit.message.short=Extend PropertiesLauncher to load nested archives
|
||||
git.commit.message.full=Tooling for PropertiesLauncher\n
|
||||
git.commit.id=a7ba9ba5cd47a924f9c7668a772957fc05ffa058
|
||||
git.commit.message.short=Tooling for PropertiesLauncher
|
||||
git.commit.user.name=Dave Syer
|
||||
git.build.user.name=Dave Syer
|
||||
git.build.user.email=dsyer@gopivotal.com
|
||||
git.branch=master
|
||||
git.commit.time=2013-10-15T10\:51\:03-0400
|
||||
git.build.time=2013-10-15T11\:07\:33-0400
|
||||
git.branch=feature/proptool
|
||||
git.commit.time=2013-10-15T16\:54\:14-0400
|
||||
git.build.time=2013-10-16T08\:14\:33-0400
|
||||
|
||||
Reference in New Issue
Block a user