in taverna-maven-plugin/src/main/java/org/apache/taverna/mavenplugin/TavernaPluginGenerateMojo.java [98:135]
private File createPluginDefinition() throws JAXBException, MojoExecutionException {
String groupId = project.getGroupId();
String artifactId = project.getArtifactId();
String version = maven2OsgiConverter.getVersion(project.getVersion());
if (version.endsWith("SNAPSHOT")) {
version = version.substring(0, version.indexOf("SNAPSHOT")) + Utils.timestamp();
}
File pluginDirectory = new File(outputDirectory, META_INF_TAVERNA);
pluginDirectory.mkdirs();
File pluginFile = new File(pluginDirectory, PLUGIN_FILE);
PluginInfo pluginInfo = new PluginInfo();
pluginInfo.setId(groupId + "." + artifactId);
pluginInfo.setName(project.getName());
pluginInfo.setVersion(version);
pluginInfo.setDescription(description);
pluginInfo.setOrganization(organization.getName());
Set<BundleArtifact> bundleDependencies = osgiUtils.getBundleDependencies(
Artifact.SCOPE_COMPILE, Artifact.SCOPE_RUNTIME);
List<BundleInfo> runtimeBundles = osgiUtils.getBundles(bundleDependencies);
if (!runtimeBundles.isEmpty()) {
List<BundleInfo> bundles = pluginInfo.getBundle();
for (BundleInfo bundle : runtimeBundles) {
bundles.add(bundle);
}
}
JAXBContext jaxbContext = JAXBContext.newInstance(PluginInfo.class);
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, SCHEMA_LOCATION);
marshaller.marshal(pluginInfo, pluginFile);
return pluginFile;
}