Extending the RTC command line
![](http://jazz.net/_images/myphoto/99f5380903f9ef16c459cfe09bc838d5.jpg)
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?
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
![](http://jazz.net/_images/myphoto/99f5380903f9ef16c459cfe09bc838d5.jpg)
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.
Copying the plugin to plugins dir is not enough. Try running
scm -clean
To cause reloading bundles. Let us know if it helps.