Uploading a Keyword Library to Silk Central from the Command Line

Upload an external keyword library to Silk Central from a Java-based command line to integrate Silk Central and your keyword-driven tests into your continuous integration build system, for example Jenkins.
To upload your keyword library to Silk Central from a Java-based command line:
  1. Select Help > Tools in Silk Central and download the Java Keyword Library Tool.
  2. Call the command line tool that is contained in the downloaded jar file with the following arguments:
    • java
    • -jar com.borland.silk.keyworddriven.jar
    • -upload
    • Library name of the library in Silk Central to be updated, or created if it does not yet exist.
    • Package name of the library package (zip archive) to be uploaded.
    • Hostname:port of the Silk Central front-end server.
    • Web-service token of the Silk Central user. Required for authentication. You can generate a web-service token in the User Settings page of Silk Central, which you can access by clicking on the user name in the Silk Central menu.
      Note: For security reasons, Micro Focus recommends using a web-service token for authentication instead of sending your user name and password over the network.
    • Username of the Silk Central user. Not required when using a web-service token for authentication.
    • Password of the Silk Central user. Not required when using a web-service token for authentication.
    • Update information, describing the changes that were applied to the library, in quotes.
    • [-allowUsedKeywordDeletion], an optional flag to allow the deletion of keywords that are used in a test or keyword sequence. By default, an error is raised if used keywords are attempted to be deleted.
    The following example outlines the command line to upload a library to Silk Central with Java 9 or later:
    java --add-modules=java.activation,java.xml.ws -jar com.borland.silk.keyworddriven.jar -upload 
    "My library" "./output/library.zip" silkcentral:19120 scLogin 
    scPassword "Build xy: Implemented missing keywords" 

Examples

The following example outlines the command line to upload a library to Silk Central with Java 8 or prior by using a web-service token for authentication:
java -jar com.borland.silk.keyworddriven.jar -upload 
"My library" "./output/library.zip" silkcentral:19120 scToken "Build xy: Implemented missing keywords"
To upload the same library with Java 8 or prior by using user name and password for authentication, use a command like the following:
java -jar com.borland.silk.keyworddriven.jar -upload 
"My library" "./output/library.zip" silkcentral:19120 scLogin 
scPassword "Build xy: Implemented missing keywords"
The corresponding commands with Java 9 or later are:
java --add-modules=java.activation,java.xml.ws -jar com.borland.silk.keyworddriven.jar -upload 
"My library" "./output/library.zip" silkcentral:19120 scToken "Build xy: Implemented missing keywords" 
java --add-modules=java.activation,java.xml.ws -jar com.borland.silk.keyworddriven.jar -upload 
"My library" "./output/library.zip" silkcentral:19120 scLogin 
scPassword "Build xy: Implemented missing keywords" 
Note: When uploading a keyword-driven library with Java 9 or later, ensure JAVA_HOME is defined on the execution servers and points to a JDK with the corresponding Java version.