private List<String> getPackages(
     List<String> exportedPackagesList, MavenProject mavenProject, String packagetype)
     throws CoreException, JavaModelException, Exception {
   List<Plugin> plugins = mavenProject.getBuild().getPlugins();
   for (Plugin plugin : plugins) {
     if ("maven-bundle-plugin".equalsIgnoreCase(plugin.getArtifactId())) {
       Xpp3Dom configurationNode = (Xpp3Dom) plugin.getConfiguration();
       Xpp3Dom[] instructions = configurationNode.getChildren("instructions");
       if (instructions.length == 1) {
         Xpp3Dom[] exportPackage = instructions[0].getChildren(packagetype);
         if (exportPackage.length == 1) {
           exportedPackagesList.clear(); // clear default configuration (All packages by default)
           String exportpackages = exportPackage[0].getValue();
           if (exportpackages != null) {
             exportedPackagesList.addAll(Arrays.asList(exportpackages.split(",")));
           }
         } else {
           log.warn(
               "Invalid configuration for <Export-Package> entry"
                   + " using default configuration for <Export-Package>");
         }
       } else {
         log.warn(
             "Invalid instructions configuration for plugin : maven-bundle-plugin"
                 + " using default configuration for <Export-Package>");
       }
       break; // not considering multiple versions of the maven-bundle-plugin
     }
   }
   return exportedPackagesList;
 }