I'm starting to use the maven-011n-package-plugin, as found in the vCO Appliance's onboard Maven Repo or as obtained via the vCO Client's --> Package --> Expand to Folder functionality. First of all, this is a very useful tool, however, the docs are very minimal. And I have couple of questions
1) Is it REQUIRED that when I build a package ( from the native XML ) I digitally sign it?
2) Is there a library version of the functionality embedded in this Maven plugin? Or can I get the source? Just wondering whether I can do this without getting maven involved; we use gradle.
I think the signing is required and package build will fail if you do not provide keystore location and password.
On your second question - there is no library, but there is a command line tool which does package import/export. It can be found in the same Maven repo, under /com/vmware/o11n/tool/vco-cli-java/
Below is the list of commands it supports + some examples.
On Maven vs Gradle - currently, our tooling is focused around Maven. I'll check if we can also provide a Gradle plug-in.
-----------------------------
vCO Package import/export command line tool
Description:
Command line tool, that provides basic vCO package import and export operations. As source or target it can have either .package file, or directory.
Usage:
java <java-parameters> -jar PackageToolCli.jar <command> <command-parameters>
Commands:
These are the basic commands that tell the tool which operation to perform.
fi - file import
Imports package to vCO from .package file.
fe - file export
Exports vCO package to .package file.
di - directory import
Imports package to vCO from directory tree.
de - directory export
Exports vCO package to directory tree.
fd - file from directory
Creates .package file from directory tree.
Command Parameters:
The direct parameters that pertain to the specific command. Source or destination files or directories.
fi <filename>
<filename> - Name of the .package file to import.
fe <packagename> [<basedir>]
<packagename> - Name of the package to export.
<basedir> - Directory to which to export. If not specified, current directory is assumed.
di <basedir>
<basedir> - Directory from which to import.
de <packagename> [<basedir>]
<packagename> - Name of the package to export.
<basedir> - Directory to which to export. If not specified, current directory is assumed.
fd <basedir>
<basedir> - Directory from which to build .package file.
Java Parameters:
Additional parameters that may be needed by the system, in order to perform the specific commands.
-DserverUrl=<user:password@serverurl>
URL and login of the vCO server against which the imports or exports will be performed.
-DallowedMask=<vef>
Access attributes of the package.
v - elements can be viewed
e - elements can be edited
f - elements can be forwarded in another package
-DkeystoreFileLocation=<path-to-vmokeystore-file>
Path to the .vmokeystore file that contains the development certificate
-DkeystorePassword=<vmokeystore-password>
Password of the .vmokeystore file
-DexportVersionHistory=<true|false>
Export version history
-Dincludes=<include-pattern-list>
';'-separated list of patterns showing which elements to include.
-Dexcludes=<exclude-pattern-list>
';'-separated list of patterns showing which elements to exclude.
Examples:
Export package com.vmware.test.TestPackage as a package file in the current folder.
java -DserverUrl=username:password@myserver:8281 -jar PackageToolCli.jar fe com.vmware.test.TestPackage
Export package com.vmware.test.TestPackage as directory structure in the current folder.
java -DserverUrl=username:password@myserver:8281 -jar PackageToolCli.jar de com.vmware.test.TestPackage
Import package file com.vmware.test.TestPackage.package to vCO server.
java -DserverUrl=username:password@myserver:8281 -jar PackageToolCli.jar fi com.vmware.test.TestImpex.package
(Note: the next two commands require development certificate in order to be performed)
Build .package file from directory structure.
java -DserverUrl=username:password@myserver:8281 -DkeystoreFileLocation=/path/to/my_cerificate.vmokeystore
-DkeystorePassword=mypassword -jar PackageToolCli.jar fd com.vmware.test.TestPackage
Import package directory structure com.vmware.test.TestPackage to vCO server.
java -DserverUrl=username:password@myserver:8281 -DkeystoreFileLocation=/path/to/my_cerificate.vmokeystore
-DkeystorePassword=mypassword -jar PackageToolCli.jar di com.vmware.test.TestPackage
The last two commands also support the allowedMask, exportVersionHistory and includes/excludes java parameters, which give more control to the content and access attributes of the package.
-DallowedMask=vf
Creates package that can not be editted.
-DexportVersionHistory=true
Preserves the local version history of developed vCO objects between exports and imports.
-Dincludes="**/Test Package/**/*.element_info.xml;**/Test Samples/**/*.element_info.xml;**/testPackage/**/*.element_info.xml"
Includes only objects that have ".element_info.xml" descriptor (which is specific for packages exported as directory trees), from library folders Test Package and Test Samples (for workflows) or testPackage package (for actions).
I think the signing is required and package build will fail if you do not provide keystore location and password.
On your second question - there is no library, but there is a command line tool which does package import/export. It can be found in the same Maven repo, under /com/vmware/o11n/tool/vco-cli-java/
Below is the list of commands it supports + some examples.
On Maven vs Gradle - currently, our tooling is focused around Maven. I'll check if we can also provide a Gradle plug-in.
-----------------------------
vCO Package import/export command line tool
Description:
Command line tool, that provides basic vCO package import and export operations. As source or target it can have either .package file, or directory.
Usage:
java <java-parameters> -jar PackageToolCli.jar <command> <command-parameters>
Commands:
These are the basic commands that tell the tool which operation to perform.
fi - file import
Imports package to vCO from .package file.
fe - file export
Exports vCO package to .package file.
di - directory import
Imports package to vCO from directory tree.
de - directory export
Exports vCO package to directory tree.
fd - file from directory
Creates .package file from directory tree.
Command Parameters:
The direct parameters that pertain to the specific command. Source or destination files or directories.
fi <filename>
<filename> - Name of the .package file to import.
fe <packagename> [<basedir>]
<packagename> - Name of the package to export.
<basedir> - Directory to which to export. If not specified, current directory is assumed.
di <basedir>
<basedir> - Directory from which to import.
de <packagename> [<basedir>]
<packagename> - Name of the package to export.
<basedir> - Directory to which to export. If not specified, current directory is assumed.
fd <basedir>
<basedir> - Directory from which to build .package file.
Java Parameters:
Additional parameters that may be needed by the system, in order to perform the specific commands.
-DserverUrl=<user:password@serverurl>
URL and login of the vCO server against which the imports or exports will be performed.
-DallowedMask=<vef>
Access attributes of the package.
v - elements can be viewed
e - elements can be edited
f - elements can be forwarded in another package
-DkeystoreFileLocation=<path-to-vmokeystore-file>
Path to the .vmokeystore file that contains the development certificate
-DkeystorePassword=<vmokeystore-password>
Password of the .vmokeystore file
-DexportVersionHistory=<true|false>
Export version history
-Dincludes=<include-pattern-list>
';'-separated list of patterns showing which elements to include.
-Dexcludes=<exclude-pattern-list>
';'-separated list of patterns showing which elements to exclude.
Examples:
Export package com.vmware.test.TestPackage as a package file in the current folder.
java -DserverUrl=username:password@myserver:8281 -jar PackageToolCli.jar fe com.vmware.test.TestPackage
Export package com.vmware.test.TestPackage as directory structure in the current folder.
java -DserverUrl=username:password@myserver:8281 -jar PackageToolCli.jar de com.vmware.test.TestPackage
Import package file com.vmware.test.TestPackage.package to vCO server.
java -DserverUrl=username:password@myserver:8281 -jar PackageToolCli.jar fi com.vmware.test.TestImpex.package
(Note: the next two commands require development certificate in order to be performed)
Build .package file from directory structure.
java -DserverUrl=username:password@myserver:8281 -DkeystoreFileLocation=/path/to/my_cerificate.vmokeystore
-DkeystorePassword=mypassword -jar PackageToolCli.jar fd com.vmware.test.TestPackage
Import package directory structure com.vmware.test.TestPackage to vCO server.
java -DserverUrl=username:password@myserver:8281 -DkeystoreFileLocation=/path/to/my_cerificate.vmokeystore
-DkeystorePassword=mypassword -jar PackageToolCli.jar di com.vmware.test.TestPackage
The last two commands also support the allowedMask, exportVersionHistory and includes/excludes java parameters, which give more control to the content and access attributes of the package.
-DallowedMask=vf
Creates package that can not be editted.
-DexportVersionHistory=true
Preserves the local version history of developed vCO objects between exports and imports.
-Dincludes="**/Test Package/**/*.element_info.xml;**/Test Samples/**/*.element_info.xml;**/testPackage/**/*.element_info.xml"
Includes only objects that have ".element_info.xml" descriptor (which is specific for packages exported as directory trees), from library folders Test Package and Test Samples (for workflows) or testPackage package (for actions).
It seems that the import /export stuff in the maven-o11n-package-plugin requires two way ssl authentication. Is this true? And, if so, does the CLI skirt this requirement?
The CLI is a great tool! Thanks.