@SuppressWarnings("restriction")
  @Override
  public ITargetDefinition createDefaultTarget() throws CoreException {

    IPath installPath = getServer().getRuntime().getLocation();

    ITargetDefinition targetDefinition = TargetPlatformService.getDefault().newTarget();
    targetDefinition.setName(getServer().getName());
    IBundleContainer[] containers = getDefaultBundleContainers(installPath);

    targetDefinition.setBundleContainers(containers);
    targetDefinition.resolve(new NullProgressMonitor());

    TargetPlatformService.getDefault().saveTargetDefinition(targetDefinition);
    return targetDefinition;
  }
 public ITargetDefinition loadMavenTargetDefinition(MavenBundleContainer mavenBundleContainer) {
   ITargetDefinition newTarget = targetPlatformService.newTarget();
   newTarget.setBundleContainers(new IBundleContainer[] {mavenBundleContainer});
   newTarget.setName(MAVEN_TARGET);
   return newTarget;
 }