This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch camel-2.x in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-2.x by this push: new 1dd8161 Fix CAMEL-13498 - Add support for AS2 in Karaf 1dd8161 is described below commit 1dd8161f864be75a1b43c370ae1f3e5db6a01c3f Author: Alexandre Kieling <alex.kiel...@gmail.com> AuthorDate: Fri May 10 08:48:12 2019 -0300 Fix CAMEL-13498 - Add support for AS2 in Karaf --- components/camel-as2/camel-as2-api/pom.xml | 3 ++ components/camel-as2/camel-as2-component/pom.xml | 29 ++----------------- .../karaf/features/src/main/resources/features.xml | 15 +++++++++- .../org/apache/camel/itest/karaf/CamelAs2Test.java | 33 ++++++++++++++++++++++ 4 files changed, 52 insertions(+), 28 deletions(-) diff --git a/components/camel-as2/camel-as2-api/pom.xml b/components/camel-as2/camel-as2-api/pom.xml index bcbc5c1..2e7ac8a 100644 --- a/components/camel-as2/camel-as2-api/pom.xml +++ b/components/camel-as2/camel-as2-api/pom.xml @@ -32,6 +32,9 @@ <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + <camel.osgi.export.pkg> + org.apache.camel.component.as2.api.*;${camel.osgi.version}, + </camel.osgi.export.pkg> </properties> <dependencies> diff --git a/components/camel-as2/camel-as2-component/pom.xml b/components/camel-as2/camel-as2-component/pom.xml index a294492..91b8da6 100644 --- a/components/camel-as2/camel-as2-component/pom.xml +++ b/components/camel-as2/camel-as2-component/pom.xml @@ -35,6 +35,8 @@ <componentName>AS2</componentName> <componentPackage>org.apache.camel.component.as2</componentPackage> <outPackage>org.apache.camel.component.as2.internal</outPackage> + <camel.osgi.export.pkg>org.apache.camel.component.as2</camel.osgi.export.pkg> + <camel.osgi.export.service>org.apache.camel.spi.ComponentResolver;component=as2</camel.osgi.export.service> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> </properties> @@ -112,33 +114,6 @@ <artifactId>maven-resources-plugin</artifactId> </plugin> - <!-- to generate the MANIFEST-FILE of the bundle --> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <version>3.2.0</version> - <extensions>true</extensions> - <configuration> - <instructions> - <Bundle-Name>Camel Component for ${componentName}</Bundle-Name> - <Bundle-SymbolicName>org.apache.camel.camel-as2</Bundle-SymbolicName> - <Export-Service>org.apache.camel.spi.ComponentResolver;component=${schemeName}</Export-Service> - <Export-Package>${componentPackage};version=${project.version}</Export-Package> - <Import-Package> - ${componentPackage}.api;version=${project.version}, - ${componentPackage};version=${project.version}, - org.apache.camel.*;version=2.18.3 - </Import-Package> - <Private-Package>${outPackage}</Private-Package> - <Implementation-Title>Apache Camel</Implementation-Title> - <Implementation-Version>${project.version}</Implementation-Version> - <Karaf-Info>Camel;${project.artifactId}=${project.version}</Karaf-Info> - <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy> - <_failok>false</_failok> - </instructions> - </configuration> - </plugin> - <!-- generate Component source and test source --> <plugin> <groupId>org.apache.camel</groupId> diff --git a/platforms/karaf/features/src/main/resources/features.xml b/platforms/karaf/features/src/main/resources/features.xml index d538e83..d80b16a 100644 --- a/platforms/karaf/features/src/main/resources/features.xml +++ b/platforms/karaf/features/src/main/resources/features.xml @@ -121,7 +121,20 @@ <bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.java-apns/${java-apns-bundle-version}</bundle> <bundle>mvn:org.apache.camel/camel-apns/${project.version}</bundle> </feature> - <feature name='camel-asn1' version='${project.version}' resolver='(obr)' start-level='50'> + <feature name='camel-as2' version='${project.version}' resolver="(obr)" start-level='50'> + <feature version='${project.version}'>camel-core</feature> + <bundle dependency="true">mvn:commons-lang/commons-lang/${commons-lang-version}</bundle> + <bundle dependency='true'>mvn:commons-collections/commons-collections/${commons-collections-version}</bundle> + <bundle dependency='true'>mvn:commons-codec/commons-codec/${commons-codec-version}</bundle> + <bundle dependency='true'>mvn:org.apache.httpcomponents/httpcore-osgi/${httpcore4-version}</bundle> + <bundle dependency='true'>mvn:org.apache.httpcomponents/httpclient-osgi/${httpclient4-version}</bundle> + <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.velocity/${velocity-bundle-version}</bundle> + <bundle dependency='true'>mvn:org.bouncycastle/bcprov-jdk15on/${bouncycastle-version}</bundle> + <bundle dependency='true'>mvn:org.bouncycastle/bcpkix-jdk15on/${bouncycastle-version}</bundle> + <bundle>mvn:org.apache.camel/camel-as2-api/${project.version}</bundle> + <bundle>mvn:org.apache.camel/camel-as2/${project.version}</bundle> + </feature> + <feature name="camel-asn1" version="${project.version}" resolver="(obr)" start-level="50"> <feature version='${project.version}'>camel-core</feature> <bundle dependency='true'>mvn:org.openmuc/jasn1/${jasn1-version}</bundle> <bundle dependency='true'>mvn:org.bouncycastle/bcprov-jdk15on/${bouncycastle-version}</bundle> diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelAs2Test.java b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelAs2Test.java new file mode 100644 index 0000000..1bb4328 --- /dev/null +++ b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelAs2Test.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.itest.karaf; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.ops4j.pax.exam.junit.PaxExam; + +@RunWith(PaxExam.class) +public class CamelAs2Test extends BaseKarafTest { + + public static final String COMPONENT = extractName(CamelAs2Test.class); + + @Test + public void test() throws Exception { + testComponent(COMPONENT); + } + +}