一.web端程序,打包成war包

jenkins配置

1.项目名称,旧文件处理配置

2.参数构建配置

3.源码库配置

4.打包文件pom.xml配置及多环境打包传参,此处传参qa(表示打测试环境包,名称自定义)

5.maven全局配置文件路径

6.打包后执行操作

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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <parent>
<groupId>com.jeck.danny</groupId>
<artifactId>danny-cloud-parent</artifactId>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../danny-cloud-parent</relativePath>
</parent> <artifactId>test-web</artifactId>
<packaging>war</packaging>
<name>test-web</name>

<url>http://maven.apache.org</url> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<scm>
<connection>scm:svn:https://192.168.1.8/svn/test</connection>
<developerConnection>scm:svn:https://192.168.1.8/svn/test</developerConnection>
</scm>
<dependencies>
<dependency>
<groupId>com.jeck.danny</groupId>
<artifactId>danny-common</artifactId>
</dependency>
<dependency>
<groupId>com.jeck.danny</groupId>
<artifactId>danny-i18n</artifactId>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.jeck.danny</groupId>
<artifactId>danny-domain</artifactId>
</dependency>
<dependency>
<groupId>com.jeck.danny</groupId>
<artifactId>danny-user-sso</artifactId>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.jeck.danny</groupId>
<artifactId>danny-test-api</artifactId>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.github.sgroschupf</groupId>
<artifactId>zkclient</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<artifactId>spring</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
</dependency>
... <dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</dependency> ...//一大堆依赖略 </dependencies> <distributionManagement>
<repository>
<id>danny-releases</id>
<name>danny-releases</name>
<url>http://maven.danny.com.cn:8091/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>danny-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://maven.danny.com.cn:8091/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement> <build>
<finalName>test-web</finalName>
<outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources> <extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.10</version>
</extension>
</extensions> <plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.16.v20140903</version>
<configuration>
<scanIntervalSeconds>3</scanIntervalSeconds>
<stopPort>9988</stopPort>
<stopKey>foo</stopKey>
<webApp>
<contextPath>/paicoin</contextPath>
</webApp>
<!-- 设置监听目录 -->
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60001</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<tagBase>https://192.168.1.8/svn/test</tagBase>
</configuration>
</plugin>
</plugins>
</build> </project>

jenkins运行打包后,会在项目的target目录下生成一个war文件

二.server端程序,打包成tar.gz包

jenkins配置

前面配置和web端配置差不多

pom.xml配置

此处在pom.xml中调用了assembly.xml配置文件

先看pom.xml配置

<modelVersion>4.0.0</modelVersion>

        <parent>
<groupId>com.danny.test</groupId>
<artifactId>test-cloud-parent</artifactId>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../test-cloud-parent</relativePath>
</parent> <artifactId>test-service</artifactId>
<packaging>jar</packaging>
<name>test-service</name>
<url>http://maven.apache.org</url> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<scm>
<connection>scm:svn:https://192.168.1.8/svn/test/tags/server/打包发布/server/业务系统</connection>
</scm>
<dependencies> <dependency>
<groupId>com.danny.test</groupId>
<artifactId>test-common</artifactId>
</dependency> <dependency>
<groupId>com.danny.test</groupId>
<artifactId>test-domain</artifactId>
</dependency> <dependency>
<groupId>com.danny.test</groupId>
<artifactId>test-user-api</artifactId>
</dependency>
<dependency>
<groupId>com.danny.test</groupId>
<artifactId>test-paicoin-api</artifactId>
<version>1.2.0-SNAPSHOT</version>
</dependency>
<!-- <dependency>
<groupId>com.danny.test</groupId>
<artifactId>test-user-sso</artifactId>
<version>1.2.0-SNAPSHOT</version>
</dependency> -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
</dependency> <dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency> <dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency> <dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.13</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.13</version>
</dependency> </dependencies> <build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<!--
<includes>
<include>*.properties</include>
<include>**/*.xml</include>
</includes>
-->
<excludes>
<exclude>**/*.properties</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions> <!--执行器 mvn assembly:assembly -->
<execution>
<id>make-assembly</id><!--名字任意 -->
<phase>package</phase><!-- 绑定到package生命周期阶段上 -->
<goals>
<goal>single</goal><!-- 只运行一次 -->
</goals>
<configuration>
<finalName>${artifactId}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<attach>false</attach>
<descriptors> <!--描述文件路径 -->
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>

</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<tagBase>https://192.168.1.8/svn/test/tags/server/打包发布/server/业务系统</tagBase>
</configuration>
</plugin>
</plugins>
</build> </project>

assembly.xml文件配置

<assembly>
<id>assembly</id>
<formats>
<format>tar.gz</format>
<!-- <format>zip</format> <format>dir</format> -->
</formats>

<includeBaseDirectory>true</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>src/main/assembly/bin</directory>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<!-- <fileSet> <directory>src/main/assembly/conf</directory> <outputDirectory>conf</outputDirectory>
<fileMode>0644</fileMode> </fileSet> -->
<fileSet>
<directory>src/main/resources/</directory>
<outputDirectory>conf</outputDirectory>
<filtered>true</filtered>
<includes>
<include>dubbo.properties</include>
<include>property.properties</include>
</includes>
</fileSet>
<!-- <fileSet> <directory>src/test/resources</directory> <outputDirectory>conf</outputDirectory>
<fileMode>0644</fileMode> </fileSet> -->
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
</assembly>

同样jenkins运行打包后,会在项目的target目录下生成一个tar.gz文件

注:

  setting.xml主要用于配置maven的运行环境等一系列通用的属性,是全局级别的配置文件;而pom.xml主要描述了项目的maven坐标,依赖关系,开发者需要遵循的规则,组织和licenses,以及其他所有的项目相关因素,是项目级别的配置文件。

  通常一个项目可能还包含其他的外部配置文件,或者自定义的shell脚本或者bat命令等,此时应该使用assemble命令来进行构建。assembly,即组合构建的意思,使用此插件可以整合你想要的文件到最终的tar包中。

dubbo框架的web端(war)和server端(tar.gz)结合jenkins打包方式的更多相关文章

  1. Tomcat 中部署 web 应用 ---- Dubbo 服务消费者 Web 应用 war 包的部署

    使用Maven构建Dubbo服务的可执行jar包 Dubbo服务的运行方式: 1.使用Servlet容器运行(Tomcat.Jetty等)----不可取 缺点:增加复杂性(端口.管理) 浪费资源(内存 ...

  2. Tomcat中部署web应用 ---- Dubbo服务消费者Web应用war包的部署

    样例视频:http://www.roncoo.com/course/view/f614343765bc4aac8597c6d8b38f06fd IP: 192.168.2.61 部署容器:apache ...

  3. Android实战简易教程-第六十六枪(server端搭建和server端Json数据交互)

    学习Android有一段时间了.对server端有非常深的好奇,决定对server端的实现进行一些研究,这里实现了一个简单的小样例,用于获取server端的json数据,样例非常easy,适合刚開始学 ...

  4. 分享 koa + mysql 的开发流程,构建 node server端,一次搭建个人博客

    前言 由于一直在用 vue 写业务,为了熟悉下 react 开发模式,所以选择了 react.数据库一开始用的是 mongodb,后来换成 mysql 了,一套下来感觉 mysql 也挺好上手的.re ...

  5. server端获得到client端的IP地址的格式

    使用telnet,ping或其他client连接server端时,server端获得的client端的ip地址取决于client端使用的时ipv4还是ipv6地址. 例: client IPv4地址: ...

  6. Unity3d Web Player 与server端联网配置

    针对Unity3d Web Player 的server端联网配置写一随笔咯.  以SmartFoxServer2X官方的Unity3d Example ”tris“为例,部署好服务器之后,在Unit ...

  7. Unity3d Web Player 的server端联网配置

    新游戏出了第一个能跑完流程的版本,不得不佩服Unity3D强大的功力,PC.MAC OS.Linux.IOS.Android.web player,前天刚发布的unity3d 4.2版本还支持WIND ...

  8. 由WSDL文件生成WEB service server端C#程序(转)

    一般一个已经实现功能的WEB Server会发布自己的WSDL文件,供客户端生成代理类. 但有时是先有的server与client交互的接口定义(WSDL)文件,然后由server和client端分别 ...

  9. RocketMq(三):server端处理框架及消费数据查找实现

    rocketmq作为一个高性能的消息中间件,咱们光停留在使用层面,总感觉缺点什么.虽然rocketmq的官方设计文档讲得还是比较详细的,但纸上得来终觉浅!今天我们就来亲自挖一挖rocketmq的实现细 ...

随机推荐

  1. Springboot整合Elastic-Job

    Elastic-Job是当当网的任务调度开源框架,有以下功能 分布式调度协调 弹性扩容缩容 失效转移 错过执行作业重触发 作业分片一致性,保证同一分片在分布式环境中仅一个执行实例 自诊断并修复分布式不 ...

  2. LVS(五)LVS的持久连接

    什么是持久链接 把某个客户端的请求始终定向到同一应用服务器上.对于LVS来说持久连接和算法没有关系.也就是使用任何算法LVS都可以实现同一客户端的请求转发到之前选定的应用服务器,以保持会话.而且还能实 ...

  3. 值得一看的35个Redis常用问题总结

    1.什么是redis? Redis 是一个基于内存的高性能key-value数据库. 2.Reids的特点 Redis本质上是一个Key-Value类型的内存数据库,很像memcached,整个数据库 ...

  4. jquery快速入门(二)

    jQuery 效果 1.隐藏,显示 1.1显示 hide() 和隐藏 show() 语法:$(selector).hide(speed,callback); $(selector).show(spee ...

  5. .net简介(一)

    什么是.NET 微软的开发平台,包含规范.编程语言.标准类.工具等.一般认为.net就是微软的软件开发技术.同时微软的所有产品也提供.NET类型的API. .NET概览 .net的组成: 开发语言,遵 ...

  6. [TCP/IP] 网络层-简单查看路由表

    使用抓包工具排除网络故障:1.如果一台计算机在网络上发广播包,广播的mac地址是全ff,就有可能堵塞2.使用抓包工具,检测广播包和多播包 网络畅通的条件:数据包有去有回1.路由器使用路由表找到目标网段 ...

  7. VSCode瞎折腾记

    搬到小机房后终于能用VSCode啦(没错以前的系统是xp) 但是这东西比Dev难搞多了qwq,简单记一下自己的DIY历程吧(不然全搞炸就凉了) 设置语言为中文 可以直接下载插件 让VSCode支持编译 ...

  8. 升级WIN10 (9879)后IE无响应的解决办法

    身为程序猿,当然有了新系统就要尝尝鲜,有WIN8时,哥是朋友圈第一个用的,有WIN8.1时哥也是第一个升级的. 现在WIN10来了,当然也得赶紧尝尝鲜.直接下载了 9879版的预览版本安装. 要说WI ...

  9. Python安装第三方包(模块/工具)出现链接超时,网速慢,安装不上的问题如何解决

    之前我的电脑重新装了系统以后,发现安装完Python后, 使用pip linstall 安装第三方包的时候,网速慢的一匹 有时候只有几百b/s ,而且还动不动就会出现无法安装,链接超时等问题. 今天我 ...

  10. 如何知道一个EXE使用什么开发语言开发的

    一般是看EXE调用哪些DLL,这可以使用VC++中的工具Dependency Walker,它可以列出静态链接的所有DLL. 如果EXE中的DLL包括MSVBVM60.DLL,则是使用VB 6.0开发 ...