基于Maven 构建rpm包

rpm-maven-plugin是一个构建RPM的maven插件,他能在maven基础上自动生成spec文件,并构建出rpm包出来

<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>rpm-maven-plugin</artifactId>
				<version>2.1.4</version>
				<extensions>true</extensions>
				<configuration>
					<license>${rpm.license}</license>
					<group>${rpm.group}</group>
					<packager>${rpm.packager}</packager>
					<prefix>${rpm.prefix}</prefix>
					<autoProvides>false</autoProvides>
					<autoRequires>false</autoRequires>
					<needarch>noarch</needarch>
					<targetOS>linux</targetOS>
					<requires combine.children="append">
					</requires>
					<mappings>
						<mapping>
							<directory>${install.path}/cfgcenter-agent-${version}/lib/</directory>
							<dependency />
							<artifact />

						</mapping>
						<mapping>
							<directory>${install.path}/cfgcenter-agent-${version}/conf/</directory>
							<sources>
								<source>
									<location>src/main/resources</location>
								</source>
							</sources>

						</mapping>
						<mapping>
							<directory>${install.path}/cfgcenter-agent-${version}</directory>
							<sources>
								<source>
									<location>script</location>
								</source>
							</sources>

						</mapping>
					</mappings>
					<postinstallScriptlet>
						<script>sudo find ${install.path}/cfgcenter-agent-${version} -iname "*.sh" -exec dos2unix ‘{}‘ \; ; sudo find ${install.path}/cfgcenter-agent-${version} -iname "*.conf" -exec dos2unix ‘{}‘ \; ; sudo chown -R apps.apps ${install.path}/cfgcenter-agent-${version} </script>
					</postinstallScriptlet>
					<preremoveScriptlet>
						<script>rm -rf ${install.path}/cfgcenter-agent-${version}</script>
					</preremoveScriptlet>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>rpm</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
时间: 2024-08-10 17:09:29

基于Maven 构建rpm包的相关文章

基于Maven构建整合SpringMVC+Mybtis+Druid

前几天趁空闲时间整合了下SpringMVC+Mybatis+Druid,这里小记录下,这个Demo是基于Maven构建的,数据源用的是阿里巴巴温少的开源项目Druid,数据库用的是Mysql. 由于eclipse去安装Maven很不方便,也老出错,这里我使用的是Spring Tool Suite(STS,基于 Spring IDE ,提供了其它的一些特性,如 基于 Spring dm Server 的osgi 开发,及其它一些 Spring 项目的支持,如 Spring Roo , Spring

Spring配置Quartz例子(基于maven构建)

Spring配置Quartz例子(基于maven构建) 在Spring中使用Quartz有两种方式实现:第一种是任务类继承QuartzJobBean,第二种则是在配置文件里定义任务类和要执行的方法,类和方法仍然是普通类.很显然,第二种方式远比第一种方式来的灵活. 之所以在这里特别对版本作一下说明,是因为spring和quartz的整合对版本是有要求的. spring3.1以下的版本必须使用quartz1.x系列,3.1以上的版本才支持quartz 2.x,不然会出错. 至于原因,则是spring

Spring 3整合Quartz 2实现定时任务一:常规整合 (基于maven构建) - mjorcen(转)

Spring 3整合Quartz 2实现定时任务一:常规整合 (基于maven构建) - mjorcen(转) 最近工作中需要用到定时任务的功能,虽然Spring3也自带了一个轻量级的定时任务实现,但感觉不够灵活,功能也不够强大.在考虑之后,决定整合更为专业的Quartz来实现定时任务功能. 首先,当然是添加依赖的jar文件,我的项目是maven管理的,以下的我项目的依赖: <properties> <project.build.sourceEncoding>UTF-8</p

Spring 3整合Quartz 2实现定时任务一:常规整合 (基于maven构建)

最近工作中需要用到定时任务的功能,虽然Spring3也自带了一个轻量级的定时任务实现,但感觉不够灵活,功能也不够强大.在考虑之后,决定整合更为专业的Quartz来实现定时任务功能. 首先,当然是添加依赖的jar文件,我的项目是maven管理的,以下的我项目的依赖: <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <spring.version>3.

Linux手动构建RPM包

一.前言 在linux上安装软件和模块很多都是通过rpm包安装的,非常的方便.如果多个主机安装文件和脚本也能用rpm包的方式就好了,节省时间和精力,正好看到了一篇文章,本地构建rpm包,试着学了下,所以写下这篇博客记录构建过程,该博客使用到的主机为Centos7. 二.准备 1.首先,打开一个终端会话,使用root用户创建可用于此项目的普通用户 “student”,并为该用户设置密码. [[email protected] ~]# useradd student [[email protecte

Linux下基于官方源代码RPM包构建自定义MySQL RPM包

1.首先安装rpmbuild #yum install rpm-build gcc gcc-c++ cmake bison ncurses-devel zlib  -y 2.下载官方源码包(tar.gz格式),并解压 #wget  http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.15.tar.gz #tar -xvf mysql-5.6.15.tar.gz 3.新建RPM文件夹 #cd  mysql-5.6.15 #mkdir rpm

基于maven构建web项目

1.打开eclipse,右击->new->Project->Maven->Maven Project    然后点击Next 2.选择创建一个简单的项目  点击Next 3.填写项目的基本信息    点击Finish 4.生成一个简单的项目,但现在的web项目还缺少部分目录结构 5.右击项目->Properties->Project Facets 原因是maven帮我们默认选择的版本出问题 6.我们需要把dynamic web module去掉,然后选择java1.6或

基于FPM制作RPM包

1.搭建Epel  Yum源 安装在线yum源 [[email protected] ~]# rpm -ivh epel-release-latest-7.noarch.rpm //安装扩展源 [[email protected] yum.repos.d]# ls a epel-release-latest-7.noarch.rpm epel-testing.repo Centos-7.repo epel.repo或   [[email protected] ~]# ls /etc/yum.re

eclipse中基于maven构建的web项目pom.xml中指定的jar包无法发布到tomcat中

eclipse运行maven web项目报错: 信息: Starting Servlet Engine: Apache Tomcat/7.0.57 一月 07, 2015 11:50:44 下午 org.apache.catalina.core.ContainerBase startInternal 严重: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catal