@Argument(metaVar="SOURCE",required=true,usage="If this points to a local file, that file will be installed. "+
"If this is an URL, Jenkins downloads the URL and installs that as a plugin."+
"Otherwise the name is assumed to be the short name of the plugin in the existing update center (like \"findbugs\"),"+
@Argument(metaVar="SOURCE",required=true,usage="If this points to a local file (‘-remoting’ mode only), that file will be installed. "+
"If this is an URL, Jenkins downloads the URL and installs that as a plugin. "+
"If it is the string ‘=’, the file will be read from standard input of the command, and ‘-name’ must be specified. "+
"Otherwise the name is assumed to be the short name of the plugin in the existing update center (like ‘findbugs’), "+
"and the plugin will be installed from the update center.")
publicList<String>sources=newArrayList<String>();
@Option(name="-name",usage="If specified, the plugin will be installed as this short name (whereas normally the name is inferred from the source name automatically).")
publicStringname;
publicStringname;// TODO better to parse out Short-Name from the manifest and deprecate this option
@Option(name="-restart",usage="Restart Jenkins upon successful installation.")
publicbooleanrestart;
...
...
@@ -80,6 +82,19 @@ public class InstallPluginCommand extends CLICommand {
}
for(Stringsource:sources){
if(source.equals("=")){
if(name==null){
thrownewIllegalArgumentException("-name required when using -source -");