From 7d041680e3fbb70cbc3b66129fe82723d6af0738 Mon Sep 17 00:00:00 2001 From: Anton Ramashkan Date: Wed, 27 Jun 2018 13:50:40 +0300 Subject: [PATCH] added activemq-client-osgi --- .../descriptors/uber-sources.xml | 46 ++++ activemq-client-osgi/pom.xml | 212 ++++++++++++++++++ .../activemq/karaf/itest/ObrFeatureTest.java | 10 +- activemq-karaf/pom.xml | 12 + .../src/main/resources/features-core.xml | 38 ++-- .../src/main/resources/features.xml | 2 +- pom.xml | 1 + 7 files changed, 297 insertions(+), 24 deletions(-) create mode 100644 activemq-client-osgi/descriptors/uber-sources.xml create mode 100644 activemq-client-osgi/pom.xml diff --git a/activemq-client-osgi/descriptors/uber-sources.xml b/activemq-client-osgi/descriptors/uber-sources.xml new file mode 100644 index 00000000000..dff38c4ccb4 --- /dev/null +++ b/activemq-client-osgi/descriptors/uber-sources.xml @@ -0,0 +1,46 @@ + + + + sources + + jar + + false + + + + src/main/java + / + unix + + + + + + / + true + true + + *:*:jar:sources + + + + + + + diff --git a/activemq-client-osgi/pom.xml b/activemq-client-osgi/pom.xml new file mode 100644 index 00000000000..878e391f009 --- /dev/null +++ b/activemq-client-osgi/pom.xml @@ -0,0 +1,212 @@ + + + + + 4.0.0 + + + org.apache.activemq + activemq-parent + 5.16.0-SNAPSHOT + + + activemq-client-osgi + bundle + ActiveMQ :: Client OSGi bundle + Puts together an ActiveMQ Client OSGi bundle + + + + javax.jmdns*;resolution:=optional, + javax.jms*;version="[1.1,3)", + javax.management*, + javax.transaction*, + javax.naming*, + org.apache.commons.net*;resolution:=optional, + * + + + org.apache.activemq*;version=${project.version};-noimport:=true;-split-package:=merge-first + + + org.fusesource.hawtbuf* + + + -Xmx512M + + + + + + ${project.groupId} + activemq-client + + + + org.osgi + org.osgi.core + provided + + + + org.osgi + org.osgi.compendium + ${org.osgi.core-version} + provided + + + + + + + + src/main/resources + + + target/extra-resources + + + + + org.apache.felix + maven-bundle-plugin + + + + *;groupId=org.apache.activemq;inline=META-INF/services/* + + true + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.apache.maven.plugins + + + maven-dependency-plugin + + [2.8,) + + unpack + + + + + + + + + + + + + + + + + deploy + + deploy + + + org.apache.maven.plugins + maven-source-plugin + ${maven-source-plugin-version} + + false + + + + attach-sources + + jar + + + + + + + + + + apache-release + + + + + ${project.groupId} + activemq-client + ${project.version} + sources + true + + + org.fusesource.hawtbuf + hawtbuf + ${hawtbuf-version} + sources + true + + + + + + + maven-source-plugin + + true + + + + maven-assembly-plugin + + + uber-sources-jar + package + + single + + + + ${basedir}/src/main/descriptors/uber-sources.xml + + true + + + + + + + + + + + diff --git a/activemq-karaf-itest/src/test/java/org/apache/activemq/karaf/itest/ObrFeatureTest.java b/activemq-karaf-itest/src/test/java/org/apache/activemq/karaf/itest/ObrFeatureTest.java index 2aa07591b7d..cdf18674a35 100644 --- a/activemq-karaf-itest/src/test/java/org/apache/activemq/karaf/itest/ObrFeatureTest.java +++ b/activemq-karaf-itest/src/test/java/org/apache/activemq/karaf/itest/ObrFeatureTest.java @@ -94,17 +94,11 @@ public void testClientWithSpring43() throws Throwable { private void testWithSpringVersion(String version) throws Exception, Throwable { featuresService.installFeature("spring", version); installAndAssertFeature("activemq-client"); - verifyBundleInstalledAndRegisteredServices("activemq-osgi", 2); + verifyBundleInstalled("activemq-client-osgi"); } - private void verifyBundleInstalledAndRegisteredServices(final String bundleName, - final int numberOfServices) - throws Exception { + private void verifyBundleInstalled(final String bundleName) throws Exception { Bundle bundle = getBundle(bundleName); Assert.assertEquals(Bundle.ACTIVE, bundle.getState()); - // Assert that the bundle has registered some services via blueprint - Assert.assertNotNull(bundle.getRegisteredServices()); - // Assert that the bundle has registered the correct number of services - Assert.assertEquals(numberOfServices, bundle.getRegisteredServices().length); } } diff --git a/activemq-karaf/pom.xml b/activemq-karaf/pom.xml index 3859da9fa06..9db9374f6f2 100644 --- a/activemq-karaf/pom.xml +++ b/activemq-karaf/pom.xml @@ -134,6 +134,18 @@ org.codehaus.mojo build-helper-maven-plugin + + generate-osgi-compatible-project-version + + regex-property + + + osgi.project.version + ${project.version} + - + . + + attach-artifacts package diff --git a/activemq-karaf/src/main/resources/features-core.xml b/activemq-karaf/src/main/resources/features-core.xml index 0e615abcddc..f344a04c00b 100644 --- a/activemq-karaf/src/main/resources/features-core.xml +++ b/activemq-karaf/src/main/resources/features-core.xml @@ -18,36 +18,44 @@ --> - + - - spring - mvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1 + mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1 mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/1.1.1 mvn:org.apache.geronimo.specs/geronimo-j2ee-management_1.1_spec/1.0.1 - mvn:org.jvnet.jaxb2_commons/jaxb2-basics-runtime/${jaxb-basics-version} - mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl/${jaxb-bundle-version} - mvn:org.apache.commons/commons-pool2/${commons-pool2-version} - mvn:commons-net/commons-net/${commons-net-version} - mvn:org.apache.zookeeper/zookeeper/${zookeeper-version} - - mvn:org.apache.activemq/activemq-osgi/${project.version} + mvn:commons-net/commons-net/${commons-net-version} + mvn:org.apache.activemq/activemq-client-osgi/${project.version} + + + osgi.wiring.package;filter:="(&(osgi.wiring.package=org.apache.activemq)(version>=${osgi.project.version})(!(version>=6.0.0)))" + - - + + activemq-client scr mvn:org.apache.activemq/activemq-cf/${project.version} - + connector http - activemq-client + spring + + mvn:org.apache.activemq/activemq-osgi/${project.version} mvn:org.apache.activemq/activemq-karaf/${project.version} + mvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1 + mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1 + mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/1.1.1 + mvn:org.apache.geronimo.specs/geronimo-j2ee-management_1.1_spec/1.0.1 + mvn:org.apache.zookeeper/zookeeper/${zookeeper-version} + mvn:org.jvnet.jaxb2_commons/jaxb2-basics-runtime/${jaxb-basics-version} + mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl/${jaxb-bundle-version} + mvn:org.apache.commons/commons-pool2/${commons-pool2-version} + mvn:commons-net/commons-net/${commons-net-version} mvn:commons-collections/commons-collections/${commons-collections-version} mvn:commons-lang/commons-lang/${commons-lang-version} mvn:commons-codec/commons-codec/1.9 diff --git a/activemq-karaf/src/main/resources/features.xml b/activemq-karaf/src/main/resources/features.xml index c989705dd89..478678c3d73 100644 --- a/activemq-karaf/src/main/resources/features.xml +++ b/activemq-karaf/src/main/resources/features.xml @@ -38,7 +38,7 @@ - activemq-client + activemq mvn:org.apache.activemq/activemq-camel/${project.version} camel-jms camel diff --git a/pom.xml b/pom.xml index 444c1427895..a2b1a80d0d3 100644 --- a/pom.xml +++ b/pom.xml @@ -254,6 +254,7 @@ activemq-web activemq-partition activemq-osgi + activemq-client-osgi activemq-blueprint activemq-web-demo activemq-web-console