<?xml version="1.0" encoding="UTF-8"?> <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"> <!-- 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. --> <modelVersion>4.0.0</modelVersion> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri-singlebundle-distribution</artifactId> <version>1.2</version> <packaging>bundle</packaging> <name>Distributed OSGI Single-Bundle Distribution</name> <url>http://cxf.apache.org</url> <parent> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri-distribution-parent</artifactId> <version>1.2</version> <relativePath>../pom.xml</relativePath> </parent> <properties> <topDirectoryLocation>../..</topDirectoryLocation> </properties> <dependencies> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-annotation_1.0_spec</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-activation_1.1_spec</artifactId> <version>1.0.2</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-javamail_1.4_spec</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-ws-metadata_2.0_spec</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>com.springsource.slf4j.org.apache.commons.logging</artifactId> <version>${slf4j.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>com.springsource.slf4j.api</artifactId> <version>${slf4j.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>com.springsource.slf4j.log4j</artifactId> <version>${slf4j.version}</version> <exclusions> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> <exclusion> <groupId>org.apache.log4j</groupId> <artifactId>com.springsource.org.apache.log4j</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.log4j</groupId> <artifactId>com.springsource.org.apache.log4j</artifactId> <version>1.2.15</version> </dependency> <dependency> <groupId>org.jdom</groupId> <artifactId>com.springsource.org.jdom</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-asm</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.aopalliance</groupId> <artifactId>com.springsource.org.aopalliance</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-oxm</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>${spring.version}</version> </dependency><dependency> <groupId>org.springframework.osgi</groupId> <artifactId>spring-osgi-io</artifactId> <version>${spring.osgi.version}</version> </dependency> <dependency> <groupId>org.springframework.osgi</groupId> <artifactId>spring-osgi-core</artifactId> <version>${spring.osgi.version}</version> </dependency> <dependency> <groupId>org.springframework.osgi</groupId> <artifactId>spring-osgi-extender</artifactId> <version>${spring.osgi.version}</version> </dependency> <!-- <dependency> <groupId>org.ops4j.pax.web</groupId> <artifactId>pax-web-jetty-bundle</artifactId> <version>1.1.1</version> </dependency> --> <dependency> <groupId>org.ops4j.pax.web</groupId> <artifactId>pax-web-service</artifactId> <version>0.5.1</version> </dependency> <dependency> <groupId>org.apache.servicemix.specs</groupId> <artifactId>org.apache.servicemix.specs.saaj-api-1.3</artifactId> <version>${servicemix.specs.version}</version> </dependency> <dependency> <groupId>org.apache.servicemix.specs</groupId> <artifactId>org.apache.servicemix.specs.stax-api-1.0</artifactId> <version>${servicemix.specs.version}</version> </dependency> <dependency> <groupId>org.apache.servicemix.specs</groupId> <artifactId>org.apache.servicemix.specs.jaxb-api-2.1</artifactId> <version>${servicemix.specs.version}</version> </dependency> <dependency> <groupId>org.apache.servicemix.specs</groupId> <artifactId>org.apache.servicemix.specs.jaxws-api-2.1</artifactId> <version>${servicemix.specs.version}</version> </dependency> <dependency> <groupId>org.apache.servicemix.specs</groupId> <artifactId>org.apache.servicemix.specs.jsr311-api-1.0</artifactId> <version>${servicemix.specs.version}</version> </dependency> <dependency> <groupId>org.apache.servicemix.bundles</groupId> <artifactId>org.apache.servicemix.bundles.xmlschema</artifactId> <version>${xmlschema.bundle.version}</version> </dependency> <dependency> <groupId>org.apache.servicemix.bundles</groupId> <artifactId>org.apache.servicemix.bundles.xmlresolver</artifactId> <version>${xmlresolver.bundle.version}</version> </dependency> <dependency> <groupId>org.apache.servicemix.bundles</groupId> <artifactId>org.apache.servicemix.bundles.neethi</artifactId> <version>${neethi.bundle.version}</version> </dependency> <dependency> <groupId>org.apache.servicemix.bundles</groupId> <artifactId>org.apache.servicemix.bundles.wsdl4j</artifactId> <version>${wsdl4j.bundle.version}</version> </dependency> <dependency> <groupId>org.apache.servicemix.bundles</groupId> <artifactId>org.apache.servicemix.bundles.xmlsec</artifactId> <version>${xmlsec.bundle.version}</version> </dependency> <dependency> <groupId>org.apache.servicemix.bundles</groupId> <artifactId>org.apache.servicemix.bundles.jaxb-impl</artifactId> <version>${jaxbimpl.bundle.version}</version> </dependency> <dependency> <groupId>org.apache.servicemix.bundles</groupId> <artifactId>org.apache.servicemix.bundles.asm</artifactId> <version>${asm.bundle.version}</version> </dependency> <dependency> <groupId>org.apache.servicemix.bundles</groupId> <artifactId>org.apache.servicemix.bundles.commons-pool</artifactId> <version>${commons.pool.bundle.version}</version> </dependency> <dependency> <groupId>org.apache.servicemix.bundles</groupId> <artifactId>org.apache.servicemix.bundles.woodstox</artifactId> <version>${woodstox.bundle.version}</version> </dependency> <dependency> <groupId>org.apache.felix</groupId> <artifactId>org.apache.felix.configadmin</artifactId> <version>1.2.8</version> </dependency> <dependency> <groupId>org.apache.felix</groupId> <artifactId>org.apache.felix.fileinstall</artifactId> <version>1.2.0</version> </dependency> <dependency> <groupId>org.apache.ws.security</groupId> <artifactId>wss4j</artifactId> <version>1.5.6</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-bundle-minimal</artifactId> <version>${cxf.version}</version> </dependency> <dependency> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri-discovery-local</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri-dsw-cxf</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri-discovery-distributed-zookeeper-wrapper</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri-discovery-distributed</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri-topology-manager</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.easymock</groupId> <artifactId>easymockclassextension</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <configuration> <instructions> <Bundle-Name>Distributed OSGi Distribution Software Single-Bundle Distribution</Bundle-Name> <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName> <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor> <Bundle-Activator>org.apache.cxf.dosgi.singlebundle.AggregatedActivator</Bundle-Activator> <Include-Resource> @cxf-bundle-minimal-${cxf.version}.jar!/META-INF/spring.*, @cxf-bundle-minimal-${cxf.version}.jar!/META-INF/cxf/*, {maven-resources} </Include-Resource> <Import-Package> javax.servlet.*;version="[2.3.0,2.6.0)", org.osgi.* </Import-Package> <Export-Package> '=META-INF.cxf', org.apache.cxf.dosgi.singlebundle;version="${pom.version}" </Export-Package> <Embed-Dependency>*;scope=compile;inline=false</Embed-Dependency> <Embed-Directory>lib</Embed-Directory> <_exportcontents> javax.xml.ws.*;version="2.1.0", javax.ws.rs.*;version="1.0.0", javax.jws.*;version="2.0.0", javax.xml.bind.annotation.*;version="2.1", javax.servlet.*;version="2.5.0", org.apache.cxf.dosgi.*;version="${pom.version}", org.apache.cxf.*;version="${cxf.version}", org.jdom.*;version="1.0.0", org.osgi.service.cm;version="1.2", org.osgi.service.distribution;version="1.0.0", org.osgi.service.discovery;version="1.0.0", org.osgi.service.log;version="1.3", org.osgi.service.remoteserviceadmin;version="1.0.0", !* </_exportcontents> <DynamicImport-Package>*</DynamicImport-Package> <_failok>true</_failok> <_removeheaders> Ignore-Package, Include-Resource, Private-Package, Embed-Dependency </_removeheaders> </instructions> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>copy</id> <phase>package</phase> <goals> <goal>copy</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>org.apache.felix</groupId> <artifactId>org.osgi.compendium</artifactId> <version>1.2.0</version> <type>jar</type> <outputDirectory>target/deps</outputDirectory> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <phase>package</phase> <configuration> <tasks> <!-- removing this directory as it confuses Eclipse when importing the bundle as a plugin --> <delete dir="target/classes" /> <fileset dir="target" id="single.bundle"> <include name="*.jar" /> </fileset> <pathconvert pathsep="" property="bundle" refid="single.bundle" /> <fileset dir="target/deps" id="felix.dep.bundles"> <include name="*.jar" /> </fileset> <pathconvert pathsep=" file:/" property="felix.deps" refid="felix.dep.bundles" /> <!-- config.properties file for Felix --> <echo file="target/felix.config.properties.append"> org.ops4j.pax.web.session.timeout=30 org.osgi.framework.startlevel=2 felix.auto.start.2= </echo> <echo message="file:/${felix.deps} file:/${bundle}" file="target/felix.config.properties.append" append="true" /> <replace file="target/felix.config.properties.append" token="\" value="/" /> <!-- config.ini file for Equinox --> <echo file="target/equinox.config.ini.append"> org.ops4j.pax.web.session.timeout=30 osgi.bundles=org.eclipse.osgi.services@start, </echo> <echo message="${bundle}@start" file="target/equinox.config.ini.append" append="true" /> <replace file="target/equinox.config.ini.append" token="\" value="/" /> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
\parent\pom.xml对应版本为:
<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"> <parent> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri</artifactId> <version>1.2</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.apache.cxf.dosgi</groupId> <artifactId>cxf-dosgi-ri-parent</artifactId> <version>1.2</version> <packaging>pom</packaging> <name>Distributed OSGI Reference Implementation Parent</name> <!-- Some versions of libraries used are different to the ones from CXF, this is generally caused by the fact that not all versions are available yet as OSGi bundles. --> <properties> <cxf.version>2.2.9</cxf.version> <felix.version>2.0.0</felix.version> <spring.version>3.0.6.RELEASE</spring.version> <spring.osgi.version>2.0.0.M1</spring.osgi.version> <zookeeper.version>3.3.0</zookeeper.version> <remote.service.admin.interfaces.version>1.0.0</remote.service.admin.interfaces.version> <servicemix.specs.version>1.4.0</servicemix.specs.version> <servlet.version>2.5</servlet.version> <log4j.version>1.2.15</log4j.version> <jetty.version>6.1.16</jetty.version> <xmlschema.bundle.version>1.4.3_1</xmlschema.bundle.version> <!-- CXF uses 1.4.4 --> <xmlresolver.bundle.version>1.2_3</xmlresolver.bundle.version> <neethi.bundle.version>2.0.4_3</neethi.bundle.version> <wsdl4j.bundle.version>1.6.2_2</wsdl4j.bundle.version> <!-- CXF uses 1.6.2 --> <xmlsec.bundle.version>1.4.3_3</xmlsec.bundle.version> <asm.bundle.version>2.2.3_1</asm.bundle.version> <commons.pool.bundle.version>1.5.4_1</commons.pool.bundle.version> <woodstox.bundle.version>3.2.9_1</woodstox.bundle.version> <!-- CXF uses 3.2.8 --> <jaxbimpl.bundle.version>2.1.12_1</jaxbimpl.bundle.version> <!-- CXF uses 2.1.9 --> <slf4j.version>1.5.6</slf4j.version> <felix.plugin.version>2.1.0</felix.plugin.version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.7</version> <scope>test</scope> </dependency> <dependency> <groupId>org.easymock</groupId> <artifactId>easymock</artifactId> <version>2.5.2</version> <scope>test</scope> </dependency> <dependency> <groupId>org.easymock</groupId> <artifactId>easymockclassextension</artifactId> <version>2.5.2</version> <scope>test</scope> </dependency> </dependencies> </dependencyManagement> <build> <defaultGoal>install</defaultGoal> <pluginManagement> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>${felix.plugin.version}</version> <extensions>true</extensions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.4.2</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.0.2</version> <configuration> <source>1.5</source> <target>1.5</target> <maxmem>256M</maxmem> <fork>false</fork> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.1</version> <dependencies> <dependency> <groupId>ant</groupId> <artifactId>ant-trax</artifactId> <version>1.6.5</version> </dependency> </dependencies> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.2</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.0</version> </plugin> <plugin> <artifactId>maven-remote-resources-plugin</artifactId> <version>1.0</version> <dependencies> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-buildtools</artifactId> <version>${project.version}</version> </dependency> </dependencies> <executions> <execution> <goals> <goal>process</goal> </goals> <configuration> <resourceBundles> <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle> </resourceBundles> <supplementalModels> <supplementalModel>notice-supplements.xml</supplementalModel> </supplementalModels> <properties> <projectName>Apache CXF Distributed OSGi DSW Reference Implementation</projectName> </properties> </configuration> </execution> </executions> </plugin> </plugins> </pluginManagement> <plugins> <plugin> <artifactId>maven-remote-resources-plugin</artifactId> <version>1.0</version> <dependencies> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-buildtools</artifactId> <version>${cxf.version}</version> </dependency> </dependencies> <executions> <execution> <goals> <goal>process</goal> </goals> <configuration> <resourceBundles> <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle> </resourceBundles> <supplementalModels> <supplementalModel>notice-supplements.xml</supplementalModel> </supplementalModels> <properties> <projectName>Apache CXF Distributed OSGi DSW Reference Implementation</projectName> </properties> </configuration> </execution> </executions> </plugin> </plugins> </build> <repositories> <repository> <id>apache.snapshots</id> <name>Apache Maven Snapshot Repository</name> <url>http://repository.apache.org/content/groups/snapshots/</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> <!-- I21 repository --> <repository> <id>i21-s3-maven-repo</id> <name>i21 S3 milestone repo</name> <url>http://s3.amazonaws.com/maven.springframework.org/milestone</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </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> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </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> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository> <id>central</id> <name>Default maven repo</name> <url>http://repo1.maven.org/maven2</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> <!-- ServiceMix repo --> <repository> <id>servicemix</id> <name>ServiceMix Repository</name> <url>http://svn.apache.org/repos/asf/servicemix/m2-repo</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> <!-- OPS4j repository --> <repository> <id>ops4j</id> <name>OPS4j repo</name> <url>http://repository.ops4j.org/maven2</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository> <id>repository.opensaml</id> <name>Open SAML repository</name> <url>http://ws.zones.apache.org/repository2</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository> <id>spring-osgified-artifacts</id> <name>Springframework Maven OSGified Artifacts Repository</name> <url>http://s3.amazonaws.com/maven.springframework.org/osgi</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository> <snapshots> <enabled>true</enabled> </snapshots> <id>springframework.org</id> <name>Springframework Maven SNAPSHOT Repository</name> <url>http://s3.amazonaws.com/maven.springframework.org/snapshot</url> </repository> <repository> <id>apache-incubating</id> <name>Apache Incubating Repository</name> <url>http://people.apache.org/repo/m2-incubating-repository/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>apache.snapshots</id> <name>Apache Maven Snapshot Repository</name> <url>http://repository.apache.org/content/groups/snapshots/</url> <layout>default</layout> <snapshots> <enabled>true</enabled> </snapshots> <releases> <enabled>false</enabled> </releases> </pluginRepository> </pluginRepositories> </project>
在apache-cxf-dosgi-ri-1.2\distribution\single-bundle目录,运行 mvn install 后,\apache-cxf-dosgi-ri-1.2\distribution\single-bundle\target目录生成cxf-dosgi-ri-singlebundle-distribution-1.2.jar
切换到apache-cxf-dosgi-ri-1.2\samples\spring_dm目录,运行mvn install 生成演示相关的Bundle。
启动jboss后,把对应的Bundle在jboss管理界面发布即可看到演示的demo。