8234867: Issue warning for mutually exclusive options on jpackage command line
Reviewed-by: prr, asemenyuk, almatvee
This commit is contained in:
parent
28099d76b2
commit
2c772c7887
@ -565,11 +565,24 @@ public class Arguments {
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user