Add layout=NONE to packaging tools
This commit is contained in:
@@ -25,6 +25,7 @@ import java.util.Map;
|
||||
* Common {@link Layout}s.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @author Dave Syer
|
||||
*/
|
||||
public class Layouts {
|
||||
|
||||
@@ -82,6 +83,17 @@ public class Layouts {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Executable expanded archive layout.
|
||||
*/
|
||||
public static class None extends Jar {
|
||||
|
||||
@Override
|
||||
public String getLauncherClassName() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Executable WAR layout.
|
||||
*/
|
||||
|
||||
@@ -172,12 +172,18 @@ public class Repackager {
|
||||
startClass = MainClassFinder.findMainClass(source,
|
||||
this.layout.getClassesLocation());
|
||||
}
|
||||
if (startClass == null) {
|
||||
throw new IllegalStateException("Unable to find main class");
|
||||
String launcherClassName = this.layout.getLauncherClassName();
|
||||
if (launcherClassName != null) {
|
||||
manifest.getMainAttributes()
|
||||
.putValue(MAIN_CLASS_ATTRIBUTE, launcherClassName);
|
||||
if (startClass == null) {
|
||||
throw new IllegalStateException("Unable to find main class");
|
||||
}
|
||||
manifest.getMainAttributes().putValue(START_CLASS_ATTRIBUTE, startClass);
|
||||
}
|
||||
else if (startClass != null) {
|
||||
manifest.getMainAttributes().putValue(MAIN_CLASS_ATTRIBUTE, startClass);
|
||||
}
|
||||
manifest.getMainAttributes().putValue(MAIN_CLASS_ATTRIBUTE,
|
||||
this.layout.getLauncherClassName());
|
||||
manifest.getMainAttributes().putValue(START_CLASS_ATTRIBUTE, startClass);
|
||||
|
||||
String bootVersion = getClass().getPackage().getImplementationVersion();
|
||||
manifest.getMainAttributes().putValue(BOOT_VERSION_ATTRIBUTE, bootVersion);
|
||||
|
||||
Reference in New Issue
Block a user