# HG changeset patch # User Omair Majid # Date 1401386321 14400 # Node ID 277471cea9afa3360830ca67706ec84d2ac79af8 # Parent 89b9cf5db67a03559dd47895114cf39ef1667800 Generate projects with packaging type `bundle` Instead of generic `jar`-type projects, create projects with the package type `bundle`. `bundle`-type projects generate jars that include OSGi metadata. Without OSGi-metadata, the jars are ignored by Thermostat. Depend on a recent version of `maven-bundle-plugin` to generate OSGi-metadata automatically. diff -r 89b9cf5db67a -r 277471cea9af com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/wizards/ProjectCreator.java --- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/wizards/ProjectCreator.java Thu May 22 11:09:30 2014 -0400 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/wizards/ProjectCreator.java Thu May 29 13:58:41 2014 -0400 @@ -47,6 +47,18 @@ private static final String POM_FOOTER = "" + "\n"; + private static final String OSGI_DEPENDENCIES_WITH_VERSION = "" + + " \n" + + " org.osgi\n" + + " org.osgi.core\n" + + " 4.3.1\n" + + " \n" + + " \n" + + " org.osgi\n" + + " org.osgi.compendium\n" + + " 4.3.1\n" + + " \n"; + private static final String OSGI_DEPENDENCIES = "" + " \n" + " org.osgi\n" @@ -57,6 +69,20 @@ + " org.osgi.compendium\n" + " \n"; + private static final String BUNDLE_PLUGIN_WITH_VERSION = "" + + " \n" + + " org.apache.felix\n" + + " maven-bundle-plugin\n" + + " 2.3.7\n" + + " \n"; + + private static final String BUNDLE_PLUGIN = "" + + " \n" + + " org.apache.felix\n" + + " maven-bundle-plugin\n" + + " true\n" + + " \n"; + private static final String BUNDLE_ACTIVATOR_NAME = "Activator"; private static final String BUNDLE_ACTIVATOR = "" + "package ${package.name};\n" // ${package.name} is replaced with actual package name @@ -135,18 +161,17 @@ + " ../" + this.artifactId + "-distribution\n" + " \n" + "\n" + + " \n" + + " \n" + + " \n" + + BUNDLE_PLUGIN_WITH_VERSION + + " \n" + + " \n" + + " \n" + + "\n" + " \n" + " \n" - + " \n" - + " org.osgi\n" - + " org.osgi.core\n" - + " 4.3.1\n" - + " \n" - + " \n" - + " org.osgi\n" - + " org.osgi.compendium\n" - + " 4.3.1\n" - + " \n" + + OSGI_DEPENDENCIES_WITH_VERSION + " \n" + " \n" + POM_FOOTER; @@ -166,7 +191,13 @@ + createParentSection(groupId, parentId, version) + "\n" + " " + artifactId + "\n" - + " jar\n" + + " bundle\n" + + "\n" + + " \n" + + " \n" + + BUNDLE_PLUGIN + + " \n" + + " \n" + "\n" + " \n" + OSGI_DEPENDENCIES @@ -188,7 +219,13 @@ + createParentSection(groupId, parentId, version) + "\n" + " " + artifactId + "\n" - + " jar\n" + + " bundle\n" + + "\n" + + " \n" + + " \n" + + BUNDLE_PLUGIN + + " \n" + + " \n" + "\n" + " \n" + " \n"