You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2015/02/17 12:50:19 UTC
[01/50] [abbrv] incubator-taverna-osgi git commit: Added documentation
Repository: incubator-taverna-osgi
Updated Branches:
refs/heads/master [created] e9d4f177f
Added documentation
git-svn-id: https://taverna.googlecode.com/svn/unsorted/taverna-commons/trunk@16458 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/2646c668
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/2646c668
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/2646c668
Branch: refs/heads/master
Commit: 2646c6680a4c744ed4a1d9f4dd2b5b34d6ca4a24
Parents: d17e3d8
Author: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Wed Dec 11 18:09:13 2013 +0000
Committer: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Wed Dec 11 18:09:13 2013 +0000
----------------------------------------------------------------------
.../uk/org/taverna/commons/plugin/Plugin.java | 23 +++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/2646c668/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/Plugin.java
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/Plugin.java b/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/Plugin.java
index 5197b6e..e9ea0a4 100644
--- a/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/Plugin.java
+++ b/taverna-plugin-api/src/main/java/uk/org/taverna/commons/plugin/Plugin.java
@@ -48,14 +48,35 @@ public interface Plugin {
public Version getVersion();
+ /**
+ * Returns the state of the plugin.
+ *
+ * @return the state of the plugin
+ */
public State getState();
/**
- * Starts the plugin.
+ * Starts the plugin and sets the state to STARTED.
+ * <p>
+ * If the plugin state is STARTED this method will have no effect.
+ * <p>
+ * All plugin bundles are not currently started will be started.
+ *
* @throws PluginException
+ * if the plugin state is UNINSTALLED or any of the plugin bundles cannot be started
*/
public void start() throws PluginException;
+ /**
+ * Stops the plugin and sets the state to STOPPED.
+ * <p>
+ * If the plugin state is not STARTED this method will have no effect.
+ * <p>
+ * All plugin bundles not used elsewhere will be stopped.
+ *
+ * @throws PluginException
+ * if any of the plugin bundles cannot be stopped
+ */
public void stop() throws PluginException;
public void uninstall() throws PluginException;
[39/50] [abbrv] incubator-taverna-osgi git commit:
taverna-maven-plugin/
Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java
new file mode 100644
index 0000000..fce4ded
--- /dev/null
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java
@@ -0,0 +1,275 @@
+/*******************************************************************************
+ * Copyright (C) 2009 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.maven.plugins;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.wagon.ConnectionException;
+import org.apache.maven.wagon.ResourceDoesNotExistException;
+import org.apache.maven.wagon.UnsupportedProtocolException;
+import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.authentication.AuthenticationException;
+import org.apache.maven.wagon.observers.Debug;
+import org.apache.maven.wagon.repository.Repository;
+
+import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
+import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
+import uk.org.taverna.commons.profile.xml.jaxb.UpdateSite;
+import uk.org.taverna.commons.versions.xml.jaxb.Version;
+import uk.org.taverna.commons.versions.xml.jaxb.Versions;
+
+/**
+ * Deploys the application profile using <code>scp</code> or <code>file</code> protocol to the site
+ * URL specified in the <code><distributionManagement></code> section of the POM.
+ *
+ * @author David Withers
+ */
+@Mojo(name = "profile-deploy", defaultPhase = LifecyclePhase.DEPLOY)
+public class TavernaProfileDeployMojo extends AbstractDeployMojo {
+
+ private static final String UPDATES_FILE = "updates.xml";
+
+ private File tempDirectory;
+
+ public void execute() throws MojoExecutionException {
+ tempDirectory = new File(buildDirectory, TavernaProfileGenerateMojo.TAVERNA_TMP);
+ tempDirectory.mkdirs();
+ if (artifact == null) {
+ throw new MojoExecutionException(
+ "The application profile does not exist, please run taverna:profile-generate first");
+ }
+
+ File artifactFile = artifact.getFile();
+ if (artifactFile == null) {
+ throw new MojoExecutionException(
+ "The application profile does not exist, please run taverna:profile-generate first");
+ }
+
+ JAXBContext jaxbContext;
+ try {
+ jaxbContext = JAXBContext.newInstance(ApplicationProfile.class, UpdateSite.class);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error setting up JAXB context ", e);
+ }
+
+ ApplicationProfile applicationProfile;
+ try {
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ applicationProfile = (ApplicationProfile) unmarshaller.unmarshal(artifactFile);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error reading " + artifactFile, e);
+ }
+
+ if (deploymentRepository == null) {
+ throw new MojoExecutionException(
+ "Missing repository information in the distribution management element in the project.");
+ }
+
+ String url = deploymentRepository.getUrl();
+ String id = deploymentRepository.getId();
+
+ if (url == null) {
+ throw new MojoExecutionException(
+ "The URL to the update site is missing in the project descriptor.");
+ }
+ getLog().debug("The Taverna application will be deployed to '" + url + "'");
+
+ Repository repository = new Repository(id, url);
+
+ // create the wagon
+ Wagon wagon;
+ try {
+ wagon = wagonManager.getWagon(repository.getProtocol());
+ } catch (UnsupportedProtocolException e) {
+ throw new MojoExecutionException("Unsupported protocol: '" + repository.getProtocol()
+ + "'", e);
+ }
+
+ Debug debug = new Debug();
+ if (getLog().isDebugEnabled()) {
+ wagon.addSessionListener(debug);
+ wagon.addTransferListener(debug);
+ }
+
+ // connect to the update site
+ try {
+ wagon.connect(repository, wagonManager.getAuthenticationInfo(id),
+ wagonManager.getProxy(repository.getProtocol()));
+ } catch (ConnectionException e) {
+ throw new MojoExecutionException("Error connecting to " + url, e);
+ } catch (AuthenticationException e) {
+ throw new MojoExecutionException("Authentication error connecting to " + url, e);
+ }
+
+ try {
+ // upload the application profile to the update site
+ String deployedProfileFile = "ApplicationProfile" + "-" + applicationProfile.getVersion()
+ + ".xml";
+ Utils.uploadFile(artifactFile, deployedProfileFile, wagon, getLog());
+
+ // fetch the applications file
+ UpdateSite updateSite;
+ File updatesFile = new File(tempDirectory, UPDATES_FILE);
+ try {
+ Utils.downloadFile(UPDATES_FILE, updatesFile, wagon, getLog());
+ try {
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ updateSite = (UpdateSite) unmarshaller
+ .unmarshal(updatesFile);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error reading " + updatesFile, e);
+ }
+ } catch(ResourceDoesNotExistException e) {
+ getLog().info("Creating new application versions file");
+ updateSite = new UpdateSite();
+ Versions versions = new Versions();
+ versions.setId(applicationProfile.getId());
+ versions.setName(applicationProfile.getName());
+ updateSite.setVersions(versions);
+ }
+
+ Version latestVersion = updateSite.getVersions().getLatestVersion();
+ if (latestVersion != null) {
+ File latestProfileFile = new File(tempDirectory, "ApplicationProfile-" + latestVersion.getVersion()
+ + ".xml");
+ try {
+ Utils.downloadFile(latestVersion.getFile(), latestProfileFile, wagon, getLog());
+ } catch (ResourceDoesNotExistException e) {
+ throw new MojoExecutionException(latestVersion.getFile() + " does not exist", e);
+ }
+ ApplicationProfile latestProfile;
+ try {
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ latestProfile = (ApplicationProfile) unmarshaller.unmarshal(latestProfileFile);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error reading " + latestProfileFile, e);
+ }
+ Set<BundleInfo> requiredBundles = getRequiredBundles(latestProfile, applicationProfile);
+ if (requiredBundles.isEmpty()) {
+ getLog().warn("No new bundles to upload");
+ } else {
+ // upload new bundles to the update site
+ uploadBundles(requiredBundles, wagon);
+ }
+ }
+
+ if (addApplicationVersion(updateSite.getVersions(), applicationProfile,
+ deployedProfileFile)) {
+ // write the new application versions list
+ try {
+ Marshaller marshaller = jaxbContext.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, TavernaProfileGenerateMojo.SCHEMA_LOCATION);
+ marshaller.marshal(updateSite, updatesFile);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error writing " + UPDATES_FILE, e);
+ }
+
+ // upload the new application versions list to the update site
+ Utils.uploadFile(updatesFile, UPDATES_FILE, wagon, getLog());
+ }
+ }
+ finally {
+ disconnectWagon(wagon, debug);
+ }
+ }
+
+ /**
+ * Adds an new application version to the application versions if the version doesn't already
+ * exist.
+ *
+ * @param applicationVersions
+ * the ApplicationVersions document
+ * @param applicationProfile
+ * the applicationProfile
+ * @param profileURL
+ * @return true if a new version was added to the ApplicationVersions document; false if the
+ * version already exits
+ */
+ private boolean addApplicationVersion(Versions applicationVersions,
+ ApplicationProfile applicationProfile, String profileURL) {
+ Version latestVersion = applicationVersions.getLatestVersion();
+ if (latestVersion != null
+ && latestVersion.getVersion().equals(applicationProfile.getVersion())) {
+ getLog().error(
+ String.format("%1$s version %2$s has already been deployed",
+ applicationProfile.getName(), applicationProfile.getVersion()));
+ return false;
+ }
+
+ Version newApplicationVersion = new Version();
+ newApplicationVersion.setVersion(applicationProfile.getVersion());
+ newApplicationVersion.setFile(profileURL);
+
+ getLog().info(
+ String.format("Adding %1$s version %2$s", applicationProfile.getName(),
+ applicationProfile.getVersion()));
+ if (applicationVersions.getLatestVersion() != null) {
+ applicationVersions.getPreviousVersion().add(applicationVersions.getLatestVersion());
+ }
+ applicationVersions.setLatestVersion(newApplicationVersion);
+ return true;
+ }
+
+ /**
+ * @param requiredBundles
+ * @throws MojoExecutionException
+ */
+ private void uploadBundles(Set<BundleInfo> requiredBundles, Wagon wagon) throws MojoExecutionException {
+ File libDirectory = new File(tempDirectory, "lib");
+ for (BundleInfo bundle : requiredBundles) {
+ Utils.uploadFile(new File(libDirectory, bundle.getFileName()), "lib/" + bundle.getFileName(), wagon, getLog());
+ }
+ }
+
+ private Set<BundleInfo> getRequiredBundles(ApplicationProfile currentProfile,
+ ApplicationProfile newProfile) {
+ Set<BundleInfo> requiredBundles = new HashSet<BundleInfo>();
+ Map<String, BundleInfo> currentBundles = new HashMap<String, BundleInfo>();
+ for (BundleInfo bundle : currentProfile.getBundle()) {
+ currentBundles.put(bundle.getSymbolicName(), bundle);
+ }
+ for (BundleInfo bundle : newProfile.getBundle()) {
+ if (currentBundles.containsKey(bundle.getSymbolicName())) {
+ BundleInfo currentBundle = currentBundles.get(bundle.getSymbolicName());
+ if (!bundle.getVersion().equals(currentBundle.getVersion())) {
+ requiredBundles.add(bundle);
+ }
+ } else {
+ requiredBundles.add(bundle);
+ }
+ }
+ return requiredBundles;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
new file mode 100644
index 0000000..1a0e9a0
--- /dev/null
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
@@ -0,0 +1,221 @@
+/*******************************************************************************
+ * Copyright (C) 2009 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.maven.plugins;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectDependenciesResolver;
+import org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter;
+import org.apache.maven.shared.osgi.Maven2OsgiConverter;
+import org.eclipse.aether.RepositorySystemSession;
+
+import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
+import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
+import uk.org.taverna.commons.profile.xml.jaxb.FrameworkConfiguration;
+import uk.org.taverna.commons.profile.xml.jaxb.Updates;
+
+/**
+ * Generates an application profile file.
+ *
+ * @author David Withers
+ */
+@Mojo(name = "profile-generate", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, requiresDependencyResolution = ResolutionScope.RUNTIME)
+public class TavernaProfileGenerateMojo extends AbstractMojo {
+
+ public static final String SYSTEM_PACKAGES = "org.osgi.framework.system.packages.extra";
+
+ public static final String SCHEMA_LOCATION = "http://ns.taverna.org.uk/2013/application/profile http://localhost/2013/application/profile/ApplicationProfile.xsd";
+
+ public static final String TAVERNA_TMP = "taverna-tmp";
+
+ public static final String APPLICATION_PROFILE_FILE = "ApplicationProfile.xml";
+
+ @Component
+ private MavenProject project;
+
+ @Component
+ private ProjectDependenciesResolver projectDependenciesResolver;
+
+ @Parameter(defaultValue = "${repositorySystemSession}", readonly = true)
+ private RepositorySystemSession repositorySystemSession;
+
+ /**
+ * The directory where the generated <code>ApplicationProfile.xml</code> file will be put.
+ */
+ @Parameter(defaultValue = "${project.build.directory}", required = true)
+ protected File outputDirectory;
+
+ @Parameter(defaultValue = "SNAPSHOT")
+ private String buildNumber;
+
+ @Parameter
+ private List<FrameworkConfiguration> frameworkConfigurations;
+
+ @Parameter(required = true)
+ private String updateSite;
+
+ @Parameter(defaultValue = "updates.xml")
+ private String updatesFile;
+
+ @Parameter(defaultValue = "lib")
+ private String libDirectory;
+
+ @Parameter(required = true)
+ private String pluginSite;
+
+ @Parameter(defaultValue = "plugins.xml")
+ private String pluginsFile;
+
+ private Maven2OsgiConverter maven2OsgiConverter = new DefaultMaven2OsgiConverter();
+
+ private MavenOsgiUtils osgiUtils;
+
+ private File tempDirectory;
+
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ try {
+ osgiUtils = new MavenOsgiUtils(project, repositorySystemSession,
+ projectDependenciesResolver, getSystemPackages(), getLog());
+ tempDirectory = new File(outputDirectory, TAVERNA_TMP);
+
+ File profileFile = createApplicationProfile();
+ project.getArtifact().setFile(profileFile);
+
+ copyDependencies();
+
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error generating application profile", e);
+ }
+ }
+
+ private void copyDependencies() throws MojoExecutionException {
+ File libDirectory = new File(tempDirectory, "lib");
+ libDirectory.mkdirs();
+
+ try {
+ for (Artifact artifact : project.getArtifacts()) {
+ FileUtils.copyFileToDirectory(artifact.getFile(),
+ new File(libDirectory, artifact.getGroupId()));
+ }
+ } catch (IOException e) {
+ throw new MojoExecutionException("Error copying dependecies to lib directory", e);
+ }
+
+ }
+
+ /**
+ * Generates the application profile file.
+ *
+ * @return the <code>File</code> that the application profile has been written to
+ * @throws JAXBException
+ * if the application profile cannot be created
+ * @throws MojoExecutionException
+ */
+ private File createApplicationProfile() 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")) + buildNumber;
+ }
+
+ tempDirectory.mkdirs();
+ File applicationProfileFile = new File(tempDirectory, APPLICATION_PROFILE_FILE);
+
+ ApplicationProfile applicationProfile = new ApplicationProfile();
+ applicationProfile.setId(groupId + "." + artifactId);
+ applicationProfile.setName(project.getName());
+ applicationProfile.setVersion(version);
+
+ Updates updates = new Updates();
+ updates.setUpdateSite(updateSite);
+ updates.setUpdatesFile(updatesFile);
+ updates.setLibDirectory(libDirectory);
+ updates.setPluginSite(pluginSite);
+ updates.setPluginsFile(pluginsFile);
+ applicationProfile.setUpdates(updates);
+
+ List<FrameworkConfiguration> frameworkConfiguration = applicationProfile
+ .getFrameworkConfiguration();
+ for (FrameworkConfiguration configuration : frameworkConfigurations) {
+ frameworkConfiguration.add(configuration);
+ }
+
+ Set<BundleArtifact> bundleDependencies = osgiUtils.getBundleDependencies(
+ Artifact.SCOPE_COMPILE, Artifact.SCOPE_RUNTIME);
+ List<BundleInfo> runtimeBundles = osgiUtils.getBundles(bundleDependencies);
+ if (!runtimeBundles.isEmpty()) {
+ List<BundleInfo> bundles = applicationProfile.getBundle();
+ for (BundleInfo bundle : runtimeBundles) {
+ bundles.add(bundle);
+ }
+ }
+
+ JAXBContext jaxbContext = JAXBContext.newInstance(ApplicationProfile.class);
+ Marshaller marshaller = jaxbContext.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, SCHEMA_LOCATION);
+ marshaller.marshal(applicationProfile, applicationProfileFile);
+
+ return applicationProfileFile;
+ }
+
+ private Set<String> getSystemPackages() {
+ Set<String> systemPackages = new HashSet<String>();
+ if (frameworkConfigurations != null) {
+ for (FrameworkConfiguration configuration : frameworkConfigurations) {
+ if (SYSTEM_PACKAGES.equals(configuration.getName())) {
+ String packagesString = configuration.getValue();
+ if (packagesString != null) {
+ String[] packages = packagesString.split(",");
+ for (String packageString : packages) {
+ String[] packageProperties = packageString.split(";");
+ if (packageProperties.length > 0) {
+ systemPackages.add(packageProperties[0]);
+ }
+ }
+ }
+ }
+ }
+ }
+ return systemPackages;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Utils.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Utils.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Utils.java
new file mode 100644
index 0000000..82f5fee
--- /dev/null
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Utils.java
@@ -0,0 +1,171 @@
+/*******************************************************************************
+ * Copyright (C) 2013 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.maven.plugins;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URLEncoder;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.io.FileUtils;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.wagon.ResourceDoesNotExistException;
+import org.apache.maven.wagon.TransferFailedException;
+import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.authorization.AuthorizationException;
+
+/**
+ * @author David Withers
+ */
+public class Utils {
+
+ public static String uploadFile(File file, String resourceName, Wagon wagon, Log log)
+ throws MojoExecutionException {
+ String resourceUrl = getResourceUrl(wagon, resourceName);
+ File digestFile = new File(file.getPath() + ".md5");
+ try {
+ String digestString = DigestUtils.md5Hex(new FileInputStream(file));
+ FileUtils.writeStringToFile(digestFile, digestString);
+ } catch (IOException e) {
+ throw new MojoExecutionException(
+ String.format("Error generating digest for %1$s", file), e);
+ }
+ try {
+ log.info(String.format("Uploading %1$s to %2$s", file, resourceUrl));
+ wagon.put(file, resourceName);
+ wagon.put(digestFile, resourceName + ".md5");
+ } catch (TransferFailedException e) {
+ throw new MojoExecutionException(String.format("Error transferring %1$s to %2$s", file,
+ resourceUrl), e);
+ } catch (ResourceDoesNotExistException e) {
+ throw new MojoExecutionException(String.format("%1$s does not exist", resourceUrl), e);
+ } catch (AuthorizationException e) {
+ throw new MojoExecutionException(String.format(
+ "Authentication error transferring %1$s to %2$s", file, resourceUrl), e);
+ }
+ return resourceUrl;
+ }
+
+ public static void downloadFile(String resourceName, File file, Wagon wagon, Log log)
+ throws MojoExecutionException, ResourceDoesNotExistException {
+ String resourceUrl = getResourceUrl(wagon, resourceName);
+ File digestFile = new File(file.getPath() + ".md5");
+ try {
+ log.info(String.format("Downloading %1$s to %2$s", resourceUrl, file));
+ wagon.get(resourceName, file);
+ wagon.get(resourceName + ".md5", digestFile);
+ } catch (TransferFailedException e) {
+ throw new MojoExecutionException(String.format("Error transferring %1$s to %2$s",
+ resourceUrl, file), e);
+ } catch (AuthorizationException e) {
+ throw new MojoExecutionException(String.format(
+ "Authentication error transferring %1$s to %2$s", resourceUrl, file), e);
+ }
+ try {
+ String digestString1 = DigestUtils.md5Hex(new FileInputStream(file));
+ String digestString2 = FileUtils.readFileToString(digestFile);
+ if (!digestString1.equals(digestString2)) {
+ throw new MojoExecutionException(String.format(
+ "Error downloading file: digsests not equal. (%1$s != %2$s)",
+ digestString1, digestString2));
+ }
+ } catch (IOException e) {
+ throw new MojoExecutionException(String.format("Error checking digest for %1$s", file),
+ e);
+ }
+ }
+
+ public static String getResourceUrl(Wagon wagon, String resourceName) {
+ StringBuilder urlBuilder = new StringBuilder(wagon.getRepository().getUrl());
+ for (String part : resourceName.split("/")) {
+ urlBuilder.append('/');
+ urlBuilder.append(URLEncoder.encode(part));
+ }
+ return urlBuilder.toString();
+ }
+
+ public static String timestamp() {
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd'T'HHmm");
+ return dateFormat.format(new Date());
+ }
+
+ public static Set<String> getJavaPackages(Log log) {
+ Set<String> javaPackages = new HashSet<String>();
+ InputStream resource = Utils.class.getClassLoader().getResourceAsStream("java7-packages");
+ if (resource != null) {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(resource));
+ try {
+ String line = reader.readLine();
+ while (line != null) {
+ if (!line.isEmpty()) {
+ javaPackages.add(line.trim());
+ }
+ line = reader.readLine();
+ }
+ } catch (IOException e) {
+ log.warn(
+ "Problem while reading to readinf java package list from resource file java7-packages",
+ e);
+ }
+ } else {
+ log.warn("Unable to read java package list from resource file java7-packages");
+ }
+ return javaPackages;
+ }
+
+ public static <T> List<Set<T>> getSubsets(Set<T> set) {
+ List<Set<T>> subsets = new ArrayList<Set<T>>();
+ List<T> list = new ArrayList<T>(set);
+ int numOfSubsets = 1 << set.size();
+ for (int i = 0; i < numOfSubsets; i++){
+ Set<T> subset = new HashSet<T>();
+ for (int j = 0; j < numOfSubsets; j++){
+ if (((i>>j) & 1) == 1) {
+ subset.add(list.get(j));
+ }
+ }
+ if (!subset.isEmpty()) {
+ subsets.add(subset);
+ }
+ }
+ Collections.sort(subsets, new Comparator<Set<T>>() {
+ @Override
+ public int compare(Set<T> o1, Set<T> o2) {
+ return o1.size() - o2.size();
+ }
+ });
+ return subsets;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/main/resources/META-INF/plexus/components.xml
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/resources/META-INF/plexus/components.xml b/taverna-maven-plugin/src/main/resources/META-INF/plexus/components.xml
new file mode 100644
index 0000000..ad375db
--- /dev/null
+++ b/taverna-maven-plugin/src/main/resources/META-INF/plexus/components.xml
@@ -0,0 +1,32 @@
+<component-set>
+ <components>
+ <component>
+ <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
+ <role-hint>taverna-plugin</role-hint>
+ <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
+ </implementation>
+ <configuration>
+ <phases>
+ <generate-resources>net.sf.taverna.t2.maven.plugins:taverna-maven-plugin:plugin-generate</generate-resources>
+ <prepare-package>net.sf.taverna.t2.maven.plugins:taverna-maven-plugin:plugin-prepare-bundles</prepare-package>
+ <package>org.apache.maven.plugins:maven-jar-plugin:jar</package>
+ <deploy>net.sf.taverna.t2.maven.plugins:taverna-maven-plugin:plugin-deploy</deploy>
+ </phases>
+ </configuration>
+ </component>
+ <component>
+ <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
+ <role-hint>taverna-application</role-hint>
+ <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
+ </implementation>
+ <configuration>
+ <phases>
+ <generate-resources>net.sf.taverna.t2.maven.plugins:taverna-maven-plugin:profile-generate
+ </generate-resources>
+ <deploy>net.sf.taverna.t2.maven.plugins:taverna-maven-plugin:profile-deploy
+ </deploy>
+ </phases>
+ </configuration>
+ </component>
+ </components>
+</component-set>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/main/resources/java7-packages
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/resources/java7-packages b/taverna-maven-plugin/src/main/resources/java7-packages
new file mode 100644
index 0000000..032c7dd
--- /dev/null
+++ b/taverna-maven-plugin/src/main/resources/java7-packages
@@ -0,0 +1,209 @@
+java.applet
+java.awt
+java.awt.color
+java.awt.datatransfer
+java.awt.dnd
+java.awt.event
+java.awt.font
+java.awt.geom
+java.awt.im
+java.awt.im.spi
+java.awt.image
+java.awt.image.renderable
+java.awt.print
+java.beans
+java.beans.beancontext
+java.io
+java.lang
+java.lang.annotation
+java.lang.instrument
+java.lang.invoke
+java.lang.management
+java.lang.ref
+java.lang.reflect
+java.math
+java.net
+java.nio
+java.nio.channels
+java.nio.channels.spi
+java.nio.charset
+java.nio.charset.spi
+java.nio.file
+java.nio.file.attribute
+java.nio.file.spi
+java.rmi
+java.rmi.activation
+java.rmi.dgc
+java.rmi.registry
+java.rmi.server
+java.security
+java.security.acl
+java.security.cert
+java.security.interfaces
+java.security.spec
+java.sql
+java.text
+java.text.spi
+java.util
+java.util.concurrent
+java.util.concurrent.atomic
+java.util.concurrent.locks
+java.util.jar
+java.util.logging
+java.util.prefs
+java.util.regex
+java.util.spi
+java.util.zip
+javax.accessibility
+javax.activation
+javax.activity
+javax.annotation
+javax.annotation.processing
+javax.crypto
+javax.crypto.interfaces
+javax.crypto.spec
+javax.imageio
+javax.imageio.event
+javax.imageio.metadata
+javax.imageio.plugins.bmp
+javax.imageio.plugins.jpeg
+javax.imageio.spi
+javax.imageio.stream
+javax.jws
+javax.jws.soap
+javax.lang.model
+javax.lang.model.element
+javax.lang.model.type
+javax.lang.model.util
+javax.management
+javax.management.loading
+javax.management.modelmbean
+javax.management.monitor
+javax.management.openmbean
+javax.management.relation
+javax.management.remote
+javax.management.remote.rmi
+javax.management.timer
+javax.naming
+javax.naming.directory
+javax.naming.event
+javax.naming.ldap
+javax.naming.spi
+javax.net
+javax.net.ssl
+javax.print
+javax.print.attribute
+javax.print.attribute.standard
+javax.print.event
+javax.rmi
+javax.rmi.CORBA
+javax.rmi.ssl
+javax.script
+javax.security.auth
+javax.security.auth.callback
+javax.security.auth.kerberos
+javax.security.auth.login
+javax.security.auth.spi
+javax.security.auth.x500
+javax.security.cert
+javax.security.sasl
+javax.sound.midi
+javax.sound.midi.spi
+javax.sound.sampled
+javax.sound.sampled.spi
+javax.sql
+javax.sql.rowset
+javax.sql.rowset.serial
+javax.sql.rowset.spi
+javax.swing
+javax.swing.border
+javax.swing.colorchooser
+javax.swing.event
+javax.swing.filechooser
+javax.swing.plaf
+javax.swing.plaf.basic
+javax.swing.plaf.metal
+javax.swing.plaf.multi
+javax.swing.plaf.nimbus
+javax.swing.plaf.synth
+javax.swing.table
+javax.swing.text
+javax.swing.text.html
+javax.swing.text.html.parser
+javax.swing.text.rtf
+javax.swing.tree
+javax.swing.undo
+javax.tools
+javax.transaction
+javax.transaction.xa
+javax.xml
+javax.xml.bind
+javax.xml.bind.annotation
+javax.xml.bind.annotation.adapters
+javax.xml.bind.attachment
+javax.xml.bind.helpers
+javax.xml.bind.util
+javax.xml.crypto
+javax.xml.crypto.dom
+javax.xml.crypto.dsig
+javax.xml.crypto.dsig.dom
+javax.xml.crypto.dsig.keyinfo
+javax.xml.crypto.dsig.spec
+javax.xml.datatype
+javax.xml.namespace
+javax.xml.parsers
+javax.xml.soap
+javax.xml.stream
+javax.xml.stream.events
+javax.xml.stream.util
+javax.xml.transform
+javax.xml.transform.dom
+javax.xml.transform.sax
+javax.xml.transform.stax
+javax.xml.transform.stream
+javax.xml.validation
+javax.xml.ws
+javax.xml.ws.handler
+javax.xml.ws.handler.soap
+javax.xml.ws.http
+javax.xml.ws.soap
+javax.xml.ws.spi
+javax.xml.ws.spi.http
+javax.xml.ws.wsaddressing
+javax.xml.xpath
+org.ietf.jgss
+org.omg.CORBA
+org.omg.CORBA_2_3
+org.omg.CORBA_2_3.portable
+org.omg.CORBA.DynAnyPackage
+org.omg.CORBA.ORBPackage
+org.omg.CORBA.portable
+org.omg.CORBA.TypeCodePackage
+org.omg.CosNaming
+org.omg.CosNaming.NamingContextExtPackage
+org.omg.CosNaming.NamingContextPackage
+org.omg.Dynamic
+org.omg.DynamicAny
+org.omg.DynamicAny.DynAnyFactoryPackage
+org.omg.DynamicAny.DynAnyPackage
+org.omg.IOP
+org.omg.IOP.CodecFactoryPackage
+org.omg.IOP.CodecPackage
+org.omg.Messaging
+org.omg.PortableInterceptor
+org.omg.PortableInterceptor.ORBInitInfoPackage
+org.omg.PortableServer
+org.omg.PortableServer.CurrentPackage
+org.omg.PortableServer.POAManagerPackage
+org.omg.PortableServer.POAPackage
+org.omg.PortableServer.portable
+org.omg.PortableServer.ServantLocatorPackage
+org.omg.SendingContext
+org.omg.stub.java.rmi
+org.w3c.dom
+org.w3c.dom.bootstrap
+org.w3c.dom.events
+org.w3c.dom.ls
+org.xml.sax
+org.xml.sax.ext
+org.xml.sax.helpers
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java b/taverna-maven-plugin/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java
new file mode 100644
index 0000000..6f21fb1
--- /dev/null
+++ b/taverna-maven-plugin/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (C) 2009 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.maven.plugins;
+
+import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * Unit tests for TavernaPluginGenerateMojo.
+ *
+ * @author David Withers
+ */
+public class TavernaPluginGenerateMojoTest extends AbstractMojoTestCase {
+
+ private TavernaPluginGenerateMojo tavernaPluginGenerateMojo;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Ignore
+ public void setUp() throws Exception {
+// super.setUp();
+//
+// File pluginXml = new File( getBasedir(), "src/test/resources/unit/plugin-config.xml" );
+// tavernaPluginGenerateMojo = (TavernaPluginGenerateMojo) lookupMojo( "plugin-generate", pluginXml );
+//
+// MavenProject mavenProject = (MavenProject) getVariableValueFromObject(tavernaPluginGenerateMojo, "project");
+//
+// Artifact artifact = new DefaultArtifact("net.sf.taverna.t2", "example-plugin", VersionRange
+// .createFromVersion("0.1.0"), "compile", "jar", "", null);
+// artifact.setRepository(new DefaultArtifactRepository("id1",
+// "http://www.mygrid.org.uk/maven/repository", new DefaultRepositoryLayout()));
+// mavenProject.setArtifact(artifact);
+//
+//
+// Artifact dependency = new DefaultArtifact("com.example.test", "test-artifact", VersionRange
+// .createFromVersion("1.3.5"), "compile", "jar", "", null);
+// dependency.setGroupId("com.example.test");
+// dependency.setArtifactId("test-artifact");
+// dependency.setVersion("1.3.5");
+// dependency.setRepository(new DefaultArtifactRepository("id2",
+// "http://www.example.com/maven/repository", new DefaultRepositoryLayout()));
+// mavenProject.setDependencyArtifacts(Collections.singleton(dependency));
+//
+// MavenSession session = new MavenSession(getContainer(), (RepositorySystemSession) null, (MavenExecutionRequest) null, (MavenExecutionResult) null);
+// setVariableValueToObject(tavernaPluginGenerateMojo, "session", session);
+ }
+
+ /**
+ * Test method for
+ * {@link net.sf.taverna.t2.maven.plugins.TavernaPluginGenerateMojo#execute()}
+ *
+ * @throws Exception
+ */
+ @Test
+ @Ignore
+ public void testExecute() throws Exception {
+// tavernaPluginGenerateMojo.execute();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/test/resources/unit/plugin-config.xml
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/test/resources/unit/plugin-config.xml b/taverna-maven-plugin/src/test/resources/unit/plugin-config.xml
new file mode 100644
index 0000000..a8c1723
--- /dev/null
+++ b/taverna-maven-plugin/src/test/resources/unit/plugin-config.xml
@@ -0,0 +1,19 @@
+<project>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>net.sf.taverna.t2.maven.plugins</groupId>
+ <artifactId>taverna-maven-plugin</artifactId>
+ <configuration>
+ <buildDirectory>${basedir}/target/test/unit</buildDirectory>
+ <project>
+ <groupId>net.sf.taverna.t2</groupId>
+ <artifactId>example-plugin</artifactId>
+ <version>0.1.0</version>
+ <name>Taverna 2 Example Plugin</name>
+ </project>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
[03/50] [abbrv] incubator-taverna-osgi git commit: Added .gitignore
Posted by st...@apache.org.
Added .gitignore
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/d84faaca
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/d84faaca
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/d84faaca
Branch: refs/heads/master
Commit: d84faaca7a51017c1879f29583d912e88666fc8b
Parents: 3a7b9ed
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Tue May 6 14:23:42 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Tue May 6 14:23:42 2014 +0100
----------------------------------------------------------------------
.gitignore | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/d84faaca/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ebe0e5b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,24 @@
+# ignore project files #
+.classpath
+.project
+.settings/
+catalog-v001.xml
+
+# ignore target files #
+target/
+bin/
+build/
+dist/
+apidoc/
+*.swp
+
+# ignore svn files if there
+.svn
+
+# ignore log files #
+*.log
+/logs/*
+*/logs/*
+
+
+
[32/50] [abbrv] incubator-taverna-osgi git commit:
taverna-xml-schemas -> taverna-osgi-schemas
Posted by st...@apache.org.
taverna-xml-schemas -> taverna-osgi-schemas
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/db7080df
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/db7080df
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/db7080df
Branch: refs/heads/master
Commit: db7080dfc538ebda7701004b5d05c3c90a9226ff
Parents: fea3650
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu Dec 18 22:30:57 2014 -0600
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu Dec 18 22:30:57 2014 -0600
----------------------------------------------------------------------
taverna-osgi-schemas/pom.xml | 49 +++++++++++++
.../src/main/resources/ApplicationPlugin.xsd | 67 +++++++++++++++++
.../src/main/resources/ApplicationProfile.xsd | 75 ++++++++++++++++++++
.../src/main/resources/ApplicationVersions.xsd | 44 ++++++++++++
taverna-xml-schemas/pom.xml | 49 -------------
.../src/main/resources/ApplicationPlugin.xsd | 67 -----------------
.../src/main/resources/ApplicationProfile.xsd | 75 --------------------
.../src/main/resources/ApplicationVersions.xsd | 44 ------------
8 files changed, 235 insertions(+), 235 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/db7080df/taverna-osgi-schemas/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-osgi-schemas/pom.xml b/taverna-osgi-schemas/pom.xml
new file mode 100644
index 0000000..8b193cc
--- /dev/null
+++ b/taverna-osgi-schemas/pom.xml
@@ -0,0 +1,49 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>taverna-commons</artifactId>
+ <groupId>uk.org.taverna.commons</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>taverna-xml-schemas</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ <name>Taverna XML Schemas</name>
+ <packaging>bundle</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jvnet.jaxb2.maven2</groupId>
+ <artifactId>maven-jaxb2-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <repositories>
+ <repository>
+ <releases />
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <id>mygrid-repository</id>
+ <name>myGrid Repository</name>
+ <url>http://www.mygrid.org.uk/maven/repository
+ </url>
+ </repository>
+ <repository>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots />
+ <id>mygrid-snapshot-repository</id>
+ <name>myGrid Snapshot Repository</name>
+ <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
+ </repository>
+ </repositories>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/db7080df/taverna-osgi-schemas/src/main/resources/ApplicationPlugin.xsd
----------------------------------------------------------------------
diff --git a/taverna-osgi-schemas/src/main/resources/ApplicationPlugin.xsd b/taverna-osgi-schemas/src/main/resources/ApplicationPlugin.xsd
new file mode 100644
index 0000000..180c8c2
--- /dev/null
+++ b/taverna-osgi-schemas/src/main/resources/ApplicationPlugin.xsd
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<xs:schema xmlns="http://ns.taverna.org.uk/2013/application/plugin"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:versions="http://ns.taverna.org.uk/2013/application/versions"
+ xmlns:ap="http://ns.taverna.org.uk/2013/application/profile"
+ xmlns:plugin="http://ns.taverna.org.uk/2013/application/plugin"
+ xmlns:jxb="http://java.sun.com/xml/ns/jaxb" jxb:version="1.0"
+ targetNamespace="http://ns.taverna.org.uk/2013/application/plugin"
+ elementFormDefault="qualified">
+
+ <xs:annotation>
+ <xs:appinfo>
+ <jxb:schemaBindings>
+ <jxb:package name="uk.org.taverna.commons.plugin.xml.jaxb" />
+ </jxb:schemaBindings>
+ </xs:appinfo>
+ </xs:annotation>
+
+ <xs:import namespace="http://ns.taverna.org.uk/2013/application/versions"
+ schemaLocation="ApplicationVersions.xsd" />
+
+ <xs:import namespace="http://ns.taverna.org.uk/2013/application/profile"
+ schemaLocation="ApplicationProfile.xsd" />
+
+ <xs:element name="pluginInfo">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="id" type="xs:string" />
+ <xs:element name="name" type="xs:string" />
+ <xs:element name="description" type="xs:string" />
+ <xs:element name="organization" type="xs:string" />
+ <xs:element name="version" type="versions:semanticVersion" />
+ <xs:element name="bundle" type="ap:bundleInfo" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="pluginVersions">
+ <xs:complexContent>
+ <xs:extension base="versions:versions">
+ <xs:sequence>
+ <xs:element name="organization" type="xs:string" />
+ <xs:element name="pluginSiteUrl" type="xs:string" minOccurs="0" />
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="plugins">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="plugin" type="pluginVersions"
+ minOccurs="1" maxOccurs="unbounded">
+ <xs:unique name="versionUnique">
+ <xs:selector
+ xpath="versions:previousVersion/versions:version|versions:latestVersion/versions:version" />
+ <xs:field xpath="." />
+ </xs:unique>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:unique name="versionsIdUnique">
+ <xs:selector xpath="plugin:versions/versions:id" />
+ <xs:field xpath="." />
+ </xs:unique>
+ </xs:element>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/db7080df/taverna-osgi-schemas/src/main/resources/ApplicationProfile.xsd
----------------------------------------------------------------------
diff --git a/taverna-osgi-schemas/src/main/resources/ApplicationProfile.xsd b/taverna-osgi-schemas/src/main/resources/ApplicationProfile.xsd
new file mode 100644
index 0000000..78073a2
--- /dev/null
+++ b/taverna-osgi-schemas/src/main/resources/ApplicationProfile.xsd
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<xs:schema xmlns="http://ns.taverna.org.uk/2013/application/profile"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:versions="http://ns.taverna.org.uk/2013/application/versions"
+ xmlns:ap="http://ns.taverna.org.uk/2013/application/profile" xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
+ jxb:version="1.0" targetNamespace="http://ns.taverna.org.uk/2013/application/profile"
+ elementFormDefault="qualified">
+
+ <xs:annotation>
+ <xs:appinfo>
+ <jxb:schemaBindings>
+ <jxb:package name="uk.org.taverna.commons.profile.xml.jaxb" />
+ </jxb:schemaBindings>
+ </xs:appinfo>
+ </xs:annotation>
+
+ <xs:import namespace="http://ns.taverna.org.uk/2013/application/versions"
+ schemaLocation="ApplicationVersions.xsd" />
+
+ <xs:complexType name="frameworkConfiguration">
+ <xs:attribute name="name" type="xs:string" use="required" />
+ <xs:attribute name="value" type="xs:string" use="required" />
+ </xs:complexType>
+
+ <xs:complexType name="bundleInfo">
+ <xs:sequence>
+ <xs:element name="fileName" type="xs:anyURI" minOccurs="0" />
+ </xs:sequence>
+ <xs:attribute name="symbolicName" type="xs:string" use="required" />
+ <xs:attribute name="version" type="versions:semanticVersion"
+ use="required" />
+ </xs:complexType>
+
+ <xs:complexType name="updates">
+ <xs:sequence>
+ <xs:element name="updateSite" type="xs:anyURI" />
+ <xs:element name="updatesFile" type="xs:string" />
+ <xs:element name="libDirectory" type="xs:string" />
+ <xs:element name="pluginSite" type="xs:string" />
+ <xs:element name="pluginsFile" type="xs:string" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name="applicationProfile">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="id" type="xs:string" />
+ <xs:element name="name" type="xs:string" />
+ <xs:element name="version" type="versions:semanticVersion" />
+ <xs:element name="updates" type="updates" />
+ <xs:element name="frameworkConfiguration" type="frameworkConfiguration"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xs:element name="bundle" type="bundleInfo" minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+ <xs:unique name="symbolicNameUnique">
+ <xs:selector xpath="ap:bundles/ap:bundle"></xs:selector>
+ <xs:field xpath="@symbolicName"></xs:field>
+ </xs:unique>
+ </xs:element>
+
+ <xs:element name="updateSite">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="versions" type="versions:versions">
+ <xs:unique name="versionUnique">
+ <xs:selector
+ xpath="versions:previousVersion/versions:version|versions:latestVersion/versions:version" />
+ <xs:field xpath="." />
+ </xs:unique>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/db7080df/taverna-osgi-schemas/src/main/resources/ApplicationVersions.xsd
----------------------------------------------------------------------
diff --git a/taverna-osgi-schemas/src/main/resources/ApplicationVersions.xsd b/taverna-osgi-schemas/src/main/resources/ApplicationVersions.xsd
new file mode 100644
index 0000000..706423c
--- /dev/null
+++ b/taverna-osgi-schemas/src/main/resources/ApplicationVersions.xsd
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<xs:schema xmlns="http://ns.taverna.org.uk/2013/application/versions"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:versions="http://ns.taverna.org.uk/2013/application/versions"
+ xmlns:jxb="http://java.sun.com/xml/ns/jaxb" jxb:version="1.0"
+ targetNamespace="http://ns.taverna.org.uk/2013/application/versions"
+ elementFormDefault="qualified">
+
+ <xs:annotation>
+ <xs:appinfo>
+ <jxb:schemaBindings>
+ <jxb:package name="uk.org.taverna.commons.versions.xml.jaxb" />
+ </jxb:schemaBindings>
+ </xs:appinfo>
+ </xs:annotation>
+
+ <xs:simpleType name="semanticVersion">
+ <xs:annotation>
+ <xs:documentation>A semantic version.</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="[0-9]+\.[0-9]+(\.[0-9]+(\.[0-9A-Za-z_-]+)?)?" />
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="version">
+ <xs:sequence>
+ <xs:element name="version" type="semanticVersion" />
+ <xs:element name="file" type="xs:string" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="versions">
+ <xs:sequence>
+ <xs:element name="id" type="xs:string" />
+ <xs:element name="name" type="xs:string" />
+ <xs:element name="description" type="xs:string" />
+ <xs:element name="latestVersion" type="version" minOccurs="1"
+ maxOccurs="1" />
+ <xs:element name="previousVersion" type="version"
+ minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+
+</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/db7080df/taverna-xml-schemas/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-xml-schemas/pom.xml b/taverna-xml-schemas/pom.xml
deleted file mode 100644
index 8b193cc..0000000
--- a/taverna-xml-schemas/pom.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>taverna-commons</artifactId>
- <groupId>uk.org.taverna.commons</groupId>
- <version>1.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>taverna-xml-schemas</artifactId>
- <version>0.1.0-SNAPSHOT</version>
- <name>Taverna XML Schemas</name>
- <packaging>bundle</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jvnet.jaxb2.maven2</groupId>
- <artifactId>maven-jaxb2-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/db7080df/taverna-xml-schemas/src/main/resources/ApplicationPlugin.xsd
----------------------------------------------------------------------
diff --git a/taverna-xml-schemas/src/main/resources/ApplicationPlugin.xsd b/taverna-xml-schemas/src/main/resources/ApplicationPlugin.xsd
deleted file mode 100644
index 180c8c2..0000000
--- a/taverna-xml-schemas/src/main/resources/ApplicationPlugin.xsd
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0"?>
-<xs:schema xmlns="http://ns.taverna.org.uk/2013/application/plugin"
- xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:versions="http://ns.taverna.org.uk/2013/application/versions"
- xmlns:ap="http://ns.taverna.org.uk/2013/application/profile"
- xmlns:plugin="http://ns.taverna.org.uk/2013/application/plugin"
- xmlns:jxb="http://java.sun.com/xml/ns/jaxb" jxb:version="1.0"
- targetNamespace="http://ns.taverna.org.uk/2013/application/plugin"
- elementFormDefault="qualified">
-
- <xs:annotation>
- <xs:appinfo>
- <jxb:schemaBindings>
- <jxb:package name="uk.org.taverna.commons.plugin.xml.jaxb" />
- </jxb:schemaBindings>
- </xs:appinfo>
- </xs:annotation>
-
- <xs:import namespace="http://ns.taverna.org.uk/2013/application/versions"
- schemaLocation="ApplicationVersions.xsd" />
-
- <xs:import namespace="http://ns.taverna.org.uk/2013/application/profile"
- schemaLocation="ApplicationProfile.xsd" />
-
- <xs:element name="pluginInfo">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="id" type="xs:string" />
- <xs:element name="name" type="xs:string" />
- <xs:element name="description" type="xs:string" />
- <xs:element name="organization" type="xs:string" />
- <xs:element name="version" type="versions:semanticVersion" />
- <xs:element name="bundle" type="ap:bundleInfo" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
- <xs:complexType name="pluginVersions">
- <xs:complexContent>
- <xs:extension base="versions:versions">
- <xs:sequence>
- <xs:element name="organization" type="xs:string" />
- <xs:element name="pluginSiteUrl" type="xs:string" minOccurs="0" />
- </xs:sequence>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:element name="plugins">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="plugin" type="pluginVersions"
- minOccurs="1" maxOccurs="unbounded">
- <xs:unique name="versionUnique">
- <xs:selector
- xpath="versions:previousVersion/versions:version|versions:latestVersion/versions:version" />
- <xs:field xpath="." />
- </xs:unique>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:unique name="versionsIdUnique">
- <xs:selector xpath="plugin:versions/versions:id" />
- <xs:field xpath="." />
- </xs:unique>
- </xs:element>
-
-</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/db7080df/taverna-xml-schemas/src/main/resources/ApplicationProfile.xsd
----------------------------------------------------------------------
diff --git a/taverna-xml-schemas/src/main/resources/ApplicationProfile.xsd b/taverna-xml-schemas/src/main/resources/ApplicationProfile.xsd
deleted file mode 100644
index 78073a2..0000000
--- a/taverna-xml-schemas/src/main/resources/ApplicationProfile.xsd
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0"?>
-<xs:schema xmlns="http://ns.taverna.org.uk/2013/application/profile"
- xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:versions="http://ns.taverna.org.uk/2013/application/versions"
- xmlns:ap="http://ns.taverna.org.uk/2013/application/profile" xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
- jxb:version="1.0" targetNamespace="http://ns.taverna.org.uk/2013/application/profile"
- elementFormDefault="qualified">
-
- <xs:annotation>
- <xs:appinfo>
- <jxb:schemaBindings>
- <jxb:package name="uk.org.taverna.commons.profile.xml.jaxb" />
- </jxb:schemaBindings>
- </xs:appinfo>
- </xs:annotation>
-
- <xs:import namespace="http://ns.taverna.org.uk/2013/application/versions"
- schemaLocation="ApplicationVersions.xsd" />
-
- <xs:complexType name="frameworkConfiguration">
- <xs:attribute name="name" type="xs:string" use="required" />
- <xs:attribute name="value" type="xs:string" use="required" />
- </xs:complexType>
-
- <xs:complexType name="bundleInfo">
- <xs:sequence>
- <xs:element name="fileName" type="xs:anyURI" minOccurs="0" />
- </xs:sequence>
- <xs:attribute name="symbolicName" type="xs:string" use="required" />
- <xs:attribute name="version" type="versions:semanticVersion"
- use="required" />
- </xs:complexType>
-
- <xs:complexType name="updates">
- <xs:sequence>
- <xs:element name="updateSite" type="xs:anyURI" />
- <xs:element name="updatesFile" type="xs:string" />
- <xs:element name="libDirectory" type="xs:string" />
- <xs:element name="pluginSite" type="xs:string" />
- <xs:element name="pluginsFile" type="xs:string" />
- </xs:sequence>
- </xs:complexType>
-
- <xs:element name="applicationProfile">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="id" type="xs:string" />
- <xs:element name="name" type="xs:string" />
- <xs:element name="version" type="versions:semanticVersion" />
- <xs:element name="updates" type="updates" />
- <xs:element name="frameworkConfiguration" type="frameworkConfiguration"
- minOccurs="0" maxOccurs="unbounded" />
- <xs:element name="bundle" type="bundleInfo" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
- <xs:unique name="symbolicNameUnique">
- <xs:selector xpath="ap:bundles/ap:bundle"></xs:selector>
- <xs:field xpath="@symbolicName"></xs:field>
- </xs:unique>
- </xs:element>
-
- <xs:element name="updateSite">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="versions" type="versions:versions">
- <xs:unique name="versionUnique">
- <xs:selector
- xpath="versions:previousVersion/versions:version|versions:latestVersion/versions:version" />
- <xs:field xpath="." />
- </xs:unique>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
-
-</xs:schema>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/db7080df/taverna-xml-schemas/src/main/resources/ApplicationVersions.xsd
----------------------------------------------------------------------
diff --git a/taverna-xml-schemas/src/main/resources/ApplicationVersions.xsd b/taverna-xml-schemas/src/main/resources/ApplicationVersions.xsd
deleted file mode 100644
index 706423c..0000000
--- a/taverna-xml-schemas/src/main/resources/ApplicationVersions.xsd
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<xs:schema xmlns="http://ns.taverna.org.uk/2013/application/versions"
- xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:versions="http://ns.taverna.org.uk/2013/application/versions"
- xmlns:jxb="http://java.sun.com/xml/ns/jaxb" jxb:version="1.0"
- targetNamespace="http://ns.taverna.org.uk/2013/application/versions"
- elementFormDefault="qualified">
-
- <xs:annotation>
- <xs:appinfo>
- <jxb:schemaBindings>
- <jxb:package name="uk.org.taverna.commons.versions.xml.jaxb" />
- </jxb:schemaBindings>
- </xs:appinfo>
- </xs:annotation>
-
- <xs:simpleType name="semanticVersion">
- <xs:annotation>
- <xs:documentation>A semantic version.</xs:documentation>
- </xs:annotation>
- <xs:restriction base="xs:string">
- <xs:pattern value="[0-9]+\.[0-9]+(\.[0-9]+(\.[0-9A-Za-z_-]+)?)?" />
- </xs:restriction>
- </xs:simpleType>
-
- <xs:complexType name="version">
- <xs:sequence>
- <xs:element name="version" type="semanticVersion" />
- <xs:element name="file" type="xs:string" />
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="versions">
- <xs:sequence>
- <xs:element name="id" type="xs:string" />
- <xs:element name="name" type="xs:string" />
- <xs:element name="description" type="xs:string" />
- <xs:element name="latestVersion" type="version" minOccurs="1"
- maxOccurs="1" />
- <xs:element name="previousVersion" type="version"
- minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
-
-</xs:schema>
[05/50] [abbrv] incubator-taverna-osgi git commit: added gitignore
Posted by st...@apache.org.
added gitignore
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/adb596a1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/adb596a1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/adb596a1
Branch: refs/heads/master
Commit: adb596a18ad3ab999b761aa62e0a4586e4fcc50d
Parents: 7839592
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Fri May 9 11:16:31 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Fri May 9 11:16:31 2014 +0100
----------------------------------------------------------------------
.gitignore | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/adb596a1/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ebe0e5b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,24 @@
+# ignore project files #
+.classpath
+.project
+.settings/
+catalog-v001.xml
+
+# ignore target files #
+target/
+bin/
+build/
+dist/
+apidoc/
+*.swp
+
+# ignore svn files if there
+.svn
+
+# ignore log files #
+*.log
+/logs/*
+*/logs/*
+
+
+
[14/50] [abbrv] incubator-taverna-osgi git commit: travis
Posted by st...@apache.org.
travis
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/051fb06c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/051fb06c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/051fb06c
Branch: refs/heads/master
Commit: 051fb06cdc4a4984dcffac341c99bb970992d1c1
Parents: f3e424f
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu May 15 15:09:58 2014 +0100
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu May 15 15:09:58 2014 +0100
----------------------------------------------------------------------
.travis.yml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/051fb06c/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..dff5f3a
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1 @@
+language: java
[04/50] [abbrv] incubator-taverna-osgi git commit: Added readme
Posted by st...@apache.org.
Added readme
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/9b44a74f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/9b44a74f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/9b44a74f
Branch: refs/heads/master
Commit: 9b44a74f305cffd89b0d8ab4bbab75846121c9a5
Parents: d84faac
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Tue May 6 14:23:50 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Tue May 6 14:23:50 2014 +0100
----------------------------------------------------------------------
README.md | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/9b44a74f/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..d0d6c4c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+Maven plugin for packaging and deploying Taverna 3 plugins
+
+This code was previously hosted at http://taverna.googlecode.com/svn/taverna/dev/maven-plugin/
\ No newline at end of file
[06/50] [abbrv] incubator-taverna-osgi git commit: add README
Posted by st...@apache.org.
add README
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/f586a577
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/f586a577
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/f586a577
Branch: refs/heads/master
Commit: f586a577dc43a8cd7dcf1fbc68181393aea9054a
Parents: adb596a
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Fri May 9 11:16:44 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Fri May 9 11:16:44 2014 +0100
----------------------------------------------------------------------
README.md | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/f586a577/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..f93284f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+OSGi Framework Launcher
+
+This code was previously hosted at http://taverna.googlecode.com/svn/osgi-launcher/
\ No newline at end of file
[33/50] [abbrv] incubator-taverna-osgi git commit: Merge branch
'taverna3-commons'
Posted by st...@apache.org.
Merge branch 'taverna3-commons'
>From https://github.com/taverna/taverna3-commons master
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/34d65c42
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/34d65c42
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/34d65c42
Branch: refs/heads/master
Commit: 34d65c42559676d4f95c26b988fe35dfd4138006
Parents: 82e6c92 db7080d
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu Dec 18 22:31:20 2014 -0600
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu Dec 18 22:31:20 2014 -0600
----------------------------------------------------------------------
taverna-app-configuration-api/.project | 24 +
taverna-app-configuration-api/pom.xml | 42 ++
.../app/ApplicationConfiguration.java | 62 +++
taverna-app-configuration-impl/.project | 24 +
taverna-app-configuration-impl/pom.xml | 66 +++
.../app/impl/ApplicationConfigurationImpl.java | 293 ++++++++++++
.../app/impl/ApplicationUserHome.java | 224 +++++++++
.../app/impl/Log4JConfiguration.java | 161 +++++++
.../spring/configuration-context-osgi.xml | 11 +
.../META-INF/spring/configuration-context.xml | 14 +
taverna-configuration-api/.project | 24 +
taverna-configuration-api/pom.xml | 54 +++
.../configuration/AbstractConfigurable.java | 184 ++++++++
.../org/taverna/configuration/Configurable.java | 118 +++++
.../configuration/ConfigurationManager.java | 51 ++
.../configuration/ConfigurationUIFactory.java | 29 ++
.../uk/org/taverna/configuration/package.html | 3 +
.../proxy/HttpProxyConfiguration.java | 79 ++++
.../configuration/AbstractConfigurableTest.java | 244 ++++++++++
.../configuration/DummyConfigurable.java | 65 +++
taverna-configuration-impl/.project | 24 +
taverna-configuration-impl/pom.xml | 94 ++++
.../impl/ConfigurationManagerImpl.java | 153 ++++++
.../proxy/impl/HttpProxyConfigurationImpl.java | 166 +++++++
.../spring/configuration-context-osgi.xml | 14 +
.../META-INF/spring/configuration-context.xml | 16 +
.../impl/ConfigurationManagerImplTest.java | 182 ++++++++
.../configuration/impl/DummyUIFactory1.java | 126 +++++
.../configuration/impl/DummyUIFactory2.java | 126 +++++
taverna-download-api/pom.xml | 34 ++
.../commons/download/DownloadException.java | 45 ++
.../commons/download/DownloadManager.java | 116 +++++
taverna-download-impl/pom.xml | 70 +++
.../download/impl/DownloadManagerImpl.java | 120 +++++
.../META-INF/spring/download-context-osgi.xml | 11 +
.../META-INF/spring/download-context.xml | 9 +
taverna-osgi-schemas/pom.xml | 49 ++
.../src/main/resources/ApplicationPlugin.xsd | 67 +++
.../src/main/resources/ApplicationProfile.xsd | 75 +++
.../src/main/resources/ApplicationVersions.xsd | 44 ++
taverna-plugin-api/pom.xml | 51 ++
.../uk/org/taverna/commons/plugin/Plugin.java | 88 ++++
.../taverna/commons/plugin/PluginException.java | 45 ++
.../taverna/commons/plugin/PluginManager.java | 105 +++++
.../org/taverna/commons/plugin/PluginSite.java | 65 +++
.../commons/plugin/PluginSiteManager.java | 86 ++++
taverna-plugin-impl/pom.xml | 103 ++++
.../plugin/impl/PluginDirectoryWatcher.java | 106 +++++
.../taverna/commons/plugin/impl/PluginImpl.java | 183 ++++++++
.../commons/plugin/impl/PluginManagerImpl.java | 466 +++++++++++++++++++
.../commons/plugin/impl/PluginSiteImpl.java | 76 +++
.../plugin/impl/PluginSiteManagerImpl.java | 190 ++++++++
.../commons/plugin/impl/PluginSites.java | 50 ++
.../META-INF/spring/plugin-context-osgi.xml | 17 +
.../META-INF/spring/plugin-context.xml | 31 ++
.../commons/plugin/impl/PluginSiteImplTest.java | 72 +++
.../plugin/impl/PluginSiteManagerImplTest.java | 142 ++++++
taverna-update-api/pom.xml | 34 ++
.../taverna/commons/update/UpdateException.java | 47 ++
.../taverna/commons/update/UpdateManager.java | 34 ++
taverna-update-impl/pom.xml | 85 ++++
.../commons/update/impl/UpdateManagerImpl.java | 270 +++++++++++
.../META-INF/spring/update-context-osgi.xml | 16 +
.../META-INF/spring/update-context.xml | 21 +
64 files changed, 5696 insertions(+)
----------------------------------------------------------------------
[12/50] [abbrv] incubator-taverna-osgi git commit: travis
Posted by st...@apache.org.
travis
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/9d6d52a8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/9d6d52a8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/9d6d52a8
Branch: refs/heads/master
Commit: 9d6d52a8bdbcef2834fb9500ef471620bbbf3d8a
Parents: 9b44a74
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu May 15 15:09:55 2014 +0100
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu May 15 15:09:55 2014 +0100
----------------------------------------------------------------------
.travis.yml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/9d6d52a8/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..dff5f3a
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1 @@
+language: java
[15/50] [abbrv] incubator-taverna-osgi git commit: changed derby
dependency for T3-1197
Posted by st...@apache.org.
changed derby dependency for T3-1197
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/27a6457e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/27a6457e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/27a6457e
Branch: refs/heads/master
Commit: 27a6457e13bf3bda7b3147c61d3bfcbd1be55671
Parents: 5631395
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Thu Jun 19 10:18:07 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Thu Jun 19 10:18:07 2014 +0100
----------------------------------------------------------------------
taverna-database-configuration-impl/pom.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/27a6457e/taverna-database-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-impl/pom.xml b/taverna-database-configuration-impl/pom.xml
index 541cfca..b988eb8 100644
--- a/taverna-database-configuration-impl/pom.xml
+++ b/taverna-database-configuration-impl/pom.xml
@@ -46,17 +46,17 @@
<dependency>
<groupId>org.apache.derby</groupId>
- <artifactId>com.springsource.org.apache.derby</artifactId>
+ <artifactId>derby</artifactId>
<version>${derby.version}</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
- <artifactId>com.springsource.org.apache.derby.client</artifactId>
+ <artifactId>derbyclient</artifactId>
<version>${derbyclient.version}</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
- <artifactId>com.springsource.org.apache.derby.drda</artifactId>
+ <artifactId>derbynet</artifactId>
<version>${derbynet.version}</version>
</dependency>
<dependency>
[47/50] [abbrv] incubator-taverna-osgi git commit: Travis info
Posted by st...@apache.org.
Travis info
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/863892d4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/863892d4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/863892d4
Branch: refs/heads/master
Commit: 863892d40c32d52eb37492ca30ffc726282d69b4
Parents: 346d0a3
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Dec 28 03:47:08 2014 -0600
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Dec 28 03:47:13 2014 -0600
----------------------------------------------------------------------
.travis.yml | 1 +
README.md | 8 ++++++++
2 files changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/863892d4/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..dff5f3a
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1 @@
+language: java
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/863892d4/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..dd2958f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,8 @@
+# Apache Taverna OSGi plugin system
+
+[![Build Status](https://travis-ci.org/taverna-incubator/incubator-taverna-osgi.svg)](https://travis-ci.org/taverna-incubator/incubator-taverna-osgi)
+
+OSGi-based plugin system, including online updates. Written for Apache Taverna, probably
+usable for any OSGi-based command line/desktop product.
+
+
[13/50] [abbrv] incubator-taverna-osgi git commit: travis
Posted by st...@apache.org.
travis
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/0e8d428c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/0e8d428c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/0e8d428c
Branch: refs/heads/master
Commit: 0e8d428ccb24d25a87ece4455e3f112d96d96625
Parents: f586a57
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu May 15 15:09:56 2014 +0100
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu May 15 15:09:56 2014 +0100
----------------------------------------------------------------------
.travis.yml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/0e8d428c/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..dff5f3a
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1 @@
+language: java
[26/50] [abbrv] incubator-taverna-osgi git commit:
incubator-taverna-osgi
Posted by st...@apache.org.
incubator-taverna-osgi
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/4fccf241
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/4fccf241
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/4fccf241
Branch: refs/heads/master
Commit: 4fccf24167b36d670ca63a776eeb45889631e7c7
Parents:
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu Dec 18 22:10:13 2014 -0600
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu Dec 18 22:10:13 2014 -0600
----------------------------------------------------------------------
pom.xml | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/4fccf241/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..b2e61fc
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,45 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.taverna</groupId>
+ <artifactId>taverna-parent</artifactId>
+ <version>1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-osgi</artifactId>
+ <version>0.2.0-incubating-SNAPSHOT</version>
+ <name>Apache Taverna OSGi plugin system</name>
+ <description>OSGi-based plugin system, including
+ online updates. Written for Apache Taverna,
+ usable for any OSGi-based
+ command line/desktop product</description>
+ <packaging>pom</packaging>
+ <modules>
+ <module>xml-parser-service</module>
+ <module>xml-transformer-service</module>
+ <module>osgi-launcher</module>
+ <module>taverna-app-configuration-api</module>
+ <module>taverna-app-configuration-impl</module>
+ <module>taverna-configuration-api</module>
+ <module>taverna-configuration-impl</module>
+ <module>taverna-download-api</module>
+ <module>taverna-download-impl</module>
+ <module>taverna-plugin-api</module>
+ <module>taverna-plugin-impl</module>
+ <module>taverna-update-api</module>
+ <module>taverna-update-impl</module>
+ <module>taverna-osgi-schemas</module>
+ </modules>
+ <repositories>
+ <repository>
+ <id>taverna-incubating</id>
+ <name>Apache Taverna incubating Repository</name>
+ <url>http://repository.mygrid.org.uk/artifactory/incubator-snapshot-local/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots />
+ </repository>
+ </repositories>
+</project>
[24/50] [abbrv] incubator-taverna-osgi git commit: Added
mygrid-snapshot-repository
Posted by st...@apache.org.
Added mygrid-snapshot-repository
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/07ea44d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/07ea44d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/07ea44d0
Branch: refs/heads/master
Commit: 07ea44d0f46231ac32a94ad49ce69239d545be31
Parents: 897484e
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Fri Sep 26 16:58:55 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Fri Sep 26 16:58:55 2014 +0100
----------------------------------------------------------------------
pom.xml | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/07ea44d0/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0600940..0868c28 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,5 +24,14 @@
<name>myGrid Repository</name>
<url>http://www.mygrid.org.uk/maven/repository</url>
</repository>
+ <repository>
+ <id>mygrid-snapshot-repository</id>
+ <name>myGrid Snapshot Repository</name>
+ <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots />
+ </repository>
</repositories>
</project>
\ No newline at end of file
[29/50] [abbrv] incubator-taverna-osgi git commit:
taverna3-osgi-launher as taverna-osgi/
Posted by st...@apache.org.
taverna3-osgi-launher as taverna-osgi/
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/b04134c8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/b04134c8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/b04134c8
Branch: refs/heads/master
Commit: b04134c824858f41e1f58e45499d1fd4f002ff35
Parents: 07ea44d
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu Dec 18 22:20:14 2014 -0600
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu Dec 18 22:20:14 2014 -0600
----------------------------------------------------------------------
.gitignore | 24 -
.project | 23 -
.travis.yml | 1 -
README.md | 3 -
pom.xml | 37 --
.../java/uk/org/taverna/osgi/OsgiLauncher.java | 434 -------------------
taverna-osgi/pom.xml | 37 ++
.../java/uk/org/taverna/osgi/OsgiLauncher.java | 434 +++++++++++++++++++
8 files changed, 471 insertions(+), 522 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b04134c8/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index ebe0e5b..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,24 +0,0 @@
-# ignore project files #
-.classpath
-.project
-.settings/
-catalog-v001.xml
-
-# ignore target files #
-target/
-bin/
-build/
-dist/
-apidoc/
-*.swp
-
-# ignore svn files if there
-.svn
-
-# ignore log files #
-*.log
-/logs/*
-*/logs/*
-
-
-
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b04134c8/.project
----------------------------------------------------------------------
diff --git a/.project b/.project
deleted file mode 100644
index a7d3468..0000000
--- a/.project
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>osgi-launcher</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b04134c8/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index dff5f3a..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1 +0,0 @@
-language: java
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b04134c8/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
deleted file mode 100644
index f93284f..0000000
--- a/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-OSGi Framework Launcher
-
-This code was previously hosted at http://taverna.googlecode.com/svn/osgi-launcher/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b04134c8/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 0868c28..0000000
--- a/pom.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>net.sf.taverna</groupId>
- <artifactId>taverna-parent</artifactId>
- <version>3.0.1-SNAPSHOT</version>
- </parent>
- <groupId>uk.org.taverna.osgi</groupId>
- <artifactId>osgi-launcher</artifactId>
- <version>0.1.1-SNAPSHOT</version>
- <name>OSGi Framework Launcher</name>
- <description>Launches an OSGi framework and handles loading and starting of OSGi bundles and Spring DM managed services</description>
- <dependencies>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>${osgi.core.version}</version>
- </dependency>
- </dependencies>
- <repositories>
- <repository>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository</url>
- </repository>
- <repository>
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- </repository>
- </repositories>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b04134c8/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java
----------------------------------------------------------------------
diff --git a/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java b/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java
deleted file mode 100644
index cfd006b..0000000
--- a/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2012 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package uk.org.taverna.osgi;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.ServiceLoader;
-import java.util.Set;
-import java.util.logging.Logger;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceListener;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.launch.Framework;
-import org.osgi.framework.launch.FrameworkFactory;
-
-/**
- * OSGi Framework launcher.
- *
- * Handles loading and starting of OSGi bundles and Spring DM managed services.
- *
- * An implementation of an OSGi Service Platform Release 4.1 (or higher) must be available on the
- * classpath.
- *
- * @author David Withers
- */
-public class OsgiLauncher {
-
- /**
- * Default boot delegation packages.
- */
- public static final String DEFAULT_BOOT_DELEGATION_PACKAGES = "sun.*,com.sun.*,java.*";
-
- /**
- * Default system packages.
- */
- public static final String DEFAULT_SYSTEM_PACKAGES = "com.sun.org.apache.xml.internal.utils";
-
- /**
- * Default time to wait for services to start up.
- */
- private static final long serviceLoadTimeoutSeconds = 30;
-
- private static final Logger logger = Logger.getLogger(OsgiLauncher.class.getName());
-
- private Framework framework;
- private BundleContext context;
-
- private Map<String, String> frameworkConfiguration = new HashMap<String, String>();
- private List<URI> bundlesToInstall = new ArrayList<URI>();
- private List<Bundle> installedBundles = new ArrayList<Bundle>();
- private Set<String> startedSpringContexts = new HashSet<String>();
- private Bundle springOsgiExtender;
-
- private OsgiLauncher(File storageDirectory) {
- setStorageDirectory(storageDirectory);
- setCleanStorageDirectory(true);
- setBootDelegationPackages(DEFAULT_BOOT_DELEGATION_PACKAGES);
- setSystemPackages(DEFAULT_SYSTEM_PACKAGES);
- }
-
- /**
- * Constructs an <code>OsgiLauncher</code> that loads bundles from a directory.
- *
- * Any file in the specified directory with a .jar extension will be loaded when the framework
- * is started.
- *
- * @param storageDirectory
- * persistent storage area used by the framework
- * @param storageDirectory
- * the directory containing bundles to load
- */
- public OsgiLauncher(File storageDirectory, File bundleDirectory) {
- this(storageDirectory);
- List<File> jars = Arrays.asList(bundleDirectory.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.endsWith(".jar");
- }
- }));
- for (File jar : jars) {
- bundlesToInstall.add(jar.toURI());
- }
- }
-
- /**
- * Constructs an <code>OsgiLauncher</code> that loads the specified bundles.
- *
- * @param storageDirectory
- * persistent storage area used by the framework
- * @param bundleURIs
- * bundles to load
- */
- public OsgiLauncher(File storageDirectory, List<URI> bundleURIs) {
- this(storageDirectory);
- for (URI bundleURI : bundleURIs) {
- bundlesToInstall.add(bundleURI);
- }
- }
-
- /**
- * Starts the OSGi framework, installs and starts the bundles.
- *
- * @throws BundleException
- * if the framework could not be started
- */
- public void start() throws BundleException {
- logger.info("Loading the OSGi Framework Factory");
- FrameworkFactory frameworkFactory = ServiceLoader.load(FrameworkFactory.class).iterator()
- .next();
-
- logger.info("Creating the OSGi Framework");
- framework = frameworkFactory.newFramework(frameworkConfiguration);
- logger.info("Starting the OSGi Framework");
- framework.start();
-
- context = framework.getBundleContext();
- context.addServiceListener(new ServiceListener() {
- public void serviceChanged(ServiceEvent event) {
- ServiceReference serviceReference = event.getServiceReference();
- if (event.getType() == ServiceEvent.REGISTERED) {
- Object property = serviceReference
- .getProperty("org.springframework.context.service.name");
- if (property != null) {
- addStartedSpringContext(property.toString());
- }
- }
- logger.fine((event.getType() == ServiceEvent.REGISTERED ? "Registering : "
- : "Unregistering : ") + serviceReference);
- }
- });
-
- installedBundles = installBundles(bundlesToInstall);
-
- List<Bundle> bundlesToStart = new ArrayList<Bundle>();
- for (Bundle bundle : installedBundles) {
- if ("org.springframework.osgi.extender".equals(bundle.getSymbolicName())) {
- springOsgiExtender = bundle;
- } else {
- bundlesToStart.add(bundle);
- }
- }
- startBundles(bundlesToStart);
- }
-
- /**
- * Starts SpringDM managed services.
- *
- * @param waitForServices
- * if true waits for services to start before returning
- * @throws BundleException
- * if the framework has not been started or a service could not be started
- */
- public void startServices(boolean waitForServices) throws BundleException {
- if (framework == null || framework.getState() != Bundle.ACTIVE) {
- throw new BundleException("Framework not started");
- }
- if (springOsgiExtender != null) {
- logger.info("Starting Spring OSGi Extender");
- springOsgiExtender.start();
- if (waitForServices) {
- logger.info("Waiting for spring contexts to be started");
- for (Bundle bundle : installedBundles) {
- if (bundle.getState() == Bundle.ACTIVE) {
- if (hasSpringContext(bundle)) {
- logger.fine("Waiting for " + bundle.getSymbolicName());
- waitForSpringContext(context, bundle.getSymbolicName(), serviceLoadTimeoutSeconds);
- }
- }
- }
- }
- }
- }
-
- /**
- * Stops the OSGI framework.
- *
- * @throws BundleException
- * if the framework has not been started
- * @throws InterruptedException
- * if the thread is interrupted while the framework is stopping
- */
- public void stop() throws BundleException, InterruptedException {
- if (framework == null || framework.getState() != Bundle.ACTIVE) {
- throw new BundleException("Framework not started");
- }
- framework.stop();
- framework.waitForStop(0);
- context = null;
- }
-
- /**
- * Installs the bundles specified by the URIs into the framework.
- *
- * @param bundlesURIs
- * the URIs of the bundles to install
- * @return the installed bundles
- * @throws BundleException
- * if a bundle could not be installed
- */
- public List<Bundle> installBundles(List<URI> bundlesURIs) throws BundleException {
- List<Bundle> installedBundles = new ArrayList<Bundle>();
- logger.info("Installing bundles into the OSGi Framework");
- for (URI bundleURI : bundlesURIs) {
- installedBundles.add(installBundle(bundleURI));
- }
- return installedBundles;
- }
-
- /**
- * Installs the bundle specified by the URI into the framework.
- *
- * @param bundleURI
- * the URI of the bundle to install
- * @return the installed bundle
- * @throws BundleException
- * if the bundle could not be installed
- */
- public Bundle installBundle(URI bundleURI) throws BundleException {
- logger.fine("Installing bundle " + bundleURI);
- return context.installBundle(bundleURI.toASCIIString());
- }
-
- /**
- * Starts the bundles.
- *
- * If a bundle is a fragment bundle that bundle is not started.
- *
- * @param bundles
- * the bundles to start
- * @throws BundleException
- * if a bundle could not be started
- */
- public void startBundles(List<Bundle> bundles) throws BundleException {
- logger.info("Starting bundles in the OSGi Framework");
- for (Bundle bundle : bundles) {
- startBundle(bundle);
- }
- }
-
- /**
- * Starts the bundle.
- *
- * If the bundle is a fragment bundle the bundle is not started.
- *
- * @param bundle
- * the bundle to start
- * @throws BundleException
- * if the bundle could not be started
- */
- public void startBundle(Bundle bundle) throws BundleException {
- if (bundle.getHeaders().get(Constants.FRAGMENT_HOST) == null) {
- logger.fine("Starting bundle " + bundle);
- bundle.start();
- }
- }
-
- /**
- * Returns the context. Returns <code>null</code> if the framework is not started.
- *
- * @return the context
- */
- public BundleContext getContext() {
- return context;
- }
-
- /**
- * Sets the configuration to use when creating the OSGi framework.
- *
- * @param frameworkConfiguration the configuration to use when creating the OSGi framework
- */
- public void setFrameworkConfiguration(Map<String, String> frameworkConfiguration) {
- this.frameworkConfiguration = frameworkConfiguration;
- }
-
- /**
- * Adds boot delegation packages.
- *
- * Multiple packages must be separated by a ','.
- *
- * @param additionalBootDelegationPackages
- * boot delegation packages to add
- */
- public void addBootDelegationPackages(String additionalBootDelegationPackages) {
- String bootDelegationPackages = frameworkConfiguration
- .get(Constants.FRAMEWORK_BOOTDELEGATION);
- if (bootDelegationPackages == null || bootDelegationPackages.isEmpty()) {
- bootDelegationPackages = additionalBootDelegationPackages;
- } else {
- bootDelegationPackages = bootDelegationPackages + ","
- + additionalBootDelegationPackages;
- }
- frameworkConfiguration.put(Constants.FRAMEWORK_BOOTDELEGATION, bootDelegationPackages);
- }
-
- /**
- * Sets the boot delegation packages.
- *
- * Multiple packages must be separated by a ','.
- *
- * @param bootDelegationPackages
- * the boot delegation packages
- */
- public void setBootDelegationPackages(String bootDelegationPackages) {
- frameworkConfiguration.put(Constants.FRAMEWORK_BOOTDELEGATION, bootDelegationPackages);
- }
-
- /**
- * Adds system packages.
- *
- * Multiple packages must be separated by a ','.
- *
- * @param additionalSystemPackages
- * system packages to add
- */
- public void addSystemPackages(String additionalSystemPackages) {
- String systemPackages = frameworkConfiguration
- .get(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA);
- if (systemPackages == null || systemPackages.isEmpty()) {
- systemPackages = additionalSystemPackages;
- } else {
- systemPackages = systemPackages + "," + additionalSystemPackages;
- }
- frameworkConfiguration.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, systemPackages);
- }
-
- /**
- * Sets the system packages.
- *
- * Multiple packages must be separated by a ','.
- *
- * @param systemPackages
- * the system packages
- */
- public void setSystemPackages(String systemPackages) {
- frameworkConfiguration.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, systemPackages);
- }
-
- /**
- * Sets the persistent storage area used by the framework.
- *
- * @param storageDirectory the persistent storage area used by the framework
- */
- public void setStorageDirectory(File storageDirectory) {
- frameworkConfiguration.put(Constants.FRAMEWORK_STORAGE, storageDirectory.getAbsolutePath());
- }
-
- /**
- * Set whether the storage directory should be cleaned on startup.
- *
- * @param cleanStorageDirectory
- * whether the storage directory should be cleaned on startup
- */
- public void setCleanStorageDirectory(boolean cleanStorageDirectory) {
- if (cleanStorageDirectory) {
- frameworkConfiguration.put(Constants.FRAMEWORK_STORAGE_CLEAN,
- Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);
- } else {
- frameworkConfiguration.remove(Constants.FRAMEWORK_STORAGE_CLEAN);
- }
- }
-
- /**
- * Returns true if a bundle contains spring context files.
- *
- * @param bundle
- * the bundle to check
- * @return true if a bundle contains spring context files
- */
- private boolean hasSpringContext(Bundle bundle) {
- String springFilesLocation = "META-INF/spring";
- // check for custom spring files location
- @SuppressWarnings("rawtypes")
- Dictionary headers = bundle.getHeaders();
- if (headers != null) {
- Object header = headers.get("Spring-Context");
- if (header != null) {
- springFilesLocation = header.toString().trim();
- }
- }
- @SuppressWarnings("rawtypes")
- Enumeration springFiles = bundle.findEntries(springFilesLocation, "*.xml", false);
- return springFiles != null && springFiles.hasMoreElements();
- }
-
- private synchronized void waitForSpringContext(BundleContext context, String springContext,
- long timeoutSeconds) {
- long timeLeftToWait = timeoutSeconds * 1000;
- long startTime = System.currentTimeMillis();
-
- while (!startedSpringContexts.contains(springContext) && timeLeftToWait > 0) {
- try {
- wait(timeLeftToWait);
- } catch (InterruptedException e) {}
- timeLeftToWait = timeLeftToWait - (System.currentTimeMillis() - startTime);
- }
- }
-
- private synchronized void addStartedSpringContext(String springContext) {
- startedSpringContexts.add(springContext);
- notifyAll();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b04134c8/taverna-osgi/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-osgi/pom.xml b/taverna-osgi/pom.xml
new file mode 100644
index 0000000..0868c28
--- /dev/null
+++ b/taverna-osgi/pom.xml
@@ -0,0 +1,37 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>net.sf.taverna</groupId>
+ <artifactId>taverna-parent</artifactId>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>uk.org.taverna.osgi</groupId>
+ <artifactId>osgi-launcher</artifactId>
+ <version>0.1.1-SNAPSHOT</version>
+ <name>OSGi Framework Launcher</name>
+ <description>Launches an OSGi framework and handles loading and starting of OSGi bundles and Spring DM managed services</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>${osgi.core.version}</version>
+ </dependency>
+ </dependencies>
+ <repositories>
+ <repository>
+ <id>mygrid-repository</id>
+ <name>myGrid Repository</name>
+ <url>http://www.mygrid.org.uk/maven/repository</url>
+ </repository>
+ <repository>
+ <id>mygrid-snapshot-repository</id>
+ <name>myGrid Snapshot Repository</name>
+ <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots />
+ </repository>
+ </repositories>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/b04134c8/taverna-osgi/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java
----------------------------------------------------------------------
diff --git a/taverna-osgi/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java b/taverna-osgi/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java
new file mode 100644
index 0000000..cfd006b
--- /dev/null
+++ b/taverna-osgi/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java
@@ -0,0 +1,434 @@
+/*******************************************************************************
+ * Copyright (C) 2012 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.osgi;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.ServiceLoader;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
+
+/**
+ * OSGi Framework launcher.
+ *
+ * Handles loading and starting of OSGi bundles and Spring DM managed services.
+ *
+ * An implementation of an OSGi Service Platform Release 4.1 (or higher) must be available on the
+ * classpath.
+ *
+ * @author David Withers
+ */
+public class OsgiLauncher {
+
+ /**
+ * Default boot delegation packages.
+ */
+ public static final String DEFAULT_BOOT_DELEGATION_PACKAGES = "sun.*,com.sun.*,java.*";
+
+ /**
+ * Default system packages.
+ */
+ public static final String DEFAULT_SYSTEM_PACKAGES = "com.sun.org.apache.xml.internal.utils";
+
+ /**
+ * Default time to wait for services to start up.
+ */
+ private static final long serviceLoadTimeoutSeconds = 30;
+
+ private static final Logger logger = Logger.getLogger(OsgiLauncher.class.getName());
+
+ private Framework framework;
+ private BundleContext context;
+
+ private Map<String, String> frameworkConfiguration = new HashMap<String, String>();
+ private List<URI> bundlesToInstall = new ArrayList<URI>();
+ private List<Bundle> installedBundles = new ArrayList<Bundle>();
+ private Set<String> startedSpringContexts = new HashSet<String>();
+ private Bundle springOsgiExtender;
+
+ private OsgiLauncher(File storageDirectory) {
+ setStorageDirectory(storageDirectory);
+ setCleanStorageDirectory(true);
+ setBootDelegationPackages(DEFAULT_BOOT_DELEGATION_PACKAGES);
+ setSystemPackages(DEFAULT_SYSTEM_PACKAGES);
+ }
+
+ /**
+ * Constructs an <code>OsgiLauncher</code> that loads bundles from a directory.
+ *
+ * Any file in the specified directory with a .jar extension will be loaded when the framework
+ * is started.
+ *
+ * @param storageDirectory
+ * persistent storage area used by the framework
+ * @param storageDirectory
+ * the directory containing bundles to load
+ */
+ public OsgiLauncher(File storageDirectory, File bundleDirectory) {
+ this(storageDirectory);
+ List<File> jars = Arrays.asList(bundleDirectory.listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".jar");
+ }
+ }));
+ for (File jar : jars) {
+ bundlesToInstall.add(jar.toURI());
+ }
+ }
+
+ /**
+ * Constructs an <code>OsgiLauncher</code> that loads the specified bundles.
+ *
+ * @param storageDirectory
+ * persistent storage area used by the framework
+ * @param bundleURIs
+ * bundles to load
+ */
+ public OsgiLauncher(File storageDirectory, List<URI> bundleURIs) {
+ this(storageDirectory);
+ for (URI bundleURI : bundleURIs) {
+ bundlesToInstall.add(bundleURI);
+ }
+ }
+
+ /**
+ * Starts the OSGi framework, installs and starts the bundles.
+ *
+ * @throws BundleException
+ * if the framework could not be started
+ */
+ public void start() throws BundleException {
+ logger.info("Loading the OSGi Framework Factory");
+ FrameworkFactory frameworkFactory = ServiceLoader.load(FrameworkFactory.class).iterator()
+ .next();
+
+ logger.info("Creating the OSGi Framework");
+ framework = frameworkFactory.newFramework(frameworkConfiguration);
+ logger.info("Starting the OSGi Framework");
+ framework.start();
+
+ context = framework.getBundleContext();
+ context.addServiceListener(new ServiceListener() {
+ public void serviceChanged(ServiceEvent event) {
+ ServiceReference serviceReference = event.getServiceReference();
+ if (event.getType() == ServiceEvent.REGISTERED) {
+ Object property = serviceReference
+ .getProperty("org.springframework.context.service.name");
+ if (property != null) {
+ addStartedSpringContext(property.toString());
+ }
+ }
+ logger.fine((event.getType() == ServiceEvent.REGISTERED ? "Registering : "
+ : "Unregistering : ") + serviceReference);
+ }
+ });
+
+ installedBundles = installBundles(bundlesToInstall);
+
+ List<Bundle> bundlesToStart = new ArrayList<Bundle>();
+ for (Bundle bundle : installedBundles) {
+ if ("org.springframework.osgi.extender".equals(bundle.getSymbolicName())) {
+ springOsgiExtender = bundle;
+ } else {
+ bundlesToStart.add(bundle);
+ }
+ }
+ startBundles(bundlesToStart);
+ }
+
+ /**
+ * Starts SpringDM managed services.
+ *
+ * @param waitForServices
+ * if true waits for services to start before returning
+ * @throws BundleException
+ * if the framework has not been started or a service could not be started
+ */
+ public void startServices(boolean waitForServices) throws BundleException {
+ if (framework == null || framework.getState() != Bundle.ACTIVE) {
+ throw new BundleException("Framework not started");
+ }
+ if (springOsgiExtender != null) {
+ logger.info("Starting Spring OSGi Extender");
+ springOsgiExtender.start();
+ if (waitForServices) {
+ logger.info("Waiting for spring contexts to be started");
+ for (Bundle bundle : installedBundles) {
+ if (bundle.getState() == Bundle.ACTIVE) {
+ if (hasSpringContext(bundle)) {
+ logger.fine("Waiting for " + bundle.getSymbolicName());
+ waitForSpringContext(context, bundle.getSymbolicName(), serviceLoadTimeoutSeconds);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Stops the OSGI framework.
+ *
+ * @throws BundleException
+ * if the framework has not been started
+ * @throws InterruptedException
+ * if the thread is interrupted while the framework is stopping
+ */
+ public void stop() throws BundleException, InterruptedException {
+ if (framework == null || framework.getState() != Bundle.ACTIVE) {
+ throw new BundleException("Framework not started");
+ }
+ framework.stop();
+ framework.waitForStop(0);
+ context = null;
+ }
+
+ /**
+ * Installs the bundles specified by the URIs into the framework.
+ *
+ * @param bundlesURIs
+ * the URIs of the bundles to install
+ * @return the installed bundles
+ * @throws BundleException
+ * if a bundle could not be installed
+ */
+ public List<Bundle> installBundles(List<URI> bundlesURIs) throws BundleException {
+ List<Bundle> installedBundles = new ArrayList<Bundle>();
+ logger.info("Installing bundles into the OSGi Framework");
+ for (URI bundleURI : bundlesURIs) {
+ installedBundles.add(installBundle(bundleURI));
+ }
+ return installedBundles;
+ }
+
+ /**
+ * Installs the bundle specified by the URI into the framework.
+ *
+ * @param bundleURI
+ * the URI of the bundle to install
+ * @return the installed bundle
+ * @throws BundleException
+ * if the bundle could not be installed
+ */
+ public Bundle installBundle(URI bundleURI) throws BundleException {
+ logger.fine("Installing bundle " + bundleURI);
+ return context.installBundle(bundleURI.toASCIIString());
+ }
+
+ /**
+ * Starts the bundles.
+ *
+ * If a bundle is a fragment bundle that bundle is not started.
+ *
+ * @param bundles
+ * the bundles to start
+ * @throws BundleException
+ * if a bundle could not be started
+ */
+ public void startBundles(List<Bundle> bundles) throws BundleException {
+ logger.info("Starting bundles in the OSGi Framework");
+ for (Bundle bundle : bundles) {
+ startBundle(bundle);
+ }
+ }
+
+ /**
+ * Starts the bundle.
+ *
+ * If the bundle is a fragment bundle the bundle is not started.
+ *
+ * @param bundle
+ * the bundle to start
+ * @throws BundleException
+ * if the bundle could not be started
+ */
+ public void startBundle(Bundle bundle) throws BundleException {
+ if (bundle.getHeaders().get(Constants.FRAGMENT_HOST) == null) {
+ logger.fine("Starting bundle " + bundle);
+ bundle.start();
+ }
+ }
+
+ /**
+ * Returns the context. Returns <code>null</code> if the framework is not started.
+ *
+ * @return the context
+ */
+ public BundleContext getContext() {
+ return context;
+ }
+
+ /**
+ * Sets the configuration to use when creating the OSGi framework.
+ *
+ * @param frameworkConfiguration the configuration to use when creating the OSGi framework
+ */
+ public void setFrameworkConfiguration(Map<String, String> frameworkConfiguration) {
+ this.frameworkConfiguration = frameworkConfiguration;
+ }
+
+ /**
+ * Adds boot delegation packages.
+ *
+ * Multiple packages must be separated by a ','.
+ *
+ * @param additionalBootDelegationPackages
+ * boot delegation packages to add
+ */
+ public void addBootDelegationPackages(String additionalBootDelegationPackages) {
+ String bootDelegationPackages = frameworkConfiguration
+ .get(Constants.FRAMEWORK_BOOTDELEGATION);
+ if (bootDelegationPackages == null || bootDelegationPackages.isEmpty()) {
+ bootDelegationPackages = additionalBootDelegationPackages;
+ } else {
+ bootDelegationPackages = bootDelegationPackages + ","
+ + additionalBootDelegationPackages;
+ }
+ frameworkConfiguration.put(Constants.FRAMEWORK_BOOTDELEGATION, bootDelegationPackages);
+ }
+
+ /**
+ * Sets the boot delegation packages.
+ *
+ * Multiple packages must be separated by a ','.
+ *
+ * @param bootDelegationPackages
+ * the boot delegation packages
+ */
+ public void setBootDelegationPackages(String bootDelegationPackages) {
+ frameworkConfiguration.put(Constants.FRAMEWORK_BOOTDELEGATION, bootDelegationPackages);
+ }
+
+ /**
+ * Adds system packages.
+ *
+ * Multiple packages must be separated by a ','.
+ *
+ * @param additionalSystemPackages
+ * system packages to add
+ */
+ public void addSystemPackages(String additionalSystemPackages) {
+ String systemPackages = frameworkConfiguration
+ .get(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA);
+ if (systemPackages == null || systemPackages.isEmpty()) {
+ systemPackages = additionalSystemPackages;
+ } else {
+ systemPackages = systemPackages + "," + additionalSystemPackages;
+ }
+ frameworkConfiguration.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, systemPackages);
+ }
+
+ /**
+ * Sets the system packages.
+ *
+ * Multiple packages must be separated by a ','.
+ *
+ * @param systemPackages
+ * the system packages
+ */
+ public void setSystemPackages(String systemPackages) {
+ frameworkConfiguration.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, systemPackages);
+ }
+
+ /**
+ * Sets the persistent storage area used by the framework.
+ *
+ * @param storageDirectory the persistent storage area used by the framework
+ */
+ public void setStorageDirectory(File storageDirectory) {
+ frameworkConfiguration.put(Constants.FRAMEWORK_STORAGE, storageDirectory.getAbsolutePath());
+ }
+
+ /**
+ * Set whether the storage directory should be cleaned on startup.
+ *
+ * @param cleanStorageDirectory
+ * whether the storage directory should be cleaned on startup
+ */
+ public void setCleanStorageDirectory(boolean cleanStorageDirectory) {
+ if (cleanStorageDirectory) {
+ frameworkConfiguration.put(Constants.FRAMEWORK_STORAGE_CLEAN,
+ Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);
+ } else {
+ frameworkConfiguration.remove(Constants.FRAMEWORK_STORAGE_CLEAN);
+ }
+ }
+
+ /**
+ * Returns true if a bundle contains spring context files.
+ *
+ * @param bundle
+ * the bundle to check
+ * @return true if a bundle contains spring context files
+ */
+ private boolean hasSpringContext(Bundle bundle) {
+ String springFilesLocation = "META-INF/spring";
+ // check for custom spring files location
+ @SuppressWarnings("rawtypes")
+ Dictionary headers = bundle.getHeaders();
+ if (headers != null) {
+ Object header = headers.get("Spring-Context");
+ if (header != null) {
+ springFilesLocation = header.toString().trim();
+ }
+ }
+ @SuppressWarnings("rawtypes")
+ Enumeration springFiles = bundle.findEntries(springFilesLocation, "*.xml", false);
+ return springFiles != null && springFiles.hasMoreElements();
+ }
+
+ private synchronized void waitForSpringContext(BundleContext context, String springContext,
+ long timeoutSeconds) {
+ long timeLeftToWait = timeoutSeconds * 1000;
+ long startTime = System.currentTimeMillis();
+
+ while (!startedSpringContexts.contains(springContext) && timeLeftToWait > 0) {
+ try {
+ wait(timeLeftToWait);
+ } catch (InterruptedException e) {}
+ timeLeftToWait = timeLeftToWait - (System.currentTimeMillis() - startTime);
+ }
+ }
+
+ private synchronized void addStartedSpringContext(String springContext) {
+ startedSpringContexts.add(springContext);
+ notifyAll();
+ }
+
+}
[44/50] [abbrv] incubator-taverna-osgi git commit: Use
org.apache.taverna.osgi
Posted by st...@apache.org.
Use org.apache.taverna.osgi
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/42fd0e4d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/42fd0e4d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/42fd0e4d
Branch: refs/heads/master
Commit: 42fd0e4d59ad565539854d179a0649970e2546b1
Parents: 752bff1
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Dec 28 02:46:55 2014 -0600
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Dec 28 02:46:55 2014 -0600
----------------------------------------------------------------------
taverna-maven-plugin/pom.xml | 37 +++++++------------------------------
1 file changed, 7 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/42fd0e4d/taverna-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/pom.xml b/taverna-maven-plugin/pom.xml
index 74d3ed5..cf7c17c 100644
--- a/taverna-maven-plugin/pom.xml
+++ b/taverna-maven-plugin/pom.xml
@@ -2,18 +2,16 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>parent</artifactId>
- <groupId>net.sf.taverna</groupId>
- <version>0.2.2011-02-17</version>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-osgi</artifactId>
+ <version>0.2.0-incubating-SNAPSHOT</version>
</parent>
<prerequisites>
<maven>3.2.0</maven>
</prerequisites>
- <groupId>net.sf.taverna.t2.maven.plugins</groupId>
<artifactId>taverna-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
- <version>0.3.1-SNAPSHOT</version>
- <name>Maven Taverna Plugin</name>
+ <name>Apache Taverna Maven Plugin</name>
<description>A Maven plugin for packaging and deploying Taverna plugins</description>
<properties>
<maven.version>3.2.3</maven.version>
@@ -68,9 +66,9 @@
<version>0.2.0</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.commons</groupId>
- <artifactId>taverna-xml-schemas</artifactId>
- <version>0.1.0-SNAPSHOT</version>
+ <groupId>${project.parent.groupId}</groupId>
+ <artifactId>taverna-osgi-schemas</artifactId>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
@@ -103,25 +101,4 @@
<scope>test</scope>
</dependency>
</dependencies>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
</project>
[17/50] [abbrv] incubator-taverna-osgi git commit: removed hardcode
version numbers for T3-1195
Posted by st...@apache.org.
removed hardcode version numbers for T3-1195
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/803dd742
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/803dd742
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/803dd742
Branch: refs/heads/master
Commit: 803dd74253e30bcad6dd107ca6259a377bc0f546
Parents: 25425c8
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Thu Jun 19 13:33:50 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Thu Jun 19 13:33:50 2014 +0100
----------------------------------------------------------------------
taverna-app-configuration-api/pom.xml | 2 +-
taverna-app-configuration-impl/pom.xml | 2 +-
taverna-configuration-api/pom.xml | 2 +-
taverna-configuration-impl/pom.xml | 4 ++--
taverna-download-impl/pom.xml | 2 +-
taverna-plugin-api/pom.xml | 6 +++---
taverna-plugin-impl/pom.xml | 14 +++++++-------
taverna-update-impl/pom.xml | 12 ++++++------
8 files changed, 22 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/803dd742/taverna-app-configuration-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-api/pom.xml b/taverna-app-configuration-api/pom.xml
index 5271a5c..d5a2dab 100644
--- a/taverna-app-configuration-api/pom.xml
+++ b/taverna-app-configuration-api/pom.xml
@@ -14,7 +14,7 @@
<dependency>
<groupId>uk.org.taverna.commons</groupId>
<artifactId>taverna-xml-schemas</artifactId>
- <version>0.1.0-SNAPSHOT</version>
+ <version>${taverna.commons.version}</version>
</dependency>
</dependencies>
<repositories>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/803dd742/taverna-app-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/pom.xml b/taverna-app-configuration-impl/pom.xml
index 70b1c39..1f87b07 100644
--- a/taverna-app-configuration-impl/pom.xml
+++ b/taverna-app-configuration-impl/pom.xml
@@ -33,7 +33,7 @@
<dependency>
<groupId>uk.org.taverna.commons</groupId>
<artifactId>taverna-xml-schemas</artifactId>
- <version>0.1.0-SNAPSHOT</version>
+ <version>${taverna.commons.version}</version>
</dependency>
<dependency>
<groupId>org.apache.log4j</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/803dd742/taverna-configuration-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/pom.xml b/taverna-configuration-api/pom.xml
index 217d7c8..29898c1 100644
--- a/taverna-configuration-api/pom.xml
+++ b/taverna-configuration-api/pom.xml
@@ -15,7 +15,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>com.springsource.org.apache.commons.csv</artifactId>
- <version>1.0.0.BUILD-20080106</version>
+ <version>${apache.commons.csv.version}</version>
</dependency>
<dependency>
<groupId>org.apache.log4j</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/803dd742/taverna-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/pom.xml b/taverna-configuration-impl/pom.xml
index a2357be..593e789 100644
--- a/taverna-configuration-impl/pom.xml
+++ b/taverna-configuration-impl/pom.xml
@@ -40,13 +40,13 @@
<dependency>
<groupId>uk.org.taverna.commons</groupId>
<artifactId>taverna-xml-schemas</artifactId>
- <version>0.1.0-SNAPSHOT</version>
+ <version>${taverna.commons.version}</version>
</dependency>
<dependency>
<groupId>net.sf.taverna</groupId>
<artifactId>wsdl-generic</artifactId>
- <version>1.10.0</version>
+ <version>${wsdl.generic.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/803dd742/taverna-download-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-download-impl/pom.xml b/taverna-download-impl/pom.xml
index 225c923..1750271 100644
--- a/taverna-download-impl/pom.xml
+++ b/taverna-download-impl/pom.xml
@@ -27,7 +27,7 @@
<dependency>
<groupId>uk.org.taverna.commons</groupId>
<artifactId>taverna-download-api</artifactId>
- <version>0.1.0-SNAPSHOT</version>
+ <version>${taverna.commons.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/803dd742/taverna-plugin-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/pom.xml b/taverna-plugin-api/pom.xml
index 0724b99..a980840 100644
--- a/taverna-plugin-api/pom.xml
+++ b/taverna-plugin-api/pom.xml
@@ -14,17 +14,17 @@
<dependency>
<groupId>uk.org.taverna.configuration</groupId>
<artifactId>taverna-app-configuration-api</artifactId>
- <version>0.1.1-SNAPSHOT</version>
+ <version>${taverna.configuration.version}</version>
</dependency>
<dependency>
<groupId>uk.org.taverna.commons</groupId>
<artifactId>taverna-xml-schemas</artifactId>
- <version>0.1.0-SNAPSHOT</version>
+ <version>${taverna.commons.version}</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
- <version>4.3.1</version>
+ <version>${osgi.core.version}</version>
</dependency>
</dependencies>
<repositories>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/803dd742/taverna-plugin-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/pom.xml b/taverna-plugin-impl/pom.xml
index 56aaba4..8ffd4fa 100644
--- a/taverna-plugin-impl/pom.xml
+++ b/taverna-plugin-impl/pom.xml
@@ -27,22 +27,22 @@
<dependency>
<groupId>uk.org.taverna.commons</groupId>
<artifactId>taverna-plugin-api</artifactId>
- <version>0.1.0-SNAPSHOT</version>
+ <version>${taverna.commons.version}</version>
</dependency>
<dependency>
<groupId>uk.org.taverna.commons</groupId>
<artifactId>taverna-download-api</artifactId>
- <version>0.1.0-SNAPSHOT</version>
+ <version>${taverna.commons.version}</version>
</dependency>
<dependency>
<groupId>uk.org.taverna.commons</groupId>
<artifactId>taverna-xml-schemas</artifactId>
- <version>0.1.0-SNAPSHOT</version>
+ <version>${taverna.commons.version}</version>
</dependency>
<dependency>
<groupId>uk.org.taverna.configuration</groupId>
<artifactId>taverna-app-configuration-api</artifactId>
- <version>0.1.1-SNAPSHOT</version>
+ <version>${taverna.configuration.version}</version>
</dependency>
<dependency>
@@ -53,12 +53,12 @@
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
- <version>4.3.1</version>
+ <version>${osgi.core.version}</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
- <version>4.3.1</version>
+ <version>${osgi.core.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
@@ -75,7 +75,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
- <version>1.9.5</version>
+ <version>${mockito.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/803dd742/taverna-update-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-update-impl/pom.xml b/taverna-update-impl/pom.xml
index bb253fe..430bf13 100644
--- a/taverna-update-impl/pom.xml
+++ b/taverna-update-impl/pom.xml
@@ -27,22 +27,22 @@
<dependency>
<groupId>uk.org.taverna.commons</groupId>
<artifactId>taverna-update-api</artifactId>
- <version>0.1.0-SNAPSHOT</version>
+ <version>${taverna.commons.version}</version>
</dependency>
<dependency>
<groupId>uk.org.taverna.commons</groupId>
<artifactId>taverna-download-api</artifactId>
- <version>0.1.0-SNAPSHOT</version>
+ <version>${taverna.commons.version}</version>
</dependency>
<dependency>
<groupId>uk.org.taverna.commons</groupId>
<artifactId>taverna-xml-schemas</artifactId>
- <version>0.1.0-SNAPSHOT</version>
+ <version>${taverna.commons.version}</version>
</dependency>
<dependency>
<groupId>uk.org.taverna.configuration</groupId>
<artifactId>taverna-app-configuration-api</artifactId>
- <version>0.1.1-SNAPSHOT</version>
+ <version>${taverna.configuration.version}</version>
</dependency>
<dependency>
@@ -53,12 +53,12 @@
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
- <version>4.3.1</version>
+ <version>${osgi.core.version}</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
- <version>4.3.1</version>
+ <version>${osgi.core.version}</version>
</dependency>
</dependencies>
<repositories>
[43/50] [abbrv] incubator-taverna-osgi git commit: Add
taverna-maven-plugin
Posted by st...@apache.org.
Add taverna-maven-plugin
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/752bff10
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/752bff10
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/752bff10
Branch: refs/heads/master
Commit: 752bff10c5e294b33b6a1aa9566ff44d48b493cc
Parents: b8c5f92
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Dec 28 02:41:58 2014 -0600
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Dec 28 02:41:58 2014 -0600
----------------------------------------------------------------------
pom.xml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/752bff10/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b2e61fc..61a6f07 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,6 +25,7 @@
<module>taverna-configuration-impl</module>
<module>taverna-download-api</module>
<module>taverna-download-impl</module>
+ <module>taverna-maven-plugin</module>
<module>taverna-plugin-api</module>
<module>taverna-plugin-impl</module>
<module>taverna-update-api</module>
[16/50] [abbrv] incubator-taverna-osgi git commit: Merge branch
'master' of https://github.com/taverna/taverna3-commons.git
Posted by st...@apache.org.
Merge branch 'master' of https://github.com/taverna/taverna3-commons.git
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/25425c81
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/25425c81
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/25425c81
Branch: refs/heads/master
Commit: 25425c812c8648e79e67156103d8d9d75464d38a
Parents: 27a6457 40c7622
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Thu Jun 19 10:18:15 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Thu Jun 19 10:18:15 2014 +0100
----------------------------------------------------------------------
.travis.yml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
[50/50] [abbrv] incubator-taverna-osgi git commit: parent pom version
Posted by st...@apache.org.
parent pom version
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/e9d4f177
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/e9d4f177
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/e9d4f177
Branch: refs/heads/master
Commit: e9d4f177f560fa400dc61d7e1d989052bb899d86
Parents: fb4c336
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Thu Feb 5 10:12:34 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Thu Feb 5 10:12:34 2015 +0000
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/e9d4f177/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 61a6f07..32bd337 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.taverna</groupId>
<artifactId>taverna-parent</artifactId>
- <version>1-SNAPSHOT</version>
+ <version>1-incubating-SNAPSHOT</version>
</parent>
<groupId>org.apache.taverna.osgi</groupId>
<artifactId>taverna-osgi</artifactId>
[19/50] [abbrv] incubator-taverna-osgi git commit: Changed project
name to be similar to github name
Posted by st...@apache.org.
Changed project name to be similar to github name
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/2dbbead2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/2dbbead2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/2dbbead2
Branch: refs/heads/master
Commit: 2dbbead2bc31ae3005591ac26cd1e9865e6a8581
Parents: 76e4cca
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Mon Jun 30 11:13:29 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Mon Jun 30 11:13:29 2014 +0100
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/2dbbead2/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e7cfb1d..0528e7b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
<artifactId>taverna-commons</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
- <name>Taverna Commons</name>
+ <name>Taverna 3 Commons</name>
<description>Taverna modules that are common to multiple products</description>
<modules>
<module>taverna-configuration-api</module>
[21/50] [abbrv] incubator-taverna-osgi git commit: Removed dead code
Posted by st...@apache.org.
Removed dead code
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/d8ab2401
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/d8ab2401
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/d8ab2401
Branch: refs/heads/master
Commit: d8ab24017fa187988ceba8a074f5956f5fc2afa3
Parents: 11552bc
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Tue Jul 1 15:59:48 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Tue Jul 1 15:59:48 2014 +0100
----------------------------------------------------------------------
.../impl/ApplicationConfigurationImpl.java | 266 -------------------
.../impl/ApplicationUserHome.java | 224 ----------------
.../impl/Log4JConfiguration.java | 161 -----------
3 files changed, 651 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/d8ab2401/taverna-app-configuration-impl/impl/ApplicationConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/impl/ApplicationConfigurationImpl.java b/taverna-app-configuration-impl/impl/ApplicationConfigurationImpl.java
deleted file mode 100644
index 7e9078e..0000000
--- a/taverna-app-configuration-impl/impl/ApplicationConfigurationImpl.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package uk.org.taverna.configuration.app.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Properties;
-import java.util.UUID;
-
-import org.apache.log4j.Logger;
-
-import uk.org.taverna.configuration.app.ApplicationConfiguration;
-
-/**
- * Represent the application config as it has been specified in {@value #PROPERTIES}. This
- * configuration specifies the application's name and title, etc.
- * <p>
- * An application would typically provide the {@value #PROPERTIES} file on the classpath under a
- * <code>conf</code> directory, or in a <code>conf</code> directory in the application's
- * distribution directory.
- *
- * @author Stian Soiland-Reyes
- * @author David Withers
- */
-public class ApplicationConfigurationImpl implements ApplicationConfiguration {
-
- private static final Logger logger = Logger.getLogger(ApplicationConfigurationImpl.class);
-
- private static final String UNKNOWN_APPLICATION = "unknownApplication-"
- + UUID.randomUUID().toString();
-
- public static final String PREFIX = "taverna.app.";
- public static final String APP_NAME = PREFIX + "name";
- public static final String APP_TITLE = PREFIX + "title";
- public static final String APP_HOME = PREFIX + "home";
- public static final String APP_STARTUP = PREFIX + "startup";
-
- public static final String PROPERTIES = PREFIX + "properties";
-
- private Properties properties;
-
- private File startupDir;
- private File homeDir;
-
- public ApplicationConfigurationImpl() {
- }
-
- @Override
- public String getName() {
- String name = (String) getProperties().get(APP_NAME);
- if (name == null) {
- logger.error("ApplicationConfig could not determine application name, using "
- + UNKNOWN_APPLICATION);
- return UNKNOWN_APPLICATION;
- }
- return name;
- }
-
- @Override
- public String getTitle() {
- String title = (String) getProperties().get(APP_TITLE);
- if (title == null) {
- return getName();
- }
- return title;
- }
-
- @Override
- public File getStartupDir() {
- if (startupDir == null) {
- String startupDirName = System.getProperty(APP_STARTUP);
- if (startupDirName != null) {
- startupDir = new File(startupDirName).getAbsoluteFile();
- }
- }
- return startupDir;
- }
-
- @Override
- public synchronized File getApplicationHomeDir() {
- if (homeDir == null) {
- if (getName().equals(ApplicationConfigurationImpl.UNKNOWN_APPLICATION)) {
- try {
- // Make a temporary home directory as a backup
- homeDir = File.createTempFile(getName(), "home");
- homeDir.delete();
- homeDir.mkdirs();
- } catch (IOException e) {
- throw new IllegalStateException("Can't create temporary application home", e);
- }
- logger.warn("Could not determine application's user home,"
- + " using temporary dir " + homeDir);
- } else {
- homeDir = new ApplicationUserHome(getName()).getAppUserHome();
- }
- if (homeDir == null || !homeDir.isDirectory()) {
- throw new IllegalStateException("Could not create application home directory "
- + homeDir);
- }
- }
- return homeDir;
- }
-
- @Override
- public File getPluginsDir() {
- File pluginsDir = new File(getApplicationHomeDir(), PLUGINS_DIR);
- pluginsDir.mkdirs();
- if (!pluginsDir.isDirectory()) {
- throw new IllegalStateException("Could not create plugins directory " + pluginsDir);
- }
- return pluginsDir;
- }
-
- @Override
- public File getDefaultPluginsDir() {
- File defaultPluginsDir = new File(getStartupDir(), PLUGINS_DIR);
- if (!defaultPluginsDir.isDirectory()) {
- throw new IllegalStateException("Could not find default plugins directory "
- + defaultPluginsDir);
- }
- return defaultPluginsDir;
- }
-
- @Override
- public File getLogFile() {
- return new File(getLogDir(), getName() + ".log");
- }
-
- @Override
- public File getLogDir() {
- File logDir = new File(getApplicationHomeDir(), "logs");
- logDir.mkdirs();
- if (!logDir.isDirectory()) {
- throw new IllegalStateException("Could not create log directory " + logDir);
- }
- return logDir;
- }
-
- @Override
- public synchronized Properties getProperties() {
- if (properties == null) {
- properties = loadProperties(PROPERTIES);
- // Fill in overrides from system properties
- for (Entry<Object, Object> property : System.getProperties().entrySet()) {
- String key = (String) property.getKey();
- if (key.startsWith(PREFIX)) {
- properties.put(key, property.getValue());
- }
- }
- }
- return properties;
- }
-
- private void findInClassLoader(List<URI> configs, ClassLoader classLoader, String resourcePath) {
- Enumeration<URL> resources;
- try {
- resources = classLoader.getResources(resourcePath);
- } catch (IOException ex) {
- System.err.println("Error looking for " + resourcePath + " in " + classLoader);
- ex.printStackTrace();
- return;
- }
- while (resources.hasMoreElements()) {
- URL configURL = resources.nextElement();
- try {
- configs.add(configURL.toURI());
- } catch (URISyntaxException ex) {
- throw new RuntimeException("Invalid URL from getResource(): " + configURL, ex);
- }
- }
- }
-
- /**
- * Attempt to load application properties from propertyFileName.
- * <p>
- * Will attempt to load a property file from the locations below. The first non-empty properties
- * successfully loaded will be returned.
- * <ol>
- * <li>$startup/conf/$resourceName</li>
- * <li>$startup/$resourceName</li>
- * <li>$contextClassPath/conf/$resourceName</li>
- * <li>$contextClassPath/$resourceName</li>
- * <li>$classpath/conf/$resourceName</li>
- * <li>$classpath/$resourceName</li>
- * </ol>
- * <p>
- * Where <code>$startup</code> is this application's startup directory as determined by
- * {@link #getStartupDir()}, and <code>$contextClassPath</code> means a search using
- * {@link ClassLoader#getResources(String)} from the classloader returned by
- * {@link Thread#getContextClassLoader()} and then again <code>$classpath</code> for the
- * classloader of {@link #getClass()} of this instance.
- * </p>
- * <p>
- * If none of these sources could find a non-empty property file, a warning is logged, and an
- * empty {@link Properties} instance is returned.
- *
- * @param resourceName
- * Relative filename of property file
- *
- * @return Loaded or empty {@link Properties} instance.
- */
- protected Properties loadProperties(String resourceName) {
- // Ordered list of config locations to attempt to load
- // properties from
- List<URI> configs = new ArrayList<URI>();
-
- File startupDir = getStartupDir();
- if (startupDir != null) {
- configs.add(startupDir.toURI().resolve(CONF_DIR).resolve(resourceName));
- configs.add(startupDir.toURI().resolve(resourceName));
- }
-
- ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
- findInClassLoader(configs, contextClassLoader, CONF_DIR + resourceName);
- findInClassLoader(configs, contextClassLoader, resourceName);
-
- findInClassLoader(configs, getClass().getClassLoader(), CONF_DIR + resourceName);
- findInClassLoader(configs, getClass().getClassLoader(), resourceName);
-
- Properties loadedProps = new Properties();
- for (URI config : configs) {
- try {
- InputStream inputStream = config.toURL().openStream();
- loadedProps.load(inputStream);
- } catch (MalformedURLException ex) {
- throw new RuntimeException("Invalid URL from URI: " + config, ex);
- } catch (IOException ex) {
- continue; // Probably not found/access denied
- }
- if (!loadedProps.isEmpty()) {
- logger.debug("Loaded " + resourceName + " from " + config);
- return loadedProps;
- }
- }
- logger.debug("Could not find application properties file " + resourceName);
- return loadedProps;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/d8ab2401/taverna-app-configuration-impl/impl/ApplicationUserHome.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/impl/ApplicationUserHome.java b/taverna-app-configuration-impl/impl/ApplicationUserHome.java
deleted file mode 100644
index 896294d..0000000
--- a/taverna-app-configuration-impl/impl/ApplicationUserHome.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package uk.org.taverna.configuration.app.impl;
-
-import java.io.File;
-
-import org.apache.log4j.Logger;
-
-/**
- * Find and create an application's user directory according to operating system
- * standards.
- * <p>
- * For example for the application "MyApp" this class will be able to find
- * <code>$HOME/.myapp</code> on Linux or
- * <code>C:\Document and settings\MyUsername\Application Data\MyApplication</code>
- * on Windows XP.
- *
- * @author Stian Soiland-Reyes
- * @author Stuart Owen
- *
- */
-public class ApplicationUserHome {
-
- private final String defaultApplicationHome;
-
- private final String applicationName;
-
- private File homeDir;
-
- private static Logger logger = Logger.getLogger(ApplicationUserHome.class);
-
- /**
- * Initialise with the name of the application.
- *
- * @param applicationName
- * This name will be used as a template for creating the
- * application home directory (but might be transcribed, for
- * instance to lowercase). It is generally recommended, but not
- * required - that this name does not contain spaces or any
- * special international/Unicode characters.
- */
- public ApplicationUserHome(String applicationName) {
- this(applicationName, null);
- }
-
- /**
- * Initialise with the name of the application and a default application
- * home.
- *
- * @param applicationName
- * This name will be used as a template for creating the
- * application home directory (but might be transcribed, for
- * instance to lowercase). It is generally recommended, but not
- * required - that this name does not contain spaces or any
- * special international/Unicode characters.
- * @param defaultApplicationHome
- * The full path to the default home directory. If this string is
- * not <code>null</code>, then a {@link File} based on this
- * directory will always be returned by
- * {@link #getDefaultApplicationHome()} - otherwise the normal
- * operating system logic is used to determine the application's
- * home directory.
- */
- public ApplicationUserHome(String applicationName,
- String defaultApplicationHome) {
- this.applicationName = applicationName;
- this.defaultApplicationHome = defaultApplicationHome;
- }
-
- /**
- * Find (and if necessary create) the user's application directory,
- * according to operating system standards. The resolved directory is then
- * returned as a {@link File} object.
- * <p>
- * The application's name as defined by {@link #getApplicationName()} is
- * used as a basis for naming the directory of the application's user
- * directory, but the directory name might for instance be transformed to
- * lowercase.
- * <p>
- * If {@link #getDefaultApplicationHome()} returns a non-null value, the
- * directory specified by that path will be used instead of the operation
- * system specific directory. The directory will be created if needed.
- * <p>
- * If any exception occurs (such as out of diskspace), <code>null</code>
- * will be returned.
- *
- * <p>
- * On Windows XP, this will typically be something like:
- *
- * <pre>
- * C:\Document and settings\MyUsername\Application Data\MyApplication
- * </pre>
- *
- * and on Windows Vista it would be something like:
- *
- * <pre>
- * C:\Users\MyUsername\Application Data\MyApplication
- * </pre>
- *
- * while on Mac OS X it will be something like:
- *
- * <pre>
- * /Users/MyUsername/Library/Application Support/MyApplication
- * </pre>
- *
- * All other OS'es are assumed to be UNIX-alike, returning something like:
- *
- * <pre>
- * /user/myusername/.myapplication
- * </pre>
- *
- * <p>
- * If the directory does not already exist, it will be created.
- * </p>
- *
- * @return An {@link File} referring to an existing directory for
- * user-specific configuration etc. for the given application.
- */
- public synchronized File getAppUserHome() {
- if (homeDir != null) {
- return homeDir;
- }
- File appHome;
- String applicationHome = getDefaultApplicationHome();
- if (applicationHome != null) {
- appHome = new File(applicationHome);
- } else {
- if (getApplicationName() == null) {
- logger.warn("Unknown application name");
- return null;
- }
- File home = new File(System.getProperty("user.home"));
- if (!home.isDirectory()) {
- logger.error("User home not a valid directory: " + home);
- return null;
- }
- String os = System.getProperty("os.name");
- // logger.debug("OS is " + os);
- if (os.equals("Mac OS X")) {
- File libDir = new File(home, "Library/Application Support");
- libDir.mkdirs();
- appHome = new File(libDir, getApplicationName());
- } else if (os.startsWith("Windows")) {
- String APPDATA = System.getenv("APPDATA");
- File appData = null;
- if (APPDATA != null) {
- appData = new File(APPDATA);
- }
- if (appData != null && appData.isDirectory()) {
- appHome = new File(appData, getApplicationName());
- } else {
- logger.warn("Could not find %APPDATA%: " + APPDATA);
- appHome = new File(home, getApplicationName());
- }
- } else {
- // We'll assume UNIX style is OK
- appHome = new File(home, "."
- + getApplicationName().toLowerCase());
- }
- }
- if (!appHome.exists()) {
- if (appHome.mkdir()) {
- logger.info("Created " + appHome);
- } else {
- logger.error("Could not create " + appHome);
- return null;
- }
- }
- if (!appHome.isDirectory()) {
- logger.error("User home not a valid directory: " + appHome);
- return null;
- }
- this.homeDir = appHome.getAbsoluteFile();
- return this.homeDir;
- }
-
- /**
- * The application's name. This name will be used as a template for creating
- * the application home directory (but might be transcribed, for instance to
- * lowercase). It is generally recommended, but not required - that this
- * name does not contain spaces or any special international/Unicode
- * characters.
- *
- * @return The application's name.
- *
- */
- public String getApplicationName() {
- return applicationName;
- }
-
- /**
- * The full path to the default home directory. If this string is not
- * <code>null</code>, then a {@link File} based on this directory will
- * always be returned by {@link #getDefaultApplicationHome()} - otherwise
- * the normal operating system logic is used to determine the application's
- * home directory.
- *
- * @return The full path to the application's home directory, or
- * <code>null</code> if the operation system specific logic is to
- * be used.
- */
- public String getDefaultApplicationHome() {
- return defaultApplicationHome;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/d8ab2401/taverna-app-configuration-impl/impl/Log4JConfiguration.java
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/impl/Log4JConfiguration.java b/taverna-app-configuration-impl/impl/Log4JConfiguration.java
deleted file mode 100644
index cdd2c2c..0000000
--- a/taverna-app-configuration-impl/impl/Log4JConfiguration.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package uk.org.taverna.configuration.app.impl;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.LogManager;
-import org.apache.log4j.PatternLayout;
-import org.apache.log4j.PropertyConfigurator;
-import org.apache.log4j.RollingFileAppender;
-
-import uk.org.taverna.configuration.app.ApplicationConfiguration;
-
-public class Log4JConfiguration {
- public final static String LOG4J_PROPERTIES = "log4j.properties";
-
- private static boolean log4jConfigured = false;
-
- private ApplicationConfiguration applicationConfiguration;
-
- private Properties properties ;
-
- protected Log4JConfiguration() {
- prepareLog4J();
- }
-
- public void prepareLog4J() {
- if (!log4jConfigured) {
- Properties log4jProperties = getLogProperties();
- if (log4jProperties != null && ! log4jProperties.isEmpty()) {
- LogManager.resetConfiguration();
- PropertyConfigurator.configure(log4jProperties);
- }
-
- String logFilePath = applicationConfiguration.getLogFile().getAbsolutePath();
- PatternLayout layout = new PatternLayout("%-5p %d{ISO8601} (%c:%L) - %m%n");
-
- // Add file appender
- RollingFileAppender appender;
- try {
- appender = new RollingFileAppender(layout, logFilePath);
- appender.setMaxFileSize("1MB");
- appender.setEncoding("UTF-8");
- appender.setMaxBackupIndex(4);
- // Let root logger decide level
- appender.setThreshold(Level.ALL);
- LogManager.getRootLogger().addAppender(appender);
- } catch (IOException e) {
- System.err.println("Could not log to " + logFilePath);
- }
-
- log4jConfigured = true;
- }
- }
-
- /**
- * Initialises and provides access to the list of Properties.
- * @return
- */
- public Properties getLogProperties() {
- if (properties == null) {
- InputStream is = getLogPropertiesInputStream();
- if (is != null) {
- try {
- properties = new Properties();
- properties.load(is);
-// properties.putAll(System.getProperties());
- } catch (IOException e) {
- errorLog("An error occurred trying to load the " + LOG4J_PROPERTIES + " file",e);
- }
- }
- }
- return properties;
- }
-
- /**
- * Return an input stream to the configuration file, or null if it can't be found
- * @return
- */
- private InputStream getLogPropertiesInputStream() {
- InputStream result = null;
- File propertiesFile = getLogPropertiesFile();
- if (propertiesFile!=null) {
- try {
- result=new FileInputStream(propertiesFile);
- } catch (FileNotFoundException e) {
- errorLog("Unable to find "+LOG4J_PROPERTIES,e);
- }
- }
- else {
- errorLog("Unable to determine file for "+LOG4J_PROPERTIES,null);
- }
- return result;
- }
-
- /**
- * Returns a File object to the configuration file or null if it cannot be found.
- *
- * @return
- */
- private File getLogPropertiesFile() {
- File home = applicationConfiguration.getApplicationHomeDir();
- File startup = applicationConfiguration.getStartupDir();
- File result=null;
- if (home!=null) {
- File file = new File(new File(home, ApplicationConfiguration.CONF_DIR), LOG4J_PROPERTIES);
- if (file.exists()) {
- result=file;
- }
- }
- if (result==null && startup!=null) {
- File file = new File(new File(startup, ApplicationConfiguration.CONF_DIR), LOG4J_PROPERTIES);
- if (file.exists()) {
- result=file;
- }
- }
- return result;
- }
-
- private void errorLog(String message, Throwable exception) {
- System.out.println(message);
- if (exception!=null) {
- exception.printStackTrace();
- }
-
- }
-
- /**
- * Sets the applicationConfiguration.
- *
- * @param applicationConfiguration the new value of applicationConfiguration
- */
- public void setApplicationConfiguration(ApplicationConfiguration applicationConfiguration) {
- this.applicationConfiguration = applicationConfiguration;
- }
-
-}
[22/50] [abbrv] incubator-taverna-osgi git commit:
1.7 for T3-1193
Posted by st...@apache.org.
<commons.codec.version>1.7 for T3-1193
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/79be5430
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/79be5430
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/79be5430
Branch: refs/heads/master
Commit: 79be5430fda98464f01bdb670a31eb38156880e9
Parents: d8ab240
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Tue Jul 1 16:00:39 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Tue Jul 1 16:00:39 2014 +0100
----------------------------------------------------------------------
taverna-download-impl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/79be5430/taverna-download-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-download-impl/pom.xml b/taverna-download-impl/pom.xml
index ff4c9ae..a1ee297 100644
--- a/taverna-download-impl/pom.xml
+++ b/taverna-download-impl/pom.xml
@@ -43,7 +43,7 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
- <version>1.7</version>
+ <version>${commons.codec.version}</version>
</dependency>
</dependencies>
<repositories>
[20/50] [abbrv] incubator-taverna-osgi git commit: Updated commons.io
to version 2.4 for T3-1193
Posted by st...@apache.org.
Updated commons.io to version 2.4 for T3-1193
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/11552bce
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/11552bce
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/11552bce
Branch: refs/heads/master
Commit: 11552bceda352a8e557af375f7a3daae46aed3e6
Parents: 2dbbead
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Mon Jun 30 17:05:19 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Mon Jun 30 17:05:19 2014 +0100
----------------------------------------------------------------------
taverna-download-impl/pom.xml | 2 +-
taverna-plugin-impl/pom.xml | 2 +-
taverna-update-impl/pom.xml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/11552bce/taverna-download-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-download-impl/pom.xml b/taverna-download-impl/pom.xml
index 1750271..ff4c9ae 100644
--- a/taverna-download-impl/pom.xml
+++ b/taverna-download-impl/pom.xml
@@ -38,7 +38,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
- <version>2.4</version>
+ <version>${commons.io.version}</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/11552bce/taverna-plugin-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/pom.xml b/taverna-plugin-impl/pom.xml
index 8ffd4fa..8dca237 100644
--- a/taverna-plugin-impl/pom.xml
+++ b/taverna-plugin-impl/pom.xml
@@ -63,7 +63,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
- <version>2.4</version>
+ <version>${commons.io.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/11552bce/taverna-update-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-update-impl/pom.xml b/taverna-update-impl/pom.xml
index 430bf13..de8722f 100644
--- a/taverna-update-impl/pom.xml
+++ b/taverna-update-impl/pom.xml
@@ -48,7 +48,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
- <version>2.4</version>
+ <version>${commons.io.version}</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
[10/50] [abbrv] incubator-taverna-osgi git commit: added README
Posted by st...@apache.org.
added README
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/56313951
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/56313951
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/56313951
Branch: refs/heads/master
Commit: 5631395141eb9264cfb739f34b11d9d93ace0fcf
Parents: 219e8da
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Fri May 9 12:07:29 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Fri May 9 12:07:29 2014 +0100
----------------------------------------------------------------------
README.md | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/56313951/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e573a56
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+Taverna 3 common libraries
+
+This code was previously hosted at http://taverna.googlecode.com/svn/unsorted/taverna-commons/
\ No newline at end of file
[49/50] [abbrv] incubator-taverna-osgi git commit:
com.springsource.org.apache.log4j -> log4j
Posted by st...@apache.org.
com.springsource.org.apache.log4j -> log4j
.. now natively OSGi bundle
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/fb4c3361
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/fb4c3361
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/fb4c3361
Branch: refs/heads/master
Commit: fb4c33613644bb8cb75a5e1d3b3eb0f9f4b733f2
Parents: 6e56595
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Tue Jan 6 16:32:13 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Tue Jan 6 16:32:13 2015 +0000
----------------------------------------------------------------------
taverna-app-configuration-impl/pom.xml | 4 ++--
taverna-configuration-api/pom.xml | 4 ++--
taverna-configuration-impl/pom.xml | 4 ++--
taverna-download-impl/pom.xml | 4 ++--
taverna-plugin-impl/pom.xml | 4 ++--
5 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fb4c3361/taverna-app-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/pom.xml b/taverna-app-configuration-impl/pom.xml
index 85bc18c..55bab09 100644
--- a/taverna-app-configuration-impl/pom.xml
+++ b/taverna-app-configuration-impl/pom.xml
@@ -35,8 +35,8 @@
<version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.log4j</groupId>
- <artifactId>com.springsource.org.apache.log4j</artifactId>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fb4c3361/taverna-configuration-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/pom.xml b/taverna-configuration-api/pom.xml
index 2402306..a2b6460 100644
--- a/taverna-configuration-api/pom.xml
+++ b/taverna-configuration-api/pom.xml
@@ -16,8 +16,8 @@
<version>${apache.commons.csv.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.log4j</groupId>
- <artifactId>com.springsource.org.apache.log4j</artifactId>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fb4c3361/taverna-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/pom.xml b/taverna-configuration-impl/pom.xml
index 3be7a08..79143c9 100644
--- a/taverna-configuration-impl/pom.xml
+++ b/taverna-configuration-impl/pom.xml
@@ -57,8 +57,8 @@
<dependency>
- <groupId>org.apache.log4j</groupId>
- <artifactId>com.springsource.org.apache.log4j</artifactId>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fb4c3361/taverna-download-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-download-impl/pom.xml b/taverna-download-impl/pom.xml
index d05182a..c472494 100644
--- a/taverna-download-impl/pom.xml
+++ b/taverna-download-impl/pom.xml
@@ -30,8 +30,8 @@
</dependency>
<dependency>
- <groupId>org.apache.log4j</groupId>
- <artifactId>com.springsource.org.apache.log4j</artifactId>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fb4c3361/taverna-plugin-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/pom.xml b/taverna-plugin-impl/pom.xml
index 5ac956b..488e777 100644
--- a/taverna-plugin-impl/pom.xml
+++ b/taverna-plugin-impl/pom.xml
@@ -45,8 +45,8 @@
</dependency>
<dependency>
- <groupId>org.apache.log4j</groupId>
- <artifactId>com.springsource.org.apache.log4j</artifactId>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
[31/50] [abbrv] incubator-taverna-osgi git commit: Remove
taverna3-commons bits not for taverna-osgi
Posted by st...@apache.org.
Remove taverna3-commons bits not for taverna-osgi
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/fea36501
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/fea36501
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/fea36501
Branch: refs/heads/master
Commit: fea3650183db6196249769c8ad058bacce4f7f76
Parents: 79be543
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu Dec 18 22:30:09 2014 -0600
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu Dec 18 22:30:09 2014 -0600
----------------------------------------------------------------------
.pom.xml.un~ | Bin 14153 -> 0 bytes
.travis.yml | 1 -
README.md | 3 -
pom.xml | 52 ----
taverna-database-configuration-api/.project | 24 --
taverna-database-configuration-api/pom.xml | 42 ----
.../database/DatabaseConfiguration.java | 124 ---------
.../configuration/database/DatabaseManager.java | 45 ----
taverna-database-configuration-impl/.project | 24 --
taverna-database-configuration-impl/pom.xml | 102 --------
.../impl/DatabaseConfigurationImpl.java | 252 -------------------
.../database/impl/DatabaseManagerImpl.java | 155 ------------
.../META-INF/spring/database-context-osgi.xml | 18 --
.../META-INF/spring/database-context.xml | 20 --
taverna-services-api/.project | 24 --
taverna-services-api/pom.xml | 41 ---
.../services/ActivityTypeNotFoundException.java | 47 ----
.../services/InvalidConfigurationException.java | 47 ----
.../commons/services/ServiceRegistry.java | 89 -------
taverna-services-impl/.project | 24 --
taverna-services-impl/pom.xml | 64 -----
.../services/impl/ServiceRegistryImpl.java | 92 -------
.../spring/taverna-services-context-osgi.xml | 13 -
.../spring/taverna-services-context.xml | 10 -
24 files changed, 1313 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/.pom.xml.un~
----------------------------------------------------------------------
diff --git a/.pom.xml.un~ b/.pom.xml.un~
deleted file mode 100644
index 9419ffa..0000000
Binary files a/.pom.xml.un~ and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index dff5f3a..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1 +0,0 @@
-language: java
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
deleted file mode 100644
index e573a56..0000000
--- a/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-Taverna 3 common libraries
-
-This code was previously hosted at http://taverna.googlecode.com/svn/unsorted/taverna-commons/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 0528e7b..0000000
--- a/pom.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>taverna-parent</artifactId>
- <groupId>net.sf.taverna</groupId>
- <version>3.0.1-SNAPSHOT</version>
- </parent>
- <groupId>uk.org.taverna.commons</groupId>
- <artifactId>taverna-commons</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>Taverna 3 Commons</name>
- <description>Taverna modules that are common to multiple products</description>
- <modules>
- <module>taverna-configuration-api</module>
- <module>taverna-configuration-impl</module>
- <module>taverna-app-configuration-api</module>
- <module>taverna-app-configuration-impl</module>
- <module>taverna-database-configuration-api</module>
- <module>taverna-database-configuration-impl</module>
- <module>taverna-download-api</module>
- <module>taverna-download-impl</module>
- <module>taverna-plugin-api</module>
- <module>taverna-plugin-impl</module>
- <module>taverna-update-api</module>
- <module>taverna-update-impl</module>
- <module>taverna-xml-schemas</module>
- <module>taverna-services-api</module>
- <module>taverna-services-impl</module>
- </modules>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository</url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-database-configuration-api/.project
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-api/.project b/taverna-database-configuration-api/.project
deleted file mode 100644
index dfcb96a..0000000
--- a/taverna-database-configuration-api/.project
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>taverna-database-configuration-api</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-database-configuration-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-api/pom.xml b/taverna-database-configuration-api/pom.xml
deleted file mode 100644
index 6604c94..0000000
--- a/taverna-database-configuration-api/pom.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>taverna-commons</artifactId>
- <groupId>uk.org.taverna.commons</groupId>
- <version>1.0.0-SNAPSHOT</version>
- </parent>
- <groupId>uk.org.taverna.configuration</groupId>
- <version>0.1.1-SNAPSHOT</version>
- <artifactId>taverna-database-configuration-api</artifactId>
- <packaging>bundle</packaging>
- <dependencies>
- <dependency>
- <groupId>uk.org.taverna.configuration</groupId>
- <artifactId>taverna-configuration-api</artifactId>
- <version>${taverna.configuration.version}</version>
- </dependency>
- </dependencies>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
- <name>Taverna Database Configuration API</name>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-database-configuration-api/src/main/java/uk/org/taverna/configuration/database/DatabaseConfiguration.java
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-api/src/main/java/uk/org/taverna/configuration/database/DatabaseConfiguration.java b/taverna-database-configuration-api/src/main/java/uk/org/taverna/configuration/database/DatabaseConfiguration.java
deleted file mode 100644
index ba3ebd2..0000000
--- a/taverna-database-configuration-api/src/main/java/uk/org/taverna/configuration/database/DatabaseConfiguration.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2012 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package uk.org.taverna.configuration.database;
-
-import java.util.Map;
-
-import uk.org.taverna.configuration.Configurable;
-
-/**
- *
- *
- * @author David Withers
- */
-public interface DatabaseConfiguration extends Configurable {
-
- public static final String IN_MEMORY = "in_memory";
- public static final String ENABLE_PROVENANCE = "provenance";
- public static final String CONNECTOR_TYPE = "connector";
- public static final String PORT = "port";
- public static final String CURRENT_PORT = "current_port";
- public static final String REFERENCE_SERVICE_CONTEXT = "referenceService.context";
- public static final String IN_MEMORY_CONTEXT = "inMemoryReferenceServiceContext.xml";
- public static final String HIBERNATE_CONTEXT = "hibernateReferenceServiceContext.xml";
- public static final String HIBERNATE_DIALECT = "dialect";
- public static final String START_INTERNAL_DERBY = "start_derby";
- public static final String POOL_MAX_ACTIVE = "pool_max_active";
- public static final String POOL_MIN_IDLE = "pool_min_idle";
- public static final String POOL_MAX_IDLE = "pool_max_idle";
- public static final String DRIVER_CLASS_NAME = "driver";
- public static final String JDBC_URI = "jdbcuri";
- public static final String USERNAME = "username";
- public static final String PASSWORD = "password";
- public static final String EXPOSE_DATANATURE = "taverna.exposedatanature";
- // FIXME: these should me just mysql & derby - but build & dependency issues
- // is causing the provenance to expect these values:
- public static final String CONNECTOR_MYSQL = "mysql";
- public static final String CONNECTOR_DERBY = "derby";
- public static final String JNDI_NAME = "jdbc/taverna";
-
- public boolean isAutoSave();
-
- public void enableAutoSave();
-
- public void disableAutoSave();
-
- public boolean isInMemory();
-
- public void setInMemory(boolean value);
-
- public boolean isExposeDatanature();
-
- public void setExposeDatanature(boolean exposeDatanature);
-
- public String getDatabaseContext();
-
- public void setPort(int port);
-
- public void setPort(String port);
-
- public void setDriverClassName(String driverClassName);
-
- public String getDriverClassName();
-
- public boolean isProvenanceEnabled();
-
- public void setProvenanceEnabled(boolean value);
-
- public void setStartInternalDerbyServer(boolean value);
-
- public boolean getStartInternalDerbyServer();
-
- public int getPort();
-
- public void setCurrentPort(int port);
-
- public int getCurrentPort();
-
- public int getPoolMaxActive();
-
- public int getPoolMinIdle();
-
- public int getPoolMaxIdle();
-
- public String getCategory();
-
- public Map<String, String> getDefaultPropertyMap();
-
- public String getHibernateDialect();
-
- public String getDisplayName();
-
- public String getFilePrefix();
-
- public String getUUID();
-
- public String getConnectorType();
-
- public String getJDBCUri();
-
- public void setJDBCUri(String uri);
-
- public String getUsername();
-
- public String getPassword();
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-database-configuration-api/src/main/java/uk/org/taverna/configuration/database/DatabaseManager.java
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-api/src/main/java/uk/org/taverna/configuration/database/DatabaseManager.java b/taverna-database-configuration-api/src/main/java/uk/org/taverna/configuration/database/DatabaseManager.java
deleted file mode 100644
index c7e6641..0000000
--- a/taverna-database-configuration-api/src/main/java/uk/org/taverna/configuration/database/DatabaseManager.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2012 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package uk.org.taverna.configuration.database;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import javax.sql.DataSource;
-
-/**
- *
- *
- * @author David Withers
- */
-public interface DatabaseManager {
-
- public Connection getConnection() throws SQLException;
-
- public DataSource getDataSource();
-
- public void startDerbyNetworkServer();
-
- public void stopDerbyNetworkServer();
-
- public boolean isRunning();
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-database-configuration-impl/.project
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-impl/.project b/taverna-database-configuration-impl/.project
deleted file mode 100644
index bac6198..0000000
--- a/taverna-database-configuration-impl/.project
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>taverna-database-configuration-impl</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-database-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-impl/pom.xml b/taverna-database-configuration-impl/pom.xml
deleted file mode 100644
index 3ecceae..0000000
--- a/taverna-database-configuration-impl/pom.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>taverna-commons</artifactId>
- <groupId>uk.org.taverna.commons</groupId>
- <version>1.0.0-SNAPSHOT</version>
- </parent>
- <groupId>uk.org.taverna.configuration</groupId>
- <version>0.1.1-SNAPSHOT</version>
- <artifactId>taverna-database-configuration-impl</artifactId>
- <packaging>bundle</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Import-Package>
- uk.org.taverna.configuration.database;provide:=true,
- org.apache.derby.jdbc, *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>uk.org.taverna.configuration</groupId>
- <artifactId>taverna-database-configuration-api</artifactId>
- <version>${taverna.configuration.version}</version>
- </dependency>
- <dependency>
- <groupId>uk.org.taverna.configuration</groupId>
- <artifactId>taverna-app-configuration-api</artifactId>
- <version>${taverna.configuration.version}</version>
- </dependency>
- <dependency>
- <groupId>uk.org.taverna.configuration</groupId>
- <artifactId>taverna-configuration-api</artifactId>
- <version>${taverna.configuration.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>com.springsource.org.apache.derby</artifactId>
- <version>${derby.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>com.springsource.org.apache.derby.client</artifactId>
- <version>${derbyclient.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>com.springsource.org.apache.derby.drda</artifactId>
- <version>${derbynet.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>com.springsource.org.apache.commons.dbcp</artifactId>
- <version>${commons.dbcp.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.log4j</groupId>
- <artifactId>com.springsource.org.apache.log4j</artifactId>
- <version>${log4j.version}</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
- <name>Taverna Database Configuration implementation</name>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-database-configuration-impl/src/main/java/uk/org/taverna/configuration/database/impl/DatabaseConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-impl/src/main/java/uk/org/taverna/configuration/database/impl/DatabaseConfigurationImpl.java b/taverna-database-configuration-impl/src/main/java/uk/org/taverna/configuration/database/impl/DatabaseConfigurationImpl.java
deleted file mode 100644
index de73269..0000000
--- a/taverna-database-configuration-impl/src/main/java/uk/org/taverna/configuration/database/impl/DatabaseConfigurationImpl.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2007 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package uk.org.taverna.configuration.database.impl;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import uk.org.taverna.configuration.database.DatabaseConfiguration;
-import uk.org.taverna.configuration.AbstractConfigurable;
-import uk.org.taverna.configuration.ConfigurationManager;
-
-/**
- * Configuration for the reference service and provenance.
- *
- * @author David Withers
- * @author Stuart Owen
- */
-
-public class DatabaseConfigurationImpl extends AbstractConfigurable implements DatabaseConfiguration {
-
- private Map<String, String> defaultPropertyMap;
-
- private boolean autoSave = true;
-
- public DatabaseConfigurationImpl(ConfigurationManager configurationManager) {
- super(configurationManager);
- }
-
- @Override
- public boolean isAutoSave() {
- return autoSave;
- }
-
- @Override
- public void enableAutoSave() {
- autoSave = true;
- }
-
- @Override
- public void disableAutoSave() {
- autoSave = false;
- }
-
- @Override
- protected void store() {
- if (autoSave) {
- super.store();
- }
- }
-
- @Override
- public boolean isInMemory() {
- return getProperty(IN_MEMORY).equalsIgnoreCase("true");
- }
-
- @Override
- public void setInMemory(boolean value) {
- setProperty(IN_MEMORY, String.valueOf(value));
- }
-
- @Override
- public boolean isExposeDatanature() {
- return getProperty(EXPOSE_DATANATURE).equalsIgnoreCase("true");
- }
-
- @Override
- public void setExposeDatanature(boolean exposeDatanature) {
- setProperty(EXPOSE_DATANATURE, String.valueOf(exposeDatanature));
- }
-
- @Override
- public String getDatabaseContext() {
- if (getProperty(IN_MEMORY).equalsIgnoreCase("true")) {
- return IN_MEMORY_CONTEXT;
- } else {
- return HIBERNATE_CONTEXT;
- }
- }
-
- @Override
- public void setPort(int port) {
- setPort(String.valueOf(port));
- }
-
- @Override
- public void setPort(String port) {
- setProperty(PORT, port);
- }
-
- @Override
- public void setDriverClassName(String driverClassName) {
- setProperty(DRIVER_CLASS_NAME, driverClassName);
- }
-
- @Override
- public String getDriverClassName() {
- return getProperty(DRIVER_CLASS_NAME);
- }
-
- @Override
- public boolean isProvenanceEnabled() {
- return getProperty(ENABLE_PROVENANCE).equalsIgnoreCase("true");
- }
-
- @Override
- public void setProvenanceEnabled(boolean value) {
- setProperty(ENABLE_PROVENANCE, String.valueOf(value));
- }
-
- @Override
- public void setStartInternalDerbyServer(boolean value) {
- setProperty(START_INTERNAL_DERBY, String.valueOf(value));
- }
-
- @Override
- public boolean getStartInternalDerbyServer() {
- return getProperty(START_INTERNAL_DERBY).equalsIgnoreCase("true");
- }
-
- @Override
- public int getPort() {
- return Integer.valueOf(getProperty(PORT));
- }
-
- @Override
- public void setCurrentPort(int port) {
- setProperty(CURRENT_PORT, String.valueOf(port));
- }
-
- @Override
- public int getCurrentPort() {
- return Integer.valueOf(getProperty(CURRENT_PORT));
- }
-
- @Override
- public int getPoolMaxActive() {
- return Integer.valueOf(getProperty(POOL_MAX_ACTIVE));
- }
-
- @Override
- public int getPoolMinIdle() {
- return Integer.valueOf(getProperty(POOL_MIN_IDLE));
- }
-
- @Override
- public int getPoolMaxIdle() {
- return Integer.valueOf(getProperty(POOL_MAX_IDLE));
- }
-
- @Override
- public String getCategory() {
- return "general";
- }
-
- @Override
- public Map<String, String> getDefaultPropertyMap() {
-
- if (defaultPropertyMap == null) {
- defaultPropertyMap = new HashMap<String, String>();
- defaultPropertyMap.put(IN_MEMORY, "true");
- defaultPropertyMap.put(ENABLE_PROVENANCE, "true");
- defaultPropertyMap.put(PORT, "1527");
- // defaultPropertyMap.put(DRIVER_CLASS_NAME,
- // "org.apache.derby.jdbc.ClientDriver");
- defaultPropertyMap.put(DRIVER_CLASS_NAME,
- "org.apache.derby.jdbc.EmbeddedDriver");
- defaultPropertyMap.put(HIBERNATE_DIALECT,
- "org.hibernate.dialect.DerbyDialect");
- defaultPropertyMap.put(POOL_MAX_ACTIVE, "50");
- defaultPropertyMap.put(POOL_MAX_IDLE, "50");
- defaultPropertyMap.put(POOL_MIN_IDLE, "10");
- defaultPropertyMap.put(USERNAME, "");
- defaultPropertyMap.put(PASSWORD, "");
- defaultPropertyMap.put(JDBC_URI,
- "jdbc:derby:t2-database;create=true;upgrade=true");
- defaultPropertyMap.put(START_INTERNAL_DERBY, "false");
-
- defaultPropertyMap.put(CONNECTOR_TYPE, CONNECTOR_DERBY);
- defaultPropertyMap.put(EXPOSE_DATANATURE, "false");
- }
- return defaultPropertyMap;
- }
-
- @Override
- public String getHibernateDialect() {
- return getProperty(HIBERNATE_DIALECT);
- }
-
- @Override
- public String getDisplayName() {
- return "Data and provenance";
- }
-
- @Override
- public String getFilePrefix() {
- return "DataAndProvenance";
- }
-
- @Override
- public String getUUID() {
- return "6BD3F5C1-C68D-4893-8D9B-2F46FA1DDB19";
- }
-
- @Override
- public String getConnectorType() {
- return getProperty(CONNECTOR_TYPE);
- }
-
- @Override
- public String getJDBCUri() {
- if (CONNECTOR_DERBY.equals(getConnectorType())
- && getStartInternalDerbyServer()) {
- return "jdbc:derby://localhost:" + getCurrentPort()
- + "/t2-database;create=true;upgrade=true";
- } else {
- return getProperty(JDBC_URI);
- }
- }
-
- @Override
- public void setJDBCUri(String uri) {
- setProperty(JDBC_URI, uri);
- }
-
- @Override
- public String getUsername() {
- return getProperty(USERNAME);
- }
-
- @Override
- public String getPassword() {
- return getProperty(PASSWORD);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-database-configuration-impl/src/main/java/uk/org/taverna/configuration/database/impl/DatabaseManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-impl/src/main/java/uk/org/taverna/configuration/database/impl/DatabaseManagerImpl.java b/taverna-database-configuration-impl/src/main/java/uk/org/taverna/configuration/database/impl/DatabaseManagerImpl.java
deleted file mode 100644
index 8a10d24..0000000
--- a/taverna-database-configuration-impl/src/main/java/uk/org/taverna/configuration/database/impl/DatabaseManagerImpl.java
+++ /dev/null
@@ -1,155 +0,0 @@
-package uk.org.taverna.configuration.database.impl;
-
-import java.io.File;
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import javax.sql.DataSource;
-
-import org.apache.commons.dbcp.BasicDataSource;
-import org.apache.derby.drda.NetworkServerControl;
-import org.apache.log4j.Logger;
-
-import uk.org.taverna.configuration.database.DatabaseConfiguration;
-import uk.org.taverna.configuration.database.DatabaseManager;
-import uk.org.taverna.configuration.app.ApplicationConfiguration;
-
-/**
- * A set of utility methods related to basic data management.
- *
- * @author Stuart Owen
- * @author Stian Soiland-Reyes
- *
- */
-public class DatabaseManagerImpl implements DatabaseManager {
-
- private final static Logger logger = Logger.getLogger(DatabaseManagerImpl.class);
-
- private NetworkServerControl server;
-
- private BasicDataSource dataSource;
-
- private DatabaseConfiguration databaseConfiguration;
-
- private ApplicationConfiguration applicationConfiguration;
-
- public DatabaseManagerImpl(ApplicationConfiguration applicationConfiguration, DatabaseConfiguration databaseConfiguration) throws SQLException {
- this.applicationConfiguration = applicationConfiguration;
- this.databaseConfiguration = databaseConfiguration;
- getConnection();
- }
-
- @Override
- public Connection getConnection() throws SQLException {
- return getDataSource().getConnection();
- }
-
- @Override
- public DataSource getDataSource() {
- if (dataSource == null) {
- setupDataSource();
- }
- return dataSource;
- }
-
- @Override
- public synchronized void startDerbyNetworkServer() {
- setDerbyPaths();
-
- System.setProperty("derby.drda.host","localhost");
- System.setProperty("derby.drda.minThreads","5");
- System.setProperty("derby.drda.maxThreads",String.valueOf(databaseConfiguration.getPoolMaxActive()));
- int port = databaseConfiguration.getPort();
- int maxPort = port+50;
-
- try {
- System.setProperty("derby.drda.portNumber",String.valueOf(port));
- if (server==null) server = new NetworkServerControl();
- while(port<maxPort) { //loop to find another available port on which Derby isn't already running
- if (!isRunning()) break;
- logger.info("Derby connection port: "+port+" is currently not available for Taverna, trying next value");
- port++;
- System.setProperty("derby.drda.portNumber",String.valueOf(port));
- server = new NetworkServerControl();
- }
- server.start(null);
- databaseConfiguration.setCurrentPort(port);
- } catch (Exception ex) {
- logger.error("Error starting up Derby network server",ex);
- }
- }
-
- @Override
- public void stopDerbyNetworkServer() {
- try {
- server.shutdown();
- } catch (Exception e) {
- logger.error("Error shutting down Derby network server",e);
- }
- }
-
- @Override
- public boolean isRunning() {
- if (server==null) {
- return false;
- }
- else {
- try {
- server.ping();
- return true;
- } catch (Exception e) {
- return false;
- }
- }
- }
-
- private void setupDataSource() {
- setDerbyPaths();
-
- dataSource = new BasicDataSource();
- dataSource.setDriverClassName(databaseConfiguration.getDriverClassName());
-
- System.setProperty("hibernate.dialect", databaseConfiguration.getHibernateDialect());
-
- dataSource.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
- dataSource.setMaxActive(databaseConfiguration.getPoolMaxActive());
- dataSource.setMinIdle(databaseConfiguration.getPoolMinIdle());
- dataSource.setMaxIdle(databaseConfiguration.getPoolMaxIdle());
- dataSource.setDefaultAutoCommit(true);
- dataSource.setInitialSize(databaseConfiguration.getPoolMinIdle());
- //Derby blows up if the username of password is empty (even an empty string thats not null).
- if (databaseConfiguration.getUsername()!=null && databaseConfiguration.getUsername().length()>=1) dataSource.setUsername(databaseConfiguration.getUsername());
- if (databaseConfiguration.getPassword()!=null && databaseConfiguration.getPassword().length()>=1) dataSource.setPassword(databaseConfiguration.getPassword());
-
- dataSource.setUrl(databaseConfiguration.getJDBCUri());
- }
-
- private void setDerbyPaths() {
- if (databaseConfiguration.getConnectorType() == DatabaseConfiguration.CONNECTOR_DERBY) {
- String homeDir = applicationConfiguration.getApplicationHomeDir().getAbsolutePath();
- System.setProperty("derby.system.home",homeDir);
- File logFile = new File(applicationConfiguration.getLogDir(), "derby.log");
- System.setProperty("derby.stream.error.file", logFile.getAbsolutePath());
- }
-
- }
-
- /**
- * Sets the databaseConfiguration.
- *
- * @param databaseConfiguration the new value of databaseConfiguration
- */
- public void setDatabaseConfiguration(DatabaseConfiguration databaseConfiguration) {
- this.databaseConfiguration = databaseConfiguration;
- }
-
- /**
- * Sets the applicationConfiguration.
- *
- * @param applicationConfiguration the new value of applicationConfiguration
- */
- public void setApplicationConfiguration(ApplicationConfiguration applicationConfiguration) {
- this.applicationConfiguration = applicationConfiguration;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-database-configuration-impl/src/main/resources/META-INF/spring/database-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-impl/src/main/resources/META-INF/spring/database-context-osgi.xml b/taverna-database-configuration-impl/src/main/resources/META-INF/spring/database-context-osgi.xml
deleted file mode 100644
index 2eae538..0000000
--- a/taverna-database-configuration-impl/src/main/resources/META-INF/spring/database-context-osgi.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans:beans xmlns="http://www.springframework.org/schema/osgi"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/osgi
- http://www.springframework.org/schema/osgi/spring-osgi.xsd">
-
- <service ref="databaseConfiguration" interface="uk.org.taverna.configuration.database.DatabaseConfiguration" />
- <service ref="databaseManager" interface="uk.org.taverna.configuration.database.DatabaseManager" />
-
- <reference id="configurationManager" interface="uk.org.taverna.configuration.ConfigurationManager" />
- <reference id="applicationConfiguration" interface="uk.org.taverna.configuration.app.ApplicationConfiguration" />
-
- <!-- <reference id="dataSourceFactory" interface="org.osgi.service.jdbc.DataSourceFactory"
- filter="(osgi.jdbc.driver.class=org.apache.derby.jdbc.EmbeddedDriver)" /> -->
-
-</beans:beans>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-database-configuration-impl/src/main/resources/META-INF/spring/database-context.xml
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-impl/src/main/resources/META-INF/spring/database-context.xml b/taverna-database-configuration-impl/src/main/resources/META-INF/spring/database-context.xml
deleted file mode 100644
index f397933..0000000
--- a/taverna-database-configuration-impl/src/main/resources/META-INF/spring/database-context.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <bean id="databaseConfiguration"
- class="uk.org.taverna.configuration.database.impl.DatabaseConfigurationImpl">
- <constructor-arg name="configurationManager" ref="configurationManager" />
- </bean>
-
- <bean id="databaseManager"
- class="uk.org.taverna.configuration.database.impl.DatabaseManagerImpl">
- <constructor-arg name="applicationConfiguration" ref="applicationConfiguration" />
- <constructor-arg name="databaseConfiguration">
- <ref local="databaseConfiguration" />
- </constructor-arg>
- </bean>
-
-</beans>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-services-api/.project
----------------------------------------------------------------------
diff --git a/taverna-services-api/.project b/taverna-services-api/.project
deleted file mode 100644
index a3fb83e..0000000
--- a/taverna-services-api/.project
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>taverna-services-api</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-services-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-services-api/pom.xml b/taverna-services-api/pom.xml
deleted file mode 100644
index e676e29..0000000
--- a/taverna-services-api/pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>uk.org.taverna.commons</groupId>
- <artifactId>taverna-commons</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>taverna-services-api</artifactId>
- <version>0.1.0-SNAPSHOT</version>
- <packaging>bundle</packaging>
- <name>Taverna Services API</name>
- <dependencies>
- <dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
- <artifactId>scufl2-api</artifactId>
- <version>${scufl2.version}</version>
- </dependency>
- </dependencies>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-services-api/src/main/java/uk/org/taverna/commons/services/ActivityTypeNotFoundException.java
----------------------------------------------------------------------
diff --git a/taverna-services-api/src/main/java/uk/org/taverna/commons/services/ActivityTypeNotFoundException.java b/taverna-services-api/src/main/java/uk/org/taverna/commons/services/ActivityTypeNotFoundException.java
deleted file mode 100644
index dafccd7..0000000
--- a/taverna-services-api/src/main/java/uk/org/taverna/commons/services/ActivityTypeNotFoundException.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package uk.org.taverna.commons.services;
-
-/**
- * Thrown when an activity type is not found.
- *
- * @author David Withers
- */
-@SuppressWarnings("serial")
-public class ActivityTypeNotFoundException extends Exception {
-
- public ActivityTypeNotFoundException() {
- super();
- }
-
- public ActivityTypeNotFoundException(String message) {
- super(message);
- }
-
- public ActivityTypeNotFoundException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ActivityTypeNotFoundException(Throwable cause) {
- super(cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-services-api/src/main/java/uk/org/taverna/commons/services/InvalidConfigurationException.java
----------------------------------------------------------------------
diff --git a/taverna-services-api/src/main/java/uk/org/taverna/commons/services/InvalidConfigurationException.java b/taverna-services-api/src/main/java/uk/org/taverna/commons/services/InvalidConfigurationException.java
deleted file mode 100644
index 0f118d6..0000000
--- a/taverna-services-api/src/main/java/uk/org/taverna/commons/services/InvalidConfigurationException.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package uk.org.taverna.commons.services;
-
-/**
- * Thrown when a Configuration is not valid for a Configurable.
- *
- * @author David Withers
- */
-@SuppressWarnings("serial")
-public class InvalidConfigurationException extends Exception {
-
- public InvalidConfigurationException() {
- super();
- }
-
- public InvalidConfigurationException(String message) {
- super(message);
- }
-
- public InvalidConfigurationException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public InvalidConfigurationException(Throwable cause) {
- super(cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-services-api/src/main/java/uk/org/taverna/commons/services/ServiceRegistry.java
----------------------------------------------------------------------
diff --git a/taverna-services-api/src/main/java/uk/org/taverna/commons/services/ServiceRegistry.java b/taverna-services-api/src/main/java/uk/org/taverna/commons/services/ServiceRegistry.java
deleted file mode 100644
index a40a1d7..0000000
--- a/taverna-services-api/src/main/java/uk/org/taverna/commons/services/ServiceRegistry.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package uk.org.taverna.commons.services;
-
-import java.net.URI;
-import java.util.Set;
-
-import uk.org.taverna.scufl2.api.port.InputActivityPort;
-import uk.org.taverna.scufl2.api.port.OutputActivityPort;
-
-import com.fasterxml.jackson.databind.JsonNode;
-
-/**
- * Register of Taverna services.
- *
- * @author David Withers
- */
-public interface ServiceRegistry {
-
- /**
- * Returns the activity types in the registry.
- *
- * @return the activity types in the registry
- */
- public Set<URI> getActivityTypes();
-
- /**
- * Returns the JSON Schema for the configuration required by an activity.
- *
- * @param activityType
- * the activity type
- * @return the JSON Schema for the configuration required by an activity
- * @throws ActivityTypeNotFoundException
- * if the activity type is not in the registry
- */
- public JsonNode getActivityConfigurationSchema(URI activityType)
- throws InvalidConfigurationException, ActivityTypeNotFoundException;
-
- /**
- * Returns the input ports that the activity type requires to be present in order to execute
- * with the specified configuration.
- * <p>
- * If the activity does not require any input port for the configuration then an empty set is
- * returned.
- *
- * @param configuration
- * the activity configuration
- * @throws ActivityTypeNotFoundException
- * if the activity type is not in the registry
- * @return the input ports that the activity requires to be present in order to execute
- */
- public Set<InputActivityPort> getActivityInputPorts(URI activityType,
- JsonNode configuration) throws InvalidConfigurationException, ActivityTypeNotFoundException;
-
- /**
- * Returns the output ports that the activity type requires to be present in order to execute
- * with the specified configuration.
- * <p>
- * If the activity type does not require any output ports for the configuration then an empty
- * set is returned.
- *
- * @param configuration
- * the activity configuration
- * @throws ActivityTypeNotFoundException
- * if the activity type is not in the registry
- * @return the output ports that the activity requires to be present in order to execute
- */
- public Set<OutputActivityPort> getActivityOutputPorts(URI activityType,
- JsonNode configuration) throws InvalidConfigurationException, ActivityTypeNotFoundException;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-services-impl/.project
----------------------------------------------------------------------
diff --git a/taverna-services-impl/.project b/taverna-services-impl/.project
deleted file mode 100644
index e2b1c3f..0000000
--- a/taverna-services-impl/.project
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>taverna-services-impl</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-services-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-services-impl/pom.xml b/taverna-services-impl/pom.xml
deleted file mode 100644
index 09b78cc..0000000
--- a/taverna-services-impl/pom.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>uk.org.taverna.commons</groupId>
- <artifactId>taverna-commons</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </parent>
- <artifactId>taverna-services-impl</artifactId>
- <version>0.1.0-SNAPSHOT</version>
- <packaging>bundle</packaging>
- <name>Taverna Services Implementation</name>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Import-Package>uk.org.taverna.commons.services;provide:=true,*</Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>uk.org.taverna.commons</groupId>
- <artifactId>taverna-services-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>uk.org.taverna.platform</groupId>
- <artifactId>taverna-capability-api</artifactId>
- <version>${platform.version}</version>
- </dependency>
- <dependency>
- <groupId>uk.org.taverna.scufl2</groupId>
- <artifactId>scufl2-api</artifactId>
- <version>${scufl2.version}</version>
- </dependency>
- </dependencies>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-services-impl/src/main/java/uk/org/taverna/commons/services/impl/ServiceRegistryImpl.java
----------------------------------------------------------------------
diff --git a/taverna-services-impl/src/main/java/uk/org/taverna/commons/services/impl/ServiceRegistryImpl.java b/taverna-services-impl/src/main/java/uk/org/taverna/commons/services/impl/ServiceRegistryImpl.java
deleted file mode 100644
index 6847f75..0000000
--- a/taverna-services-impl/src/main/java/uk/org/taverna/commons/services/impl/ServiceRegistryImpl.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package uk.org.taverna.commons.services.impl;
-
-import java.net.URI;
-import java.util.Set;
-
-import uk.org.taverna.commons.services.ActivityTypeNotFoundException;
-import uk.org.taverna.commons.services.InvalidConfigurationException;
-import uk.org.taverna.commons.services.ServiceRegistry;
-import uk.org.taverna.platform.capability.api.ActivityConfigurationException;
-import uk.org.taverna.platform.capability.api.ActivityNotFoundException;
-import uk.org.taverna.platform.capability.api.ActivityService;
-import uk.org.taverna.scufl2.api.port.InputActivityPort;
-import uk.org.taverna.scufl2.api.port.OutputActivityPort;
-
-import com.fasterxml.jackson.databind.JsonNode;
-
-/**
- * Simple implementation of a ServiceRegistry that discovers available services from the
- * ActivityService.
- *
- * @author David Withers
- */
-public class ServiceRegistryImpl implements ServiceRegistry {
-
- private ActivityService activityService;
-
- @Override
- public Set<URI> getActivityTypes() {
- return activityService.getActivityTypes();
- }
-
- @Override
- public JsonNode getActivityConfigurationSchema(URI activityType)
- throws InvalidConfigurationException, ActivityTypeNotFoundException {
- try {
- return activityService.getActivityConfigurationSchema(activityType);
- } catch (ActivityConfigurationException e) {
- throw new InvalidConfigurationException(e);
- } catch (ActivityNotFoundException e) {
- throw new ActivityTypeNotFoundException(e);
- }
- }
-
- @Override
- public Set<InputActivityPort> getActivityInputPorts(URI activityType, JsonNode configuration)
- throws InvalidConfigurationException, ActivityTypeNotFoundException {
- try {
- return activityService.getActivityInputPorts(activityType, configuration);
- } catch (ActivityConfigurationException e) {
- throw new InvalidConfigurationException(e);
- } catch (ActivityNotFoundException e) {
- throw new ActivityTypeNotFoundException(e);
- }
- }
-
- @Override
- public Set<OutputActivityPort> getActivityOutputPorts(URI activityType, JsonNode configuration)
- throws InvalidConfigurationException, ActivityTypeNotFoundException {
- try {
- return activityService.getActivityOutputPorts(activityType, configuration);
- } catch (ActivityConfigurationException e) {
- throw new InvalidConfigurationException(e);
- } catch (ActivityNotFoundException e) {
- throw new ActivityTypeNotFoundException(e);
- }
- }
-
- public void setActivityService(ActivityService activityService) {
- this.activityService = activityService;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-services-impl/src/main/resources/META-INF/spring/taverna-services-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-services-impl/src/main/resources/META-INF/spring/taverna-services-context-osgi.xml b/taverna-services-impl/src/main/resources/META-INF/spring/taverna-services-context-osgi.xml
deleted file mode 100644
index 70fdfef..0000000
--- a/taverna-services-impl/src/main/resources/META-INF/spring/taverna-services-context-osgi.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:beans="http://www.springframework.org/schema/beans"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/osgi
- http://www.springframework.org/schema/osgi/spring-osgi.xsd">
-
- <service ref="serviceRegistry" interface="uk.org.taverna.commons.services.ServiceRegistry" />
-
- <reference id="activityService" interface="uk.org.taverna.platform.capability.api.ActivityService" />
-
-</beans:beans>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fea36501/taverna-services-impl/src/main/resources/META-INF/spring/taverna-services-context.xml
----------------------------------------------------------------------
diff --git a/taverna-services-impl/src/main/resources/META-INF/spring/taverna-services-context.xml b/taverna-services-impl/src/main/resources/META-INF/spring/taverna-services-context.xml
deleted file mode 100644
index 72c88d1..0000000
--- a/taverna-services-impl/src/main/resources/META-INF/spring/taverna-services-context.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <bean id="serviceRegistry" class="uk.org.taverna.commons.services.impl.ServiceRegistryImpl">
- <property name="activityService" ref="activityService" />
- </bean>
-
-</beans>
[38/50] [abbrv] incubator-taverna-osgi git commit: JUST the apache
license
Posted by st...@apache.org.
JUST the apache license
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/d27ddcd6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/d27ddcd6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/d27ddcd6
Branch: refs/heads/master
Commit: d27ddcd6159b502ee55285ab9863d92588e45dc2
Parents: 7724dde
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Fri Dec 19 17:37:09 2014 -0600
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Fri Dec 19 17:37:09 2014 -0600
----------------------------------------------------------------------
LICENSE | 46 ----------------------------------------------
1 file changed, 46 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/d27ddcd6/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 944080e..68c771a 100644
--- a/LICENSE
+++ b/LICENSE
@@ -174,49 +174,3 @@
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
-----------------------------------------------------------------------------------
-The following files contain code contributed by Plugged In Software:
-
-src/main/java/com/hp/hpl/jena/rdf/arp/ExtendedHandler.java
-src/main/java/com/hp/hpl/jena/rdf/arp/impl/XMLHandler.java
-src/main/java/com/hp/hpl/jena/rdf/arp/ARP.java
-
- (c) Copyright 2003, Plugged In Software
-
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------------
-
-- - - - - - - - - - - - - - - - - - - - - - -
-
- Copyright (c) 2004-2009 Mort Bay Consulting Pty. Ltd.
-
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License v1.0
-and Apache License v2.0 which accompanies this distribution.
-
-The Eclipse Public License is available at
- http://www.eclipse.org/legal/epl-v10.html
-The Apache License v2.0 is available at
- http://www.opensource.org/licenses/apache2.0.php
[37/50] [abbrv] incubator-taverna-osgi git commit: Apache License 2.0
Posted by st...@apache.org.
Apache License 2.0
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/7724dde4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/7724dde4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/7724dde4
Branch: refs/heads/master
Commit: 7724dde4fca035caae7559e12869dc02bf242ba6
Parents: fe2ff84
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Fri Dec 19 17:36:42 2014 -0600
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Fri Dec 19 17:36:42 2014 -0600
----------------------------------------------------------------------
LICENSE | 222 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 222 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/7724dde4/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..944080e
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,222 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+----------------------------------------------------------------------------------
+The following files contain code contributed by Plugged In Software:
+
+src/main/java/com/hp/hpl/jena/rdf/arp/ExtendedHandler.java
+src/main/java/com/hp/hpl/jena/rdf/arp/impl/XMLHandler.java
+src/main/java/com/hp/hpl/jena/rdf/arp/ARP.java
+
+ (c) Copyright 2003, Plugged In Software
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+----------------------------------------------------------------------------------
+
+- - - - - - - - - - - - - - - - - - - - - - -
+
+ Copyright (c) 2004-2009 Mort Bay Consulting Pty. Ltd.
+
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+and Apache License v2.0 which accompanies this distribution.
+
+The Eclipse Public License is available at
+ http://www.eclipse.org/legal/epl-v10.html
+The Apache License v2.0 is available at
+ http://www.opensource.org/licenses/apache2.0.php
[23/50] [abbrv] incubator-taverna-osgi git commit: Using taverna
parent to get version numbers T3-1195
Posted by st...@apache.org.
Using taverna parent to get version numbers T3-1195
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/897484e7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/897484e7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/897484e7
Branch: refs/heads/master
Commit: 897484e79192a7970c654ea7725c9bd4c7429784
Parents: 0e8d428
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Wed Jul 2 14:48:16 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Wed Jul 2 14:48:16 2014 +0100
----------------------------------------------------------------------
pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/897484e7/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d1ca67b..0600940 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,9 +2,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>net.sf.taverna</groupId>
- <artifactId>parent</artifactId>
- <version>0.2.2011-02-17</version>
+ <groupId>net.sf.taverna</groupId>
+ <artifactId>taverna-parent</artifactId>
+ <version>3.0.1-SNAPSHOT</version>
</parent>
<groupId>uk.org.taverna.osgi</groupId>
<artifactId>osgi-launcher</artifactId>
@@ -15,7 +15,7 @@
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
- <version>4.3.1</version>
+ <version>${osgi.core.version}</version>
</dependency>
</dependencies>
<repositories>
[35/50] [abbrv] incubator-taverna-osgi git commit: Merge branch
'taverna3-osgi-launcher'
Posted by st...@apache.org.
Merge branch 'taverna3-osgi-launcher'
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/12502cdd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/12502cdd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/12502cdd
Branch: refs/heads/master
Commit: 12502cdd674c7e0d1de310f6c5b59db33cae92a6
Parents: 34d65c4 0153c7d
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu Dec 18 22:33:09 2014 -0600
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu Dec 18 22:33:09 2014 -0600
----------------------------------------------------------------------
osgi-launcher/pom.xml | 37 ++
.../java/uk/org/taverna/osgi/OsgiLauncher.java | 434 +++++++++++++++++++
taverna-osgi/pom.xml | 37 --
.../java/uk/org/taverna/osgi/OsgiLauncher.java | 434 -------------------
4 files changed, 471 insertions(+), 471 deletions(-)
----------------------------------------------------------------------
[46/50] [abbrv] incubator-taverna-osgi git commit:
org.apache.taverna.osgi .. and com.example
Posted by st...@apache.org.
org.apache.taverna.osgi .. and com.example
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/346d0a31
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/346d0a31
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/346d0a31
Branch: refs/heads/master
Commit: 346d0a3137de6db10e803296cba822e3cd92be2b
Parents: be905ac
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Dec 28 02:53:33 2014 -0600
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Dec 28 02:53:33 2014 -0600
----------------------------------------------------------------------
.../src/test/resources/unit/plugin-config.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/346d0a31/taverna-maven-plugin/src/test/resources/unit/plugin-config.xml
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/test/resources/unit/plugin-config.xml b/taverna-maven-plugin/src/test/resources/unit/plugin-config.xml
index a8c1723..0d23438 100644
--- a/taverna-maven-plugin/src/test/resources/unit/plugin-config.xml
+++ b/taverna-maven-plugin/src/test/resources/unit/plugin-config.xml
@@ -2,18 +2,18 @@
<build>
<plugins>
<plugin>
- <groupId>net.sf.taverna.t2.maven.plugins</groupId>
+ <groupId>org.apache.taverna.osgi</groupId>
<artifactId>taverna-maven-plugin</artifactId>
<configuration>
<buildDirectory>${basedir}/target/test/unit</buildDirectory>
<project>
- <groupId>net.sf.taverna.t2</groupId>
+ <groupId>com.example</groupId>
<artifactId>example-plugin</artifactId>
<version>0.1.0</version>
- <name>Taverna 2 Example Plugin</name>
+ <name>Example Plugin</name>
</project>
</configuration>
</plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
[25/50] [abbrv] incubator-taverna-osgi git commit: Make compatible
with Maven 3.2
Posted by st...@apache.org.
Make compatible with Maven 3.2
(but now we require 3.2 :( )
org.sonatype.aether -> org.eclipse.aether
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/01a7c47e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/01a7c47e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/01a7c47e
Branch: refs/heads/master
Commit: 01a7c47e9644fd01f2ac55ab3d58f9345ea88a78
Parents: 9d6d52a
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Tue Oct 28 12:50:02 2014 +0000
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Tue Oct 28 12:50:02 2014 +0000
----------------------------------------------------------------------
pom.xml | 11 +++++++----
.../sf/taverna/t2/maven/plugins/MavenOsgiUtils.java | 6 +++---
.../t2/maven/plugins/TavernaPluginGenerateMojo.java | 2 +-
.../maven/plugins/TavernaPluginPrepareBundlesMojo.java | 2 +-
.../t2/maven/plugins/TavernaProfileGenerateMojo.java | 2 +-
.../maven/plugins/TavernaPluginGenerateMojoTest.java | 13 -------------
6 files changed, 13 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/01a7c47e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index aab045b..74d3ed5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,6 +6,9 @@
<groupId>net.sf.taverna</groupId>
<version>0.2.2011-02-17</version>
</parent>
+ <prerequisites>
+ <maven>3.2.0</maven>
+ </prerequisites>
<groupId>net.sf.taverna.t2.maven.plugins</groupId>
<artifactId>taverna-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
@@ -13,7 +16,7 @@
<name>Maven Taverna Plugin</name>
<description>A Maven plugin for packaging and deploying Taverna plugins</description>
<properties>
- <maven.version>3.0.5</maven.version>
+ <maven.version>3.2.3</maven.version>
<mavenArchiverVersion>2.5</mavenArchiverVersion>
</properties>
<build>
@@ -21,7 +24,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
- <version>3.2</version>
+ <version>3.3</version>
<configuration>
<!-- see http://jira.codehaus.org/browse/MNG-5346 -->
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
@@ -56,7 +59,7 @@
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-annotations</artifactId>
- <version>3.2</version>
+ <version>3.3</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -96,7 +99,7 @@
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
- <version>1.2</version>
+ <version>3.2.0</version>
<scope>test</scope>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/01a7c47e/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java b/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
index fe7e225..6901119 100644
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
+++ b/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
@@ -45,9 +45,9 @@ import org.apache.maven.project.DependencyResolutionException;
import org.apache.maven.project.DependencyResolutionResult;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectDependenciesResolver;
-import org.sonatype.aether.RepositorySystemSession;
-import org.sonatype.aether.graph.DependencyNode;
-import org.sonatype.aether.util.filter.ScopeDependencyFilter;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.util.filter.ScopeDependencyFilter;
import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
import aQute.bnd.header.Attrs;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/01a7c47e/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java b/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
index 355210b..0ec94f4 100644
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
+++ b/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
@@ -42,7 +42,7 @@ import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectDependenciesResolver;
import org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter;
import org.apache.maven.shared.osgi.Maven2OsgiConverter;
-import org.sonatype.aether.RepositorySystemSession;
+import org.eclipse.aether.RepositorySystemSession;
import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/01a7c47e/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java b/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java
index 7521017..497151f 100644
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java
+++ b/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java
@@ -36,7 +36,7 @@ import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectDependenciesResolver;
-import org.sonatype.aether.RepositorySystemSession;
+import org.eclipse.aether.RepositorySystemSession;
/**
* Prepares the plugin OSGi bundles.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/01a7c47e/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java b/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
index b255561..1a0e9a0 100644
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
+++ b/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
@@ -44,7 +44,7 @@ import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectDependenciesResolver;
import org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter;
import org.apache.maven.shared.osgi.Maven2OsgiConverter;
-import org.sonatype.aether.RepositorySystemSession;
+import org.eclipse.aether.RepositorySystemSession;
import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/01a7c47e/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java b/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java
index f5701bc..6f21fb1 100644
--- a/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java
+++ b/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java
@@ -20,22 +20,9 @@
******************************************************************************/
package net.sf.taverna.t2.maven.plugins;
-import java.io.File;
-import java.util.Collections;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.DefaultArtifact;
-import org.apache.maven.artifact.repository.DefaultArtifactRepository;
-import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
-import org.apache.maven.artifact.versioning.VersionRange;
-import org.apache.maven.execution.MavenExecutionRequest;
-import org.apache.maven.execution.MavenExecutionResult;
-import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-import org.apache.maven.project.MavenProject;
import org.junit.Ignore;
import org.junit.Test;
-import org.sonatype.aether.RepositorySystemSession;
/**
* Unit tests for TavernaPluginGenerateMojo.
[09/50] [abbrv] incubator-taverna-osgi git commit: extended gitignore
Posted by st...@apache.org.
extended gitignore
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/219e8da2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/219e8da2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/219e8da2
Branch: refs/heads/master
Commit: 219e8da2521f1da004e3898d45edd7199e2af836
Parents: 2646c66
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Fri May 9 12:07:19 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Fri May 9 12:07:19 2014 +0100
----------------------------------------------------------------------
.gitignore | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/219e8da2/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index da8dcd4..ebe0e5b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,24 @@
+# ignore project files #
.classpath
.project
.settings/
+catalog-v001.xml
+
+# ignore target files #
target/
-.svn
+bin/
+build/
+dist/
+apidoc/
*.swp
-catalog-v001.xml
+
+# ignore svn files if there
+.svn
+
+# ignore log files #
+*.log
+/logs/*
+*/logs/*
+
+
+
[34/50] [abbrv] incubator-taverna-osgi git commit: taverna-osgi ->
osgi-launcher
Posted by st...@apache.org.
taverna-osgi -> osgi-launcher
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/0153c7d8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/0153c7d8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/0153c7d8
Branch: refs/heads/master
Commit: 0153c7d81cb35935afc01d0408160faf1d302c15
Parents: b04134c
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu Dec 18 22:32:55 2014 -0600
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu Dec 18 22:32:55 2014 -0600
----------------------------------------------------------------------
osgi-launcher/pom.xml | 37 ++
.../java/uk/org/taverna/osgi/OsgiLauncher.java | 434 +++++++++++++++++++
taverna-osgi/pom.xml | 37 --
.../java/uk/org/taverna/osgi/OsgiLauncher.java | 434 -------------------
4 files changed, 471 insertions(+), 471 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/0153c7d8/osgi-launcher/pom.xml
----------------------------------------------------------------------
diff --git a/osgi-launcher/pom.xml b/osgi-launcher/pom.xml
new file mode 100644
index 0000000..0868c28
--- /dev/null
+++ b/osgi-launcher/pom.xml
@@ -0,0 +1,37 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>net.sf.taverna</groupId>
+ <artifactId>taverna-parent</artifactId>
+ <version>3.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>uk.org.taverna.osgi</groupId>
+ <artifactId>osgi-launcher</artifactId>
+ <version>0.1.1-SNAPSHOT</version>
+ <name>OSGi Framework Launcher</name>
+ <description>Launches an OSGi framework and handles loading and starting of OSGi bundles and Spring DM managed services</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>${osgi.core.version}</version>
+ </dependency>
+ </dependencies>
+ <repositories>
+ <repository>
+ <id>mygrid-repository</id>
+ <name>myGrid Repository</name>
+ <url>http://www.mygrid.org.uk/maven/repository</url>
+ </repository>
+ <repository>
+ <id>mygrid-snapshot-repository</id>
+ <name>myGrid Snapshot Repository</name>
+ <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots />
+ </repository>
+ </repositories>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/0153c7d8/osgi-launcher/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java
----------------------------------------------------------------------
diff --git a/osgi-launcher/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java b/osgi-launcher/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java
new file mode 100644
index 0000000..cfd006b
--- /dev/null
+++ b/osgi-launcher/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java
@@ -0,0 +1,434 @@
+/*******************************************************************************
+ * Copyright (C) 2012 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.osgi;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.ServiceLoader;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
+
+/**
+ * OSGi Framework launcher.
+ *
+ * Handles loading and starting of OSGi bundles and Spring DM managed services.
+ *
+ * An implementation of an OSGi Service Platform Release 4.1 (or higher) must be available on the
+ * classpath.
+ *
+ * @author David Withers
+ */
+public class OsgiLauncher {
+
+ /**
+ * Default boot delegation packages.
+ */
+ public static final String DEFAULT_BOOT_DELEGATION_PACKAGES = "sun.*,com.sun.*,java.*";
+
+ /**
+ * Default system packages.
+ */
+ public static final String DEFAULT_SYSTEM_PACKAGES = "com.sun.org.apache.xml.internal.utils";
+
+ /**
+ * Default time to wait for services to start up.
+ */
+ private static final long serviceLoadTimeoutSeconds = 30;
+
+ private static final Logger logger = Logger.getLogger(OsgiLauncher.class.getName());
+
+ private Framework framework;
+ private BundleContext context;
+
+ private Map<String, String> frameworkConfiguration = new HashMap<String, String>();
+ private List<URI> bundlesToInstall = new ArrayList<URI>();
+ private List<Bundle> installedBundles = new ArrayList<Bundle>();
+ private Set<String> startedSpringContexts = new HashSet<String>();
+ private Bundle springOsgiExtender;
+
+ private OsgiLauncher(File storageDirectory) {
+ setStorageDirectory(storageDirectory);
+ setCleanStorageDirectory(true);
+ setBootDelegationPackages(DEFAULT_BOOT_DELEGATION_PACKAGES);
+ setSystemPackages(DEFAULT_SYSTEM_PACKAGES);
+ }
+
+ /**
+ * Constructs an <code>OsgiLauncher</code> that loads bundles from a directory.
+ *
+ * Any file in the specified directory with a .jar extension will be loaded when the framework
+ * is started.
+ *
+ * @param storageDirectory
+ * persistent storage area used by the framework
+ * @param storageDirectory
+ * the directory containing bundles to load
+ */
+ public OsgiLauncher(File storageDirectory, File bundleDirectory) {
+ this(storageDirectory);
+ List<File> jars = Arrays.asList(bundleDirectory.listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".jar");
+ }
+ }));
+ for (File jar : jars) {
+ bundlesToInstall.add(jar.toURI());
+ }
+ }
+
+ /**
+ * Constructs an <code>OsgiLauncher</code> that loads the specified bundles.
+ *
+ * @param storageDirectory
+ * persistent storage area used by the framework
+ * @param bundleURIs
+ * bundles to load
+ */
+ public OsgiLauncher(File storageDirectory, List<URI> bundleURIs) {
+ this(storageDirectory);
+ for (URI bundleURI : bundleURIs) {
+ bundlesToInstall.add(bundleURI);
+ }
+ }
+
+ /**
+ * Starts the OSGi framework, installs and starts the bundles.
+ *
+ * @throws BundleException
+ * if the framework could not be started
+ */
+ public void start() throws BundleException {
+ logger.info("Loading the OSGi Framework Factory");
+ FrameworkFactory frameworkFactory = ServiceLoader.load(FrameworkFactory.class).iterator()
+ .next();
+
+ logger.info("Creating the OSGi Framework");
+ framework = frameworkFactory.newFramework(frameworkConfiguration);
+ logger.info("Starting the OSGi Framework");
+ framework.start();
+
+ context = framework.getBundleContext();
+ context.addServiceListener(new ServiceListener() {
+ public void serviceChanged(ServiceEvent event) {
+ ServiceReference serviceReference = event.getServiceReference();
+ if (event.getType() == ServiceEvent.REGISTERED) {
+ Object property = serviceReference
+ .getProperty("org.springframework.context.service.name");
+ if (property != null) {
+ addStartedSpringContext(property.toString());
+ }
+ }
+ logger.fine((event.getType() == ServiceEvent.REGISTERED ? "Registering : "
+ : "Unregistering : ") + serviceReference);
+ }
+ });
+
+ installedBundles = installBundles(bundlesToInstall);
+
+ List<Bundle> bundlesToStart = new ArrayList<Bundle>();
+ for (Bundle bundle : installedBundles) {
+ if ("org.springframework.osgi.extender".equals(bundle.getSymbolicName())) {
+ springOsgiExtender = bundle;
+ } else {
+ bundlesToStart.add(bundle);
+ }
+ }
+ startBundles(bundlesToStart);
+ }
+
+ /**
+ * Starts SpringDM managed services.
+ *
+ * @param waitForServices
+ * if true waits for services to start before returning
+ * @throws BundleException
+ * if the framework has not been started or a service could not be started
+ */
+ public void startServices(boolean waitForServices) throws BundleException {
+ if (framework == null || framework.getState() != Bundle.ACTIVE) {
+ throw new BundleException("Framework not started");
+ }
+ if (springOsgiExtender != null) {
+ logger.info("Starting Spring OSGi Extender");
+ springOsgiExtender.start();
+ if (waitForServices) {
+ logger.info("Waiting for spring contexts to be started");
+ for (Bundle bundle : installedBundles) {
+ if (bundle.getState() == Bundle.ACTIVE) {
+ if (hasSpringContext(bundle)) {
+ logger.fine("Waiting for " + bundle.getSymbolicName());
+ waitForSpringContext(context, bundle.getSymbolicName(), serviceLoadTimeoutSeconds);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Stops the OSGI framework.
+ *
+ * @throws BundleException
+ * if the framework has not been started
+ * @throws InterruptedException
+ * if the thread is interrupted while the framework is stopping
+ */
+ public void stop() throws BundleException, InterruptedException {
+ if (framework == null || framework.getState() != Bundle.ACTIVE) {
+ throw new BundleException("Framework not started");
+ }
+ framework.stop();
+ framework.waitForStop(0);
+ context = null;
+ }
+
+ /**
+ * Installs the bundles specified by the URIs into the framework.
+ *
+ * @param bundlesURIs
+ * the URIs of the bundles to install
+ * @return the installed bundles
+ * @throws BundleException
+ * if a bundle could not be installed
+ */
+ public List<Bundle> installBundles(List<URI> bundlesURIs) throws BundleException {
+ List<Bundle> installedBundles = new ArrayList<Bundle>();
+ logger.info("Installing bundles into the OSGi Framework");
+ for (URI bundleURI : bundlesURIs) {
+ installedBundles.add(installBundle(bundleURI));
+ }
+ return installedBundles;
+ }
+
+ /**
+ * Installs the bundle specified by the URI into the framework.
+ *
+ * @param bundleURI
+ * the URI of the bundle to install
+ * @return the installed bundle
+ * @throws BundleException
+ * if the bundle could not be installed
+ */
+ public Bundle installBundle(URI bundleURI) throws BundleException {
+ logger.fine("Installing bundle " + bundleURI);
+ return context.installBundle(bundleURI.toASCIIString());
+ }
+
+ /**
+ * Starts the bundles.
+ *
+ * If a bundle is a fragment bundle that bundle is not started.
+ *
+ * @param bundles
+ * the bundles to start
+ * @throws BundleException
+ * if a bundle could not be started
+ */
+ public void startBundles(List<Bundle> bundles) throws BundleException {
+ logger.info("Starting bundles in the OSGi Framework");
+ for (Bundle bundle : bundles) {
+ startBundle(bundle);
+ }
+ }
+
+ /**
+ * Starts the bundle.
+ *
+ * If the bundle is a fragment bundle the bundle is not started.
+ *
+ * @param bundle
+ * the bundle to start
+ * @throws BundleException
+ * if the bundle could not be started
+ */
+ public void startBundle(Bundle bundle) throws BundleException {
+ if (bundle.getHeaders().get(Constants.FRAGMENT_HOST) == null) {
+ logger.fine("Starting bundle " + bundle);
+ bundle.start();
+ }
+ }
+
+ /**
+ * Returns the context. Returns <code>null</code> if the framework is not started.
+ *
+ * @return the context
+ */
+ public BundleContext getContext() {
+ return context;
+ }
+
+ /**
+ * Sets the configuration to use when creating the OSGi framework.
+ *
+ * @param frameworkConfiguration the configuration to use when creating the OSGi framework
+ */
+ public void setFrameworkConfiguration(Map<String, String> frameworkConfiguration) {
+ this.frameworkConfiguration = frameworkConfiguration;
+ }
+
+ /**
+ * Adds boot delegation packages.
+ *
+ * Multiple packages must be separated by a ','.
+ *
+ * @param additionalBootDelegationPackages
+ * boot delegation packages to add
+ */
+ public void addBootDelegationPackages(String additionalBootDelegationPackages) {
+ String bootDelegationPackages = frameworkConfiguration
+ .get(Constants.FRAMEWORK_BOOTDELEGATION);
+ if (bootDelegationPackages == null || bootDelegationPackages.isEmpty()) {
+ bootDelegationPackages = additionalBootDelegationPackages;
+ } else {
+ bootDelegationPackages = bootDelegationPackages + ","
+ + additionalBootDelegationPackages;
+ }
+ frameworkConfiguration.put(Constants.FRAMEWORK_BOOTDELEGATION, bootDelegationPackages);
+ }
+
+ /**
+ * Sets the boot delegation packages.
+ *
+ * Multiple packages must be separated by a ','.
+ *
+ * @param bootDelegationPackages
+ * the boot delegation packages
+ */
+ public void setBootDelegationPackages(String bootDelegationPackages) {
+ frameworkConfiguration.put(Constants.FRAMEWORK_BOOTDELEGATION, bootDelegationPackages);
+ }
+
+ /**
+ * Adds system packages.
+ *
+ * Multiple packages must be separated by a ','.
+ *
+ * @param additionalSystemPackages
+ * system packages to add
+ */
+ public void addSystemPackages(String additionalSystemPackages) {
+ String systemPackages = frameworkConfiguration
+ .get(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA);
+ if (systemPackages == null || systemPackages.isEmpty()) {
+ systemPackages = additionalSystemPackages;
+ } else {
+ systemPackages = systemPackages + "," + additionalSystemPackages;
+ }
+ frameworkConfiguration.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, systemPackages);
+ }
+
+ /**
+ * Sets the system packages.
+ *
+ * Multiple packages must be separated by a ','.
+ *
+ * @param systemPackages
+ * the system packages
+ */
+ public void setSystemPackages(String systemPackages) {
+ frameworkConfiguration.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, systemPackages);
+ }
+
+ /**
+ * Sets the persistent storage area used by the framework.
+ *
+ * @param storageDirectory the persistent storage area used by the framework
+ */
+ public void setStorageDirectory(File storageDirectory) {
+ frameworkConfiguration.put(Constants.FRAMEWORK_STORAGE, storageDirectory.getAbsolutePath());
+ }
+
+ /**
+ * Set whether the storage directory should be cleaned on startup.
+ *
+ * @param cleanStorageDirectory
+ * whether the storage directory should be cleaned on startup
+ */
+ public void setCleanStorageDirectory(boolean cleanStorageDirectory) {
+ if (cleanStorageDirectory) {
+ frameworkConfiguration.put(Constants.FRAMEWORK_STORAGE_CLEAN,
+ Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);
+ } else {
+ frameworkConfiguration.remove(Constants.FRAMEWORK_STORAGE_CLEAN);
+ }
+ }
+
+ /**
+ * Returns true if a bundle contains spring context files.
+ *
+ * @param bundle
+ * the bundle to check
+ * @return true if a bundle contains spring context files
+ */
+ private boolean hasSpringContext(Bundle bundle) {
+ String springFilesLocation = "META-INF/spring";
+ // check for custom spring files location
+ @SuppressWarnings("rawtypes")
+ Dictionary headers = bundle.getHeaders();
+ if (headers != null) {
+ Object header = headers.get("Spring-Context");
+ if (header != null) {
+ springFilesLocation = header.toString().trim();
+ }
+ }
+ @SuppressWarnings("rawtypes")
+ Enumeration springFiles = bundle.findEntries(springFilesLocation, "*.xml", false);
+ return springFiles != null && springFiles.hasMoreElements();
+ }
+
+ private synchronized void waitForSpringContext(BundleContext context, String springContext,
+ long timeoutSeconds) {
+ long timeLeftToWait = timeoutSeconds * 1000;
+ long startTime = System.currentTimeMillis();
+
+ while (!startedSpringContexts.contains(springContext) && timeLeftToWait > 0) {
+ try {
+ wait(timeLeftToWait);
+ } catch (InterruptedException e) {}
+ timeLeftToWait = timeLeftToWait - (System.currentTimeMillis() - startTime);
+ }
+ }
+
+ private synchronized void addStartedSpringContext(String springContext) {
+ startedSpringContexts.add(springContext);
+ notifyAll();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/0153c7d8/taverna-osgi/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-osgi/pom.xml b/taverna-osgi/pom.xml
deleted file mode 100644
index 0868c28..0000000
--- a/taverna-osgi/pom.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>net.sf.taverna</groupId>
- <artifactId>taverna-parent</artifactId>
- <version>3.0.1-SNAPSHOT</version>
- </parent>
- <groupId>uk.org.taverna.osgi</groupId>
- <artifactId>osgi-launcher</artifactId>
- <version>0.1.1-SNAPSHOT</version>
- <name>OSGi Framework Launcher</name>
- <description>Launches an OSGi framework and handles loading and starting of OSGi bundles and Spring DM managed services</description>
- <dependencies>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>${osgi.core.version}</version>
- </dependency>
- </dependencies>
- <repositories>
- <repository>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository</url>
- </repository>
- <repository>
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- </repository>
- </repositories>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/0153c7d8/taverna-osgi/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java
----------------------------------------------------------------------
diff --git a/taverna-osgi/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java b/taverna-osgi/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java
deleted file mode 100644
index cfd006b..0000000
--- a/taverna-osgi/src/main/java/uk/org/taverna/osgi/OsgiLauncher.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2012 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package uk.org.taverna.osgi;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.ServiceLoader;
-import java.util.Set;
-import java.util.logging.Logger;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceListener;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.launch.Framework;
-import org.osgi.framework.launch.FrameworkFactory;
-
-/**
- * OSGi Framework launcher.
- *
- * Handles loading and starting of OSGi bundles and Spring DM managed services.
- *
- * An implementation of an OSGi Service Platform Release 4.1 (or higher) must be available on the
- * classpath.
- *
- * @author David Withers
- */
-public class OsgiLauncher {
-
- /**
- * Default boot delegation packages.
- */
- public static final String DEFAULT_BOOT_DELEGATION_PACKAGES = "sun.*,com.sun.*,java.*";
-
- /**
- * Default system packages.
- */
- public static final String DEFAULT_SYSTEM_PACKAGES = "com.sun.org.apache.xml.internal.utils";
-
- /**
- * Default time to wait for services to start up.
- */
- private static final long serviceLoadTimeoutSeconds = 30;
-
- private static final Logger logger = Logger.getLogger(OsgiLauncher.class.getName());
-
- private Framework framework;
- private BundleContext context;
-
- private Map<String, String> frameworkConfiguration = new HashMap<String, String>();
- private List<URI> bundlesToInstall = new ArrayList<URI>();
- private List<Bundle> installedBundles = new ArrayList<Bundle>();
- private Set<String> startedSpringContexts = new HashSet<String>();
- private Bundle springOsgiExtender;
-
- private OsgiLauncher(File storageDirectory) {
- setStorageDirectory(storageDirectory);
- setCleanStorageDirectory(true);
- setBootDelegationPackages(DEFAULT_BOOT_DELEGATION_PACKAGES);
- setSystemPackages(DEFAULT_SYSTEM_PACKAGES);
- }
-
- /**
- * Constructs an <code>OsgiLauncher</code> that loads bundles from a directory.
- *
- * Any file in the specified directory with a .jar extension will be loaded when the framework
- * is started.
- *
- * @param storageDirectory
- * persistent storage area used by the framework
- * @param storageDirectory
- * the directory containing bundles to load
- */
- public OsgiLauncher(File storageDirectory, File bundleDirectory) {
- this(storageDirectory);
- List<File> jars = Arrays.asList(bundleDirectory.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.endsWith(".jar");
- }
- }));
- for (File jar : jars) {
- bundlesToInstall.add(jar.toURI());
- }
- }
-
- /**
- * Constructs an <code>OsgiLauncher</code> that loads the specified bundles.
- *
- * @param storageDirectory
- * persistent storage area used by the framework
- * @param bundleURIs
- * bundles to load
- */
- public OsgiLauncher(File storageDirectory, List<URI> bundleURIs) {
- this(storageDirectory);
- for (URI bundleURI : bundleURIs) {
- bundlesToInstall.add(bundleURI);
- }
- }
-
- /**
- * Starts the OSGi framework, installs and starts the bundles.
- *
- * @throws BundleException
- * if the framework could not be started
- */
- public void start() throws BundleException {
- logger.info("Loading the OSGi Framework Factory");
- FrameworkFactory frameworkFactory = ServiceLoader.load(FrameworkFactory.class).iterator()
- .next();
-
- logger.info("Creating the OSGi Framework");
- framework = frameworkFactory.newFramework(frameworkConfiguration);
- logger.info("Starting the OSGi Framework");
- framework.start();
-
- context = framework.getBundleContext();
- context.addServiceListener(new ServiceListener() {
- public void serviceChanged(ServiceEvent event) {
- ServiceReference serviceReference = event.getServiceReference();
- if (event.getType() == ServiceEvent.REGISTERED) {
- Object property = serviceReference
- .getProperty("org.springframework.context.service.name");
- if (property != null) {
- addStartedSpringContext(property.toString());
- }
- }
- logger.fine((event.getType() == ServiceEvent.REGISTERED ? "Registering : "
- : "Unregistering : ") + serviceReference);
- }
- });
-
- installedBundles = installBundles(bundlesToInstall);
-
- List<Bundle> bundlesToStart = new ArrayList<Bundle>();
- for (Bundle bundle : installedBundles) {
- if ("org.springframework.osgi.extender".equals(bundle.getSymbolicName())) {
- springOsgiExtender = bundle;
- } else {
- bundlesToStart.add(bundle);
- }
- }
- startBundles(bundlesToStart);
- }
-
- /**
- * Starts SpringDM managed services.
- *
- * @param waitForServices
- * if true waits for services to start before returning
- * @throws BundleException
- * if the framework has not been started or a service could not be started
- */
- public void startServices(boolean waitForServices) throws BundleException {
- if (framework == null || framework.getState() != Bundle.ACTIVE) {
- throw new BundleException("Framework not started");
- }
- if (springOsgiExtender != null) {
- logger.info("Starting Spring OSGi Extender");
- springOsgiExtender.start();
- if (waitForServices) {
- logger.info("Waiting for spring contexts to be started");
- for (Bundle bundle : installedBundles) {
- if (bundle.getState() == Bundle.ACTIVE) {
- if (hasSpringContext(bundle)) {
- logger.fine("Waiting for " + bundle.getSymbolicName());
- waitForSpringContext(context, bundle.getSymbolicName(), serviceLoadTimeoutSeconds);
- }
- }
- }
- }
- }
- }
-
- /**
- * Stops the OSGI framework.
- *
- * @throws BundleException
- * if the framework has not been started
- * @throws InterruptedException
- * if the thread is interrupted while the framework is stopping
- */
- public void stop() throws BundleException, InterruptedException {
- if (framework == null || framework.getState() != Bundle.ACTIVE) {
- throw new BundleException("Framework not started");
- }
- framework.stop();
- framework.waitForStop(0);
- context = null;
- }
-
- /**
- * Installs the bundles specified by the URIs into the framework.
- *
- * @param bundlesURIs
- * the URIs of the bundles to install
- * @return the installed bundles
- * @throws BundleException
- * if a bundle could not be installed
- */
- public List<Bundle> installBundles(List<URI> bundlesURIs) throws BundleException {
- List<Bundle> installedBundles = new ArrayList<Bundle>();
- logger.info("Installing bundles into the OSGi Framework");
- for (URI bundleURI : bundlesURIs) {
- installedBundles.add(installBundle(bundleURI));
- }
- return installedBundles;
- }
-
- /**
- * Installs the bundle specified by the URI into the framework.
- *
- * @param bundleURI
- * the URI of the bundle to install
- * @return the installed bundle
- * @throws BundleException
- * if the bundle could not be installed
- */
- public Bundle installBundle(URI bundleURI) throws BundleException {
- logger.fine("Installing bundle " + bundleURI);
- return context.installBundle(bundleURI.toASCIIString());
- }
-
- /**
- * Starts the bundles.
- *
- * If a bundle is a fragment bundle that bundle is not started.
- *
- * @param bundles
- * the bundles to start
- * @throws BundleException
- * if a bundle could not be started
- */
- public void startBundles(List<Bundle> bundles) throws BundleException {
- logger.info("Starting bundles in the OSGi Framework");
- for (Bundle bundle : bundles) {
- startBundle(bundle);
- }
- }
-
- /**
- * Starts the bundle.
- *
- * If the bundle is a fragment bundle the bundle is not started.
- *
- * @param bundle
- * the bundle to start
- * @throws BundleException
- * if the bundle could not be started
- */
- public void startBundle(Bundle bundle) throws BundleException {
- if (bundle.getHeaders().get(Constants.FRAGMENT_HOST) == null) {
- logger.fine("Starting bundle " + bundle);
- bundle.start();
- }
- }
-
- /**
- * Returns the context. Returns <code>null</code> if the framework is not started.
- *
- * @return the context
- */
- public BundleContext getContext() {
- return context;
- }
-
- /**
- * Sets the configuration to use when creating the OSGi framework.
- *
- * @param frameworkConfiguration the configuration to use when creating the OSGi framework
- */
- public void setFrameworkConfiguration(Map<String, String> frameworkConfiguration) {
- this.frameworkConfiguration = frameworkConfiguration;
- }
-
- /**
- * Adds boot delegation packages.
- *
- * Multiple packages must be separated by a ','.
- *
- * @param additionalBootDelegationPackages
- * boot delegation packages to add
- */
- public void addBootDelegationPackages(String additionalBootDelegationPackages) {
- String bootDelegationPackages = frameworkConfiguration
- .get(Constants.FRAMEWORK_BOOTDELEGATION);
- if (bootDelegationPackages == null || bootDelegationPackages.isEmpty()) {
- bootDelegationPackages = additionalBootDelegationPackages;
- } else {
- bootDelegationPackages = bootDelegationPackages + ","
- + additionalBootDelegationPackages;
- }
- frameworkConfiguration.put(Constants.FRAMEWORK_BOOTDELEGATION, bootDelegationPackages);
- }
-
- /**
- * Sets the boot delegation packages.
- *
- * Multiple packages must be separated by a ','.
- *
- * @param bootDelegationPackages
- * the boot delegation packages
- */
- public void setBootDelegationPackages(String bootDelegationPackages) {
- frameworkConfiguration.put(Constants.FRAMEWORK_BOOTDELEGATION, bootDelegationPackages);
- }
-
- /**
- * Adds system packages.
- *
- * Multiple packages must be separated by a ','.
- *
- * @param additionalSystemPackages
- * system packages to add
- */
- public void addSystemPackages(String additionalSystemPackages) {
- String systemPackages = frameworkConfiguration
- .get(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA);
- if (systemPackages == null || systemPackages.isEmpty()) {
- systemPackages = additionalSystemPackages;
- } else {
- systemPackages = systemPackages + "," + additionalSystemPackages;
- }
- frameworkConfiguration.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, systemPackages);
- }
-
- /**
- * Sets the system packages.
- *
- * Multiple packages must be separated by a ','.
- *
- * @param systemPackages
- * the system packages
- */
- public void setSystemPackages(String systemPackages) {
- frameworkConfiguration.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, systemPackages);
- }
-
- /**
- * Sets the persistent storage area used by the framework.
- *
- * @param storageDirectory the persistent storage area used by the framework
- */
- public void setStorageDirectory(File storageDirectory) {
- frameworkConfiguration.put(Constants.FRAMEWORK_STORAGE, storageDirectory.getAbsolutePath());
- }
-
- /**
- * Set whether the storage directory should be cleaned on startup.
- *
- * @param cleanStorageDirectory
- * whether the storage directory should be cleaned on startup
- */
- public void setCleanStorageDirectory(boolean cleanStorageDirectory) {
- if (cleanStorageDirectory) {
- frameworkConfiguration.put(Constants.FRAMEWORK_STORAGE_CLEAN,
- Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);
- } else {
- frameworkConfiguration.remove(Constants.FRAMEWORK_STORAGE_CLEAN);
- }
- }
-
- /**
- * Returns true if a bundle contains spring context files.
- *
- * @param bundle
- * the bundle to check
- * @return true if a bundle contains spring context files
- */
- private boolean hasSpringContext(Bundle bundle) {
- String springFilesLocation = "META-INF/spring";
- // check for custom spring files location
- @SuppressWarnings("rawtypes")
- Dictionary headers = bundle.getHeaders();
- if (headers != null) {
- Object header = headers.get("Spring-Context");
- if (header != null) {
- springFilesLocation = header.toString().trim();
- }
- }
- @SuppressWarnings("rawtypes")
- Enumeration springFiles = bundle.findEntries(springFilesLocation, "*.xml", false);
- return springFiles != null && springFiles.hasMoreElements();
- }
-
- private synchronized void waitForSpringContext(BundleContext context, String springContext,
- long timeoutSeconds) {
- long timeLeftToWait = timeoutSeconds * 1000;
- long startTime = System.currentTimeMillis();
-
- while (!startedSpringContexts.contains(springContext) && timeLeftToWait > 0) {
- try {
- wait(timeLeftToWait);
- } catch (InterruptedException e) {}
- timeLeftToWait = timeLeftToWait - (System.currentTimeMillis() - startTime);
- }
- }
-
- private synchronized void addStartedSpringContext(String springContext) {
- startedSpringContexts.add(springContext);
- notifyAll();
- }
-
-}
[45/50] [abbrv] incubator-taverna-osgi git commit: groupId
org.apache.taverna.osgi
Posted by st...@apache.org.
groupId org.apache.taverna.osgi
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/be905ac0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/be905ac0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/be905ac0
Branch: refs/heads/master
Commit: be905ac05c888e10f6bbdd67853039f5256a3e0f
Parents: 42fd0e4
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Dec 28 02:51:44 2014 -0600
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Dec 28 02:51:44 2014 -0600
----------------------------------------------------------------------
.../src/main/resources/META-INF/plexus/components.xml | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/be905ac0/taverna-maven-plugin/src/main/resources/META-INF/plexus/components.xml
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/resources/META-INF/plexus/components.xml b/taverna-maven-plugin/src/main/resources/META-INF/plexus/components.xml
index ad375db..d458176 100644
--- a/taverna-maven-plugin/src/main/resources/META-INF/plexus/components.xml
+++ b/taverna-maven-plugin/src/main/resources/META-INF/plexus/components.xml
@@ -7,10 +7,10 @@
</implementation>
<configuration>
<phases>
- <generate-resources>net.sf.taverna.t2.maven.plugins:taverna-maven-plugin:plugin-generate</generate-resources>
- <prepare-package>net.sf.taverna.t2.maven.plugins:taverna-maven-plugin:plugin-prepare-bundles</prepare-package>
+ <generate-resources>org.apache.taverna.osgi:taverna-maven-plugin:plugin-generate</generate-resources>
+ <prepare-package>org.apache.taverna.osgi:taverna-maven-plugin:plugin-prepare-bundles</prepare-package>
<package>org.apache.maven.plugins:maven-jar-plugin:jar</package>
- <deploy>net.sf.taverna.t2.maven.plugins:taverna-maven-plugin:plugin-deploy</deploy>
+ <deploy>org.apache.taverna.osgi:taverna-maven-plugin:plugin-deploy</deploy>
</phases>
</configuration>
</component>
@@ -21,10 +21,8 @@
</implementation>
<configuration>
<phases>
- <generate-resources>net.sf.taverna.t2.maven.plugins:taverna-maven-plugin:profile-generate
- </generate-resources>
- <deploy>net.sf.taverna.t2.maven.plugins:taverna-maven-plugin:profile-deploy
- </deploy>
+ <generate-resources>org.apache.taverna.osgi:taverna-maven-plugin:profile-generate</generate-resources>
+ <deploy>org.apache.taverna.osgi:taverna-maven-plugin:profile-deploy</deploy>
</phases>
</configuration>
</component>
[11/50] [abbrv] incubator-taverna-osgi git commit: travis
Posted by st...@apache.org.
travis
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/40c7622a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/40c7622a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/40c7622a
Branch: refs/heads/master
Commit: 40c7622aad98b2e25187478ed95138f7546037ba
Parents: 5631395
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu May 15 15:09:53 2014 +0100
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu May 15 15:09:53 2014 +0100
----------------------------------------------------------------------
.travis.yml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/40c7622a/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..dff5f3a
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1 @@
+language: java
[48/50] [abbrv] incubator-taverna-osgi git commit: Avoid setting
AxisProperties from here
Posted by st...@apache.org.
Avoid setting AxisProperties from here
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/6e565955
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/6e565955
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/6e565955
Branch: refs/heads/master
Commit: 6e5659553dea9aaeec15978cd5e78ea6a8f88609
Parents: 863892d
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Mon Jan 5 11:58:48 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Mon Jan 5 11:58:48 2015 +0000
----------------------------------------------------------------------
taverna-configuration-impl/pom.xml | 2 +-
.../configuration/proxy/impl/HttpProxyConfigurationImpl.java | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6e565955/taverna-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/pom.xml b/taverna-configuration-impl/pom.xml
index 3c00732..3be7a08 100644
--- a/taverna-configuration-impl/pom.xml
+++ b/taverna-configuration-impl/pom.xml
@@ -48,12 +48,12 @@
<artifactId>wsdl-generic</artifactId>
<version>${wsdl.generic.version}</version>
</dependency>
- -->
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>com.springsource.org.apache.axis</artifactId>
<version>${axis.version}</version>
</dependency>
+ -->
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/6e565955/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java b/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
index 7eb79f0..ddcdf65 100644
--- a/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
+++ b/taverna-configuration-impl/src/main/java/uk/org/taverna/configuration/proxy/impl/HttpProxyConfigurationImpl.java
@@ -24,7 +24,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
-import org.apache.axis.AxisProperties;
+//import org.apache.axis.AxisProperties;
import org.apache.log4j.Logger;
import uk.org.taverna.configuration.AbstractConfigurable;
@@ -117,7 +117,7 @@ public class HttpProxyConfigurationImpl extends AbstractConfigurable implements
} else {
System.setProperty(key, value);
}
- AxisProperties.setProperty(key, (value == null ? "" : value));
+ //AxisProperties.setProperty(key, (value == null ? "" : value));
}
@Override
[36/50] [abbrv] incubator-taverna-osgi git commit: New groupId
org.apache.taverna.osgi
Posted by st...@apache.org.
New groupId org.apache.taverna.osgi
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/fe2ff845
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/fe2ff845
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/fe2ff845
Branch: refs/heads/master
Commit: fe2ff8453026d69ca0f3a8249b8eebc4be3db292
Parents: 12502cd
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu Dec 18 22:34:58 2014 -0600
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu Dec 18 22:34:58 2014 -0600
----------------------------------------------------------------------
osgi-launcher/pom.xml | 26 ++-----------
taverna-app-configuration-api/pom.xml | 43 +++++----------------
taverna-app-configuration-impl/pom.xml | 49 +++++++-----------------
taverna-configuration-api/pom.xml | 34 +++--------------
taverna-configuration-impl/pom.xml | 59 +++++++++++------------------
taverna-download-api/pom.xml | 34 +++--------------
taverna-download-impl/pom.xml | 38 ++++---------------
taverna-osgi-schemas/pom.xml | 34 +++--------------
taverna-plugin-api/pom.xml | 44 ++++++---------------
taverna-plugin-impl/pom.xml | 50 +++++++-----------------
taverna-update-api/pom.xml | 32 +++-------------
taverna-update-impl/pom.xml | 50 +++++++-----------------
xml-parser-service/pom.xml | 30 ++-------------
xml-transformer-service/pom.xml | 30 ++-------------
14 files changed, 126 insertions(+), 427 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fe2ff845/osgi-launcher/pom.xml
----------------------------------------------------------------------
diff --git a/osgi-launcher/pom.xml b/osgi-launcher/pom.xml
index 0868c28..f2c6996 100644
--- a/osgi-launcher/pom.xml
+++ b/osgi-launcher/pom.xml
@@ -2,13 +2,11 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>net.sf.taverna</groupId>
- <artifactId>taverna-parent</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-osgi</artifactId>
+ <version>0.2.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>uk.org.taverna.osgi</groupId>
<artifactId>osgi-launcher</artifactId>
- <version>0.1.1-SNAPSHOT</version>
<name>OSGi Framework Launcher</name>
<description>Launches an OSGi framework and handles loading and starting of OSGi bundles and Spring DM managed services</description>
<dependencies>
@@ -18,20 +16,4 @@
<version>${osgi.core.version}</version>
</dependency>
</dependencies>
- <repositories>
- <repository>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository</url>
- </repository>
- <repository>
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- </repository>
- </repositories>
-</project>
\ No newline at end of file
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fe2ff845/taverna-app-configuration-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-api/pom.xml b/taverna-app-configuration-api/pom.xml
index d5a2dab..020cea7 100644
--- a/taverna-app-configuration-api/pom.xml
+++ b/taverna-app-configuration-api/pom.xml
@@ -1,42 +1,19 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>taverna-commons</artifactId>
- <groupId>uk.org.taverna.commons</groupId>
- <version>1.0.0-SNAPSHOT</version>
- </parent>
- <groupId>uk.org.taverna.configuration</groupId>
- <version>0.1.1-SNAPSHOT</version>
+ <parent>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-osgi</artifactId>
+ <version>0.2.0-incubating-SNAPSHOT</version>
+ </parent>
<artifactId>taverna-app-configuration-api</artifactId>
<packaging>bundle</packaging>
<dependencies>
<dependency>
- <groupId>uk.org.taverna.commons</groupId>
- <artifactId>taverna-xml-schemas</artifactId>
- <version>${taverna.commons.version}</version>
+ <groupId>${project.parent.groupId}</groupId>
+ <artifactId>taverna-osgi-schemas</artifactId>
+ <version>${project.parent.version}</version>
</dependency>
</dependencies>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
- <name>Taverna App Configuration API</name>
-</project>
\ No newline at end of file
+ <name>Apache Taverna App Configuration API</name>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fe2ff845/taverna-app-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-app-configuration-impl/pom.xml b/taverna-app-configuration-impl/pom.xml
index 1f87b07..85bc18c 100644
--- a/taverna-app-configuration-impl/pom.xml
+++ b/taverna-app-configuration-impl/pom.xml
@@ -1,15 +1,14 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>taverna-commons</artifactId>
- <groupId>uk.org.taverna.commons</groupId>
- <version>1.0.0-SNAPSHOT</version>
- </parent>
- <groupId>uk.org.taverna.configuration</groupId>
- <version>0.1.1-SNAPSHOT</version>
- <artifactId>taverna-app-configuration-impl</artifactId>
+ <parent>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-osgi</artifactId>
+ <version>0.2.0-incubating-SNAPSHOT</version>
+ </parent>
<packaging>bundle</packaging>
+ <artifactId>taverna-app-configuration-impl</artifactId>
+ <name>Apache Taverna App Configuration implementation</name>
<build>
<plugins>
<plugin>
@@ -25,15 +24,15 @@
</build>
<dependencies>
<dependency>
- <groupId>uk.org.taverna.configuration</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>taverna-app-configuration-api</artifactId>
- <version>${taverna.configuration.version}</version>
+ <version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
- <groupId>uk.org.taverna.commons</groupId>
- <artifactId>taverna-xml-schemas</artifactId>
- <version>${taverna.commons.version}</version>
+ <groupId>${project.parent.groupId}</groupId>
+ <artifactId>taverna-osgi-schemas</artifactId>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.apache.log4j</groupId>
@@ -41,26 +40,4 @@
<version>${log4j.version}</version>
</dependency>
</dependencies>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
- <name>Taverna App Configuration implementation</name>
-</project>
\ No newline at end of file
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fe2ff845/taverna-configuration-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-configuration-api/pom.xml b/taverna-configuration-api/pom.xml
index 29898c1..2402306 100644
--- a/taverna-configuration-api/pom.xml
+++ b/taverna-configuration-api/pom.xml
@@ -2,14 +2,12 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>taverna-commons</artifactId>
- <groupId>uk.org.taverna.commons</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-osgi</artifactId>
+ <version>0.2.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>uk.org.taverna.configuration</groupId>
- <version>0.1.1-SNAPSHOT</version>
<artifactId>taverna-configuration-api</artifactId>
- <name>Taverna Configuration API</name>
+ <name>Apache Taverna Configuration API</name>
<packaging>bundle</packaging>
<dependencies>
<dependency>
@@ -22,7 +20,6 @@
<artifactId>com.springsource.org.apache.log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
-
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -30,25 +27,4 @@
<scope>test</scope>
</dependency>
</dependencies>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
-</project>
\ No newline at end of file
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fe2ff845/taverna-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-configuration-impl/pom.xml b/taverna-configuration-impl/pom.xml
index 593e789..3c00732 100644
--- a/taverna-configuration-impl/pom.xml
+++ b/taverna-configuration-impl/pom.xml
@@ -2,13 +2,12 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>taverna-commons</artifactId>
- <groupId>uk.org.taverna.commons</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-osgi</artifactId>
+ <version>0.2.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>uk.org.taverna.configuration</groupId>
- <version>0.1.1-SNAPSHOT</version>
<artifactId>taverna-configuration-impl</artifactId>
+ <name>Apache Taverna Configuration implementation</name>
<packaging>bundle</packaging>
<build>
<plugins>
@@ -28,26 +27,34 @@
</build>
<dependencies>
<dependency>
- <groupId>uk.org.taverna.configuration</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>taverna-configuration-api</artifactId>
- <version>${taverna.configuration.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.configuration</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>taverna-app-configuration-api</artifactId>
- <version>${taverna.configuration.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.commons</groupId>
- <artifactId>taverna-xml-schemas</artifactId>
- <version>${taverna.commons.version}</version>
+ <groupId>${project.parent.groupId}</groupId>
+ <artifactId>taverna-osgi-schemas</artifactId>
+ <version>${project.parent.version}</version>
</dependency>
+<!--
<dependency>
<groupId>net.sf.taverna</groupId>
<artifactId>wsdl-generic</artifactId>
<version>${wsdl.generic.version}</version>
</dependency>
+ -->
+ <dependency>
+ <groupId>org.apache.axis</groupId>
+ <artifactId>com.springsource.org.apache.axis</artifactId>
+ <version>${axis.version}</version>
+ </dependency>
+
<dependency>
<groupId>org.apache.log4j</groupId>
@@ -62,33 +69,11 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>uk.org.taverna.configuration</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>taverna-configuration-api</artifactId>
- <version>${project.version}</version>
+ <version>${project.parent.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
- <name>Taverna Configuration implementation</name>
-</project>
\ No newline at end of file
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fe2ff845/taverna-download-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-download-api/pom.xml b/taverna-download-api/pom.xml
index ee019dd..b5dbcd7 100644
--- a/taverna-download-api/pom.xml
+++ b/taverna-download-api/pom.xml
@@ -2,33 +2,11 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>uk.org.taverna.commons</groupId>
- <artifactId>taverna-commons</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-osgi</artifactId>
+ <version>0.2.0-incubating-SNAPSHOT</version>
</parent>
- <artifactId>taverna-download-api</artifactId>
- <version>0.1.0-SNAPSHOT</version>
<packaging>bundle</packaging>
- <name>Taverna Download API</name>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
-</project>
\ No newline at end of file
+ <artifactId>taverna-download-api</artifactId>
+ <name>Apache Taverna Download API</name>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fe2ff845/taverna-download-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-download-impl/pom.xml b/taverna-download-impl/pom.xml
index a1ee297..d05182a 100644
--- a/taverna-download-impl/pom.xml
+++ b/taverna-download-impl/pom.xml
@@ -2,14 +2,13 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>taverna-commons</artifactId>
- <groupId>uk.org.taverna.commons</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-osgi</artifactId>
+ <version>0.2.0-incubating-SNAPSHOT</version>
</parent>
- <artifactId>taverna-download-impl</artifactId>
- <version>0.1.0-SNAPSHOT</version>
<packaging>bundle</packaging>
- <name>Taverna Download implementation</name>
+ <artifactId>taverna-download-impl</artifactId>
+ <name>Apache Taverna Download implementation</name>
<build>
<plugins>
<plugin>
@@ -25,9 +24,9 @@
</build>
<dependencies>
<dependency>
- <groupId>uk.org.taverna.commons</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>taverna-download-api</artifactId>
- <version>${taverna.commons.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
@@ -46,25 +45,4 @@
<version>${commons.codec.version}</version>
</dependency>
</dependencies>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
-</project>
\ No newline at end of file
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fe2ff845/taverna-osgi-schemas/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-osgi-schemas/pom.xml b/taverna-osgi-schemas/pom.xml
index 8b193cc..853ff16 100644
--- a/taverna-osgi-schemas/pom.xml
+++ b/taverna-osgi-schemas/pom.xml
@@ -2,13 +2,12 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>taverna-commons</artifactId>
- <groupId>uk.org.taverna.commons</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-osgi</artifactId>
+ <version>0.2.0-incubating-SNAPSHOT</version>
</parent>
- <artifactId>taverna-xml-schemas</artifactId>
- <version>0.1.0-SNAPSHOT</version>
- <name>Taverna XML Schemas</name>
+ <artifactId>taverna-osgi-schemas</artifactId>
+ <name>Apache Taverna OSGi XML Schemas</name>
<packaging>bundle</packaging>
<build>
<plugins>
@@ -25,25 +24,4 @@
</plugin>
</plugins>
</build>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
-</project>
\ No newline at end of file
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fe2ff845/taverna-plugin-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-plugin-api/pom.xml b/taverna-plugin-api/pom.xml
index a980840..1e7ed02 100644
--- a/taverna-plugin-api/pom.xml
+++ b/taverna-plugin-api/pom.xml
@@ -2,24 +2,23 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>taverna-commons</artifactId>
- <groupId>uk.org.taverna.commons</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-osgi</artifactId>
+ <version>0.2.0-incubating-SNAPSHOT</version>
</parent>
- <artifactId>taverna-plugin-api</artifactId>
- <version>0.1.0-SNAPSHOT</version>
<packaging>bundle</packaging>
- <name>Taverna Plugin API</name>
+ <artifactId>taverna-plugin-api</artifactId>
+ <name>Apache Taverna Plugin API</name>
<dependencies>
<dependency>
- <groupId>uk.org.taverna.configuration</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>taverna-app-configuration-api</artifactId>
- <version>${taverna.configuration.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.commons</groupId>
- <artifactId>taverna-xml-schemas</artifactId>
- <version>${taverna.commons.version}</version>
+ <groupId>${project.parent.groupId}</groupId>
+ <artifactId>taverna-osgi-schemas</artifactId>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
@@ -27,25 +26,4 @@
<version>${osgi.core.version}</version>
</dependency>
</dependencies>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
-</project>
\ No newline at end of file
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fe2ff845/taverna-plugin-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-plugin-impl/pom.xml b/taverna-plugin-impl/pom.xml
index 8dca237..5ac956b 100644
--- a/taverna-plugin-impl/pom.xml
+++ b/taverna-plugin-impl/pom.xml
@@ -2,14 +2,13 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>taverna-commons</artifactId>
- <groupId>uk.org.taverna.commons</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-osgi</artifactId>
+ <version>0.2.0-incubating-SNAPSHOT</version>
</parent>
<artifactId>taverna-plugin-impl</artifactId>
- <version>0.1.0-SNAPSHOT</version>
<packaging>bundle</packaging>
- <name>Taverna Plugin Implementation</name>
+ <name>Apache Taverna Plugin Implementation</name>
<build>
<plugins>
<plugin>
@@ -25,24 +24,24 @@
</build>
<dependencies>
<dependency>
- <groupId>uk.org.taverna.commons</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>taverna-plugin-api</artifactId>
- <version>${taverna.commons.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.commons</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>taverna-download-api</artifactId>
- <version>${taverna.commons.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.commons</groupId>
- <artifactId>taverna-xml-schemas</artifactId>
- <version>${taverna.commons.version}</version>
+ <groupId>${project.parent.groupId}</groupId>
+ <artifactId>taverna-osgi-schemas</artifactId>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.configuration</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>taverna-app-configuration-api</artifactId>
- <version>${taverna.configuration.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
@@ -79,25 +78,4 @@
<scope>test</scope>
</dependency>
</dependencies>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
-</project>
\ No newline at end of file
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fe2ff845/taverna-update-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-update-api/pom.xml b/taverna-update-api/pom.xml
index 6a28526..2b70a7d 100644
--- a/taverna-update-api/pom.xml
+++ b/taverna-update-api/pom.xml
@@ -2,33 +2,11 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>taverna-commons</artifactId>
- <groupId>uk.org.taverna.commons</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-osgi</artifactId>
+ <version>0.2.0-incubating-SNAPSHOT</version>
</parent>
<artifactId>taverna-update-api</artifactId>
- <version>0.1.0-SNAPSHOT</version>
<packaging>bundle</packaging>
- <name>Taverna Update API</name>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
-</project>
\ No newline at end of file
+ <name>Apache Taverna Update API</name>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fe2ff845/taverna-update-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-update-impl/pom.xml b/taverna-update-impl/pom.xml
index de8722f..ee081a2 100644
--- a/taverna-update-impl/pom.xml
+++ b/taverna-update-impl/pom.xml
@@ -2,14 +2,13 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>taverna-commons</artifactId>
- <groupId>uk.org.taverna.commons</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-osgi</artifactId>
+ <version>0.2.0-incubating-SNAPSHOT</version>
</parent>
<artifactId>taverna-update-impl</artifactId>
- <version>0.1.0-SNAPSHOT</version>
<packaging>bundle</packaging>
- <name>Taverna Update Implementation</name>
+ <name>Apache Taverna Update Implementation</name>
<build>
<plugins>
<plugin>
@@ -25,24 +24,24 @@
</build>
<dependencies>
<dependency>
- <groupId>uk.org.taverna.commons</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>taverna-update-api</artifactId>
- <version>${taverna.commons.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.commons</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>taverna-download-api</artifactId>
- <version>${taverna.commons.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.commons</groupId>
- <artifactId>taverna-xml-schemas</artifactId>
- <version>${taverna.commons.version}</version>
+ <groupId>${project.parent.groupId}</groupId>
+ <artifactId>taverna-osgi-schemas</artifactId>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
- <groupId>uk.org.taverna.configuration</groupId>
+ <groupId>${project.parent.groupId}</groupId>
<artifactId>taverna-app-configuration-api</artifactId>
- <version>${taverna.configuration.version}</version>
+ <version>${project.parent.version}</version>
</dependency>
<dependency>
@@ -61,25 +60,4 @@
<version>${osgi.core.version}</version>
</dependency>
</dependencies>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
-</project>
\ No newline at end of file
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fe2ff845/xml-parser-service/pom.xml
----------------------------------------------------------------------
diff --git a/xml-parser-service/pom.xml b/xml-parser-service/pom.xml
index 600004f..8ded30e 100644
--- a/xml-parser-service/pom.xml
+++ b/xml-parser-service/pom.xml
@@ -2,13 +2,11 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>uk.org.taverna.osgi</groupId>
- <artifactId>osgi-services</artifactId>
- <version>0.1.1</version>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-osgi</artifactId>
+ <version>0.2.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>uk.org.taverna.osgi.services</groupId>
<artifactId>xml-parser-service</artifactId>
- <version>0.1.2-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>XML Parser Service</name>
<description>Implementation of XML Parser Service Specification, Version 1.0</description>
@@ -39,24 +37,4 @@
<version>2.9.1</version>
</dependency>
</dependencies>
- <repositories>
- <repository>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository</url>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- </repository>
- </repositories>
-</project>
\ No newline at end of file
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/fe2ff845/xml-transformer-service/pom.xml
----------------------------------------------------------------------
diff --git a/xml-transformer-service/pom.xml b/xml-transformer-service/pom.xml
index a799264..dc58a2e 100644
--- a/xml-transformer-service/pom.xml
+++ b/xml-transformer-service/pom.xml
@@ -2,13 +2,11 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>uk.org.taverna.osgi</groupId>
- <artifactId>osgi-services</artifactId>
- <version>0.1.1</version>
+ <groupId>org.apache.taverna.osgi</groupId>
+ <artifactId>taverna-osgi</artifactId>
+ <version>0.2.0-incubating-SNAPSHOT</version>
</parent>
- <groupId>uk.org.taverna.osgi.services</groupId>
<artifactId>xml-transformer-service</artifactId>
- <version>0.1.2-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>XML Transformer Service</name>
<description>An XML Transformer Service</description>
@@ -44,24 +42,4 @@
<version>2.1.3</version>
</dependency>
</dependencies>
- <repositories>
- <repository>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository</url>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- </repository>
- </repositories>
-</project>
\ No newline at end of file
+</project>
[27/50] [abbrv] incubator-taverna-osgi git commit: Remove top-level
taverna3-osgi-services
Posted by st...@apache.org.
Remove top-level taverna3-osgi-services
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/e1564194
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/e1564194
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/e1564194
Branch: refs/heads/master
Commit: e1564194494c99218397013e0496ebefbeb745e7
Parents: 051fb06
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu Dec 18 22:15:30 2014 -0600
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu Dec 18 22:15:30 2014 -0600
----------------------------------------------------------------------
.project | 23 ---------------------
.travis.yml | 1 -
README.md | 5 -----
pom.xml | 61 --------------------------------------------------------
4 files changed, 90 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/e1564194/.project
----------------------------------------------------------------------
diff --git a/.project b/.project
deleted file mode 100644
index 5f7616d..0000000
--- a/.project
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>taverna-osgi</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/e1564194/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index dff5f3a..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1 +0,0 @@
-language: java
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/e1564194/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
deleted file mode 100644
index cfda180..0000000
--- a/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-OSGi Compendium Services (Rel. 4, Ver. 4.3)
-
-Implementations of services specified in the OSGi Service Platform Service Compendium, Release 4, Version 4.3
-
-This code was previously hosted at http://taverna.googlecode.com/svn/osgi-launcher/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/e1564194/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index df445b2..0000000
--- a/pom.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>net.sf.taverna</groupId>
- <artifactId>parent</artifactId>
- <version>0.2.2011-02-17</version>
- </parent>
- <groupId>uk.org.taverna.osgi</groupId>
- <artifactId>osgi-services</artifactId>
- <version>0.1.2-SNAPSHOT</version>
- <name>OSGi Enterprise Service Implementations</name>
- <description>Implementations of services specified in the OSGi Service Platform Service Compendium, Release 4, Version 4.3</description>
- <packaging>pom</packaging>
- <modules>
- <module>xml-parser-service</module>
- <module>xml-transformer-service</module>
- </modules>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.7</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
- <repositories>
- <repository>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository</url>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- </repository>
- <repository>
- <id>com.springsource.repository.bundles.release</id>
- <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
- <url>http://repository.springsource.com/maven/bundles/release</url>
- </repository>
- <repository>
- <id>com.springsource.repository.bundles.external</id>
- <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
- <url>http://repository.springsource.com/maven/bundles/external</url>
- </repository>
- </repositories>
-</project>
\ No newline at end of file
[40/50] [abbrv] incubator-taverna-osgi git commit:
taverna-maven-plugin/
Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/main/java/net/sf/taverna/t2/maven/plugins/Utils.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/Utils.java b/src/main/java/net/sf/taverna/t2/maven/plugins/Utils.java
deleted file mode 100644
index 82f5fee..0000000
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/Utils.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.maven.plugins;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URLEncoder;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.commons.io.FileUtils;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.wagon.ResourceDoesNotExistException;
-import org.apache.maven.wagon.TransferFailedException;
-import org.apache.maven.wagon.Wagon;
-import org.apache.maven.wagon.authorization.AuthorizationException;
-
-/**
- * @author David Withers
- */
-public class Utils {
-
- public static String uploadFile(File file, String resourceName, Wagon wagon, Log log)
- throws MojoExecutionException {
- String resourceUrl = getResourceUrl(wagon, resourceName);
- File digestFile = new File(file.getPath() + ".md5");
- try {
- String digestString = DigestUtils.md5Hex(new FileInputStream(file));
- FileUtils.writeStringToFile(digestFile, digestString);
- } catch (IOException e) {
- throw new MojoExecutionException(
- String.format("Error generating digest for %1$s", file), e);
- }
- try {
- log.info(String.format("Uploading %1$s to %2$s", file, resourceUrl));
- wagon.put(file, resourceName);
- wagon.put(digestFile, resourceName + ".md5");
- } catch (TransferFailedException e) {
- throw new MojoExecutionException(String.format("Error transferring %1$s to %2$s", file,
- resourceUrl), e);
- } catch (ResourceDoesNotExistException e) {
- throw new MojoExecutionException(String.format("%1$s does not exist", resourceUrl), e);
- } catch (AuthorizationException e) {
- throw new MojoExecutionException(String.format(
- "Authentication error transferring %1$s to %2$s", file, resourceUrl), e);
- }
- return resourceUrl;
- }
-
- public static void downloadFile(String resourceName, File file, Wagon wagon, Log log)
- throws MojoExecutionException, ResourceDoesNotExistException {
- String resourceUrl = getResourceUrl(wagon, resourceName);
- File digestFile = new File(file.getPath() + ".md5");
- try {
- log.info(String.format("Downloading %1$s to %2$s", resourceUrl, file));
- wagon.get(resourceName, file);
- wagon.get(resourceName + ".md5", digestFile);
- } catch (TransferFailedException e) {
- throw new MojoExecutionException(String.format("Error transferring %1$s to %2$s",
- resourceUrl, file), e);
- } catch (AuthorizationException e) {
- throw new MojoExecutionException(String.format(
- "Authentication error transferring %1$s to %2$s", resourceUrl, file), e);
- }
- try {
- String digestString1 = DigestUtils.md5Hex(new FileInputStream(file));
- String digestString2 = FileUtils.readFileToString(digestFile);
- if (!digestString1.equals(digestString2)) {
- throw new MojoExecutionException(String.format(
- "Error downloading file: digsests not equal. (%1$s != %2$s)",
- digestString1, digestString2));
- }
- } catch (IOException e) {
- throw new MojoExecutionException(String.format("Error checking digest for %1$s", file),
- e);
- }
- }
-
- public static String getResourceUrl(Wagon wagon, String resourceName) {
- StringBuilder urlBuilder = new StringBuilder(wagon.getRepository().getUrl());
- for (String part : resourceName.split("/")) {
- urlBuilder.append('/');
- urlBuilder.append(URLEncoder.encode(part));
- }
- return urlBuilder.toString();
- }
-
- public static String timestamp() {
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd'T'HHmm");
- return dateFormat.format(new Date());
- }
-
- public static Set<String> getJavaPackages(Log log) {
- Set<String> javaPackages = new HashSet<String>();
- InputStream resource = Utils.class.getClassLoader().getResourceAsStream("java7-packages");
- if (resource != null) {
- BufferedReader reader = new BufferedReader(new InputStreamReader(resource));
- try {
- String line = reader.readLine();
- while (line != null) {
- if (!line.isEmpty()) {
- javaPackages.add(line.trim());
- }
- line = reader.readLine();
- }
- } catch (IOException e) {
- log.warn(
- "Problem while reading to readinf java package list from resource file java7-packages",
- e);
- }
- } else {
- log.warn("Unable to read java package list from resource file java7-packages");
- }
- return javaPackages;
- }
-
- public static <T> List<Set<T>> getSubsets(Set<T> set) {
- List<Set<T>> subsets = new ArrayList<Set<T>>();
- List<T> list = new ArrayList<T>(set);
- int numOfSubsets = 1 << set.size();
- for (int i = 0; i < numOfSubsets; i++){
- Set<T> subset = new HashSet<T>();
- for (int j = 0; j < numOfSubsets; j++){
- if (((i>>j) & 1) == 1) {
- subset.add(list.get(j));
- }
- }
- if (!subset.isEmpty()) {
- subsets.add(subset);
- }
- }
- Collections.sort(subsets, new Comparator<Set<T>>() {
- @Override
- public int compare(Set<T> o1, Set<T> o2) {
- return o1.size() - o2.size();
- }
- });
- return subsets;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/main/resources/META-INF/plexus/components.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/META-INF/plexus/components.xml b/src/main/resources/META-INF/plexus/components.xml
deleted file mode 100644
index ad375db..0000000
--- a/src/main/resources/META-INF/plexus/components.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<component-set>
- <components>
- <component>
- <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
- <role-hint>taverna-plugin</role-hint>
- <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
- </implementation>
- <configuration>
- <phases>
- <generate-resources>net.sf.taverna.t2.maven.plugins:taverna-maven-plugin:plugin-generate</generate-resources>
- <prepare-package>net.sf.taverna.t2.maven.plugins:taverna-maven-plugin:plugin-prepare-bundles</prepare-package>
- <package>org.apache.maven.plugins:maven-jar-plugin:jar</package>
- <deploy>net.sf.taverna.t2.maven.plugins:taverna-maven-plugin:plugin-deploy</deploy>
- </phases>
- </configuration>
- </component>
- <component>
- <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
- <role-hint>taverna-application</role-hint>
- <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
- </implementation>
- <configuration>
- <phases>
- <generate-resources>net.sf.taverna.t2.maven.plugins:taverna-maven-plugin:profile-generate
- </generate-resources>
- <deploy>net.sf.taverna.t2.maven.plugins:taverna-maven-plugin:profile-deploy
- </deploy>
- </phases>
- </configuration>
- </component>
- </components>
-</component-set>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/main/resources/java7-packages
----------------------------------------------------------------------
diff --git a/src/main/resources/java7-packages b/src/main/resources/java7-packages
deleted file mode 100644
index 032c7dd..0000000
--- a/src/main/resources/java7-packages
+++ /dev/null
@@ -1,209 +0,0 @@
-java.applet
-java.awt
-java.awt.color
-java.awt.datatransfer
-java.awt.dnd
-java.awt.event
-java.awt.font
-java.awt.geom
-java.awt.im
-java.awt.im.spi
-java.awt.image
-java.awt.image.renderable
-java.awt.print
-java.beans
-java.beans.beancontext
-java.io
-java.lang
-java.lang.annotation
-java.lang.instrument
-java.lang.invoke
-java.lang.management
-java.lang.ref
-java.lang.reflect
-java.math
-java.net
-java.nio
-java.nio.channels
-java.nio.channels.spi
-java.nio.charset
-java.nio.charset.spi
-java.nio.file
-java.nio.file.attribute
-java.nio.file.spi
-java.rmi
-java.rmi.activation
-java.rmi.dgc
-java.rmi.registry
-java.rmi.server
-java.security
-java.security.acl
-java.security.cert
-java.security.interfaces
-java.security.spec
-java.sql
-java.text
-java.text.spi
-java.util
-java.util.concurrent
-java.util.concurrent.atomic
-java.util.concurrent.locks
-java.util.jar
-java.util.logging
-java.util.prefs
-java.util.regex
-java.util.spi
-java.util.zip
-javax.accessibility
-javax.activation
-javax.activity
-javax.annotation
-javax.annotation.processing
-javax.crypto
-javax.crypto.interfaces
-javax.crypto.spec
-javax.imageio
-javax.imageio.event
-javax.imageio.metadata
-javax.imageio.plugins.bmp
-javax.imageio.plugins.jpeg
-javax.imageio.spi
-javax.imageio.stream
-javax.jws
-javax.jws.soap
-javax.lang.model
-javax.lang.model.element
-javax.lang.model.type
-javax.lang.model.util
-javax.management
-javax.management.loading
-javax.management.modelmbean
-javax.management.monitor
-javax.management.openmbean
-javax.management.relation
-javax.management.remote
-javax.management.remote.rmi
-javax.management.timer
-javax.naming
-javax.naming.directory
-javax.naming.event
-javax.naming.ldap
-javax.naming.spi
-javax.net
-javax.net.ssl
-javax.print
-javax.print.attribute
-javax.print.attribute.standard
-javax.print.event
-javax.rmi
-javax.rmi.CORBA
-javax.rmi.ssl
-javax.script
-javax.security.auth
-javax.security.auth.callback
-javax.security.auth.kerberos
-javax.security.auth.login
-javax.security.auth.spi
-javax.security.auth.x500
-javax.security.cert
-javax.security.sasl
-javax.sound.midi
-javax.sound.midi.spi
-javax.sound.sampled
-javax.sound.sampled.spi
-javax.sql
-javax.sql.rowset
-javax.sql.rowset.serial
-javax.sql.rowset.spi
-javax.swing
-javax.swing.border
-javax.swing.colorchooser
-javax.swing.event
-javax.swing.filechooser
-javax.swing.plaf
-javax.swing.plaf.basic
-javax.swing.plaf.metal
-javax.swing.plaf.multi
-javax.swing.plaf.nimbus
-javax.swing.plaf.synth
-javax.swing.table
-javax.swing.text
-javax.swing.text.html
-javax.swing.text.html.parser
-javax.swing.text.rtf
-javax.swing.tree
-javax.swing.undo
-javax.tools
-javax.transaction
-javax.transaction.xa
-javax.xml
-javax.xml.bind
-javax.xml.bind.annotation
-javax.xml.bind.annotation.adapters
-javax.xml.bind.attachment
-javax.xml.bind.helpers
-javax.xml.bind.util
-javax.xml.crypto
-javax.xml.crypto.dom
-javax.xml.crypto.dsig
-javax.xml.crypto.dsig.dom
-javax.xml.crypto.dsig.keyinfo
-javax.xml.crypto.dsig.spec
-javax.xml.datatype
-javax.xml.namespace
-javax.xml.parsers
-javax.xml.soap
-javax.xml.stream
-javax.xml.stream.events
-javax.xml.stream.util
-javax.xml.transform
-javax.xml.transform.dom
-javax.xml.transform.sax
-javax.xml.transform.stax
-javax.xml.transform.stream
-javax.xml.validation
-javax.xml.ws
-javax.xml.ws.handler
-javax.xml.ws.handler.soap
-javax.xml.ws.http
-javax.xml.ws.soap
-javax.xml.ws.spi
-javax.xml.ws.spi.http
-javax.xml.ws.wsaddressing
-javax.xml.xpath
-org.ietf.jgss
-org.omg.CORBA
-org.omg.CORBA_2_3
-org.omg.CORBA_2_3.portable
-org.omg.CORBA.DynAnyPackage
-org.omg.CORBA.ORBPackage
-org.omg.CORBA.portable
-org.omg.CORBA.TypeCodePackage
-org.omg.CosNaming
-org.omg.CosNaming.NamingContextExtPackage
-org.omg.CosNaming.NamingContextPackage
-org.omg.Dynamic
-org.omg.DynamicAny
-org.omg.DynamicAny.DynAnyFactoryPackage
-org.omg.DynamicAny.DynAnyPackage
-org.omg.IOP
-org.omg.IOP.CodecFactoryPackage
-org.omg.IOP.CodecPackage
-org.omg.Messaging
-org.omg.PortableInterceptor
-org.omg.PortableInterceptor.ORBInitInfoPackage
-org.omg.PortableServer
-org.omg.PortableServer.CurrentPackage
-org.omg.PortableServer.POAManagerPackage
-org.omg.PortableServer.POAPackage
-org.omg.PortableServer.portable
-org.omg.PortableServer.ServantLocatorPackage
-org.omg.SendingContext
-org.omg.stub.java.rmi
-org.w3c.dom
-org.w3c.dom.bootstrap
-org.w3c.dom.events
-org.w3c.dom.ls
-org.xml.sax
-org.xml.sax.ext
-org.xml.sax.helpers
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java b/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java
deleted file mode 100644
index 6f21fb1..0000000
--- a/src/test/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojoTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2009 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.maven.plugins;
-
-import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * Unit tests for TavernaPluginGenerateMojo.
- *
- * @author David Withers
- */
-public class TavernaPluginGenerateMojoTest extends AbstractMojoTestCase {
-
- private TavernaPluginGenerateMojo tavernaPluginGenerateMojo;
-
- /**
- * @throws java.lang.Exception
- */
- @Ignore
- public void setUp() throws Exception {
-// super.setUp();
-//
-// File pluginXml = new File( getBasedir(), "src/test/resources/unit/plugin-config.xml" );
-// tavernaPluginGenerateMojo = (TavernaPluginGenerateMojo) lookupMojo( "plugin-generate", pluginXml );
-//
-// MavenProject mavenProject = (MavenProject) getVariableValueFromObject(tavernaPluginGenerateMojo, "project");
-//
-// Artifact artifact = new DefaultArtifact("net.sf.taverna.t2", "example-plugin", VersionRange
-// .createFromVersion("0.1.0"), "compile", "jar", "", null);
-// artifact.setRepository(new DefaultArtifactRepository("id1",
-// "http://www.mygrid.org.uk/maven/repository", new DefaultRepositoryLayout()));
-// mavenProject.setArtifact(artifact);
-//
-//
-// Artifact dependency = new DefaultArtifact("com.example.test", "test-artifact", VersionRange
-// .createFromVersion("1.3.5"), "compile", "jar", "", null);
-// dependency.setGroupId("com.example.test");
-// dependency.setArtifactId("test-artifact");
-// dependency.setVersion("1.3.5");
-// dependency.setRepository(new DefaultArtifactRepository("id2",
-// "http://www.example.com/maven/repository", new DefaultRepositoryLayout()));
-// mavenProject.setDependencyArtifacts(Collections.singleton(dependency));
-//
-// MavenSession session = new MavenSession(getContainer(), (RepositorySystemSession) null, (MavenExecutionRequest) null, (MavenExecutionResult) null);
-// setVariableValueToObject(tavernaPluginGenerateMojo, "session", session);
- }
-
- /**
- * Test method for
- * {@link net.sf.taverna.t2.maven.plugins.TavernaPluginGenerateMojo#execute()}
- *
- * @throws Exception
- */
- @Test
- @Ignore
- public void testExecute() throws Exception {
-// tavernaPluginGenerateMojo.execute();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/test/resources/unit/plugin-config.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/unit/plugin-config.xml b/src/test/resources/unit/plugin-config.xml
deleted file mode 100644
index a8c1723..0000000
--- a/src/test/resources/unit/plugin-config.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<project>
- <build>
- <plugins>
- <plugin>
- <groupId>net.sf.taverna.t2.maven.plugins</groupId>
- <artifactId>taverna-maven-plugin</artifactId>
- <configuration>
- <buildDirectory>${basedir}/target/test/unit</buildDirectory>
- <project>
- <groupId>net.sf.taverna.t2</groupId>
- <artifactId>example-plugin</artifactId>
- <version>0.1.0</version>
- <name>Taverna 2 Example Plugin</name>
- </project>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/pom.xml b/taverna-maven-plugin/pom.xml
new file mode 100644
index 0000000..74d3ed5
--- /dev/null
+++ b/taverna-maven-plugin/pom.xml
@@ -0,0 +1,127 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>parent</artifactId>
+ <groupId>net.sf.taverna</groupId>
+ <version>0.2.2011-02-17</version>
+ </parent>
+ <prerequisites>
+ <maven>3.2.0</maven>
+ </prerequisites>
+ <groupId>net.sf.taverna.t2.maven.plugins</groupId>
+ <artifactId>taverna-maven-plugin</artifactId>
+ <packaging>maven-plugin</packaging>
+ <version>0.3.1-SNAPSHOT</version>
+ <name>Maven Taverna Plugin</name>
+ <description>A Maven plugin for packaging and deploying Taverna plugins</description>
+ <properties>
+ <maven.version>3.2.3</maven.version>
+ <mavenArchiverVersion>2.5</mavenArchiverVersion>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>3.3</version>
+ <configuration>
+ <!-- see http://jira.codehaus.org/browse/MNG-5346 -->
+ <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+ </configuration>
+ <executions>
+ <execution>
+ <id>mojo-descriptor</id>
+ <goals>
+ <goal>descriptor</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>${maven.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core</artifactId>
+ <version>${maven.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-aether-provider</artifactId>
+ <version>${maven.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-annotations</artifactId>
+ <version>3.3</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-osgi</artifactId>
+ <version>0.2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>uk.org.taverna.commons</groupId>
+ <artifactId>taverna-xml-schemas</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>biz.aQute</groupId>
+ <artifactId>bndlib</artifactId>
+ <version>2.0.0.20130123-133441</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.7</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugin-testing</groupId>
+ <artifactId>maven-plugin-testing-harness</artifactId>
+ <version>3.2.0</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <repositories>
+ <repository>
+ <releases />
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <id>mygrid-repository</id>
+ <name>myGrid Repository</name>
+ <url>http://www.mygrid.org.uk/maven/repository
+ </url>
+ </repository>
+ <repository>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots />
+ <id>mygrid-snapshot-repository</id>
+ <name>myGrid Snapshot Repository</name>
+ <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
+ </repository>
+ </repositories>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java
new file mode 100644
index 0000000..d3e98cf
--- /dev/null
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (C) 2013 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.maven.plugins;
+
+import java.io.File;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.MavenProject;
+
+/**
+ * Abstract Mojo for deploying artifacts.
+ *
+ * @author David Withers
+ */
+public abstract class AbstractDeployMojo extends AbstractWagonMojo {
+
+ @Component
+ protected MavenProject project;
+
+ /**
+ * Directory containing the generated Taverna plugin.
+ */
+ @Parameter(defaultValue = "${project.build.directory}", required = true)
+ protected File buildDirectory;
+
+ @Parameter(defaultValue = "${project.build.outputDirectory}", required = true)
+ protected File outputDirectory;
+
+ @Parameter(defaultValue = "${project.artifact}", required = true, readonly = true)
+ protected Artifact artifact;
+
+ @Parameter(defaultValue = "${project.distributionManagementArtifactRepository}", required = true, readonly = true)
+ protected ArtifactRepository deploymentRepository;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java
new file mode 100644
index 0000000..a74166a
--- /dev/null
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (C) 2013 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.maven.plugins;
+
+import org.apache.maven.artifact.manager.WagonManager;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.wagon.ConnectionException;
+import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.observers.Debug;
+
+/**
+ * Abstract Mojo for using the wagon.
+ *
+ * @author David Withers
+ */
+public abstract class AbstractWagonMojo extends AbstractMojo {
+
+ @Component
+ protected WagonManager wagonManager;
+
+ /**
+ * Disconnect the wagon.
+ *
+ * @param wagon
+ * the wagon to disconnect
+ * @param debug
+ */
+ protected void disconnectWagon(Wagon wagon, Debug debug) {
+ if (getLog().isDebugEnabled()) {
+ wagon.removeTransferListener(debug);
+ wagon.removeSessionListener(debug);
+ }
+ try {
+ wagon.disconnect();
+ } catch (ConnectionException e) {
+ getLog().error("Error disconnecting wagon - ignored", e);
+ }
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/BundleArtifact.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/BundleArtifact.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/BundleArtifact.java
new file mode 100644
index 0000000..0226a07
--- /dev/null
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/BundleArtifact.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (C) 2013 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.maven.plugins;
+
+import org.apache.maven.artifact.Artifact;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+public class BundleArtifact {
+
+ private Artifact artifact;
+ private String symbolicName;
+ private String version;
+
+ public BundleArtifact(Artifact artifact, String symbolicName, String version) {
+ this.artifact = artifact;
+ this.symbolicName = symbolicName;
+ this.version = version;
+ }
+
+ public Artifact getArtifact() {
+ return artifact;
+ }
+
+ public void setArtifact(Artifact artifact) {
+ this.artifact = artifact;
+ }
+
+ public String getSymbolicName() {
+ return symbolicName;
+ }
+
+ public void setSymbolicName(String symbolicName) {
+ this.symbolicName = symbolicName;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
new file mode 100644
index 0000000..6901119
--- /dev/null
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
@@ -0,0 +1,415 @@
+/*******************************************************************************
+ * Copyright (C) 2013 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.maven.plugins;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+
+import org.apache.maven.RepositoryUtils;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.DefaultDependencyResolutionRequest;
+import org.apache.maven.project.DependencyResolutionException;
+import org.apache.maven.project.DependencyResolutionResult;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectDependenciesResolver;
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.util.filter.ScopeDependencyFilter;
+
+import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
+import aQute.bnd.header.Attrs;
+import aQute.bnd.header.OSGiHeader;
+import aQute.bnd.header.Parameters;
+import aQute.bnd.osgi.Constants;
+import aQute.bnd.version.Version;
+import aQute.bnd.version.VersionRange;
+
+/**
+ * @author David Withers
+ */
+public class MavenOsgiUtils {
+
+ private final MavenProject project;
+ private final RepositorySystemSession repositorySystemSession;
+ private final ProjectDependenciesResolver projectDependenciesResolver;
+ private final Log log;
+
+ private Set<String> javaPackages;
+ private Set<String> systemPackages;
+
+ public MavenOsgiUtils(MavenProject project, RepositorySystemSession repositorySystemSession,
+ ProjectDependenciesResolver projectDependenciesResolver, Log log) {
+ this(project, repositorySystemSession, projectDependenciesResolver, new HashSet<String>(),
+ log);
+ }
+
+ public MavenOsgiUtils(MavenProject project, RepositorySystemSession repositorySystemSession,
+ ProjectDependenciesResolver projectDependenciesResolver, Set<String> systemPackages,
+ Log log) {
+ this.project = project;
+ this.repositorySystemSession = repositorySystemSession;
+ this.projectDependenciesResolver = projectDependenciesResolver;
+ this.systemPackages = systemPackages;
+ this.log = log;
+ javaPackages = Utils.getJavaPackages(log);
+ }
+
+ public Set<BundleArtifact> getBundleDependencies(String... scopes)
+ throws MojoExecutionException {
+ ScopeDependencyFilter scopeFilter = new ScopeDependencyFilter(Arrays.asList(scopes), null);
+
+ DefaultDependencyResolutionRequest dependencyResolutionRequest = new DefaultDependencyResolutionRequest(
+ project, repositorySystemSession);
+ dependencyResolutionRequest.setResolutionFilter(scopeFilter);
+
+ DependencyResolutionResult dependencyResolutionResult;
+ try {
+ dependencyResolutionResult = projectDependenciesResolver
+ .resolve(dependencyResolutionRequest);
+ } catch (DependencyResolutionException ex) {
+ throw new MojoExecutionException(ex.getMessage(), ex);
+ }
+
+ DependencyNode dependencyGraph = dependencyResolutionResult.getDependencyGraph();
+ if (dependencyGraph != null) {
+ checkBundleDependencies(dependencyGraph.getChildren());
+ return getBundleArtifacts(dependencyGraph.getChildren());
+ } else {
+ return new HashSet<BundleArtifact>();
+ }
+ }
+
+ public Set<BundleArtifact> getBundleArtifacts(List<DependencyNode> nodes) {
+ Set<BundleArtifact> bundleArtifacts = new HashSet<BundleArtifact>();
+ for (DependencyNode node : nodes) {
+ Artifact artifact = RepositoryUtils.toArtifact(node.getDependency().getArtifact());
+ String symbolicName = getManifestAttribute(artifact, Constants.BUNDLE_SYMBOLICNAME);
+ if (symbolicName != null) {
+ String version = getManifestAttribute(artifact, Constants.BUNDLE_VERSION);
+ bundleArtifacts.add(new BundleArtifact(artifact, symbolicName, version));
+ bundleArtifacts.addAll(getBundleArtifacts(node.getChildren()));
+ } else {
+ log.warn("Not an OSGi bundle : " + artifact.getId());
+ }
+ }
+ return bundleArtifacts;
+ }
+
+ public Set<Artifact> getAllArtifacts(List<DependencyNode> nodes) {
+ Set<Artifact> artifacts = new HashSet<Artifact>();
+ for (DependencyNode node : nodes) {
+ Artifact artifact = RepositoryUtils.toArtifact(node.getDependency().getArtifact());
+ if (isBundle(artifact)) {
+ artifacts.add(artifact);
+ artifacts.addAll(getAllArtifacts(node.getChildren()));
+ }
+ }
+ return artifacts;
+ }
+
+ public Set<Artifact> getArtifacts(List<DependencyNode> nodes) {
+ Set<Artifact> artifacts = new HashSet<Artifact>();
+ for (DependencyNode node : nodes) {
+ Artifact artifact = RepositoryUtils.toArtifact(node.getDependency().getArtifact());
+ if (isBundle(artifact)) {
+ artifacts.add(artifact);
+ }
+ }
+ return artifacts;
+ }
+
+ public List<BundleInfo> getBundles(Set<BundleArtifact> bundleDependencies)
+ throws MojoExecutionException {
+ List<BundleInfo> bundles = new ArrayList<BundleInfo>();
+ for (BundleArtifact bundleArtifact : bundleDependencies) {
+ Artifact artifact = bundleArtifact.getArtifact();
+ BundleInfo bundle = new BundleInfo();
+ bundle.setSymbolicName(bundleArtifact.getSymbolicName());
+ bundle.setVersion(bundleArtifact.getVersion());
+ bundle.setFileName(new File(artifact.getGroupId(), artifact.getFile().getName())
+ .getPath());
+ bundles.add(bundle);
+ }
+ Collections.sort(bundles, new BundleComparator());
+ return bundles;
+ }
+
+ public Map<String, Set<PackageVersion>> getPackageDependencies(List<DependencyNode> nodes) {
+ Map<String, Set<PackageVersion>> exportVersions = calculatePackageVersions(
+ getAllArtifacts(nodes), true, false);
+ return getPackageDependencies(getArtifacts(nodes), exportVersions);
+ }
+
+ public Map<String, Set<PackageVersion>> getPackageDependencies(Set<Artifact> requiredArtifacts,
+ Map<String, Set<PackageVersion>> exportVersions) {
+ Map<String, Set<PackageVersion>> importVersions = calculatePackageVersions(
+ requiredArtifacts, false, true);
+ Set<Artifact> newRequiredArtifacts = new HashSet<Artifact>();
+ for (Entry<String, Set<PackageVersion>> entry : importVersions.entrySet()) {
+ if (!javaPackages.contains(entry.getKey())) {
+ String packageName = entry.getKey();
+ Set<PackageVersion> importsVersions = entry.getValue();
+ Set<PackageVersion> exportsVersions = exportVersions.get(packageName);
+ if (exportVersions.containsKey(entry.getKey())) {
+ for (Artifact artifact : getRequiredArtifacts(importsVersions, exportsVersions)) {
+ if (!requiredArtifacts.contains(artifact)) {
+ newRequiredArtifacts.add(artifact);
+ }
+ }
+ }
+ }
+ }
+ if (!newRequiredArtifacts.isEmpty()) {
+ newRequiredArtifacts.addAll(requiredArtifacts);
+ return getPackageDependencies(newRequiredArtifacts, exportVersions);
+ }
+ return importVersions;
+ }
+
+ /**
+ * Returns the minimum set of artifacts required to satisfy the range of importVersions.
+ *
+ * @param importsVersions
+ * the version ranges required for the package
+ * @param exportVersions
+ * the available versions for the package
+ * @return the minimum set of artifacts required to satisfy the range of importVersions
+ */
+ private Set<Artifact> getRequiredArtifacts(Set<PackageVersion> importsVersions,
+ Set<PackageVersion> exportVersions) {
+ Set<Artifact> requiredArtifacts = new HashSet<Artifact>();
+ List<Set<PackageVersion>> exportsSubsets = Utils.getSubsets(exportVersions);
+ for (Set<PackageVersion> exportsSubset : exportsSubsets) {
+ if (satisfiesImports(importsVersions, exportsSubset)) {
+ for (PackageVersion exportVersion : exportsSubset) {
+ requiredArtifacts.add(exportVersion.getArtifact());
+ }
+ break;
+ }
+ }
+ return requiredArtifacts;
+ }
+
+ private boolean satisfiesImports(Set<PackageVersion> imports, Set<PackageVersion> exports) {
+ for (PackageVersion importVersion : imports) {
+ if (!satisfiesImport(importVersion, exports)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private boolean satisfiesImport(PackageVersion importVersion, Set<PackageVersion> exports) {
+ for (PackageVersion exportVersion : exports) {
+ if (importVersion.getVersionRange().includes(exportVersion.getVersionRange().getLow())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void checkBundleDependencies(List<DependencyNode> nodes) {
+ Map<Artifact, Set<Package>> unresolvedArtifacts = new HashMap<Artifact, Set<Package>>();
+ Set<Artifact> artifacts = getAllArtifacts(nodes);
+ Map<String, Set<PackageVersion>> exports = calculatePackageVersions(artifacts, true, false);
+ for (Artifact artifact : artifacts) {
+ if (isBundle(artifact)) {
+ Parameters imports = getManifestAttributeParameters(artifact,
+ Constants.IMPORT_PACKAGE);
+ if (imports != null) {
+ for (String packageName : imports.keySet()) {
+ boolean exportMissing = true;
+ VersionRange importRange = null;
+ Attrs attrs = imports.get(packageName);
+ if (isOptional(attrs)) {
+ exportMissing = false;
+ } else if (javaPackages.contains(packageName)
+ || systemPackages.contains(packageName)
+ || packageName.startsWith("org.osgi.")) {
+ exportMissing = false;
+ } else if (attrs == null || attrs.get(Constants.VERSION_ATTRIBUTE) == null) {
+ if (exports.containsKey(packageName)) {
+ exportMissing = false;
+ }
+ } else {
+ importRange = getVersionRange(attrs);
+ if (exports.containsKey(packageName)) {
+ for (PackageVersion exportVersion : exports.get(packageName)) {
+ if (importRange.includes(exportVersion.getVersionRange()
+ .getLow())) {
+ exportMissing = false;
+ break;
+ }
+ }
+ }
+ }
+ if (exportMissing) {
+ if (!unresolvedArtifacts.containsKey(artifact)) {
+ unresolvedArtifacts.put(artifact, new HashSet<Package>());
+ }
+ unresolvedArtifacts.get(artifact).add(
+ new Package(packageName, importRange));
+ }
+ }
+ }
+ }
+ }
+ for (Entry<Artifact, Set<Package>> unresolvedArtifact : unresolvedArtifacts.entrySet()) {
+ log.warn("Bundle : " + unresolvedArtifact.getKey().getId()
+ + " has unresolved package dependencies:");
+ for (Package unresolvedPackage : unresolvedArtifact.getValue()) {
+ log.warn(" " + unresolvedPackage);
+ }
+ }
+ }
+
+ public Map<String, Set<PackageVersion>> calculatePackageVersions(Set<Artifact> artifacts,
+ boolean export, boolean unique) {
+ Map<String, Set<PackageVersion>> packageVersions = new HashMap<String, Set<PackageVersion>>();
+ for (Artifact artifact : artifacts) {
+ if (isBundle(artifact)) {
+ Parameters packages = getManifestAttributeParameters(artifact,
+ export ? Constants.EXPORT_PACKAGE : Constants.IMPORT_PACKAGE);
+ if (packages != null) {
+ for (String packageName : packages.keySet()) {
+ if (!packageVersions.containsKey(packageName)) {
+ packageVersions.put(packageName, new HashSet<PackageVersion>());
+ }
+ Set<PackageVersion> versions = packageVersions.get(packageName);
+ VersionRange versionRange = getVersionRange(packages.get(packageName));
+ boolean optional = isOptional(packages.get(packageName));
+ if (unique) {
+ // check if this version range is unique
+ boolean uniqueVersion = true;
+ for (PackageVersion version : versions) {
+ if (equals(versionRange, version.getVersionRange())) {
+ uniqueVersion = false;
+ break;
+ }
+ }
+ if (uniqueVersion) {
+ versions.add(new PackageVersion(versionRange, artifact, optional));
+ }
+ } else {
+ versions.add(new PackageVersion(versionRange, artifact, optional));
+ }
+ }
+ }
+ }
+ }
+ return packageVersions;
+ }
+
+ public Version getVersion(Attrs attrs) {
+ if (attrs == null) {
+ return Version.LOWEST;
+ }
+ return Version.parseVersion(attrs.get(Constants.VERSION_ATTRIBUTE));
+ }
+
+ public VersionRange getVersionRange(Attrs attrs) {
+ if (attrs == null) {
+ return new VersionRange("0");
+ }
+ String version = attrs.get(Constants.VERSION_ATTRIBUTE);
+ if (version == null) {
+ return new VersionRange("0");
+ }
+ return new VersionRange(version);
+ }
+
+ public boolean isBundle(Artifact artifact) {
+ return getManifestAttribute(artifact, Constants.BUNDLE_SYMBOLICNAME) != null;
+ }
+
+ public boolean isOptional(Attrs attrs) {
+ return attrs != null && "optional".equals(attrs.get(Constants.RESOLUTION_DIRECTIVE));
+ }
+
+ public boolean equals(VersionRange v1, VersionRange v2) {
+ return v1 == v2 || v1.toString().equals(v2.toString());
+ }
+
+ public Parameters getManifestAttributeParameters(Artifact artifact, String attributeName) {
+ String attributeValue = getManifestAttribute(artifact, attributeName);
+ if (attributeValue != null) {
+ return OSGiHeader.parseHeader(attributeValue);
+ }
+ return null;
+ }
+
+ public String getManifestAttribute(Artifact artifact, String attributeName) {
+ Manifest manifest = getManifest(artifact);
+ if (manifest != null) {
+ Attributes mainAttributes = manifest.getMainAttributes();
+ return mainAttributes.getValue(attributeName);
+ }
+ return null;
+ }
+
+ public Manifest getManifest(Artifact artifact) {
+ if (artifact != null) {
+ File file = artifact.getFile();
+ if (file != null) {
+ try {
+ JarFile jarFile = new JarFile(artifact.getFile());
+ return jarFile.getManifest();
+ } catch (IOException e) {
+ return null;
+ }
+ }
+ }
+ return null;
+ }
+
+ private final class BundleComparator implements Comparator<BundleInfo> {
+
+ @Override
+ public int compare(BundleInfo bundle1, BundleInfo bundle2) {
+ return bundle1.getSymbolicName().compareTo(bundle2.getSymbolicName());
+ }
+
+ }
+
+ // public static void main(String[] args) throws Exception {
+ // MavenOsgiUtils mavenOsgiUtils = new MavenOsgiUtils();
+ // Parameters exports = mavenOsgiUtils.getImports(new
+ // File("/Users/david/Documents/workspace-trunk/taverna-plugin-impl/target/taverna-plugin-impl-0.1.0-SNAPSHOT.jar"));
+ // for (String key : exports.keySet()) {
+ // System.out.println(key + " " + mavenOsgiUtils.getVersionRange(exports.get(key)));
+ // }
+ // }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Package.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Package.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Package.java
new file mode 100644
index 0000000..5e4a5e5
--- /dev/null
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/Package.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (C) 2013 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.maven.plugins;
+
+import aQute.bnd.version.VersionRange;
+
+/**
+ * @author David Withers
+ */
+public class Package {
+
+ private String name;
+ private VersionRange versionRange;
+
+ public Package(String name, VersionRange versionRange) {
+ this.name = name;
+ this.versionRange = versionRange;
+ }
+
+ @Override
+ public String toString() {
+ if (versionRange == null) {
+ return name;
+ } else {
+ return name + ";version=\"" + versionRange + "\"";
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/PackageVersion.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/PackageVersion.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/PackageVersion.java
new file mode 100644
index 0000000..14e0dee
--- /dev/null
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/PackageVersion.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (C) 2013 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.maven.plugins;
+
+import org.apache.maven.artifact.Artifact;
+
+import aQute.bnd.version.VersionRange;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+public class PackageVersion {
+
+ private VersionRange versionRange;
+ private Artifact artifact;
+ private boolean optional;
+
+ public PackageVersion(VersionRange versionRange, Artifact artifact) {
+ this(versionRange, artifact, false);
+ }
+
+ public PackageVersion(VersionRange versionRange, Artifact artifact, boolean optional) {
+ this.versionRange = versionRange;
+ this.artifact = artifact;
+ this.optional = optional;
+ }
+
+ @Override
+ public String toString() {
+ return versionRange + (optional ? "" : "") + "(from " + artifact.getId() + ")";
+ }
+
+ public VersionRange getVersionRange() {
+ return versionRange;
+ }
+
+ public void setVersionRange(VersionRange versionRange) {
+ this.versionRange = versionRange;
+ }
+
+ public Artifact getArtifact() {
+ return artifact;
+ }
+
+ public void setArtifact(Artifact artifact) {
+ this.artifact = artifact;
+ }
+
+ public boolean isOptional() {
+ return optional;
+ }
+
+ public void setOptional(boolean optional) {
+ this.optional = optional;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
new file mode 100644
index 0000000..cf2034b
--- /dev/null
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
@@ -0,0 +1,235 @@
+/*******************************************************************************
+ * Copyright (C) 2009 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.maven.plugins;
+
+import static net.sf.taverna.t2.maven.plugins.TavernaPluginGenerateMojo.META_INF_TAVERNA;
+import static net.sf.taverna.t2.maven.plugins.TavernaPluginGenerateMojo.PLUGIN_FILE;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.jar.JarFile;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipException;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.wagon.ConnectionException;
+import org.apache.maven.wagon.ResourceDoesNotExistException;
+import org.apache.maven.wagon.UnsupportedProtocolException;
+import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.authentication.AuthenticationException;
+import org.apache.maven.wagon.observers.Debug;
+import org.apache.maven.wagon.repository.Repository;
+
+import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
+import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
+import uk.org.taverna.commons.plugin.xml.jaxb.Plugins;
+import uk.org.taverna.commons.versions.xml.jaxb.Version;
+
+/**
+ * Deploys the Taverna plugin using <code>scp</code> or <code>file</code> protocol to the site URL
+ * specified.
+ *
+ * @author David Withers
+ */
+@Mojo(name = "plugin-deploy-file", requiresProject=false, requiresDirectInvocation = true)
+public class TavernaPluginDeployFileMojo extends AbstractWagonMojo {
+
+ private static final String PLUGIN_FILE_ENTRY = META_INF_TAVERNA + "/" + PLUGIN_FILE;
+
+ private static final String PLUGINS_FILE = "plugins.xml";
+
+ @Parameter(defaultValue = "http://updates.taverna.org.uk/workbench/3.0/dev/", required = true)
+ protected String site;
+
+ @Parameter(property = "file", required = true)
+ protected File file;
+
+ @Parameter(property = "url", required = true)
+ protected String url;
+
+ @Parameter(property = "serverId", required = true)
+ protected String serverId;
+
+ public void execute() throws MojoExecutionException {
+ if (!file.exists()) {
+ throw new MojoExecutionException("The Taverna Plugin file " + file
+ + " does not exist");
+ }
+
+ JarFile pluginJarFile;
+ try {
+ pluginJarFile = new JarFile(file);
+ } catch (ZipException e) {
+ throw new MojoExecutionException(file + " is not a valid Taverna Plugin file", e);
+ } catch (IOException e) {
+ throw new MojoExecutionException("Error opening Taverna Plugin file: " + file, e);
+ }
+
+ ZipEntry pluginFileEntry = pluginJarFile.getJarEntry(PLUGIN_FILE_ENTRY);
+ if (pluginFileEntry == null) {
+ throw new MojoExecutionException(file
+ + " is not a valid Taverna Plugin file, missing " + PLUGIN_FILE_ENTRY);
+ }
+
+ JAXBContext jaxbContext;
+ try {
+ jaxbContext = JAXBContext.newInstance(PluginInfo.class, Plugins.class);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error setting up JAXB context ", e);
+ }
+
+ PluginInfo plugin;
+ try {
+ InputStream inputStream = pluginJarFile.getInputStream(pluginFileEntry);
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ plugin = (PluginInfo) unmarshaller.unmarshal(inputStream);
+ inputStream.close();
+ } catch (IOException e) {
+ throw new MojoExecutionException("Error reading " + file, e);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error reading " + file, e);
+ }
+
+ getLog().debug("The Taverna plugin will be deployed to '" + url + "'");
+
+ Repository repository = new Repository(serverId, url);
+
+ // create the wagon
+ Wagon wagon;
+ try {
+ wagon = wagonManager.getWagon(repository.getProtocol());
+ } catch (UnsupportedProtocolException e) {
+ throw new MojoExecutionException("Unsupported protocol: '" + repository.getProtocol()
+ + "'", e);
+ }
+
+ Debug debug = new Debug();
+ if (getLog().isDebugEnabled()) {
+ wagon.addSessionListener(debug);
+ wagon.addTransferListener(debug);
+ }
+
+ // connect to the plugin site
+ try {
+ wagon.connect(repository, wagonManager.getAuthenticationInfo(serverId),
+ wagonManager.getProxy(repository.getProtocol()));
+ } catch (ConnectionException e) {
+ throw new MojoExecutionException("Error connecting to plugin site at " + url, e);
+ } catch (AuthenticationException e) {
+ throw new MojoExecutionException("Authentication error connecting to plugin site at "
+ + url, e);
+ }
+
+ try {
+ File pluginsFile = File.createTempFile("taverna", null);
+
+ // fetch the plugins file
+ Plugins plugins;
+ try {
+ Utils.downloadFile(PLUGINS_FILE, pluginsFile, wagon, getLog());
+ try {
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ plugins = (Plugins) unmarshaller.unmarshal(pluginsFile);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error reading " + pluginsFile, e);
+ }
+ } catch (ResourceDoesNotExistException e) {
+ getLog().info("Creating new plugins file");
+ plugins = new Plugins();
+ }
+
+ String deployedPluginFile = plugin.getId() + "-" + plugin.getVersion() + ".jar";
+
+ if (addPlugin(plugins, plugin, deployedPluginFile)) {
+ // write the new plugin site file
+ try {
+ Marshaller marshaller = jaxbContext.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION,
+ TavernaPluginGenerateMojo.SCHEMA_LOCATION);
+ marshaller.marshal(plugins, pluginsFile);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error writing " + PLUGINS_FILE, e);
+ }
+
+ // upload the plugin to the update site
+ Utils.uploadFile(file, deployedPluginFile, wagon, getLog());
+ // upload the plugin site file
+ Utils.uploadFile(pluginsFile, PLUGINS_FILE, wagon, getLog());
+ }
+ } catch (IOException e) {
+ throw new MojoExecutionException("Error writing " + PLUGINS_FILE, e);
+ } finally {
+ disconnectWagon(wagon, debug);
+ }
+ }
+
+ private boolean addPlugin(Plugins plugins, PluginInfo pluginInfo, String pluginURL) {
+ PluginVersions plugin = getPlugin(plugins, pluginInfo);
+ Version latestVersion = plugin.getLatestVersion();
+ if (latestVersion != null && latestVersion.getVersion().equals(pluginInfo.getVersion())) {
+ getLog().error(
+ String.format("%1$s version %2$s has already been deployed",
+ pluginInfo.getName(), pluginInfo.getVersion()));
+ return false;
+ }
+ Version newPluginVersion = new Version();
+ newPluginVersion.setVersion(pluginInfo.getVersion());
+ newPluginVersion.setFile(pluginURL);
+
+ getLog().info(
+ String.format("Adding %1$s version %2$s", pluginInfo.getName(),
+ pluginInfo.getVersion()));
+ if (plugin.getLatestVersion() != null) {
+ plugin.getPreviousVersion().add(plugin.getLatestVersion());
+ }
+ plugin.setLatestVersion(newPluginVersion);
+ return true;
+ }
+
+ private PluginVersions getPlugin(Plugins plugins, PluginInfo pluginInfo) {
+ PluginVersions pluginVersions = null;
+ for (PluginVersions existingPlugin : plugins.getPlugin()) {
+ if (existingPlugin.getId().equals(pluginInfo.getId())) {
+ pluginVersions = existingPlugin;
+ break;
+ }
+ }
+ if (pluginVersions == null) {
+ pluginVersions = new PluginVersions();
+ pluginVersions.setId(pluginInfo.getId());
+ plugins.getPlugin().add(pluginVersions);
+ }
+ pluginVersions.setName(pluginInfo.getName());
+ pluginVersions.setDescription(pluginInfo.getDescription());
+ pluginVersions.setOrganization(pluginInfo.getOrganization());
+ return pluginVersions;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
new file mode 100644
index 0000000..8ba1f3d
--- /dev/null
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
@@ -0,0 +1,220 @@
+/*******************************************************************************
+ * Copyright (C) 2009 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.maven.plugins;
+
+import java.io.File;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.wagon.ConnectionException;
+import org.apache.maven.wagon.ResourceDoesNotExistException;
+import org.apache.maven.wagon.UnsupportedProtocolException;
+import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.authentication.AuthenticationException;
+import org.apache.maven.wagon.observers.Debug;
+import org.apache.maven.wagon.repository.Repository;
+
+import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
+import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
+import uk.org.taverna.commons.plugin.xml.jaxb.Plugins;
+import uk.org.taverna.commons.versions.xml.jaxb.Version;
+
+/**
+ * Deploys the Taverna plugin using <code>scp</code> or <code>file</code> protocol to the site URL
+ * specified in the <code><distributionManagement></code> section of the POM.
+ *
+ * @author David Withers
+ */
+@Mojo(name = "plugin-deploy", defaultPhase = LifecyclePhase.DEPLOY)
+public class TavernaPluginDeployMojo extends AbstractDeployMojo {
+
+ private static final String PLUGINS_FILE = "plugins.xml";
+
+ private File tempDirectory;
+
+ public void execute() throws MojoExecutionException {
+ tempDirectory = new File(buildDirectory, TavernaProfileGenerateMojo.TAVERNA_TMP);
+ tempDirectory.mkdirs();
+ if (artifact == null) {
+ throw new MojoExecutionException(
+ "The Taverna Plugin does not exist, please run taverna:plugin-generate first");
+ }
+
+ File artifactFile = artifact.getFile();
+ if (artifactFile == null) {
+ throw new MojoExecutionException(
+ "The Taverna Plugin does not exist, please run taverna:plugin-generate first");
+ }
+
+ File pluginDirectory = new File(outputDirectory, TavernaPluginGenerateMojo.META_INF_TAVERNA);
+ File pluginFile = new File(pluginDirectory, TavernaPluginGenerateMojo.PLUGIN_FILE);
+ if (!pluginFile.exists()) {
+ throw new MojoExecutionException(
+ "The Taverna Plugin does not exist, please run taverna:plugin-generate first");
+ }
+
+ JAXBContext jaxbContext;
+ try {
+ jaxbContext = JAXBContext.newInstance(PluginInfo.class, Plugins.class);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error setting up JAXB context ", e);
+ }
+
+ PluginInfo plugin;
+ try {
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ plugin = (PluginInfo) unmarshaller.unmarshal(pluginFile);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error reading " + pluginFile, e);
+ }
+
+ if (deploymentRepository == null) {
+ throw new MojoExecutionException(
+ "Missing repository information in the distribution management element in the project.");
+ }
+
+ String url = deploymentRepository.getUrl();
+ String id = deploymentRepository.getId();
+
+ if (url == null) {
+ throw new MojoExecutionException(
+ "The URL to the Taverna plugin site is missing in the project descriptor.");
+ }
+ getLog().debug("The Taverna plugin will be deployed to '" + url + "'");
+
+ Repository repository = new Repository(id, url);
+
+ // create the wagon
+ Wagon wagon;
+ try {
+ wagon = wagonManager.getWagon(repository.getProtocol());
+ } catch (UnsupportedProtocolException e) {
+ throw new MojoExecutionException("Unsupported protocol: '" + repository.getProtocol()
+ + "'", e);
+ }
+
+ Debug debug = new Debug();
+ if (getLog().isDebugEnabled()) {
+ wagon.addSessionListener(debug);
+ wagon.addTransferListener(debug);
+ }
+
+ // connect to the plugin site
+ try {
+ wagon.connect(repository, wagonManager.getAuthenticationInfo(id),
+ wagonManager.getProxy(repository.getProtocol()));
+ } catch (ConnectionException e) {
+ throw new MojoExecutionException("Error connecting to plugin site at " + url, e);
+ } catch (AuthenticationException e) {
+ throw new MojoExecutionException("Authentication error connecting to plugin site at "
+ + url, e);
+ }
+
+ try {
+ String deployedPluginFile = project.getGroupId() + "." + project.getArtifactId() + "-"
+ + plugin.getVersion() + ".jar";
+
+ // fetch the plugins file
+ Plugins plugins;
+ File pluginsFile = new File(tempDirectory, PLUGINS_FILE);
+ try {
+ Utils.downloadFile(PLUGINS_FILE, pluginsFile, wagon, getLog());
+ try {
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ plugins = (Plugins) unmarshaller.unmarshal(pluginsFile);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error reading " + pluginsFile, e);
+ }
+ } catch (ResourceDoesNotExistException e) {
+ getLog().info("Creating new plugins file");
+ plugins = new Plugins();
+ }
+
+ if (addPlugin(plugins, plugin, deployedPluginFile)) {
+ // write the new plugin site file
+ try {
+ Marshaller marshaller = jaxbContext.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION,
+ TavernaPluginGenerateMojo.SCHEMA_LOCATION);
+ marshaller.marshal(plugins, pluginsFile);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error writing " + PLUGINS_FILE, e);
+ }
+
+ // upload the plugin to the update site
+ Utils.uploadFile(artifactFile, deployedPluginFile, wagon, getLog());
+ // upload the plugin site file
+ Utils.uploadFile(pluginsFile, PLUGINS_FILE, wagon, getLog());
+ }
+ } finally {
+ disconnectWagon(wagon, debug);
+ }
+ }
+
+ private boolean addPlugin(Plugins plugins, PluginInfo pluginInfo, String pluginURL) {
+ PluginVersions plugin = getPlugin(plugins, pluginInfo);
+ Version latestVersion = plugin.getLatestVersion();
+ if (latestVersion != null && latestVersion.getVersion().equals(pluginInfo.getVersion())) {
+ getLog().error(
+ String.format("%1$s version %2$s has already been deployed", pluginInfo.getName(),
+ pluginInfo.getVersion()));
+ return false;
+ }
+ Version newPluginVersion = new Version();
+ newPluginVersion.setVersion(pluginInfo.getVersion());
+ newPluginVersion.setFile(pluginURL);
+
+ getLog().info(
+ String.format("Adding %1$s version %2$s", pluginInfo.getName(), pluginInfo.getVersion()));
+ if (plugin.getLatestVersion() != null) {
+ plugin.getPreviousVersion().add(plugin.getLatestVersion());
+ }
+ plugin.setLatestVersion(newPluginVersion);
+ return true;
+ }
+
+ private PluginVersions getPlugin(Plugins plugins, PluginInfo pluginInfo) {
+ PluginVersions pluginVersions = null;
+ for (PluginVersions existingPlugin : plugins.getPlugin()) {
+ if (existingPlugin.getId().equals(pluginInfo.getId())) {
+ pluginVersions = existingPlugin;
+ break;
+ }
+ }
+ if (pluginVersions == null) {
+ pluginVersions = new PluginVersions();
+ pluginVersions.setId(pluginInfo.getId());
+ plugins.getPlugin().add(pluginVersions);
+ }
+ pluginVersions.setName(pluginInfo.getName());
+ pluginVersions.setDescription(pluginInfo.getDescription());
+ pluginVersions.setOrganization(pluginInfo.getOrganization());
+ return pluginVersions;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
new file mode 100644
index 0000000..0ec94f4
--- /dev/null
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * Copyright (C) 2009 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.maven.plugins;
+
+import java.io.File;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.model.Organization;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectDependenciesResolver;
+import org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter;
+import org.apache.maven.shared.osgi.Maven2OsgiConverter;
+import org.eclipse.aether.RepositorySystemSession;
+
+import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
+import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
+
+/**
+ * Generates a Taverna plugin definition file.
+ *
+ * @author David Withers
+ */
+@Mojo(name = "plugin-generate", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, requiresDependencyResolution = ResolutionScope.RUNTIME)
+public class TavernaPluginGenerateMojo extends AbstractMojo {
+
+ public static final String PLUGIN_FILE = "plugin.xml";
+
+ public static final String META_INF_TAVERNA = "META-INF/taverna";
+
+ public static final String SCHEMA_LOCATION = "http://ns.taverna.org.uk/2013/application/plugin http://localhost/2013/application/plugin/ApplicationPlugin.xsd";
+
+ @Component
+ private MavenProject project;
+
+ @Component
+ private ProjectDependenciesResolver projectDependenciesResolver;
+
+ @Parameter(defaultValue = "${repositorySystemSession}", readonly = true)
+ private RepositorySystemSession repositorySystemSession;
+
+ @Parameter(defaultValue = "${project.build.outputDirectory}", required = true)
+ protected File outputDirectory;
+
+ @Parameter(defaultValue = "${project.description}", required = true)
+ protected String description;
+
+ @Parameter(defaultValue = "${project.organization}", required = true)
+ protected Organization organization;
+
+ private MavenOsgiUtils osgiUtils;
+
+ private Maven2OsgiConverter maven2OsgiConverter = new DefaultMaven2OsgiConverter();
+
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ try {
+ osgiUtils = new MavenOsgiUtils(project, repositorySystemSession,
+ projectDependenciesResolver, getLog());
+ createPluginDefinition();
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error generating Taverna plugin", e);
+ }
+ }
+
+ /**
+ * Generates the Taverna plugin definition file.
+ *
+ * @return the <code>File</code> that the Taverna plugin definition has been written to
+ * @throws JAXBException
+ * @throws MojoExecutionException
+ */
+ 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;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java
----------------------------------------------------------------------
diff --git a/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java
new file mode 100644
index 0000000..497151f
--- /dev/null
+++ b/taverna-maven-plugin/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (C) 2009 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.maven.plugins;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Set;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectDependenciesResolver;
+import org.eclipse.aether.RepositorySystemSession;
+
+/**
+ * Prepares the plugin OSGi bundles.
+ *
+ * @author David Withers
+ */
+@Mojo(name = "plugin-prepare-bundles", defaultPhase = LifecyclePhase.PREPARE_PACKAGE, requiresDependencyResolution = ResolutionScope.RUNTIME)
+public class TavernaPluginPrepareBundlesMojo extends AbstractMojo {
+
+ @Component
+ private MavenProject project;
+
+ @Component
+ private ProjectDependenciesResolver projectDependenciesResolver;
+
+ @Parameter(defaultValue = "${repositorySystemSession}", readonly = true)
+ private RepositorySystemSession repositorySystemSession;
+
+ /**
+ * The directory where the plugin OSGi bundles file will be put.
+ */
+ @Parameter(defaultValue = "${project.build.outputDirectory}", required = true)
+ protected File outputDirectory;
+
+ private MavenOsgiUtils osgiUtils;
+
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ osgiUtils = new MavenOsgiUtils(project, repositorySystemSession,
+ projectDependenciesResolver, getLog());
+ outputDirectory.mkdirs();
+
+ Set<BundleArtifact> bundleDependencies = osgiUtils.getBundleDependencies(
+ Artifact.SCOPE_COMPILE, Artifact.SCOPE_RUNTIME);
+ try {
+ for (BundleArtifact bundleArtifact : bundleDependencies) {
+ Artifact artifact = bundleArtifact.getArtifact();
+ FileUtils.copyFileToDirectory(bundleArtifact.getArtifact().getFile(), new File(
+ outputDirectory, artifact.getGroupId()));
+ }
+ } catch (IOException e) {
+ throw new MojoExecutionException("Error copying dependecies to archive directory", e);
+ }
+ }
+
+}
[28/50] [abbrv] incubator-taverna-osgi git commit: Merge branch
'taverna3-osgi-services'
Posted by st...@apache.org.
Merge branch 'taverna3-osgi-services'
>From https://github.com/taverna/taverna3-osgi-services master
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/43f9f8db
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/43f9f8db
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/43f9f8db
Branch: refs/heads/master
Commit: 43f9f8db5b40de0b5c9b5a6e123b4300715ff5b7
Parents: 4fccf24 e156419
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu Dec 18 22:15:56 2014 -0600
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu Dec 18 22:15:56 2014 -0600
----------------------------------------------------------------------
.gitignore | 24 +++
xml-parser-service/.project | 24 +++
xml-parser-service/pom.xml | 62 ++++++++
.../javax.xml.parsers.DocumentBuilderFactory | 1 +
.../services/javax.xml.parsers.SAXParserFactory | 1 +
xml-transformer-service/.project | 24 +++
xml-transformer-service/pom.xml | 67 +++++++++
.../services/xml/XMLTransformerActivator.java | 147 +++++++++++++++++++
.../javax.xml.transform.TransformerFactory | 1 +
9 files changed, 351 insertions(+)
----------------------------------------------------------------------
[08/50] [abbrv] incubator-taverna-osgi git commit: add README
Posted by st...@apache.org.
add README
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/f3e424f5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/f3e424f5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/f3e424f5
Branch: refs/heads/master
Commit: f3e424f5046ed94bc066af5f124bcd1b03b4c5f6
Parents: ac73555
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Fri May 9 11:48:17 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Fri May 9 11:48:17 2014 +0100
----------------------------------------------------------------------
README.md | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/f3e424f5/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..cfda180
--- /dev/null
+++ b/README.md
@@ -0,0 +1,5 @@
+OSGi Compendium Services (Rel. 4, Ver. 4.3)
+
+Implementations of services specified in the OSGi Service Platform Service Compendium, Release 4, Version 4.3
+
+This code was previously hosted at http://taverna.googlecode.com/svn/osgi-launcher/
\ No newline at end of file
[02/50] [abbrv] incubator-taverna-osgi git commit: Added
plugin-deploy-file goal
Posted by st...@apache.org.
Added plugin-deploy-file goal
git-svn-id: http://taverna.googlecode.com/svn/taverna/dev/maven-plugin/trunk/taverna-maven-plugin@16464 bf327186-88b3-11dd-a302-d386e5130c1c
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/3a7b9ed4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/3a7b9ed4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/3a7b9ed4
Branch: refs/heads/master
Commit: 3a7b9ed4d476799ea2b2d4d33faffed1979b97e7
Parents: d377e30
Author: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Fri Dec 13 16:43:50 2013 +0000
Committer: david@mygrid.org.uk <da...@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Fri Dec 13 16:43:50 2013 +0000
----------------------------------------------------------------------
pom.xml | 15 --
.../t2/maven/plugins/AbstractDeployMojo.java | 32 +--
.../t2/maven/plugins/AbstractWagonMojo.java | 60 +++++
.../plugins/TavernaPluginDeployFileMojo.java | 235 +++++++++++++++++++
.../maven/plugins/TavernaPluginDeployMojo.java | 4 +-
5 files changed, 299 insertions(+), 47 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/3a7b9ed4/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7e7d6dc..aab045b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,14 +35,6 @@
</execution>
</executions>
</plugin>
- <!-- <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId>
- <version>0.8.3</version> <configuration> <forceRegenerate>true</forceRegenerate>
- <schemas> <schema> Use real url when deployed <url>http://ns.taverna.org.uk/2013/application/profile/ApplicationProfile.xsd</url>
- <url>http://localhost/2013/application/profile/ApplicationProfile.xsd</url>
- </schema> <schema> Use real url when deployed <url>http://ns.taverna.org.uk/2013/application/plugin/ApplicationPlugin.xsd</url>
- <url>http://localhost/2013/application/plugin/ApplicationPlugin.xsd</url>
- </schema> </schemas> </configuration> <executions> <execution> <goals> <goal>generate</goal>
- </goals> </execution> </executions> </plugin> -->
</plugins>
</build>
<dependencies>
@@ -72,18 +64,11 @@
<artifactId>maven-osgi</artifactId>
<version>0.2.0</version>
</dependency>
- <!-- <dependency>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-file</artifactId>
- <version>2.4</version>
- </dependency> -->
<dependency>
<groupId>uk.org.taverna.commons</groupId>
<artifactId>taverna-xml-schemas</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
- <!-- <dependency> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.7</version> </dependency> -->
<dependency>
<groupId>biz.aQute</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/3a7b9ed4/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java b/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java
index e19e2f6..d3e98cf 100644
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java
+++ b/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java
@@ -23,22 +23,17 @@ package net.sf.taverna.t2.maven.plugins;
import java.io.File;
import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.manager.WagonManager;
import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
-import org.apache.maven.wagon.ConnectionException;
-import org.apache.maven.wagon.Wagon;
-import org.apache.maven.wagon.observers.Debug;
/**
- *
+ * Abstract Mojo for deploying artifacts.
*
* @author David Withers
*/
-public abstract class AbstractDeployMojo extends AbstractMojo {
+public abstract class AbstractDeployMojo extends AbstractWagonMojo {
@Component
protected MavenProject project;
@@ -58,27 +53,4 @@ public abstract class AbstractDeployMojo extends AbstractMojo {
@Parameter(defaultValue = "${project.distributionManagementArtifactRepository}", required = true, readonly = true)
protected ArtifactRepository deploymentRepository;
- @Component
- protected WagonManager wagonManager;
-
- /**
- * Disconnect the wagon.
- *
- * @param wagon
- * the wagon to disconnect
- * @param debug
- */
- protected void disconnectWagon(Wagon wagon, Debug debug) {
- if (getLog().isDebugEnabled()) {
- wagon.removeTransferListener(debug);
- wagon.removeSessionListener(debug);
- }
- try {
- wagon.disconnect();
- } catch (ConnectionException e) {
- getLog().error("Error disconnecting wagon - ignored", e);
- }
- }
-
-
}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/3a7b9ed4/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java b/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java
new file mode 100644
index 0000000..a74166a
--- /dev/null
+++ b/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (C) 2013 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.maven.plugins;
+
+import org.apache.maven.artifact.manager.WagonManager;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.wagon.ConnectionException;
+import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.observers.Debug;
+
+/**
+ * Abstract Mojo for using the wagon.
+ *
+ * @author David Withers
+ */
+public abstract class AbstractWagonMojo extends AbstractMojo {
+
+ @Component
+ protected WagonManager wagonManager;
+
+ /**
+ * Disconnect the wagon.
+ *
+ * @param wagon
+ * the wagon to disconnect
+ * @param debug
+ */
+ protected void disconnectWagon(Wagon wagon, Debug debug) {
+ if (getLog().isDebugEnabled()) {
+ wagon.removeTransferListener(debug);
+ wagon.removeSessionListener(debug);
+ }
+ try {
+ wagon.disconnect();
+ } catch (ConnectionException e) {
+ getLog().error("Error disconnecting wagon - ignored", e);
+ }
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/3a7b9ed4/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java b/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
new file mode 100644
index 0000000..cf2034b
--- /dev/null
+++ b/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
@@ -0,0 +1,235 @@
+/*******************************************************************************
+ * Copyright (C) 2009 The University of Manchester
+ *
+ * Modifications to the initial code base are copyright of their
+ * respective authors, or their employers as appropriate.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.maven.plugins;
+
+import static net.sf.taverna.t2.maven.plugins.TavernaPluginGenerateMojo.META_INF_TAVERNA;
+import static net.sf.taverna.t2.maven.plugins.TavernaPluginGenerateMojo.PLUGIN_FILE;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.jar.JarFile;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipException;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.wagon.ConnectionException;
+import org.apache.maven.wagon.ResourceDoesNotExistException;
+import org.apache.maven.wagon.UnsupportedProtocolException;
+import org.apache.maven.wagon.Wagon;
+import org.apache.maven.wagon.authentication.AuthenticationException;
+import org.apache.maven.wagon.observers.Debug;
+import org.apache.maven.wagon.repository.Repository;
+
+import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
+import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
+import uk.org.taverna.commons.plugin.xml.jaxb.Plugins;
+import uk.org.taverna.commons.versions.xml.jaxb.Version;
+
+/**
+ * Deploys the Taverna plugin using <code>scp</code> or <code>file</code> protocol to the site URL
+ * specified.
+ *
+ * @author David Withers
+ */
+@Mojo(name = "plugin-deploy-file", requiresProject=false, requiresDirectInvocation = true)
+public class TavernaPluginDeployFileMojo extends AbstractWagonMojo {
+
+ private static final String PLUGIN_FILE_ENTRY = META_INF_TAVERNA + "/" + PLUGIN_FILE;
+
+ private static final String PLUGINS_FILE = "plugins.xml";
+
+ @Parameter(defaultValue = "http://updates.taverna.org.uk/workbench/3.0/dev/", required = true)
+ protected String site;
+
+ @Parameter(property = "file", required = true)
+ protected File file;
+
+ @Parameter(property = "url", required = true)
+ protected String url;
+
+ @Parameter(property = "serverId", required = true)
+ protected String serverId;
+
+ public void execute() throws MojoExecutionException {
+ if (!file.exists()) {
+ throw new MojoExecutionException("The Taverna Plugin file " + file
+ + " does not exist");
+ }
+
+ JarFile pluginJarFile;
+ try {
+ pluginJarFile = new JarFile(file);
+ } catch (ZipException e) {
+ throw new MojoExecutionException(file + " is not a valid Taverna Plugin file", e);
+ } catch (IOException e) {
+ throw new MojoExecutionException("Error opening Taverna Plugin file: " + file, e);
+ }
+
+ ZipEntry pluginFileEntry = pluginJarFile.getJarEntry(PLUGIN_FILE_ENTRY);
+ if (pluginFileEntry == null) {
+ throw new MojoExecutionException(file
+ + " is not a valid Taverna Plugin file, missing " + PLUGIN_FILE_ENTRY);
+ }
+
+ JAXBContext jaxbContext;
+ try {
+ jaxbContext = JAXBContext.newInstance(PluginInfo.class, Plugins.class);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error setting up JAXB context ", e);
+ }
+
+ PluginInfo plugin;
+ try {
+ InputStream inputStream = pluginJarFile.getInputStream(pluginFileEntry);
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ plugin = (PluginInfo) unmarshaller.unmarshal(inputStream);
+ inputStream.close();
+ } catch (IOException e) {
+ throw new MojoExecutionException("Error reading " + file, e);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error reading " + file, e);
+ }
+
+ getLog().debug("The Taverna plugin will be deployed to '" + url + "'");
+
+ Repository repository = new Repository(serverId, url);
+
+ // create the wagon
+ Wagon wagon;
+ try {
+ wagon = wagonManager.getWagon(repository.getProtocol());
+ } catch (UnsupportedProtocolException e) {
+ throw new MojoExecutionException("Unsupported protocol: '" + repository.getProtocol()
+ + "'", e);
+ }
+
+ Debug debug = new Debug();
+ if (getLog().isDebugEnabled()) {
+ wagon.addSessionListener(debug);
+ wagon.addTransferListener(debug);
+ }
+
+ // connect to the plugin site
+ try {
+ wagon.connect(repository, wagonManager.getAuthenticationInfo(serverId),
+ wagonManager.getProxy(repository.getProtocol()));
+ } catch (ConnectionException e) {
+ throw new MojoExecutionException("Error connecting to plugin site at " + url, e);
+ } catch (AuthenticationException e) {
+ throw new MojoExecutionException("Authentication error connecting to plugin site at "
+ + url, e);
+ }
+
+ try {
+ File pluginsFile = File.createTempFile("taverna", null);
+
+ // fetch the plugins file
+ Plugins plugins;
+ try {
+ Utils.downloadFile(PLUGINS_FILE, pluginsFile, wagon, getLog());
+ try {
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ plugins = (Plugins) unmarshaller.unmarshal(pluginsFile);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error reading " + pluginsFile, e);
+ }
+ } catch (ResourceDoesNotExistException e) {
+ getLog().info("Creating new plugins file");
+ plugins = new Plugins();
+ }
+
+ String deployedPluginFile = plugin.getId() + "-" + plugin.getVersion() + ".jar";
+
+ if (addPlugin(plugins, plugin, deployedPluginFile)) {
+ // write the new plugin site file
+ try {
+ Marshaller marshaller = jaxbContext.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+ marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION,
+ TavernaPluginGenerateMojo.SCHEMA_LOCATION);
+ marshaller.marshal(plugins, pluginsFile);
+ } catch (JAXBException e) {
+ throw new MojoExecutionException("Error writing " + PLUGINS_FILE, e);
+ }
+
+ // upload the plugin to the update site
+ Utils.uploadFile(file, deployedPluginFile, wagon, getLog());
+ // upload the plugin site file
+ Utils.uploadFile(pluginsFile, PLUGINS_FILE, wagon, getLog());
+ }
+ } catch (IOException e) {
+ throw new MojoExecutionException("Error writing " + PLUGINS_FILE, e);
+ } finally {
+ disconnectWagon(wagon, debug);
+ }
+ }
+
+ private boolean addPlugin(Plugins plugins, PluginInfo pluginInfo, String pluginURL) {
+ PluginVersions plugin = getPlugin(plugins, pluginInfo);
+ Version latestVersion = plugin.getLatestVersion();
+ if (latestVersion != null && latestVersion.getVersion().equals(pluginInfo.getVersion())) {
+ getLog().error(
+ String.format("%1$s version %2$s has already been deployed",
+ pluginInfo.getName(), pluginInfo.getVersion()));
+ return false;
+ }
+ Version newPluginVersion = new Version();
+ newPluginVersion.setVersion(pluginInfo.getVersion());
+ newPluginVersion.setFile(pluginURL);
+
+ getLog().info(
+ String.format("Adding %1$s version %2$s", pluginInfo.getName(),
+ pluginInfo.getVersion()));
+ if (plugin.getLatestVersion() != null) {
+ plugin.getPreviousVersion().add(plugin.getLatestVersion());
+ }
+ plugin.setLatestVersion(newPluginVersion);
+ return true;
+ }
+
+ private PluginVersions getPlugin(Plugins plugins, PluginInfo pluginInfo) {
+ PluginVersions pluginVersions = null;
+ for (PluginVersions existingPlugin : plugins.getPlugin()) {
+ if (existingPlugin.getId().equals(pluginInfo.getId())) {
+ pluginVersions = existingPlugin;
+ break;
+ }
+ }
+ if (pluginVersions == null) {
+ pluginVersions = new PluginVersions();
+ pluginVersions.setId(pluginInfo.getId());
+ plugins.getPlugin().add(pluginVersions);
+ }
+ pluginVersions.setName(pluginInfo.getName());
+ pluginVersions.setDescription(pluginInfo.getDescription());
+ pluginVersions.setOrganization(pluginInfo.getOrganization());
+ return pluginVersions;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/3a7b9ed4/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java b/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
index e4d56a4..8ba1f3d 100644
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
+++ b/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
@@ -135,10 +135,8 @@ public class TavernaPluginDeployMojo extends AbstractDeployMojo {
}
try {
- // upload the plugin to the update site
String deployedPluginFile = project.getGroupId() + "." + project.getArtifactId() + "-"
+ plugin.getVersion() + ".jar";
- Utils.uploadFile(artifactFile, deployedPluginFile, wagon, getLog());
// fetch the plugins file
Plugins plugins;
@@ -168,6 +166,8 @@ public class TavernaPluginDeployMojo extends AbstractDeployMojo {
throw new MojoExecutionException("Error writing " + PLUGINS_FILE, e);
}
+ // upload the plugin to the update site
+ Utils.uploadFile(artifactFile, deployedPluginFile, wagon, getLog());
// upload the plugin site file
Utils.uploadFile(pluginsFile, PLUGINS_FILE, wagon, getLog());
}
[07/50] [abbrv] incubator-taverna-osgi git commit: add gitignore
Posted by st...@apache.org.
add gitignore
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/ac735550
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/ac735550
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/ac735550
Branch: refs/heads/master
Commit: ac7355503df463424fcde4f72fcfbdd467034684
Parents: 4b5c0a3
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Fri May 9 11:48:10 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Fri May 9 11:48:10 2014 +0100
----------------------------------------------------------------------
.gitignore | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/ac735550/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ebe0e5b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,24 @@
+# ignore project files #
+.classpath
+.project
+.settings/
+catalog-v001.xml
+
+# ignore target files #
+target/
+bin/
+build/
+dist/
+apidoc/
+*.swp
+
+# ignore svn files if there
+.svn
+
+# ignore log files #
+*.log
+/logs/*
+*/logs/*
+
+
+
[42/50] [abbrv] incubator-taverna-osgi git commit: Merge branch
'taverna3-maven-plugin'
Posted by st...@apache.org.
Merge branch 'taverna3-maven-plugin'
>From https://github.com/taverna/taverna3-maven-plugin master
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/b8c5f925
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/b8c5f925
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/b8c5f925
Branch: refs/heads/master
Commit: b8c5f9255a463759e6a653b7238f6d7836efe261
Parents: d27ddcd 3726492
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Dec 28 02:41:16 2014 -0600
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Dec 28 02:41:16 2014 -0600
----------------------------------------------------------------------
taverna-maven-plugin/pom.xml | 127 ++++++
.../t2/maven/plugins/AbstractDeployMojo.java | 56 +++
.../t2/maven/plugins/AbstractWagonMojo.java | 60 +++
.../t2/maven/plugins/BundleArtifact.java | 66 +++
.../t2/maven/plugins/MavenOsgiUtils.java | 415 +++++++++++++++++++
.../sf/taverna/t2/maven/plugins/Package.java | 46 ++
.../t2/maven/plugins/PackageVersion.java | 77 ++++
.../plugins/TavernaPluginDeployFileMojo.java | 235 +++++++++++
.../maven/plugins/TavernaPluginDeployMojo.java | 220 ++++++++++
.../plugins/TavernaPluginGenerateMojo.java | 142 +++++++
.../TavernaPluginPrepareBundlesMojo.java | 84 ++++
.../maven/plugins/TavernaProfileDeployMojo.java | 275 ++++++++++++
.../plugins/TavernaProfileGenerateMojo.java | 221 ++++++++++
.../net/sf/taverna/t2/maven/plugins/Utils.java | 171 ++++++++
.../resources/META-INF/plexus/components.xml | 32 ++
.../src/main/resources/java7-packages | 209 ++++++++++
.../plugins/TavernaPluginGenerateMojoTest.java | 80 ++++
.../src/test/resources/unit/plugin-config.xml | 19 +
18 files changed, 2535 insertions(+)
----------------------------------------------------------------------
[18/50] [abbrv] incubator-taverna-osgi git commit: Reverted Derby
back com.springsource.org.apache.derby 10.5.1000001.764942 See: T3-1197
Posted by st...@apache.org.
Reverted Derby back com.springsource.org.apache.derby 10.5.1000001.764942 See: T3-1197
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/76e4cca0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/76e4cca0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/76e4cca0
Branch: refs/heads/master
Commit: 76e4cca0ef45cb66014f7ef3fb5d78c0bf4295a6
Parents: 803dd74
Author: Christian-B <br...@cs.man.ac.uk>
Authored: Mon Jun 30 10:47:58 2014 +0100
Committer: Christian-B <br...@cs.man.ac.uk>
Committed: Mon Jun 30 10:47:58 2014 +0100
----------------------------------------------------------------------
taverna-database-configuration-impl/pom.xml | 28 ++++++++++++------------
1 file changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/76e4cca0/taverna-database-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-impl/pom.xml b/taverna-database-configuration-impl/pom.xml
index b988eb8..3ecceae 100644
--- a/taverna-database-configuration-impl/pom.xml
+++ b/taverna-database-configuration-impl/pom.xml
@@ -45,20 +45,20 @@
</dependency>
<dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>${derby.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derbyclient</artifactId>
- <version>${derbyclient.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derbynet</artifactId>
- <version>${derbynet.version}</version>
- </dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>com.springsource.org.apache.derby</artifactId>
+ <version>${derby.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>com.springsource.org.apache.derby.client</artifactId>
+ <version>${derbyclient.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>com.springsource.org.apache.derby.drda</artifactId>
+ <version>${derbynet.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>com.springsource.org.apache.commons.dbcp</artifactId>
[30/50] [abbrv] incubator-taverna-osgi git commit: Merge branch
'taverna3-osgi-launcher'
Posted by st...@apache.org.
Merge branch 'taverna3-osgi-launcher'
>From https://github.com/taverna/taverna3-osgi-launcher master
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/82e6c925
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/82e6c925
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/82e6c925
Branch: refs/heads/master
Commit: 82e6c92513d56c2c020dbcb756b2e6ac7bd9b9e8
Parents: 43f9f8d b04134c
Author: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Authored: Thu Dec 18 22:20:53 2014 -0600
Committer: Stian Soiland-Reyes <so...@cs.manchester.ac.uk>
Committed: Thu Dec 18 22:20:53 2014 -0600
----------------------------------------------------------------------
taverna-osgi/pom.xml | 37 ++
.../java/uk/org/taverna/osgi/OsgiLauncher.java | 434 +++++++++++++++++++
2 files changed, 471 insertions(+)
----------------------------------------------------------------------
[41/50] [abbrv] incubator-taverna-osgi git commit:
taverna-maven-plugin/
Posted by st...@apache.org.
taverna-maven-plugin/
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/commit/37264921
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/tree/37264921
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/diff/37264921
Branch: refs/heads/master
Commit: 372649217ce13770e34a8e52b9da1e6d7a92abaf
Parents: 01a7c47
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sun Dec 28 02:40:39 2014 -0600
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sun Dec 28 02:41:03 2014 -0600
----------------------------------------------------------------------
.gitignore | 24 --
.project | 29 --
.travis.yml | 1 -
README.md | 3 -
pom.xml | 127 ------
.../t2/maven/plugins/AbstractDeployMojo.java | 56 ---
.../t2/maven/plugins/AbstractWagonMojo.java | 60 ---
.../t2/maven/plugins/BundleArtifact.java | 66 ---
.../t2/maven/plugins/MavenOsgiUtils.java | 415 -------------------
.../sf/taverna/t2/maven/plugins/Package.java | 46 --
.../t2/maven/plugins/PackageVersion.java | 77 ----
.../plugins/TavernaPluginDeployFileMojo.java | 235 -----------
.../maven/plugins/TavernaPluginDeployMojo.java | 220 ----------
.../plugins/TavernaPluginGenerateMojo.java | 142 -------
.../TavernaPluginPrepareBundlesMojo.java | 84 ----
.../maven/plugins/TavernaProfileDeployMojo.java | 275 ------------
.../plugins/TavernaProfileGenerateMojo.java | 221 ----------
.../net/sf/taverna/t2/maven/plugins/Utils.java | 171 --------
.../resources/META-INF/plexus/components.xml | 32 --
src/main/resources/java7-packages | 209 ----------
.../plugins/TavernaPluginGenerateMojoTest.java | 80 ----
src/test/resources/unit/plugin-config.xml | 19 -
taverna-maven-plugin/pom.xml | 127 ++++++
.../t2/maven/plugins/AbstractDeployMojo.java | 56 +++
.../t2/maven/plugins/AbstractWagonMojo.java | 60 +++
.../t2/maven/plugins/BundleArtifact.java | 66 +++
.../t2/maven/plugins/MavenOsgiUtils.java | 415 +++++++++++++++++++
.../sf/taverna/t2/maven/plugins/Package.java | 46 ++
.../t2/maven/plugins/PackageVersion.java | 77 ++++
.../plugins/TavernaPluginDeployFileMojo.java | 235 +++++++++++
.../maven/plugins/TavernaPluginDeployMojo.java | 220 ++++++++++
.../plugins/TavernaPluginGenerateMojo.java | 142 +++++++
.../TavernaPluginPrepareBundlesMojo.java | 84 ++++
.../maven/plugins/TavernaProfileDeployMojo.java | 275 ++++++++++++
.../plugins/TavernaProfileGenerateMojo.java | 221 ++++++++++
.../net/sf/taverna/t2/maven/plugins/Utils.java | 171 ++++++++
.../resources/META-INF/plexus/components.xml | 32 ++
.../src/main/resources/java7-packages | 209 ++++++++++
.../plugins/TavernaPluginGenerateMojoTest.java | 80 ++++
.../src/test/resources/unit/plugin-config.xml | 19 +
40 files changed, 2535 insertions(+), 2592 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index ebe0e5b..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,24 +0,0 @@
-# ignore project files #
-.classpath
-.project
-.settings/
-catalog-v001.xml
-
-# ignore target files #
-target/
-bin/
-build/
-dist/
-apidoc/
-*.swp
-
-# ignore svn files if there
-.svn
-
-# ignore log files #
-*.log
-/logs/*
-*/logs/*
-
-
-
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/.project
----------------------------------------------------------------------
diff --git a/.project b/.project
deleted file mode 100644
index 5cd1f1a..0000000
--- a/.project
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>taverna-maven-plugin</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index dff5f3a..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1 +0,0 @@
-language: java
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
deleted file mode 100644
index d0d6c4c..0000000
--- a/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-Maven plugin for packaging and deploying Taverna 3 plugins
-
-This code was previously hosted at http://taverna.googlecode.com/svn/taverna/dev/maven-plugin/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 74d3ed5..0000000
--- a/pom.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>parent</artifactId>
- <groupId>net.sf.taverna</groupId>
- <version>0.2.2011-02-17</version>
- </parent>
- <prerequisites>
- <maven>3.2.0</maven>
- </prerequisites>
- <groupId>net.sf.taverna.t2.maven.plugins</groupId>
- <artifactId>taverna-maven-plugin</artifactId>
- <packaging>maven-plugin</packaging>
- <version>0.3.1-SNAPSHOT</version>
- <name>Maven Taverna Plugin</name>
- <description>A Maven plugin for packaging and deploying Taverna plugins</description>
- <properties>
- <maven.version>3.2.3</maven.version>
- <mavenArchiverVersion>2.5</mavenArchiverVersion>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <version>3.3</version>
- <configuration>
- <!-- see http://jira.codehaus.org/browse/MNG-5346 -->
- <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
- </configuration>
- <executions>
- <execution>
- <id>mojo-descriptor</id>
- <goals>
- <goal>descriptor</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>${maven.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-core</artifactId>
- <version>${maven.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-aether-provider</artifactId>
- <version>${maven.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-annotations</artifactId>
- <version>3.3</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-osgi</artifactId>
- <version>0.2.0</version>
- </dependency>
- <dependency>
- <groupId>uk.org.taverna.commons</groupId>
- <artifactId>taverna-xml-schemas</artifactId>
- <version>0.1.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>biz.aQute</groupId>
- <artifactId>bndlib</artifactId>
- <version>2.0.0.20130123-133441</version>
- </dependency>
-
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.7</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.4</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.4</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.plugin-testing</groupId>
- <artifactId>maven-plugin-testing-harness</artifactId>
- <version>3.2.0</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository
- </url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- </repositories>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java b/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java
deleted file mode 100644
index d3e98cf..0000000
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractDeployMojo.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.maven.plugins;
-
-import java.io.File;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.plugins.annotations.Component;
-import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.project.MavenProject;
-
-/**
- * Abstract Mojo for deploying artifacts.
- *
- * @author David Withers
- */
-public abstract class AbstractDeployMojo extends AbstractWagonMojo {
-
- @Component
- protected MavenProject project;
-
- /**
- * Directory containing the generated Taverna plugin.
- */
- @Parameter(defaultValue = "${project.build.directory}", required = true)
- protected File buildDirectory;
-
- @Parameter(defaultValue = "${project.build.outputDirectory}", required = true)
- protected File outputDirectory;
-
- @Parameter(defaultValue = "${project.artifact}", required = true, readonly = true)
- protected Artifact artifact;
-
- @Parameter(defaultValue = "${project.distributionManagementArtifactRepository}", required = true, readonly = true)
- protected ArtifactRepository deploymentRepository;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java b/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java
deleted file mode 100644
index a74166a..0000000
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/AbstractWagonMojo.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.maven.plugins;
-
-import org.apache.maven.artifact.manager.WagonManager;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugins.annotations.Component;
-import org.apache.maven.wagon.ConnectionException;
-import org.apache.maven.wagon.Wagon;
-import org.apache.maven.wagon.observers.Debug;
-
-/**
- * Abstract Mojo for using the wagon.
- *
- * @author David Withers
- */
-public abstract class AbstractWagonMojo extends AbstractMojo {
-
- @Component
- protected WagonManager wagonManager;
-
- /**
- * Disconnect the wagon.
- *
- * @param wagon
- * the wagon to disconnect
- * @param debug
- */
- protected void disconnectWagon(Wagon wagon, Debug debug) {
- if (getLog().isDebugEnabled()) {
- wagon.removeTransferListener(debug);
- wagon.removeSessionListener(debug);
- }
- try {
- wagon.disconnect();
- } catch (ConnectionException e) {
- getLog().error("Error disconnecting wagon - ignored", e);
- }
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/main/java/net/sf/taverna/t2/maven/plugins/BundleArtifact.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/BundleArtifact.java b/src/main/java/net/sf/taverna/t2/maven/plugins/BundleArtifact.java
deleted file mode 100644
index 0226a07..0000000
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/BundleArtifact.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.maven.plugins;
-
-import org.apache.maven.artifact.Artifact;
-
-/**
- *
- *
- * @author David Withers
- */
-public class BundleArtifact {
-
- private Artifact artifact;
- private String symbolicName;
- private String version;
-
- public BundleArtifact(Artifact artifact, String symbolicName, String version) {
- this.artifact = artifact;
- this.symbolicName = symbolicName;
- this.version = version;
- }
-
- public Artifact getArtifact() {
- return artifact;
- }
-
- public void setArtifact(Artifact artifact) {
- this.artifact = artifact;
- }
-
- public String getSymbolicName() {
- return symbolicName;
- }
-
- public void setSymbolicName(String symbolicName) {
- this.symbolicName = symbolicName;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java b/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
deleted file mode 100644
index 6901119..0000000
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/MavenOsgiUtils.java
+++ /dev/null
@@ -1,415 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.maven.plugins;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-
-import org.apache.maven.RepositoryUtils;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.project.DefaultDependencyResolutionRequest;
-import org.apache.maven.project.DependencyResolutionException;
-import org.apache.maven.project.DependencyResolutionResult;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.ProjectDependenciesResolver;
-import org.eclipse.aether.RepositorySystemSession;
-import org.eclipse.aether.graph.DependencyNode;
-import org.eclipse.aether.util.filter.ScopeDependencyFilter;
-
-import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
-import aQute.bnd.header.Attrs;
-import aQute.bnd.header.OSGiHeader;
-import aQute.bnd.header.Parameters;
-import aQute.bnd.osgi.Constants;
-import aQute.bnd.version.Version;
-import aQute.bnd.version.VersionRange;
-
-/**
- * @author David Withers
- */
-public class MavenOsgiUtils {
-
- private final MavenProject project;
- private final RepositorySystemSession repositorySystemSession;
- private final ProjectDependenciesResolver projectDependenciesResolver;
- private final Log log;
-
- private Set<String> javaPackages;
- private Set<String> systemPackages;
-
- public MavenOsgiUtils(MavenProject project, RepositorySystemSession repositorySystemSession,
- ProjectDependenciesResolver projectDependenciesResolver, Log log) {
- this(project, repositorySystemSession, projectDependenciesResolver, new HashSet<String>(),
- log);
- }
-
- public MavenOsgiUtils(MavenProject project, RepositorySystemSession repositorySystemSession,
- ProjectDependenciesResolver projectDependenciesResolver, Set<String> systemPackages,
- Log log) {
- this.project = project;
- this.repositorySystemSession = repositorySystemSession;
- this.projectDependenciesResolver = projectDependenciesResolver;
- this.systemPackages = systemPackages;
- this.log = log;
- javaPackages = Utils.getJavaPackages(log);
- }
-
- public Set<BundleArtifact> getBundleDependencies(String... scopes)
- throws MojoExecutionException {
- ScopeDependencyFilter scopeFilter = new ScopeDependencyFilter(Arrays.asList(scopes), null);
-
- DefaultDependencyResolutionRequest dependencyResolutionRequest = new DefaultDependencyResolutionRequest(
- project, repositorySystemSession);
- dependencyResolutionRequest.setResolutionFilter(scopeFilter);
-
- DependencyResolutionResult dependencyResolutionResult;
- try {
- dependencyResolutionResult = projectDependenciesResolver
- .resolve(dependencyResolutionRequest);
- } catch (DependencyResolutionException ex) {
- throw new MojoExecutionException(ex.getMessage(), ex);
- }
-
- DependencyNode dependencyGraph = dependencyResolutionResult.getDependencyGraph();
- if (dependencyGraph != null) {
- checkBundleDependencies(dependencyGraph.getChildren());
- return getBundleArtifacts(dependencyGraph.getChildren());
- } else {
- return new HashSet<BundleArtifact>();
- }
- }
-
- public Set<BundleArtifact> getBundleArtifacts(List<DependencyNode> nodes) {
- Set<BundleArtifact> bundleArtifacts = new HashSet<BundleArtifact>();
- for (DependencyNode node : nodes) {
- Artifact artifact = RepositoryUtils.toArtifact(node.getDependency().getArtifact());
- String symbolicName = getManifestAttribute(artifact, Constants.BUNDLE_SYMBOLICNAME);
- if (symbolicName != null) {
- String version = getManifestAttribute(artifact, Constants.BUNDLE_VERSION);
- bundleArtifacts.add(new BundleArtifact(artifact, symbolicName, version));
- bundleArtifacts.addAll(getBundleArtifacts(node.getChildren()));
- } else {
- log.warn("Not an OSGi bundle : " + artifact.getId());
- }
- }
- return bundleArtifacts;
- }
-
- public Set<Artifact> getAllArtifacts(List<DependencyNode> nodes) {
- Set<Artifact> artifacts = new HashSet<Artifact>();
- for (DependencyNode node : nodes) {
- Artifact artifact = RepositoryUtils.toArtifact(node.getDependency().getArtifact());
- if (isBundle(artifact)) {
- artifacts.add(artifact);
- artifacts.addAll(getAllArtifacts(node.getChildren()));
- }
- }
- return artifacts;
- }
-
- public Set<Artifact> getArtifacts(List<DependencyNode> nodes) {
- Set<Artifact> artifacts = new HashSet<Artifact>();
- for (DependencyNode node : nodes) {
- Artifact artifact = RepositoryUtils.toArtifact(node.getDependency().getArtifact());
- if (isBundle(artifact)) {
- artifacts.add(artifact);
- }
- }
- return artifacts;
- }
-
- public List<BundleInfo> getBundles(Set<BundleArtifact> bundleDependencies)
- throws MojoExecutionException {
- List<BundleInfo> bundles = new ArrayList<BundleInfo>();
- for (BundleArtifact bundleArtifact : bundleDependencies) {
- Artifact artifact = bundleArtifact.getArtifact();
- BundleInfo bundle = new BundleInfo();
- bundle.setSymbolicName(bundleArtifact.getSymbolicName());
- bundle.setVersion(bundleArtifact.getVersion());
- bundle.setFileName(new File(artifact.getGroupId(), artifact.getFile().getName())
- .getPath());
- bundles.add(bundle);
- }
- Collections.sort(bundles, new BundleComparator());
- return bundles;
- }
-
- public Map<String, Set<PackageVersion>> getPackageDependencies(List<DependencyNode> nodes) {
- Map<String, Set<PackageVersion>> exportVersions = calculatePackageVersions(
- getAllArtifacts(nodes), true, false);
- return getPackageDependencies(getArtifacts(nodes), exportVersions);
- }
-
- public Map<String, Set<PackageVersion>> getPackageDependencies(Set<Artifact> requiredArtifacts,
- Map<String, Set<PackageVersion>> exportVersions) {
- Map<String, Set<PackageVersion>> importVersions = calculatePackageVersions(
- requiredArtifacts, false, true);
- Set<Artifact> newRequiredArtifacts = new HashSet<Artifact>();
- for (Entry<String, Set<PackageVersion>> entry : importVersions.entrySet()) {
- if (!javaPackages.contains(entry.getKey())) {
- String packageName = entry.getKey();
- Set<PackageVersion> importsVersions = entry.getValue();
- Set<PackageVersion> exportsVersions = exportVersions.get(packageName);
- if (exportVersions.containsKey(entry.getKey())) {
- for (Artifact artifact : getRequiredArtifacts(importsVersions, exportsVersions)) {
- if (!requiredArtifacts.contains(artifact)) {
- newRequiredArtifacts.add(artifact);
- }
- }
- }
- }
- }
- if (!newRequiredArtifacts.isEmpty()) {
- newRequiredArtifacts.addAll(requiredArtifacts);
- return getPackageDependencies(newRequiredArtifacts, exportVersions);
- }
- return importVersions;
- }
-
- /**
- * Returns the minimum set of artifacts required to satisfy the range of importVersions.
- *
- * @param importsVersions
- * the version ranges required for the package
- * @param exportVersions
- * the available versions for the package
- * @return the minimum set of artifacts required to satisfy the range of importVersions
- */
- private Set<Artifact> getRequiredArtifacts(Set<PackageVersion> importsVersions,
- Set<PackageVersion> exportVersions) {
- Set<Artifact> requiredArtifacts = new HashSet<Artifact>();
- List<Set<PackageVersion>> exportsSubsets = Utils.getSubsets(exportVersions);
- for (Set<PackageVersion> exportsSubset : exportsSubsets) {
- if (satisfiesImports(importsVersions, exportsSubset)) {
- for (PackageVersion exportVersion : exportsSubset) {
- requiredArtifacts.add(exportVersion.getArtifact());
- }
- break;
- }
- }
- return requiredArtifacts;
- }
-
- private boolean satisfiesImports(Set<PackageVersion> imports, Set<PackageVersion> exports) {
- for (PackageVersion importVersion : imports) {
- if (!satisfiesImport(importVersion, exports)) {
- return false;
- }
- }
- return true;
- }
-
- private boolean satisfiesImport(PackageVersion importVersion, Set<PackageVersion> exports) {
- for (PackageVersion exportVersion : exports) {
- if (importVersion.getVersionRange().includes(exportVersion.getVersionRange().getLow())) {
- return true;
- }
- }
- return false;
- }
-
- public void checkBundleDependencies(List<DependencyNode> nodes) {
- Map<Artifact, Set<Package>> unresolvedArtifacts = new HashMap<Artifact, Set<Package>>();
- Set<Artifact> artifacts = getAllArtifacts(nodes);
- Map<String, Set<PackageVersion>> exports = calculatePackageVersions(artifacts, true, false);
- for (Artifact artifact : artifacts) {
- if (isBundle(artifact)) {
- Parameters imports = getManifestAttributeParameters(artifact,
- Constants.IMPORT_PACKAGE);
- if (imports != null) {
- for (String packageName : imports.keySet()) {
- boolean exportMissing = true;
- VersionRange importRange = null;
- Attrs attrs = imports.get(packageName);
- if (isOptional(attrs)) {
- exportMissing = false;
- } else if (javaPackages.contains(packageName)
- || systemPackages.contains(packageName)
- || packageName.startsWith("org.osgi.")) {
- exportMissing = false;
- } else if (attrs == null || attrs.get(Constants.VERSION_ATTRIBUTE) == null) {
- if (exports.containsKey(packageName)) {
- exportMissing = false;
- }
- } else {
- importRange = getVersionRange(attrs);
- if (exports.containsKey(packageName)) {
- for (PackageVersion exportVersion : exports.get(packageName)) {
- if (importRange.includes(exportVersion.getVersionRange()
- .getLow())) {
- exportMissing = false;
- break;
- }
- }
- }
- }
- if (exportMissing) {
- if (!unresolvedArtifacts.containsKey(artifact)) {
- unresolvedArtifacts.put(artifact, new HashSet<Package>());
- }
- unresolvedArtifacts.get(artifact).add(
- new Package(packageName, importRange));
- }
- }
- }
- }
- }
- for (Entry<Artifact, Set<Package>> unresolvedArtifact : unresolvedArtifacts.entrySet()) {
- log.warn("Bundle : " + unresolvedArtifact.getKey().getId()
- + " has unresolved package dependencies:");
- for (Package unresolvedPackage : unresolvedArtifact.getValue()) {
- log.warn(" " + unresolvedPackage);
- }
- }
- }
-
- public Map<String, Set<PackageVersion>> calculatePackageVersions(Set<Artifact> artifacts,
- boolean export, boolean unique) {
- Map<String, Set<PackageVersion>> packageVersions = new HashMap<String, Set<PackageVersion>>();
- for (Artifact artifact : artifacts) {
- if (isBundle(artifact)) {
- Parameters packages = getManifestAttributeParameters(artifact,
- export ? Constants.EXPORT_PACKAGE : Constants.IMPORT_PACKAGE);
- if (packages != null) {
- for (String packageName : packages.keySet()) {
- if (!packageVersions.containsKey(packageName)) {
- packageVersions.put(packageName, new HashSet<PackageVersion>());
- }
- Set<PackageVersion> versions = packageVersions.get(packageName);
- VersionRange versionRange = getVersionRange(packages.get(packageName));
- boolean optional = isOptional(packages.get(packageName));
- if (unique) {
- // check if this version range is unique
- boolean uniqueVersion = true;
- for (PackageVersion version : versions) {
- if (equals(versionRange, version.getVersionRange())) {
- uniqueVersion = false;
- break;
- }
- }
- if (uniqueVersion) {
- versions.add(new PackageVersion(versionRange, artifact, optional));
- }
- } else {
- versions.add(new PackageVersion(versionRange, artifact, optional));
- }
- }
- }
- }
- }
- return packageVersions;
- }
-
- public Version getVersion(Attrs attrs) {
- if (attrs == null) {
- return Version.LOWEST;
- }
- return Version.parseVersion(attrs.get(Constants.VERSION_ATTRIBUTE));
- }
-
- public VersionRange getVersionRange(Attrs attrs) {
- if (attrs == null) {
- return new VersionRange("0");
- }
- String version = attrs.get(Constants.VERSION_ATTRIBUTE);
- if (version == null) {
- return new VersionRange("0");
- }
- return new VersionRange(version);
- }
-
- public boolean isBundle(Artifact artifact) {
- return getManifestAttribute(artifact, Constants.BUNDLE_SYMBOLICNAME) != null;
- }
-
- public boolean isOptional(Attrs attrs) {
- return attrs != null && "optional".equals(attrs.get(Constants.RESOLUTION_DIRECTIVE));
- }
-
- public boolean equals(VersionRange v1, VersionRange v2) {
- return v1 == v2 || v1.toString().equals(v2.toString());
- }
-
- public Parameters getManifestAttributeParameters(Artifact artifact, String attributeName) {
- String attributeValue = getManifestAttribute(artifact, attributeName);
- if (attributeValue != null) {
- return OSGiHeader.parseHeader(attributeValue);
- }
- return null;
- }
-
- public String getManifestAttribute(Artifact artifact, String attributeName) {
- Manifest manifest = getManifest(artifact);
- if (manifest != null) {
- Attributes mainAttributes = manifest.getMainAttributes();
- return mainAttributes.getValue(attributeName);
- }
- return null;
- }
-
- public Manifest getManifest(Artifact artifact) {
- if (artifact != null) {
- File file = artifact.getFile();
- if (file != null) {
- try {
- JarFile jarFile = new JarFile(artifact.getFile());
- return jarFile.getManifest();
- } catch (IOException e) {
- return null;
- }
- }
- }
- return null;
- }
-
- private final class BundleComparator implements Comparator<BundleInfo> {
-
- @Override
- public int compare(BundleInfo bundle1, BundleInfo bundle2) {
- return bundle1.getSymbolicName().compareTo(bundle2.getSymbolicName());
- }
-
- }
-
- // public static void main(String[] args) throws Exception {
- // MavenOsgiUtils mavenOsgiUtils = new MavenOsgiUtils();
- // Parameters exports = mavenOsgiUtils.getImports(new
- // File("/Users/david/Documents/workspace-trunk/taverna-plugin-impl/target/taverna-plugin-impl-0.1.0-SNAPSHOT.jar"));
- // for (String key : exports.keySet()) {
- // System.out.println(key + " " + mavenOsgiUtils.getVersionRange(exports.get(key)));
- // }
- // }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/main/java/net/sf/taverna/t2/maven/plugins/Package.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/Package.java b/src/main/java/net/sf/taverna/t2/maven/plugins/Package.java
deleted file mode 100644
index 5e4a5e5..0000000
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/Package.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.maven.plugins;
-
-import aQute.bnd.version.VersionRange;
-
-/**
- * @author David Withers
- */
-public class Package {
-
- private String name;
- private VersionRange versionRange;
-
- public Package(String name, VersionRange versionRange) {
- this.name = name;
- this.versionRange = versionRange;
- }
-
- @Override
- public String toString() {
- if (versionRange == null) {
- return name;
- } else {
- return name + ";version=\"" + versionRange + "\"";
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/main/java/net/sf/taverna/t2/maven/plugins/PackageVersion.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/PackageVersion.java b/src/main/java/net/sf/taverna/t2/maven/plugins/PackageVersion.java
deleted file mode 100644
index 14e0dee..0000000
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/PackageVersion.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2013 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.maven.plugins;
-
-import org.apache.maven.artifact.Artifact;
-
-import aQute.bnd.version.VersionRange;
-
-/**
- *
- *
- * @author David Withers
- */
-public class PackageVersion {
-
- private VersionRange versionRange;
- private Artifact artifact;
- private boolean optional;
-
- public PackageVersion(VersionRange versionRange, Artifact artifact) {
- this(versionRange, artifact, false);
- }
-
- public PackageVersion(VersionRange versionRange, Artifact artifact, boolean optional) {
- this.versionRange = versionRange;
- this.artifact = artifact;
- this.optional = optional;
- }
-
- @Override
- public String toString() {
- return versionRange + (optional ? "" : "") + "(from " + artifact.getId() + ")";
- }
-
- public VersionRange getVersionRange() {
- return versionRange;
- }
-
- public void setVersionRange(VersionRange versionRange) {
- this.versionRange = versionRange;
- }
-
- public Artifact getArtifact() {
- return artifact;
- }
-
- public void setArtifact(Artifact artifact) {
- this.artifact = artifact;
- }
-
- public boolean isOptional() {
- return optional;
- }
-
- public void setOptional(boolean optional) {
- this.optional = optional;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java b/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
deleted file mode 100644
index cf2034b..0000000
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployFileMojo.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2009 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.maven.plugins;
-
-import static net.sf.taverna.t2.maven.plugins.TavernaPluginGenerateMojo.META_INF_TAVERNA;
-import static net.sf.taverna.t2.maven.plugins.TavernaPluginGenerateMojo.PLUGIN_FILE;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.jar.JarFile;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipException;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.wagon.ConnectionException;
-import org.apache.maven.wagon.ResourceDoesNotExistException;
-import org.apache.maven.wagon.UnsupportedProtocolException;
-import org.apache.maven.wagon.Wagon;
-import org.apache.maven.wagon.authentication.AuthenticationException;
-import org.apache.maven.wagon.observers.Debug;
-import org.apache.maven.wagon.repository.Repository;
-
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
-import uk.org.taverna.commons.plugin.xml.jaxb.Plugins;
-import uk.org.taverna.commons.versions.xml.jaxb.Version;
-
-/**
- * Deploys the Taverna plugin using <code>scp</code> or <code>file</code> protocol to the site URL
- * specified.
- *
- * @author David Withers
- */
-@Mojo(name = "plugin-deploy-file", requiresProject=false, requiresDirectInvocation = true)
-public class TavernaPluginDeployFileMojo extends AbstractWagonMojo {
-
- private static final String PLUGIN_FILE_ENTRY = META_INF_TAVERNA + "/" + PLUGIN_FILE;
-
- private static final String PLUGINS_FILE = "plugins.xml";
-
- @Parameter(defaultValue = "http://updates.taverna.org.uk/workbench/3.0/dev/", required = true)
- protected String site;
-
- @Parameter(property = "file", required = true)
- protected File file;
-
- @Parameter(property = "url", required = true)
- protected String url;
-
- @Parameter(property = "serverId", required = true)
- protected String serverId;
-
- public void execute() throws MojoExecutionException {
- if (!file.exists()) {
- throw new MojoExecutionException("The Taverna Plugin file " + file
- + " does not exist");
- }
-
- JarFile pluginJarFile;
- try {
- pluginJarFile = new JarFile(file);
- } catch (ZipException e) {
- throw new MojoExecutionException(file + " is not a valid Taverna Plugin file", e);
- } catch (IOException e) {
- throw new MojoExecutionException("Error opening Taverna Plugin file: " + file, e);
- }
-
- ZipEntry pluginFileEntry = pluginJarFile.getJarEntry(PLUGIN_FILE_ENTRY);
- if (pluginFileEntry == null) {
- throw new MojoExecutionException(file
- + " is not a valid Taverna Plugin file, missing " + PLUGIN_FILE_ENTRY);
- }
-
- JAXBContext jaxbContext;
- try {
- jaxbContext = JAXBContext.newInstance(PluginInfo.class, Plugins.class);
- } catch (JAXBException e) {
- throw new MojoExecutionException("Error setting up JAXB context ", e);
- }
-
- PluginInfo plugin;
- try {
- InputStream inputStream = pluginJarFile.getInputStream(pluginFileEntry);
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- plugin = (PluginInfo) unmarshaller.unmarshal(inputStream);
- inputStream.close();
- } catch (IOException e) {
- throw new MojoExecutionException("Error reading " + file, e);
- } catch (JAXBException e) {
- throw new MojoExecutionException("Error reading " + file, e);
- }
-
- getLog().debug("The Taverna plugin will be deployed to '" + url + "'");
-
- Repository repository = new Repository(serverId, url);
-
- // create the wagon
- Wagon wagon;
- try {
- wagon = wagonManager.getWagon(repository.getProtocol());
- } catch (UnsupportedProtocolException e) {
- throw new MojoExecutionException("Unsupported protocol: '" + repository.getProtocol()
- + "'", e);
- }
-
- Debug debug = new Debug();
- if (getLog().isDebugEnabled()) {
- wagon.addSessionListener(debug);
- wagon.addTransferListener(debug);
- }
-
- // connect to the plugin site
- try {
- wagon.connect(repository, wagonManager.getAuthenticationInfo(serverId),
- wagonManager.getProxy(repository.getProtocol()));
- } catch (ConnectionException e) {
- throw new MojoExecutionException("Error connecting to plugin site at " + url, e);
- } catch (AuthenticationException e) {
- throw new MojoExecutionException("Authentication error connecting to plugin site at "
- + url, e);
- }
-
- try {
- File pluginsFile = File.createTempFile("taverna", null);
-
- // fetch the plugins file
- Plugins plugins;
- try {
- Utils.downloadFile(PLUGINS_FILE, pluginsFile, wagon, getLog());
- try {
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- plugins = (Plugins) unmarshaller.unmarshal(pluginsFile);
- } catch (JAXBException e) {
- throw new MojoExecutionException("Error reading " + pluginsFile, e);
- }
- } catch (ResourceDoesNotExistException e) {
- getLog().info("Creating new plugins file");
- plugins = new Plugins();
- }
-
- String deployedPluginFile = plugin.getId() + "-" + plugin.getVersion() + ".jar";
-
- if (addPlugin(plugins, plugin, deployedPluginFile)) {
- // write the new plugin site file
- try {
- Marshaller marshaller = jaxbContext.createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
- marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION,
- TavernaPluginGenerateMojo.SCHEMA_LOCATION);
- marshaller.marshal(plugins, pluginsFile);
- } catch (JAXBException e) {
- throw new MojoExecutionException("Error writing " + PLUGINS_FILE, e);
- }
-
- // upload the plugin to the update site
- Utils.uploadFile(file, deployedPluginFile, wagon, getLog());
- // upload the plugin site file
- Utils.uploadFile(pluginsFile, PLUGINS_FILE, wagon, getLog());
- }
- } catch (IOException e) {
- throw new MojoExecutionException("Error writing " + PLUGINS_FILE, e);
- } finally {
- disconnectWagon(wagon, debug);
- }
- }
-
- private boolean addPlugin(Plugins plugins, PluginInfo pluginInfo, String pluginURL) {
- PluginVersions plugin = getPlugin(plugins, pluginInfo);
- Version latestVersion = plugin.getLatestVersion();
- if (latestVersion != null && latestVersion.getVersion().equals(pluginInfo.getVersion())) {
- getLog().error(
- String.format("%1$s version %2$s has already been deployed",
- pluginInfo.getName(), pluginInfo.getVersion()));
- return false;
- }
- Version newPluginVersion = new Version();
- newPluginVersion.setVersion(pluginInfo.getVersion());
- newPluginVersion.setFile(pluginURL);
-
- getLog().info(
- String.format("Adding %1$s version %2$s", pluginInfo.getName(),
- pluginInfo.getVersion()));
- if (plugin.getLatestVersion() != null) {
- plugin.getPreviousVersion().add(plugin.getLatestVersion());
- }
- plugin.setLatestVersion(newPluginVersion);
- return true;
- }
-
- private PluginVersions getPlugin(Plugins plugins, PluginInfo pluginInfo) {
- PluginVersions pluginVersions = null;
- for (PluginVersions existingPlugin : plugins.getPlugin()) {
- if (existingPlugin.getId().equals(pluginInfo.getId())) {
- pluginVersions = existingPlugin;
- break;
- }
- }
- if (pluginVersions == null) {
- pluginVersions = new PluginVersions();
- pluginVersions.setId(pluginInfo.getId());
- plugins.getPlugin().add(pluginVersions);
- }
- pluginVersions.setName(pluginInfo.getName());
- pluginVersions.setDescription(pluginInfo.getDescription());
- pluginVersions.setOrganization(pluginInfo.getOrganization());
- return pluginVersions;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java b/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
deleted file mode 100644
index 8ba1f3d..0000000
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginDeployMojo.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2009 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.maven.plugins;
-
-import java.io.File;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.wagon.ConnectionException;
-import org.apache.maven.wagon.ResourceDoesNotExistException;
-import org.apache.maven.wagon.UnsupportedProtocolException;
-import org.apache.maven.wagon.Wagon;
-import org.apache.maven.wagon.authentication.AuthenticationException;
-import org.apache.maven.wagon.observers.Debug;
-import org.apache.maven.wagon.repository.Repository;
-
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginVersions;
-import uk.org.taverna.commons.plugin.xml.jaxb.Plugins;
-import uk.org.taverna.commons.versions.xml.jaxb.Version;
-
-/**
- * Deploys the Taverna plugin using <code>scp</code> or <code>file</code> protocol to the site URL
- * specified in the <code><distributionManagement></code> section of the POM.
- *
- * @author David Withers
- */
-@Mojo(name = "plugin-deploy", defaultPhase = LifecyclePhase.DEPLOY)
-public class TavernaPluginDeployMojo extends AbstractDeployMojo {
-
- private static final String PLUGINS_FILE = "plugins.xml";
-
- private File tempDirectory;
-
- public void execute() throws MojoExecutionException {
- tempDirectory = new File(buildDirectory, TavernaProfileGenerateMojo.TAVERNA_TMP);
- tempDirectory.mkdirs();
- if (artifact == null) {
- throw new MojoExecutionException(
- "The Taverna Plugin does not exist, please run taverna:plugin-generate first");
- }
-
- File artifactFile = artifact.getFile();
- if (artifactFile == null) {
- throw new MojoExecutionException(
- "The Taverna Plugin does not exist, please run taverna:plugin-generate first");
- }
-
- File pluginDirectory = new File(outputDirectory, TavernaPluginGenerateMojo.META_INF_TAVERNA);
- File pluginFile = new File(pluginDirectory, TavernaPluginGenerateMojo.PLUGIN_FILE);
- if (!pluginFile.exists()) {
- throw new MojoExecutionException(
- "The Taverna Plugin does not exist, please run taverna:plugin-generate first");
- }
-
- JAXBContext jaxbContext;
- try {
- jaxbContext = JAXBContext.newInstance(PluginInfo.class, Plugins.class);
- } catch (JAXBException e) {
- throw new MojoExecutionException("Error setting up JAXB context ", e);
- }
-
- PluginInfo plugin;
- try {
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- plugin = (PluginInfo) unmarshaller.unmarshal(pluginFile);
- } catch (JAXBException e) {
- throw new MojoExecutionException("Error reading " + pluginFile, e);
- }
-
- if (deploymentRepository == null) {
- throw new MojoExecutionException(
- "Missing repository information in the distribution management element in the project.");
- }
-
- String url = deploymentRepository.getUrl();
- String id = deploymentRepository.getId();
-
- if (url == null) {
- throw new MojoExecutionException(
- "The URL to the Taverna plugin site is missing in the project descriptor.");
- }
- getLog().debug("The Taverna plugin will be deployed to '" + url + "'");
-
- Repository repository = new Repository(id, url);
-
- // create the wagon
- Wagon wagon;
- try {
- wagon = wagonManager.getWagon(repository.getProtocol());
- } catch (UnsupportedProtocolException e) {
- throw new MojoExecutionException("Unsupported protocol: '" + repository.getProtocol()
- + "'", e);
- }
-
- Debug debug = new Debug();
- if (getLog().isDebugEnabled()) {
- wagon.addSessionListener(debug);
- wagon.addTransferListener(debug);
- }
-
- // connect to the plugin site
- try {
- wagon.connect(repository, wagonManager.getAuthenticationInfo(id),
- wagonManager.getProxy(repository.getProtocol()));
- } catch (ConnectionException e) {
- throw new MojoExecutionException("Error connecting to plugin site at " + url, e);
- } catch (AuthenticationException e) {
- throw new MojoExecutionException("Authentication error connecting to plugin site at "
- + url, e);
- }
-
- try {
- String deployedPluginFile = project.getGroupId() + "." + project.getArtifactId() + "-"
- + plugin.getVersion() + ".jar";
-
- // fetch the plugins file
- Plugins plugins;
- File pluginsFile = new File(tempDirectory, PLUGINS_FILE);
- try {
- Utils.downloadFile(PLUGINS_FILE, pluginsFile, wagon, getLog());
- try {
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- plugins = (Plugins) unmarshaller.unmarshal(pluginsFile);
- } catch (JAXBException e) {
- throw new MojoExecutionException("Error reading " + pluginsFile, e);
- }
- } catch (ResourceDoesNotExistException e) {
- getLog().info("Creating new plugins file");
- plugins = new Plugins();
- }
-
- if (addPlugin(plugins, plugin, deployedPluginFile)) {
- // write the new plugin site file
- try {
- Marshaller marshaller = jaxbContext.createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
- marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION,
- TavernaPluginGenerateMojo.SCHEMA_LOCATION);
- marshaller.marshal(plugins, pluginsFile);
- } catch (JAXBException e) {
- throw new MojoExecutionException("Error writing " + PLUGINS_FILE, e);
- }
-
- // upload the plugin to the update site
- Utils.uploadFile(artifactFile, deployedPluginFile, wagon, getLog());
- // upload the plugin site file
- Utils.uploadFile(pluginsFile, PLUGINS_FILE, wagon, getLog());
- }
- } finally {
- disconnectWagon(wagon, debug);
- }
- }
-
- private boolean addPlugin(Plugins plugins, PluginInfo pluginInfo, String pluginURL) {
- PluginVersions plugin = getPlugin(plugins, pluginInfo);
- Version latestVersion = plugin.getLatestVersion();
- if (latestVersion != null && latestVersion.getVersion().equals(pluginInfo.getVersion())) {
- getLog().error(
- String.format("%1$s version %2$s has already been deployed", pluginInfo.getName(),
- pluginInfo.getVersion()));
- return false;
- }
- Version newPluginVersion = new Version();
- newPluginVersion.setVersion(pluginInfo.getVersion());
- newPluginVersion.setFile(pluginURL);
-
- getLog().info(
- String.format("Adding %1$s version %2$s", pluginInfo.getName(), pluginInfo.getVersion()));
- if (plugin.getLatestVersion() != null) {
- plugin.getPreviousVersion().add(plugin.getLatestVersion());
- }
- plugin.setLatestVersion(newPluginVersion);
- return true;
- }
-
- private PluginVersions getPlugin(Plugins plugins, PluginInfo pluginInfo) {
- PluginVersions pluginVersions = null;
- for (PluginVersions existingPlugin : plugins.getPlugin()) {
- if (existingPlugin.getId().equals(pluginInfo.getId())) {
- pluginVersions = existingPlugin;
- break;
- }
- }
- if (pluginVersions == null) {
- pluginVersions = new PluginVersions();
- pluginVersions.setId(pluginInfo.getId());
- plugins.getPlugin().add(pluginVersions);
- }
- pluginVersions.setName(pluginInfo.getName());
- pluginVersions.setDescription(pluginInfo.getDescription());
- pluginVersions.setOrganization(pluginInfo.getOrganization());
- return pluginVersions;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java b/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
deleted file mode 100644
index 0ec94f4..0000000
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginGenerateMojo.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2009 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.maven.plugins;
-
-import java.io.File;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.model.Organization;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.Component;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.plugins.annotations.ResolutionScope;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.ProjectDependenciesResolver;
-import org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter;
-import org.apache.maven.shared.osgi.Maven2OsgiConverter;
-import org.eclipse.aether.RepositorySystemSession;
-
-import uk.org.taverna.commons.plugin.xml.jaxb.PluginInfo;
-import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
-
-/**
- * Generates a Taverna plugin definition file.
- *
- * @author David Withers
- */
-@Mojo(name = "plugin-generate", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, requiresDependencyResolution = ResolutionScope.RUNTIME)
-public class TavernaPluginGenerateMojo extends AbstractMojo {
-
- public static final String PLUGIN_FILE = "plugin.xml";
-
- public static final String META_INF_TAVERNA = "META-INF/taverna";
-
- public static final String SCHEMA_LOCATION = "http://ns.taverna.org.uk/2013/application/plugin http://localhost/2013/application/plugin/ApplicationPlugin.xsd";
-
- @Component
- private MavenProject project;
-
- @Component
- private ProjectDependenciesResolver projectDependenciesResolver;
-
- @Parameter(defaultValue = "${repositorySystemSession}", readonly = true)
- private RepositorySystemSession repositorySystemSession;
-
- @Parameter(defaultValue = "${project.build.outputDirectory}", required = true)
- protected File outputDirectory;
-
- @Parameter(defaultValue = "${project.description}", required = true)
- protected String description;
-
- @Parameter(defaultValue = "${project.organization}", required = true)
- protected Organization organization;
-
- private MavenOsgiUtils osgiUtils;
-
- private Maven2OsgiConverter maven2OsgiConverter = new DefaultMaven2OsgiConverter();
-
- public void execute() throws MojoExecutionException, MojoFailureException {
- try {
- osgiUtils = new MavenOsgiUtils(project, repositorySystemSession,
- projectDependenciesResolver, getLog());
- createPluginDefinition();
- } catch (JAXBException e) {
- throw new MojoExecutionException("Error generating Taverna plugin", e);
- }
- }
-
- /**
- * Generates the Taverna plugin definition file.
- *
- * @return the <code>File</code> that the Taverna plugin definition has been written to
- * @throws JAXBException
- * @throws MojoExecutionException
- */
- 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;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java b/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java
deleted file mode 100644
index 497151f..0000000
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaPluginPrepareBundlesMojo.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2009 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.maven.plugins;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Set;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.Component;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.plugins.annotations.ResolutionScope;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.ProjectDependenciesResolver;
-import org.eclipse.aether.RepositorySystemSession;
-
-/**
- * Prepares the plugin OSGi bundles.
- *
- * @author David Withers
- */
-@Mojo(name = "plugin-prepare-bundles", defaultPhase = LifecyclePhase.PREPARE_PACKAGE, requiresDependencyResolution = ResolutionScope.RUNTIME)
-public class TavernaPluginPrepareBundlesMojo extends AbstractMojo {
-
- @Component
- private MavenProject project;
-
- @Component
- private ProjectDependenciesResolver projectDependenciesResolver;
-
- @Parameter(defaultValue = "${repositorySystemSession}", readonly = true)
- private RepositorySystemSession repositorySystemSession;
-
- /**
- * The directory where the plugin OSGi bundles file will be put.
- */
- @Parameter(defaultValue = "${project.build.outputDirectory}", required = true)
- protected File outputDirectory;
-
- private MavenOsgiUtils osgiUtils;
-
- public void execute() throws MojoExecutionException, MojoFailureException {
- osgiUtils = new MavenOsgiUtils(project, repositorySystemSession,
- projectDependenciesResolver, getLog());
- outputDirectory.mkdirs();
-
- Set<BundleArtifact> bundleDependencies = osgiUtils.getBundleDependencies(
- Artifact.SCOPE_COMPILE, Artifact.SCOPE_RUNTIME);
- try {
- for (BundleArtifact bundleArtifact : bundleDependencies) {
- Artifact artifact = bundleArtifact.getArtifact();
- FileUtils.copyFileToDirectory(bundleArtifact.getArtifact().getFile(), new File(
- outputDirectory, artifact.getGroupId()));
- }
- } catch (IOException e) {
- throw new MojoExecutionException("Error copying dependecies to archive directory", e);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java b/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java
deleted file mode 100644
index fce4ded..0000000
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileDeployMojo.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2009 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.maven.plugins;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.wagon.ConnectionException;
-import org.apache.maven.wagon.ResourceDoesNotExistException;
-import org.apache.maven.wagon.UnsupportedProtocolException;
-import org.apache.maven.wagon.Wagon;
-import org.apache.maven.wagon.authentication.AuthenticationException;
-import org.apache.maven.wagon.observers.Debug;
-import org.apache.maven.wagon.repository.Repository;
-
-import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
-import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
-import uk.org.taverna.commons.profile.xml.jaxb.UpdateSite;
-import uk.org.taverna.commons.versions.xml.jaxb.Version;
-import uk.org.taverna.commons.versions.xml.jaxb.Versions;
-
-/**
- * Deploys the application profile using <code>scp</code> or <code>file</code> protocol to the site
- * URL specified in the <code><distributionManagement></code> section of the POM.
- *
- * @author David Withers
- */
-@Mojo(name = "profile-deploy", defaultPhase = LifecyclePhase.DEPLOY)
-public class TavernaProfileDeployMojo extends AbstractDeployMojo {
-
- private static final String UPDATES_FILE = "updates.xml";
-
- private File tempDirectory;
-
- public void execute() throws MojoExecutionException {
- tempDirectory = new File(buildDirectory, TavernaProfileGenerateMojo.TAVERNA_TMP);
- tempDirectory.mkdirs();
- if (artifact == null) {
- throw new MojoExecutionException(
- "The application profile does not exist, please run taverna:profile-generate first");
- }
-
- File artifactFile = artifact.getFile();
- if (artifactFile == null) {
- throw new MojoExecutionException(
- "The application profile does not exist, please run taverna:profile-generate first");
- }
-
- JAXBContext jaxbContext;
- try {
- jaxbContext = JAXBContext.newInstance(ApplicationProfile.class, UpdateSite.class);
- } catch (JAXBException e) {
- throw new MojoExecutionException("Error setting up JAXB context ", e);
- }
-
- ApplicationProfile applicationProfile;
- try {
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- applicationProfile = (ApplicationProfile) unmarshaller.unmarshal(artifactFile);
- } catch (JAXBException e) {
- throw new MojoExecutionException("Error reading " + artifactFile, e);
- }
-
- if (deploymentRepository == null) {
- throw new MojoExecutionException(
- "Missing repository information in the distribution management element in the project.");
- }
-
- String url = deploymentRepository.getUrl();
- String id = deploymentRepository.getId();
-
- if (url == null) {
- throw new MojoExecutionException(
- "The URL to the update site is missing in the project descriptor.");
- }
- getLog().debug("The Taverna application will be deployed to '" + url + "'");
-
- Repository repository = new Repository(id, url);
-
- // create the wagon
- Wagon wagon;
- try {
- wagon = wagonManager.getWagon(repository.getProtocol());
- } catch (UnsupportedProtocolException e) {
- throw new MojoExecutionException("Unsupported protocol: '" + repository.getProtocol()
- + "'", e);
- }
-
- Debug debug = new Debug();
- if (getLog().isDebugEnabled()) {
- wagon.addSessionListener(debug);
- wagon.addTransferListener(debug);
- }
-
- // connect to the update site
- try {
- wagon.connect(repository, wagonManager.getAuthenticationInfo(id),
- wagonManager.getProxy(repository.getProtocol()));
- } catch (ConnectionException e) {
- throw new MojoExecutionException("Error connecting to " + url, e);
- } catch (AuthenticationException e) {
- throw new MojoExecutionException("Authentication error connecting to " + url, e);
- }
-
- try {
- // upload the application profile to the update site
- String deployedProfileFile = "ApplicationProfile" + "-" + applicationProfile.getVersion()
- + ".xml";
- Utils.uploadFile(artifactFile, deployedProfileFile, wagon, getLog());
-
- // fetch the applications file
- UpdateSite updateSite;
- File updatesFile = new File(tempDirectory, UPDATES_FILE);
- try {
- Utils.downloadFile(UPDATES_FILE, updatesFile, wagon, getLog());
- try {
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- updateSite = (UpdateSite) unmarshaller
- .unmarshal(updatesFile);
- } catch (JAXBException e) {
- throw new MojoExecutionException("Error reading " + updatesFile, e);
- }
- } catch(ResourceDoesNotExistException e) {
- getLog().info("Creating new application versions file");
- updateSite = new UpdateSite();
- Versions versions = new Versions();
- versions.setId(applicationProfile.getId());
- versions.setName(applicationProfile.getName());
- updateSite.setVersions(versions);
- }
-
- Version latestVersion = updateSite.getVersions().getLatestVersion();
- if (latestVersion != null) {
- File latestProfileFile = new File(tempDirectory, "ApplicationProfile-" + latestVersion.getVersion()
- + ".xml");
- try {
- Utils.downloadFile(latestVersion.getFile(), latestProfileFile, wagon, getLog());
- } catch (ResourceDoesNotExistException e) {
- throw new MojoExecutionException(latestVersion.getFile() + " does not exist", e);
- }
- ApplicationProfile latestProfile;
- try {
- Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
- latestProfile = (ApplicationProfile) unmarshaller.unmarshal(latestProfileFile);
- } catch (JAXBException e) {
- throw new MojoExecutionException("Error reading " + latestProfileFile, e);
- }
- Set<BundleInfo> requiredBundles = getRequiredBundles(latestProfile, applicationProfile);
- if (requiredBundles.isEmpty()) {
- getLog().warn("No new bundles to upload");
- } else {
- // upload new bundles to the update site
- uploadBundles(requiredBundles, wagon);
- }
- }
-
- if (addApplicationVersion(updateSite.getVersions(), applicationProfile,
- deployedProfileFile)) {
- // write the new application versions list
- try {
- Marshaller marshaller = jaxbContext.createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
- marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, TavernaProfileGenerateMojo.SCHEMA_LOCATION);
- marshaller.marshal(updateSite, updatesFile);
- } catch (JAXBException e) {
- throw new MojoExecutionException("Error writing " + UPDATES_FILE, e);
- }
-
- // upload the new application versions list to the update site
- Utils.uploadFile(updatesFile, UPDATES_FILE, wagon, getLog());
- }
- }
- finally {
- disconnectWagon(wagon, debug);
- }
- }
-
- /**
- * Adds an new application version to the application versions if the version doesn't already
- * exist.
- *
- * @param applicationVersions
- * the ApplicationVersions document
- * @param applicationProfile
- * the applicationProfile
- * @param profileURL
- * @return true if a new version was added to the ApplicationVersions document; false if the
- * version already exits
- */
- private boolean addApplicationVersion(Versions applicationVersions,
- ApplicationProfile applicationProfile, String profileURL) {
- Version latestVersion = applicationVersions.getLatestVersion();
- if (latestVersion != null
- && latestVersion.getVersion().equals(applicationProfile.getVersion())) {
- getLog().error(
- String.format("%1$s version %2$s has already been deployed",
- applicationProfile.getName(), applicationProfile.getVersion()));
- return false;
- }
-
- Version newApplicationVersion = new Version();
- newApplicationVersion.setVersion(applicationProfile.getVersion());
- newApplicationVersion.setFile(profileURL);
-
- getLog().info(
- String.format("Adding %1$s version %2$s", applicationProfile.getName(),
- applicationProfile.getVersion()));
- if (applicationVersions.getLatestVersion() != null) {
- applicationVersions.getPreviousVersion().add(applicationVersions.getLatestVersion());
- }
- applicationVersions.setLatestVersion(newApplicationVersion);
- return true;
- }
-
- /**
- * @param requiredBundles
- * @throws MojoExecutionException
- */
- private void uploadBundles(Set<BundleInfo> requiredBundles, Wagon wagon) throws MojoExecutionException {
- File libDirectory = new File(tempDirectory, "lib");
- for (BundleInfo bundle : requiredBundles) {
- Utils.uploadFile(new File(libDirectory, bundle.getFileName()), "lib/" + bundle.getFileName(), wagon, getLog());
- }
- }
-
- private Set<BundleInfo> getRequiredBundles(ApplicationProfile currentProfile,
- ApplicationProfile newProfile) {
- Set<BundleInfo> requiredBundles = new HashSet<BundleInfo>();
- Map<String, BundleInfo> currentBundles = new HashMap<String, BundleInfo>();
- for (BundleInfo bundle : currentProfile.getBundle()) {
- currentBundles.put(bundle.getSymbolicName(), bundle);
- }
- for (BundleInfo bundle : newProfile.getBundle()) {
- if (currentBundles.containsKey(bundle.getSymbolicName())) {
- BundleInfo currentBundle = currentBundles.get(bundle.getSymbolicName());
- if (!bundle.getVersion().equals(currentBundle.getVersion())) {
- requiredBundles.add(bundle);
- }
- } else {
- requiredBundles.add(bundle);
- }
- }
- return requiredBundles;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-osgi/blob/37264921/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java b/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
deleted file mode 100644
index 1a0e9a0..0000000
--- a/src/main/java/net/sf/taverna/t2/maven/plugins/TavernaProfileGenerateMojo.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2009 The University of Manchester
- *
- * Modifications to the initial code base are copyright of their
- * respective authors, or their employers as appropriate.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- ******************************************************************************/
-package net.sf.taverna.t2.maven.plugins;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.Component;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.plugins.annotations.ResolutionScope;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.ProjectDependenciesResolver;
-import org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter;
-import org.apache.maven.shared.osgi.Maven2OsgiConverter;
-import org.eclipse.aether.RepositorySystemSession;
-
-import uk.org.taverna.commons.profile.xml.jaxb.ApplicationProfile;
-import uk.org.taverna.commons.profile.xml.jaxb.BundleInfo;
-import uk.org.taverna.commons.profile.xml.jaxb.FrameworkConfiguration;
-import uk.org.taverna.commons.profile.xml.jaxb.Updates;
-
-/**
- * Generates an application profile file.
- *
- * @author David Withers
- */
-@Mojo(name = "profile-generate", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, requiresDependencyResolution = ResolutionScope.RUNTIME)
-public class TavernaProfileGenerateMojo extends AbstractMojo {
-
- public static final String SYSTEM_PACKAGES = "org.osgi.framework.system.packages.extra";
-
- public static final String SCHEMA_LOCATION = "http://ns.taverna.org.uk/2013/application/profile http://localhost/2013/application/profile/ApplicationProfile.xsd";
-
- public static final String TAVERNA_TMP = "taverna-tmp";
-
- public static final String APPLICATION_PROFILE_FILE = "ApplicationProfile.xml";
-
- @Component
- private MavenProject project;
-
- @Component
- private ProjectDependenciesResolver projectDependenciesResolver;
-
- @Parameter(defaultValue = "${repositorySystemSession}", readonly = true)
- private RepositorySystemSession repositorySystemSession;
-
- /**
- * The directory where the generated <code>ApplicationProfile.xml</code> file will be put.
- */
- @Parameter(defaultValue = "${project.build.directory}", required = true)
- protected File outputDirectory;
-
- @Parameter(defaultValue = "SNAPSHOT")
- private String buildNumber;
-
- @Parameter
- private List<FrameworkConfiguration> frameworkConfigurations;
-
- @Parameter(required = true)
- private String updateSite;
-
- @Parameter(defaultValue = "updates.xml")
- private String updatesFile;
-
- @Parameter(defaultValue = "lib")
- private String libDirectory;
-
- @Parameter(required = true)
- private String pluginSite;
-
- @Parameter(defaultValue = "plugins.xml")
- private String pluginsFile;
-
- private Maven2OsgiConverter maven2OsgiConverter = new DefaultMaven2OsgiConverter();
-
- private MavenOsgiUtils osgiUtils;
-
- private File tempDirectory;
-
- public void execute() throws MojoExecutionException, MojoFailureException {
- try {
- osgiUtils = new MavenOsgiUtils(project, repositorySystemSession,
- projectDependenciesResolver, getSystemPackages(), getLog());
- tempDirectory = new File(outputDirectory, TAVERNA_TMP);
-
- File profileFile = createApplicationProfile();
- project.getArtifact().setFile(profileFile);
-
- copyDependencies();
-
- } catch (JAXBException e) {
- throw new MojoExecutionException("Error generating application profile", e);
- }
- }
-
- private void copyDependencies() throws MojoExecutionException {
- File libDirectory = new File(tempDirectory, "lib");
- libDirectory.mkdirs();
-
- try {
- for (Artifact artifact : project.getArtifacts()) {
- FileUtils.copyFileToDirectory(artifact.getFile(),
- new File(libDirectory, artifact.getGroupId()));
- }
- } catch (IOException e) {
- throw new MojoExecutionException("Error copying dependecies to lib directory", e);
- }
-
- }
-
- /**
- * Generates the application profile file.
- *
- * @return the <code>File</code> that the application profile has been written to
- * @throws JAXBException
- * if the application profile cannot be created
- * @throws MojoExecutionException
- */
- private File createApplicationProfile() 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")) + buildNumber;
- }
-
- tempDirectory.mkdirs();
- File applicationProfileFile = new File(tempDirectory, APPLICATION_PROFILE_FILE);
-
- ApplicationProfile applicationProfile = new ApplicationProfile();
- applicationProfile.setId(groupId + "." + artifactId);
- applicationProfile.setName(project.getName());
- applicationProfile.setVersion(version);
-
- Updates updates = new Updates();
- updates.setUpdateSite(updateSite);
- updates.setUpdatesFile(updatesFile);
- updates.setLibDirectory(libDirectory);
- updates.setPluginSite(pluginSite);
- updates.setPluginsFile(pluginsFile);
- applicationProfile.setUpdates(updates);
-
- List<FrameworkConfiguration> frameworkConfiguration = applicationProfile
- .getFrameworkConfiguration();
- for (FrameworkConfiguration configuration : frameworkConfigurations) {
- frameworkConfiguration.add(configuration);
- }
-
- Set<BundleArtifact> bundleDependencies = osgiUtils.getBundleDependencies(
- Artifact.SCOPE_COMPILE, Artifact.SCOPE_RUNTIME);
- List<BundleInfo> runtimeBundles = osgiUtils.getBundles(bundleDependencies);
- if (!runtimeBundles.isEmpty()) {
- List<BundleInfo> bundles = applicationProfile.getBundle();
- for (BundleInfo bundle : runtimeBundles) {
- bundles.add(bundle);
- }
- }
-
- JAXBContext jaxbContext = JAXBContext.newInstance(ApplicationProfile.class);
- Marshaller marshaller = jaxbContext.createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
- marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, SCHEMA_LOCATION);
- marshaller.marshal(applicationProfile, applicationProfileFile);
-
- return applicationProfileFile;
- }
-
- private Set<String> getSystemPackages() {
- Set<String> systemPackages = new HashSet<String>();
- if (frameworkConfigurations != null) {
- for (FrameworkConfiguration configuration : frameworkConfigurations) {
- if (SYSTEM_PACKAGES.equals(configuration.getName())) {
- String packagesString = configuration.getValue();
- if (packagesString != null) {
- String[] packages = packagesString.split(",");
- for (String packageString : packages) {
- String[] packageProperties = packageString.split(";");
- if (packageProperties.length > 0) {
- systemPackages.add(packageProperties[0]);
- }
- }
- }
- }
- }
- }
- return systemPackages;
- }
-
-}