maven

MapStruct

泄露秘密 提交于 2020-12-31 00:11:06
1.什么是MapStruct      简单来说,MapStruct 可以将某几种类型的对象映射为另外一种类型,如将多个 DO(业务实体对象) 对象转换为 DTO(数据传输对象),避免了在业务代码内new DTO对象和不断的进行set方法 2.如何使用MapStruct    (1)引入Maven依赖      <!--mapStruct依赖--> <dependency> <groupId>org.mapstruct</groupId> <artifactId>mapstruct-jdk8</artifactId> <version>1.2.0.Final</version> </dependency> <dependency> <groupId>org.mapstruct</groupId> <artifactId>mapstruct-processor</artifactId> <scope>provided</scope> <version>1.2.0.Final</version> </dependency>   (2)使用     此处假设将两个实体对象(StudentInfo,classInfo)转换为一个DTO(StudentInfoDTO)      @Data public class StudentInfo { /** * 姓名 */ private

Activiti开发学习笔记

感情迁移 提交于 2020-12-30 14:02:12
概述介绍 最近公司有个大项目需要用到流程引擎平台。服务治理平台中要提供流程治理服务,所以小编在加紧学习工作流引擎的开发。 所以即将学习的是一个业务流程管理框架, 常见开源工作流引擎框架 :OSWorkFlow、jBPM(jboss business process management),Activiti工作流(是对jBPM升级)。流程开发框架一般我们称作为工作流框架. 为什么推荐使用activit这个框架? activit它是覆盖了业务流程管理、工作流、服务协作等领域的一个开源的、灵活的、易扩展的可执行流程语言框架。Activiti基于Apache许可的开源BPM平台,创始人Tom Baeyens是JBoss jBPM的项目架构师,它特色是提供了eclipse插件,开发人员可以通过插件直接绘画出业务。 另外我觉得它比JBPM相对来说好的一点就是:再简单,开发难度减低了。 技术框架-开发环境 语言:Java 8 IDE(JAVA):IDEA / Eclipse安装activit插件 IDE(前端):WebStorm 或者 IDEA 依赖管理:Maven 数据库:MySQL5.7 第一个例子 源码下载地址,复制下载即可 import org.activiti.engine.ProcessEngine; import org.activiti.engine.ProcessEngines

一键实现自动化部署(灰度发布)实践

走远了吗. 提交于 2020-12-30 10:30:16
在过去几年的DevOps的浪潮中,自动化、持续集成这两个概念早已深入人心(互联网技术人)。 比尔盖茨先生曾经都说过: “任何技术在一个业务中使用的第一条规则就是,将自动化应用到一个高效的操作上将会放大高效。第二条就是自动化应用到一个低效操作上,则放大了低效率。” 自动化部署也逐渐成为各中小型企业追求的方向,那么,今天民工哥就自动化部署的概述、自动化部署的工具、自动化部署的流程、自动化部署实践等4个方面,与大家一同来讨论、交流一下关于中小企业自动部署的问题。 1、自动化部署概述 1.1 什么是自动化部署 一句简单的话概括:部署的过程中所有的操作全部自动化,无需人工手工干预。 1.2 自动部署的好处 传统的部署方式如下: 运维人员手工使用Scp、Xftp等方式来传输数据 手工登录服务器执行git pull 、svn update等命令进行更新代码的操作 开发人员手工编译打包,然后通过内网传输给运维人员 运维人员通过rz上传的方式上传到目标服务器,然后,执行重命名原包、拷贝新包到目标目录,再执行服务应用重启命令完成整个部署过程 看似非常简单,也不是很麻烦,但是一旦项目多,部署频繁,这种情况下就会大大降低工作效率。民工哥之前工作中就有这类体验,公司的活动类项目高达100+,很多都是需要快速上线及下线、或者更新的,手工部署真的累。 传统的部署方式有以下的缺点: 整个过程都需要人员参与

maven war application setting up contextroot

微笑、不失礼 提交于 2020-12-30 06:32:41
问题 i am building a war application file using the below maven config, however when i start the application in tomcat the Context Root is set to "/CommerceApi-0.0.1-SNAPSHOT/" I want this to be set to "/api", any ideas?, below is the 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> <groupId

maven war application setting up contextroot

烈酒焚心 提交于 2020-12-30 06:32:34
问题 i am building a war application file using the below maven config, however when i start the application in tomcat the Context Root is set to "/CommerceApi-0.0.1-SNAPSHOT/" I want this to be set to "/api", any ideas?, below is the 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> <groupId

maven war application setting up contextroot

泪湿孤枕 提交于 2020-12-30 06:31:12
问题 i am building a war application file using the below maven config, however when i start the application in tomcat the Context Root is set to "/CommerceApi-0.0.1-SNAPSHOT/" I want this to be set to "/api", any ideas?, below is the 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> <groupId

Is there a way to trace origin of a property in maven pom?

一笑奈何 提交于 2020-12-30 06:01:59
问题 I have a complex maven project with a lot of managed dependencies, and have a little problem tracing versions of these dependencies. For example, spring libraries' version is guided by a property value {spring.version} - but I have no idea which project this property is coming from. Using mvn dependency:tree I can see the final result where all versions are resolved, but it does not go deep into detail to tell me where the winning dependency version is coming from, and why that version is a

Maven integration-test doesn't find my class in same package structure

人盡茶涼 提交于 2020-12-30 02:15:56
问题 Here are my files: Pom parent: <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"> <modelVersion>4.0.0</modelVersion> <groupId>my.group</groupId> <artifactId>my.artifact.pom</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <modules> <module>my.artifact.ws</module> </modules> <parent> <groupId>org.springframework.boot<

Maven integration-test doesn't find my class in same package structure

余生颓废 提交于 2020-12-30 02:05:31
问题 Here are my files: Pom parent: <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"> <modelVersion>4.0.0</modelVersion> <groupId>my.group</groupId> <artifactId>my.artifact.pom</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <modules> <module>my.artifact.ws</module> </modules> <parent> <groupId>org.springframework.boot<