maven配置bundle工程
来源:互联网 发布:儿歌大全软件 编辑:程序博客网 时间:2024/06/05 22:40
1.在src\main\resources路径下配置features.xml文件,内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.0.0 http://karaf.apache.org/xmlns/features/v1.0.0"
name="esbconsoleRepository">
<repository>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</repository>
<feature name="${project.artifactId}" version="${project.version}">
<feature version="${camel.version}">camel-http</feature>
<feature version="${camel.version}">camel-jetty</feature>
<bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
</feature>
</features>
2.pom.xml文件要点
2.1:打包成bundle格式文件
<packaging>bundle</packaging>
2.2:配置构建所需插件
<build>
<plugins><plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Description>${project.description}</Bundle-Description>
<DynamicImport-Package>*</DynamicImport-Package>
<Import-Package>!*</Import-Package>
<!-- <Import-Package>!antlr.*,!gnu.*,!javassist.*,!javax.persistence.*,!javax.xml.rpc*,!junit.*,*</Import-Package> -->
<Export-Package>com.csair.cod.route*;version=${project.version}</Export-Package>
<Embed-Dependency>log4j,svc-sample-fuse-lib,jbossall-client,testejb;scope=compile|runtime|system</Embed-Dependency>
</instructions>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<!-- add the following args -->
<fork>true</fork>
<meminitial>128m</meminitial>
<maxmem>256m</maxmem>
<!-- if it doesn't work, try 768M, it seems that UTF-16 consumes more
memory -->
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target</outputDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/features.xml</file>
<type>xml</type>
<classifier>features</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
2.3依赖所需包:
具体项目所需包不一样,所以省略
- maven配置bundle工程
- Maven工程管理配置
- 使用maven创建基于spring的模块|工程|bundle
- 利用maven创建spring-osgi powered 多bundle工程
- 利用maven创建spring-osgi powered 多bundle工程
- 利用maven创建spring-osgi powered 多bundle工程
- maven +jetty 配置web工程
- 新建并配置Maven工程
- maven工程如何配置servlet
- maven工程的一些配置
- 【Maven】maven父子工程pom.xml配置
- Maven-maven介绍&maven安装配置&创建maven工程&M2Eclipse
- MyEclipse9 Maven开发Web工程 详细配置
- MyEclipse + Maven开发Web工程的配置
- myeclipse+maven开发web工程详细配置
- MyEclipse + Maven开发Web工程的配置
- Myeclipse创建maven web工程及配置
- maven配置和工程的创建
- mysql sql语句
- 利用VC/VS检测程序内存溢出(转)
- Putty 配置笔记
- http://www.cnblogs.com/YSO1983/archive/2010/06/10/1755665.html
- 项目管理:Redmine安装错误You cannot specify the same gem twice with different version
- maven配置bundle工程
- 文件路径Node.js高级编程:用JavaScript构建可伸缩应用(7)3.7 文件,进程,流和网络
- Java开发之数据库基本原理
- 新闻发布系统总结
- 硬链接和软连接的区别
- centos 6.3 64bit 添加RPMForge软件源
- pthread多线程编程整理
- 【50个最受网友欢迎的HTML5资源下载列表】(转载)
- 比较好的开源网站