Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1006599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:29:12+00:00 2026-05-16T08:29:12+00:00

I am doing a gradle/OSGi build. I have the OSGi bundle building fine, but

  • 0

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:

  1. telnet to the OSGi container port
  2. send ss command to list the bundles
  3. parse out the bundle in question
  4. uninstall the bundle via a “uninstall [ID]” command
  5. install the bundle via an “install file:///path to bundle” url
  6. parse the results
  7. 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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T08:29:13+00:00Added an answer on May 16, 2026 at 8:29 am

    I don’t know about telnet, but I worked with Groovy and SSH using the AntBuilder and the sshexec task like this:

    class SshClient {
    
        def host
        def username
        def password
    
    
        def execute (def command) {
            def ant = new AntBuilder()
            ant.sshexec(host : host,
                        username : username,
                        password : password,
                        command : command,
                        trust : "true",
                        outputproperty : "result")
    
            return ant.project.properties."result"
        }
    }
    
    def ssh = new SshClient ( host: "myhost",
                              username : "myuser",
                              password : "secret")
    
    println ssh.execute("ls")
    

    You will need the ant-jsch.jar and jsch-0.1.33.jar or higher in your classpath.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know if I'm not doing this right or if i have to
I have some java book and i'm doing exercises. But right now i'm stuck
I don't know if I totally got the concept wrong, but I want to
Doing some jquery animation. I have certain divs set up with an attribute of
Doing a mysqli query and COUNTing the results, is there a preferred comparison operator
Doing a simple Squeryl database lookup, but trying to exclude a value. I've tried:
In gradle I have created a new sourceSet for service testing like this: sourceSets{
In my Gradle script (version 0.8), I have a local ivy repository which I
I am trying to make this ViewGroup programmatically, but I am having trouble doing
The Gradle User Guide shows a syntax for creating a task that I don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.