Java生成二维码之Graphics2D自定义码眼形状

news2024/9/24 23:21:16

Java 2D API 提供了几个类来定义常见的几何对象,例如点、直线、曲线和矩形。这些几何类是 java.awt.geom包的一部分。通过熟练使用Graphics2D类,可以绘制出任意类型的图形。

官网教程地址:https://docs.oracle.com/javase/tutorial/2d/geometry/index.html

先看效果,由于审核原因,此二维码的左下角的码眼内框没有生成。

 通过效果图可以看出目前已经实现了11种组合码眼的绘制,都是通过Java中Graphics2D绘制实现,下面我们针对每种码眼的形状绘制形成实例代码。我们按照效果图先后顺序以此说明生成方式。

  • 绘制方形二维码码眼

代码实例:

package com.faea.test;

import javax.swing.*;
import java.awt.*;

/**
 * 生成方形
 *
 * @author liuchao
 * @date 2023/4/11
 */
public class CodeCreateTestOne extends JPanel {
    @Override
    public void paintComponent(Graphics g) {
        Graphics2D graphics2D = (Graphics2D) g;
        graphics2D.setColor(Color.RED);
        //尺寸
        int multiple = 30;
        //X坐标
        int x = 50;
        //Y坐标
        int y = 50;
        BasicStroke stroke = new BasicStroke(multiple);
        graphics2D.setStroke(stroke);
        int offset = multiple / 2;
        graphics2D.drawRect(x + offset,
                y + offset, multiple, multiple);
    }

    public static void main(String[] args) {
        JFrame frame = new JFrame("Rounded Rectangle");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(new CodeCreateTestOne());
        frame.setSize(400, 400);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }

}

  

  • 绘制圆形二维码码眼

实例代码:

package com.faea.test;

import javax.swing.*;
import java.awt.*;

/**
 * 生成圆形(粗边)
 *
 * @author liuchao
 * @date 2023/4/11
 */
public class CodeCreateTestTwo extends JPanel {
    @Override
    public void paintComponent(Graphics g) {
        Graphics2D graphics2D = (Graphics2D) g;
        graphics2D.setColor(Color.RED);
        //尺寸
        int multiple = 30;
        //X坐标
        int x = 50;
        //Y坐标
        int y = 50;
        BasicStroke stroke = new BasicStroke(multiple);
        graphics2D.setStroke(stroke);

        int offset = multiple / 2;
        int size = multiple / 4;
        graphics2D.drawOval(x + offset, y + offset, size, size);


    }

    public static void main(String[] args) {
        JFrame frame = new JFrame("circle_thick_edge");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(new CodeCreateTestTwo());
        frame.setSize(200, 200);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }

}

效果:

  • 绘制圆角矩形二维码码眼

代码:

package com.faea.test;

import javax.swing.*;
import java.awt.*;

/**
 * 生成圆角矩形
 *
 * @author liuchao
 * @date 2023/4/11
 */
public class CodeCreateTestThree extends JPanel {
    @Override
    public void paintComponent(Graphics g) {
        Graphics2D graphics2D = (Graphics2D) g;
        graphics2D.setColor(Color.RED);
        //尺寸
        int multiple = 30;
        //X坐标
        int x = 50;
        //Y坐标
        int y = 50;

        BasicStroke stroke = new BasicStroke(multiple / 4);
        graphics2D.setStroke(stroke);


        graphics2D.drawRoundRect(x, y, multiple,
                multiple, multiple / 2, multiple / 2);


    }

    public static void main(String[] args) {
        JFrame frame = new JFrame("rounded_thick_edge");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(new CodeCreateTestThree());
        frame.setSize(200, 200);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }

}

 效果:

  • 绘制方形圆点二维码码眼

代码:

package com.faea.test;

import com.alibaba.fastjson.JSON;
import com.faea.qrcode.model.CodeEyeOutDrawModel;

import javax.swing.*;
import java.awt.*;

/**
 * 生成圆点
 *
 * @author liuchao
 * @date 2023/4/11
 */
public class CodeCreateTestFour extends JPanel {
    @Override
    public void paintComponent(Graphics g) {
        Graphics2D graphics2D = (Graphics2D) g;
        graphics2D.setColor(Color.RED);
        String json = "{'eyePosition':'LEFT_TOP','holdPointNum':7,'multiple':8,'pointList':[{'x':0,'y':0},{'x':1,'y':0},{'x':2,'y':0},{'x':3,'y':0},{'x':4,'y':0},{'x':5,'y':0},{'x':6,'y':0},{'x':0,'y':1},{'x':6,'y':1},{'x':0,'y':2},{'x':6,'y':2},{'x':0,'y':3},{'x':6,'y':3},{'x':0,'y':4},{'x':6,'y':4},{'x':0,'y':5},{'x':6,'y':5},{'x':0,'y':6},{'x':1,'y':6},{'x':2,'y':6},{'x':3,'y':6},{'x':4,'y':6},{'x':5,'y':6},{'x':6,'y':6}]}";
        CodeEyeOutDrawModel model = JSON.parseObject(json, CodeEyeOutDrawModel.class);
        int multiple = model.getMultiple();
        for (Point point : model.getPointList()) {
            int x = 20 + (int) point.getX() * model.getMultiple();
            int y = 20 + (int) point.getY() * model.getMultiple();
            graphics2D.fillOval(x, y, multiple, multiple);
        }

    }

    public static void main(String[] args) {
        JFrame frame = new JFrame("round_dot");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(new CodeCreateTestFour());
        frame.setSize(200, 200);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }

}

效果:

  •  绘制方形小方点二维码码眼

代码:

package com.faea.test;

import com.alibaba.fastjson.JSON;
import com.faea.qrcode.model.CodeEyeOutDrawModel;

import javax.swing.*;
import java.awt.*;

/**
 * 生成方点
 *
 * @author liuchao
 * @date 2023/4/11
 */
public class CodeCreateTestFive extends JPanel {
    @Override
    public void paintComponent(Graphics g) {
        Graphics2D graphics2D = (Graphics2D) g;
        graphics2D.setColor(Color.RED);
        String json = "{'eyePosition':'LEFT_TOP','holdPointNum':7,'multiple':8,'pointList':[{'x':0,'y':0},{'x':1,'y':0},{'x':2,'y':0},{'x':3,'y':0},{'x':4,'y':0},{'x':5,'y':0},{'x':6,'y':0},{'x':0,'y':1},{'x':6,'y':1},{'x':0,'y':2},{'x':6,'y':2},{'x':0,'y':3},{'x':6,'y':3},{'x':0,'y':4},{'x':6,'y':4},{'x':0,'y':5},{'x':6,'y':5},{'x':0,'y':6},{'x':1,'y':6},{'x':2,'y':6},{'x':3,'y':6},{'x':4,'y':6},{'x':5,'y':6},{'x':6,'y':6}]}";
        CodeEyeOutDrawModel model = JSON.parseObject(json, CodeEyeOutDrawModel.class);
        int multiple = model.getMultiple();
        int offsetX = multiple / 8, offsetY = multiple / 8;
        int width = multiple - offsetX * 2, height = multiple - offsetY * 2;
        for (Point point : model.getPointList()) {
            int x = 20 + (int) point.getX() * model.getMultiple();
            int y = 20 + (int) point.getY() * model.getMultiple();
            graphics2D.fillRect(x + offsetX, y + offsetY, width, height);
        }

    }

    public static void main(String[] args) {
        JFrame frame = new JFrame("square_dot");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(new CodeCreateTestFive());
        frame.setSize(200, 200);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }

}

  • 绘制单边圆角二维码码眼

代码:

package com.faea.test;

import com.alibaba.fastjson.JSON;
import com.faea.qrcode.model.CodeEyeOutDrawModel;

import javax.swing.*;
import java.awt.*;
import java.awt.geom.Path2D;

/**
 * 生成方点
 *
 * @author liuchao
 * @date 2023/4/11
 */
public class CodeCreateTestSix extends JPanel {
    @Override
    public void paintComponent(Graphics g) {
        Graphics2D graphics2D = (Graphics2D) g;
        graphics2D.setColor(Color.RED);

        String json = "{'eyePosition':'LEFT_TOP','holdPointNum':7,'multiple':8,'pointList':[{'x':0,'y':0},{'x':1,'y':0},{'x':2,'y':0},{'x':3,'y':0},{'x':4,'y':0},{'x':5,'y':0},{'x':6,'y':0},{'x':0,'y':1},{'x':6,'y':1},{'x':0,'y':2},{'x':6,'y':2},{'x':0,'y':3},{'x':6,'y':3},{'x':0,'y':4},{'x':6,'y':4},{'x':0,'y':5},{'x':6,'y':5},{'x':0,'y':6},{'x':1,'y':6},{'x':2,'y':6},{'x':3,'y':6},{'x':4,'y':6},{'x':5,'y':6},{'x':6,'y':6}]}";
        CodeEyeOutDrawModel model = JSON.parseObject(json, CodeEyeOutDrawModel.class);
        BasicStroke stroke = new BasicStroke(model.getMultiple());
        graphics2D.setStroke(stroke);

        int x = 20 + (int) model.getPointList().get(0).getX() * model.getMultiple();
        int y = 20 + (int) model.getPointList().get(0).getY() * model.getMultiple();
        int width = model.getHoldPointNum() * model.getMultiple() - model.getMultiple() / 2;
        int offset = model.getMultiple() / 4;
        x += offset;
        y += offset;
        int height = width;
        int arcWidth = width / 2;
        int arcHeight = arcWidth;
        Path2D path = new Path2D.Double();
        path.moveTo(x, y + arcHeight);
        path.quadTo(x, y, x + arcWidth, y);
        path.lineTo(x + width, y);
        path.lineTo(x + width, y + height);
        path.lineTo(x, y + height);
        path.closePath();
        graphics2D.draw(path);

    }

    public static void main(String[] args) {
        JFrame frame = new JFrame("single_sided_fillet");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(new CodeCreateTestSix());
        frame.setSize(200, 200);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }

}

 

  • 绘制眼睛形状二维码码眼

代码:

package com.faea.test;

import com.alibaba.fastjson.JSON;
import com.faea.qrcode.model.CodeEyeOutDrawModel;

import javax.swing.*;
import java.awt.*;
import java.awt.geom.Path2D;

/**
 * 生成眼睛形状
 *
 * @author liuchao
 * @date 2023/4/11
 */
public class CodeCreateTestSeven extends JPanel {
    @Override
    public void paintComponent(Graphics g) {
        Graphics2D graphics2D = (Graphics2D) g;
        graphics2D.setColor(Color.RED);

        String json = "{'eyePosition':'LEFT_TOP','holdPointNum':7,'multiple':8,'pointList':[{'x':0,'y':0},{'x':1,'y':0},{'x':2,'y':0},{'x':3,'y':0},{'x':4,'y':0},{'x':5,'y':0},{'x':6,'y':0},{'x':0,'y':1},{'x':6,'y':1},{'x':0,'y':2},{'x':6,'y':2},{'x':0,'y':3},{'x':6,'y':3},{'x':0,'y':4},{'x':6,'y':4},{'x':0,'y':5},{'x':6,'y':5},{'x':0,'y':6},{'x':1,'y':6},{'x':2,'y':6},{'x':3,'y':6},{'x':4,'y':6},{'x':5,'y':6},{'x':6,'y':6}]}";
        CodeEyeOutDrawModel model = JSON.parseObject(json, CodeEyeOutDrawModel.class);
        BasicStroke stroke = new BasicStroke(model.getMultiple());
        graphics2D.setStroke(stroke);

        int x = 20 + (int) model.getPointList().get(0).getX() * model.getMultiple();
        int y = 20 + (int) model.getPointList().get(0).getY() * model.getMultiple();
        int width = model.getHoldPointNum() * model.getMultiple() - model.getMultiple() / 2;
        int offset = model.getMultiple() / 4;
        x += offset;
        y += offset;
        int height = width;
        int arcWidth = width / 2;
        int arcHeight = arcWidth;

        Path2D path = new Path2D.Double();
        path.moveTo(x, y + height - arcHeight);
        path.lineTo(x, y);
        path.lineTo(x + width - arcWidth, y);
        path.quadTo(x + width, y, x + width, y + arcHeight);
        path.lineTo(x + width, y + height);
        path.lineTo(x + arcWidth, y + height);
        path.quadTo(x, y + height, x, y + height - arcHeight);
        path.closePath();
        graphics2D.draw(path);

    }

    public static void main(String[] args) {
        JFrame frame = new JFrame("eye_shape");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(new CodeCreateTestSeven());
        frame.setSize(200, 200);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }

}

 

  • 绘制气泡形状二维码码眼

代码实例:

package com.faea.test;

import com.alibaba.fastjson.JSON;
import com.faea.qrcode.constants.CodeEyePositionEnum;
import com.faea.qrcode.model.CodeEyeOutDrawModel;

import javax.swing.*;
import java.awt.*;
import java.awt.geom.Path2D;

/**
 * 生成气泡形状
 *
 * @author liuchao
 * @date 2023/4/11
 */
public class CodeCreateTestNine extends JPanel {
    @Override
    public void paintComponent(Graphics g) {
        Graphics2D graphics2D = (Graphics2D) g;
        graphics2D.setColor(Color.RED);

        String json = "{'eyePosition':'LEFT_TOP','holdPointNum':7,'multiple':8,'pointList':[{'x':0,'y':0},{'x':1,'y':0},{'x':2,'y':0},{'x':3,'y':0},{'x':4,'y':0},{'x':5,'y':0},{'x':6,'y':0},{'x':0,'y':1},{'x':6,'y':1},{'x':0,'y':2},{'x':6,'y':2},{'x':0,'y':3},{'x':6,'y':3},{'x':0,'y':4},{'x':6,'y':4},{'x':0,'y':5},{'x':6,'y':5},{'x':0,'y':6},{'x':1,'y':6},{'x':2,'y':6},{'x':3,'y':6},{'x':4,'y':6},{'x':5,'y':6},{'x':6,'y':6}]}";
        CodeEyeOutDrawModel model = JSON.parseObject(json, CodeEyeOutDrawModel.class);
        BasicStroke stroke = new BasicStroke(model.getMultiple());
        graphics2D.setStroke(stroke);

        int x = 20 + (int) model.getPointList().get(0).getX() * model.getMultiple();
        int y = 20 + (int) model.getPointList().get(0).getY() * model.getMultiple();
        int width = model.getHoldPointNum() * model.getMultiple() - model.getMultiple() / 2;
        int offset = model.getMultiple() / 4;
        x += offset;
        y += offset;
        int height = width;
        int arcWidth = width / 2;
        int arcHeight = arcWidth;

        Path2D path = new Path2D.Double();
        path.moveTo(x, y + arcHeight);
        //左上角
        if (CodeEyePositionEnum.LEFT_TOP.equals(model.getEyePosition())) {
            path.quadTo(x, y, x + arcWidth, y);
            path.lineTo(x + width, y);
            path.lineTo(x + width, y + height - arcHeight);
            path.quadTo(x + width, y + height, x + width - arcWidth, y + height);
            path.lineTo(x + arcWidth, y + height);
            path.quadTo(x, y + height, x, y + height - arcHeight);
            //右上角
        } else if (CodeEyePositionEnum.RIGHT_TOP.equals(model.getEyePosition())) {
            path.lineTo(x, y);
            path.lineTo(x + width - arcWidth, y);
            path.quadTo(x + width, y, x + width, y + arcHeight);
            path.lineTo(x + width, y + height - arcHeight);
            path.quadTo(x + width, y + height, x + width - arcWidth, y + height);
            path.lineTo(x + arcWidth, y + height);
            path.quadTo(x, y + height, x, y + height - arcHeight);

            //左下角
        } else {
            path.quadTo(x, y, x + arcWidth, y);
            path.lineTo(x + width - arcWidth, y);
            path.quadTo(x + width, y, x + width, y + arcHeight);
            path.lineTo(x + width, y + height);
            path.lineTo(x + arcWidth, y + height);
            path.quadTo(x, y + height, x, y + height - arcHeight);

        }
        path.closePath();
        graphics2D.draw(path);

    }

    public static void main(String[] args) {
        JFrame frame = new JFrame("air_bubble");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(new CodeCreateTestNine());
        frame.setSize(200, 200);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }

}

 以上就是各种码眼绘制的代码实例,通过码外眼+码内眼 不同形状组合可以形成是几十种不同样式的码眼,如果朋友们还有其他的样式可以留言沟通,小编也继续学习扩展下。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/430742.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【虹科案例】固态量子发射器——虹科数字化仪用于控制钻石色心中的脉冲序列

前言 钻石的色心是晶格中的缺陷,其中碳原子被不同种类的原子取代,相邻的晶格位置是空的。由于其明亮的单光子发射和光学可访问的自旋,色心可以成为未来量子信息处理和量子网络的有前途的固态量子发射器。 实现自旋量子比特和相干光子纠缠的两…

基于RK3568的Linux驱动开发—— GPIO知识点(二)

authordaisy.skye的博客_CSDN博客-嵌入式,Qt,Linux领域博主系列基于RK3568的Linux驱动开发——GPIO知识点(一)_daisy.skye的博客-CSDN博客 查看goio使用情况 cat /sys/kernel/debug/gpio 1|rk3568_r:# cat /sys/kernel/debug/gpio gpiochip0: GPIOs 0-3…

English Learning - L2-14 英音地道语音语调 重音技巧 2023.04.10 周一

English Learning - L2-14 英音地道语音语调 重音技巧 2023.04.10 周一课前热身重音日常表达节奏单词全部重读的句子间隔时间非重读单词代词和缩约词助动词声临其境语调预习课前热身 学习目标 重音 重弱突出,重音突出核心表达的意思 重音是落在重读单词上&#x…

Vue3简介

1.Vue3简介 2020年9月18日,Vue.js发布3.0版本,代号:One Piece(海贼王)耗时2年多、[2600次提交](https://github.com/vuejs/vue-next/graphs/commit-activity)、[30个RFC](https://github.com/vuejs/rfcs/tree/master/…

机器学习 | 实验四:正则化

⭐对应笔记:正则化 📚描述 在这个练习中,你将实现正则化的线性回归和正则化的逻辑回归。 📚数据 这个数据包包含两组数据,一组用于线性回归,另一个用于逻辑回归。还包含一个名为"map_feature"…

Win11快速打开便签和使用技巧分享

Win11快速打开便签和使用技巧分享。Win11系统中为用户提供了一个非常实用的系统组件,就是便签功能,使用这个功能可以帮助我们便捷的进行一些重要内容的记录。那么如何去开启开启这个程序来使用呢?来看看以下的详情分享吧。 详细分享&#xff…

docker介绍与安装

目录 Docker docker概述 容器化优点 虚拟化架构 docker与虚拟机区别 docker三大核心概念 docker运行的原理 Docker安装 查看 docker 版本信息 docker 信息查看 Docker docker概述 Docker是一个开源的应用容器引擎,基于go语言开发并遵循了apache2.0协议开…

Perceiver Perceiver IO: 人工智能的多功能工具

如今人工智能系统使用的大多数架构都是专业的。2D 残差网络可能是处理图像的一个很好的选择,但它最多只能用于其他类型的数据,比如自动驾驶汽车中使用的激光雷达信号或机器人中使用的 torques。此外,标准架构在设计时通常只考虑一项任务&…

Seal AppManager发布:基于平台工程理念的全新应用部署管理体验

4月12日,数澈软件Seal(以下简称“Seal”)宣布推出新一代应用统一部署管理平台 Seal AppManager,采用平台工程的理念,降低基础设施操作的复杂度为研发和运维团队提供易用、一致的应用管理和部署体验,进而提升…

SpringMVC使用介绍-快速入门

文章目录SpringMVCSpringMVC快速入门bean加载控制SpringMVC SpringMVC快速入门 SpringMVC是一种基于Java实现MVC模型的轻量级Web框架 优点 使用简单,开发便捷(相比于Servlet) 灵活性强 使用SpringMVC技术开发web程序流程: 1.创建web工程&a…

[牛客复盘] 牛客小白月赛70 20230407

[牛客复盘] 牛客小白月赛70 20230407 一、本周周赛总结A、 小d和答案修改2. 思路分析3. 代码实现B、小d和图片压缩1. 题目描述2. 思路分析3. 代码实现C、小d和超级泡泡堂1. 题目描述2. 思路分析3. 代码实现D、小d和孤独的区间1. 题目描述2. 思路分析3. 代码实现E、小d的博弈1. …

C语言内存函数介绍以及实现

目录 前言 一:内存拷贝函数 (1)memcpy( )函数 (2)memove( )函数 二:内存比较函数 三:内存设置函数 前言 本文介绍的函数的函数声明都在头文件string.h中。 一:内存拷贝函数 (1)memcpy( )函数 函数声明:void* memcpy(void* dest,const void* src,size_t num) 作用…

【python】制作一个简单的界面,有手就行的界面~

目录前言准备工作试手小案例开始我们今天的案例教学尾语 💝前言 嗨喽~大家好呀,这里是魔王呐 ❤ ~! ttkbootstrap 是一个基于 tkinter 的界面美化库, 使用这个工具可以开发出类似前端 bootstrap 风格的 tkinter 桌面程序。 ttkbootstrap 不…

8:00面试,8:05就出来了 ,问的实在是太变态了···

从外包出来,没想到算法死在另一家厂子。 自从加入这家公司,每天都在加班,钱倒是给的不少,所以也就忍了。没想到12月一纸通知,所有人不许加班,薪资直降30%,顿时有吃不起饭的赶脚。 好在有个兄弟…

Yolov5_DeepSort_Pytorch:基于 Yolov5 + Deep Sort 的实时多目标跟踪器

Yolov5_DeepSort_Pytorch:基于 Yolov5 Deep Sort 的实时多目标跟踪器 原创 视界君 Python视界 昨天 Python视界分享 原文地址:Yolov5_DeepSort_Pytorch:基于 Yolov5 Deep Sort 的实时多目标跟踪器 简介 该存储库包含一个两阶段跟踪器。…

linux主机设置主机间免密登录

举例:想要在A主机免密登录到B主机; 此文案前提是linux都安装了ssh服务,可以使用systemctl status sshd 查看ssh状态 1、使用任意用户在A主机上执行ssh-keygen -t rsa 所有提示均按回车默认,会在当前目录生成.ssh文件夹&#xff0…

实战-高并发下的读/写

文章目录高并发下的读/写高并发读业务场景高并发写业务场景同时高并发读和高并发写业务场景高并发读策略一:加缓存/读副本方案一:本地缓存/集中式缓存方案二:数据库层面的改变,Master/Slave,使用主从完成读写分离方案三…

MySQL学习笔记:count(1)、count(*)、count(字段)的区别

关于数据库中行数统计,无论是MySQL还是Oracle,都有一个函数可以使用,那就是COUNT()。 但是,就是这个常用的COUNT函数,却暗藏着很多玄机,尤其是在面试的时候,一不小心就会…

JUC多并发编程 CompletableFuture

Future 接口理论 Future 接口(FutureTask 实现类): 定义了操作异步任务执行一些方法,如获取异步任务的执行结果、取消任务的执行、判断任务是否被取消、判断任务执行是否完毕等 方法图: 类图: 代码示例: import ja…

Maven聚合开发【实例详解---5555字】

目录 一、Maven聚合开发_继承关系 二、Maven聚合案例 1. 搭建dao模块 2. 搭建service模块 3. 搭建web模块 4. 运行项目 一、Maven聚合开发_继承关系 Maven中的继承是针对于父工程和子工程。父工程定义的依赖和插件子工程可以直接使用。注意父工程类型一定为POM类型工程…