It's all about the answers!

Ask a question

Extending the RTC command line


Zoe Slattery (4011720) | asked Jan 02 '14, 1:13 p.m.
Hi, It looks as thought it should be possible to extend the SCM command line - see https://jazz.net/forum/questions/53567/extending-the-scm-command-line,  https://jazz.net/forum/questions/16622/trying-to-extend-the-rtc-scm-cli and the wiki page : https://jazz.net/wiki/bin/view/Main/SCMCommandLineDevelopment#Building.

I'm using RTC 4.3 and think I must be missing something. I made a plugin that depends on com.ibm.team.rtc.cli.infrastructure and uses the extension point com.ibm.team.rtc.cli.infrastructure.subcommand.
My plugin xml looks like this:
<extension point="com.ibm.team.rtc.cli.infrastructure.subcommand">
      <subcommand
            class="com.ibm.team.filesystem.cli.client.internal.custom.HelloWorld"
            id="com.ibm.stg.svc.hello"
            initpolicy="scratch"
            name="hello"
            scope="FrontEndClient default"
            shortHelp="%subcommand.shortHelp.0">
      </subcommand>
  </extension>

The HelloWorld class looks like this:
package com.ibm.team.filesystem.cli.client.internal.custom;

import com.ibm.team.rtc.cli.infrastructure.internal.core.AbstractSubcommand;
import com.ibm.team.rtc.cli.infrastructure.internal.core.CLIClientException;
import com.ibm.team.rtc.cli.infrastructure.internal.core.IClientConfiguration;

public class HelloWorld extends AbstractSubcommand{

    @Override
    public int run(IClientConfiguration config) throws CLIClientException {     
        System.out.println("Hello World");
        return 0;
    }
 
}

I exported it using the export wizard and it creates a valid bundle which I can load into an OSGi framework - it resolves correctly. I dropped the plugin into the scmtools/eclipse/plugins directory hoping (optimism!) that the command would be found when I ran lscm or scm. It wasn't. I've tried adding and removing activators without any effect.

What completely obvious thing am I missing? Or is this much harder that I think it should be?

One answer



permanent link
Krzysztof Kaźmierczyk (7.5k480103) | answered Jan 03 '14, 2:54 a.m.
Hi Zoe,
Copying the plugin to plugins dir is not enough. Try running
scm -clean
To cause reloading bundles. Let us know if it helps.

Comments
Zoe Slattery commented Jan 03 '14, 4:57 a.m.

Hi Krzysztof


Thanks for your reply -  I'm afraid it didn't make any difference:


Shashikant Padur commented Jan 08 '14, 5:46 a.m.
JAZZ DEVELOPER

I created a sample plugin (same as you have done) and dropped it into the scmtools/plugins folder and it worked fine. I ran scm -clean just to be sure that my plugin gets loaded.


Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.