Skip to content
Permalink
Browse files

8234867: Issue warning for mutually exclusive options on jpackage com…

…mand line

Reviewed-by: prr, asemenyuk, almatvee
  • Loading branch information
Andy Herrick
Andy Herrick committed Dec 10, 2019
1 parent 28099d7 commit 2c772c78872dac48595b90902f70d753988167d0
@@ -565,11 +565,24 @@ private void validateArguments() throws PackagerException {
}
}
}
if (installerOnly && hasRuntime) {
// note --runtime-image is only for image or runtime installer.
throw new PackagerException("ERR_InvalidTypeOption",
CLIOptions.PREDEFINED_RUNTIME_IMAGE.getIdWithPrefix(),
ptype);
if (hasRuntime) {
if (hasAppImage) {
// note --runtime-image is only for image or runtime installer.
throw new PackagerException("ERR_MutuallyExclusiveOptions",
CLIOptions.PREDEFINED_RUNTIME_IMAGE.getIdWithPrefix(),
CLIOptions.PREDEFINED_APP_IMAGE.getIdWithPrefix());
}
if (allOptions.contains(CLIOptions.ADD_MODULES)) {
throw new PackagerException("ERR_MutuallyExclusiveOptions",
CLIOptions.PREDEFINED_RUNTIME_IMAGE.getIdWithPrefix(),
CLIOptions.ADD_MODULES.getIdWithPrefix());
}
if (allOptions.contains(CLIOptions.BIND_SERVICES)) {
throw new PackagerException("ERR_MutuallyExclusiveOptions",
CLIOptions.PREDEFINED_RUNTIME_IMAGE.getIdWithPrefix(),
CLIOptions.BIND_SERVICES.getIdWithPrefix());
}

}
if (hasMainJar && hasMainModule) {
throw new PackagerException("ERR_BothMainJarAndModule");
@@ -72,6 +72,7 @@ ERR_NoMainClass=Error: Main application class is missing
ERR_UnsupportedOption=Error: Option [{0}] is not valid on this platform
ERR_InvalidTypeOption=Error: Option [{0}] is not valid with type [{1}]
ERR_NoInstallerEntryPoint=Error: Option [{0}] is not valid without --module or --main-jar entry point option
ERR_MutuallyExclusiveOptions="Error: Mutually exclusive options [{0}] and [{1}]

ERR_MissingArgument=Error: Missing argument: {0}
ERR_MissingAppResources=Error: No application jars found
@@ -72,6 +72,7 @@ ERR_NoMainClass=Error: Main application class is missing
ERR_UnsupportedOption=Error: Option [{0}] is not valid on this platform
ERR_InvalidTypeOption=Error: Option [{0}] is not valid with type [{1}]
ERR_NoInstallerEntryPoint=Error: Option [{0}] is not valid without --module or --main-jar entry point option
ERR_MutuallyExclusiveOptions="Error: Mutually exclusive options [{0}] and [{1}]

ERR_MissingArgument=Error: Missing argument: {0}
ERR_MissingAppResources=Error: No application jars found
@@ -72,6 +72,7 @@ ERR_NoMainClass=Error: Main application class is missing
ERR_UnsupportedOption=Error: Option [{0}] is not valid on this platform
ERR_InvalidTypeOption=Error: Option [{0}] is not valid with type [{1}]
ERR_NoInstallerEntryPoint=Error: Option [{0}] is not valid without --module or --main-jar entry point option
ERR_MutuallyExclusiveOptions="Error: Mutually exclusive options [{0}] and [{1}]

ERR_MissingArgument=Error: Missing argument: {0}
ERR_MissingAppResources=Error: No application jars found

0 comments on commit 2c772c7

Please sign in to comment.
You can’t perform that action at this time.