I am doing a gradle/OSGi build.
I have the OSGi bundle building fine, but want to automate the bundle deployment. I don’t think there is a gradle task for this, so this becomes a groovy question. To deploy to an osgi container you do the following:
- telnet to the OSGi container port
- send ss command to list the bundles
- parse out the bundle in question
- uninstall the bundle via a “uninstall [ID]” command
- install the bundle via an “install file:///path to bundle” url
- parse the results
- exit telnet session.
Is there a way to telnet to a port using Groovy and send commands and read the output?
Thanks for any help,
phil
I don’t know about telnet, but I worked with Groovy and SSH using the AntBuilder and the sshexec task like this:
You will need the ant-jsch.jar and jsch-0.1.33.jar or higher in your classpath.