构建系统maven

1 前言

说真的,我是真的不想看构建了,因为真的太多了。又多又乱。Maven、Gradle、Make、CMake、Meson、Ninja,Android BP。。。感觉学不完,根本学不完。。。

但是没办法最近又要用一下Maven,所以咬着牙再简单整理一下。

安装:

sudo apt update
sudo apt install maven
mvn -v

功能:

功能说明
📦 依赖管理自动下载并管理第三方 JAR 包
🔨 项目构建编译 Java、打包成 JAR/WAR 等
📁 项目结构标准化统一目录结构,便于协作
🔁 生命周期管理统一管理编译、测试、打包、部署流程
📜 插件系统可通过插件扩展(如编译器、测试、部署)

核心就是POM(Project Object Model),一个XML配置文件。然后maven工具读取这个xml,根据上面的配置进行处理。

maven有三个生命周期

clean生命周期: clean
           |
default生命周期: validate → compile → test → package → verify → install → deploy

           |
site生命周期:site→ site-deploy 生成文档部署文档

所以典型命令是:

mvn clean package

这个命令就是首先清理之前的构建,再进行新的打包。

三个周期中最重要的是default周期,命令如下:

阶段(Phase)作用
compile编译源码
test编译并运行单元测试
package打包(生成 JAR/WAR)
install安装到本地仓库
deploy部署到远程仓库

2 一些实际例子

2.1 Hello

代码结构:

helloworld/
├── pom.xml
└── src/
    └── main/
        └── java/
            └── com/example/
                └── App.java

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>com.example</groupId><artifactId>helloworld</artifactId><version>1.0-SNAPSHOT</version><packaging>jar</packaging><name>HelloWorld</name><build><plugins><!-- 编译和运行入口 --><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.11.0</version><configuration><source>17</source><target>17</target></configuration></plugin></plugins></build>
</project>

App.java

package com.example;public class App {public static void main(String[] args) {System.out.println("Hello, Maven!");}
}

编译打包命令是mvn package

从log可以看出,maven自动下载的内容真的非常多。

ubuntu@VM-8-10-ubuntu:~/java$ mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.example:helloworld >-----------------------
[INFO] Building HelloWorld 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom (8.1 kB at 2.7 kB/s)...Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.5.0/plexus-utils-3.5.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/2.13.0/plexus-compiler-api-2.13.0.jar (27 kB at 4.9 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.13.0/plexus-compiler-manager-2.13.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.13.0/plexus-compiler-manager-2.13.0.jar (4.7 kB at 735 B/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/2.13.0/plexus-compiler-javac-2.13.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/2.13.0/plexus-compiler-javac-2.13.0.jar (23 kB at 2.4 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/commons-io/commons-io/2.6/commons-io-2.6.jar (215 kB at 21 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.5.0/plexus-utils-3.5.0.jar (267 kB at 16 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/ow2/asm/asm/9.4/asm-9.4.jar (122 kB at 6.3 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/com/thoughtworks/qdox/qdox/2.0.3/qdox-2.0.3.jar (334 kB at 13 kB/s)
[INFO] Changes detected - recompiling the module! :source
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file with javac [debug target 17] to target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ helloworld ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ubuntu/java/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.11.0:testCompile (default-testCompile) @ helloworld ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ helloworld ---
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.pom (1.5 kB at 3.9 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven/2.0.9/maven-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven/2.0.9/maven-2.0.9.pom (19 kB at 14 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/8/maven-parent-8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/8/maven-parent-8.pom (24 kB at 9.8 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/apache/4/apache-4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/apache/4/apache-4.pom (4.5 kB at 1.7 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-booter/2.12.4/surefire-booter-2.12.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-booter/2.12.4/surefire-booter-2.12.4.pom (3.0 kB at 2.4 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-api/2.12.4/surefire-api-2.12.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-api/2.12.4/surefire-api-2.12.4.pom (2.5 kB at 2.8 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.12.4/maven-surefire-common-2.12.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.12.4/maven-surefire-common-2.12.4.pom (5.5 kB at 4.8 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.1/maven-plugin-annotations-3.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.1/maven-plugin-annotations-3.1.pom (1.6 kB at 2.1 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-tools/3.1/maven-plugin-tools-3.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-tools/3.1/maven-plugin-tools-3.1.pom (16 kB at 8.4 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.9/maven-artifact-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.9/maven-artifact-2.0.9.pom (1.6 kB at 4.3 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.8/plexus-utils-3.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.8/plexus-utils-3.0.8.pom (3.1 kB at 4.3 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/3.2/plexus-3.2.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/3.2/plexus-3.2.pom (19 kB at 16 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/sonatype/spice/spice-parent/17/spice-parent-17.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/sonatype/spice/spice-parent/17/spice-parent-17.pom (6.8 kB at 11 kB/s)...Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/2.1/plexus-archiver-2.1.jar (184 kB at 19 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar (226 kB at 15 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/commons-lang/commons-lang/2.1/commons-lang-2.1.jar (208 kB at 9.8 kB/s)
[INFO] Building jar: /home/ubuntu/java/target/helloworld-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  04:17 min
[INFO] Finished at: 2025-06-01T22:14:24+08:00
[INFO] ------------------------------------------------------------------------

编译完成之后直接用java运行即可。

ubuntu@VM-8-10-ubuntu:~/java$ java -cp target/helloworld-1.0-SNAPSHOT.jar com.example.App
Hello, Maven!

2.2 添加第三方依赖(如 Gson)

在pom.xml中增加,并且指示编译成fat jar

<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.0http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.example</groupId><artifactId>helloworld</artifactId><version>1.0-SNAPSHOT</version><packaging>jar</packaging><name>HelloWorld</name><dependencies><dependency><groupId>com.google.code.gson</groupId><artifactId>gson</artifactId><version>2.10.1</version></dependency></dependencies><build><plugins><!-- Java 编译器插件 --><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.11.0</version><configuration><source>17</source><target>17</target></configuration></plugin><!-- 打包为 fat jar --><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-shade-plugin</artifactId><version>3.5.0</version><executions><execution><phase>package</phase><goals><goal>shade</goal></goals><configuration><transformers><transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"><mainClass>com.example.App</mainClass></transformer></transformers></configuration></execution></executions></plugin></plugins></build>
</project>

修改代码App.java

package com.example;
import com.google.gson.Gson;public class App {public static void main(String[] args) {Gson gson = new Gson();String json = gson.toJson(new int[]{1, 2, 3});System.out.println(json); // 输出:[1,2,3]}
}

之后编译时会自动下载新的依赖。

buntu@VM-8-10-ubuntu:~/java$ mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.example:helloworld >-----------------------
[INFO] Building HelloWorld 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1.pom (9.4 kB at 1.0 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/com/google/code/gson/gson-parent/2.10.1/gson-parent-2.10.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/com/google/code/gson/gson-parent/2.10.1/gson-parent-2.10.1.pom (13 kB at 5.2 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar (283 kB at 10.0 kB/s)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ helloworld ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/ubuntu/java/src/main/resources

运行:

ubuntu@VM-8-10-ubuntu:~/java$ java -cp target/helloworld-1.0-SNAPSHOT.jar com.example.App
[1,2,3]

2.3 多POM

项目结构:

myproject/
├── pom.xml  <-- 父项目
├── module-a/
│   └── pom.xml
└── module-b/
    └── pom.xml
父pom.xml

<modules><module>module-a</module><module>module-b</module>
</modules>

3 对比

最后列一下这一堆构建工具的对比。

特性/工具MavenGradleMakeCMakeMesonNinja
🔧 主要用于语言Java, KotlinJava, Kotlin, GroovyC/C++、FortranC/C++、CUDAC/C++、Python、Rust 等C/C++(需搭配生成器)
⚙️ 配置方式XMLGroovy/Kotlin DSL手写 MakefileCMakeLists.txt(专有语法)meson.build(Python-like).ninja(自动生成)
📦 依赖管理✅ 内置依赖管理(Maven Central)✅ 更灵活支持 Maven/Gradle 仓库❌ 无内置❌ 无,依赖手动或外部工具🔄 可接入 wrapdb、pkg-config❌ 无
🚀 性能较慢(XML解析、顺序执行)快(增量构建、多线程)慢(无并行、无依赖缓存)中等(生成效率好,构建慢)快(配合 Ninja 后端)极快(专注高效执行)
🔁 增量构建支持(但较粗)✅ 高级支持(内建缓存)❌ 无内建❌ 无内建✅ 支持✅ 由生成器控制
🧱 多模块支持✅ 优秀✅ 优秀❌ 需手动✅ 通过 add_subdirectory✅ 支持❌ 不支持
🔌 插件/扩展✅ 丰富插件系统✅ 插件和自定义 Task 多❌ 无插件✅ 一些模块少量内建模块❌ 无插件系统
📚 文档与社区📘 成熟,企业多📘 成熟,现代项目多📙 历史悠久📘 主流开源工具使用📘 新兴,GN、Gnome 使用📙 少,偏底层
📈 学习曲线中(XML配置略繁琐)中高(DSL强大但复杂)低(语法简单)中(语法非标准)低-中(简洁清晰)低(但手动写复杂)
🧩 常用场景Java EE、Spring Boot 项目Android、Kotlin、Java 项目Linux 内核、小项目Qt、Vulkan、LLVM 项目GNOME、系统包项目Chromium、LLVM 构建后端

选用指南

你是…推荐工具理由
Java 开发者Maven 或 GradleJava 生态标准构建工具
Android 开发者GradleAndroid Studio 默认工具,支持 DSL
C/C++ 项目开发者CMake + Ninja广泛支持 IDE,效率高
嵌入式或 Linux 驱动开发者Make简洁、可控,资源占用少
现代 C/C++ 工程、GNOME/GTKMeson + Ninja更快、更现代的构建系统
要最高性能的构建执行Ninja超快速构建执行器(需搭配生成器使用)

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

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

相关文章

UE5蓝图暴露变量,在游戏运行时修改变量实时变化、看向目标跟随目标Find Look at Rotation、修改玩家自身弹簧臂

UE5蓝图中暴露变量&#xff0c;类似Unity中public一个变量&#xff0c;在游戏运行时修改变量实时变化 1&#xff0c;添加变量 2&#xff0c;设置变量的值 3&#xff0c;点开小眼睛&#xff0c;此变量显示在编辑器中&#xff0c;可以运行时修改 看向目标跟随目标Find Look at R…

proteus美观与偏好设置

本文主要讲&#xff1a; 1 快捷键修改&#xff08;复制&#xff0c;粘贴&#xff0c;原件旋转&#xff09; 2 背景颜色替换 3 模块分区 一 快捷键的设置 设置复制粘贴和旋转三个 这里只是强调一下要分配 二 背景颜色 原来的背景颜色&#xff1a; 之后的背景颜色&#xff1a;…

Arm处理器调试采用jlink硬件调试器的命令使用大全

arm处理器分为cortex-a&#xff0c;cortex-r&#xff0c;cortex-m等3个内核系列&#xff0c;其中m系列一般是单片机&#xff0c;例如stm32等&#xff0c;工控用得挺多。a系列一般是消费娱乐产品等使用较多&#xff0c;例如手机处理器。r系列是高端实时类型处理器&#xff0c;价…

如何将图像插入 PDF:最佳工具比较

无论您是编辑营销材料、写报告还是改写原来的PDF文件&#xff0c;将图像插入 PDF 都至关重要。幸运的是&#xff0c;有多种在线和离线工具可以简化此任务。在本文中&#xff0c;我们将比较一些常用的 PDF 添加图像工具&#xff0c;并根据您的使用场景推荐最佳解决方案&#xff…

4、获取树莓派温度

打开终端&#xff0c;使用指令查看CPU温度&#xff0c;依次输入以下指令&#xff1a; 1.进入操作目录 cd /sys/class/thermal/thermal_zone0 2.查看温度 cat temp 树莓派的返回值 51540 返回值除以1000为当前CPU温度值。即当前温度为51摄氏度。

Leetcode 269. 火星词典

1.题目基本信息 1.1.题目描述 现有一种使用英语字母的外星文语言&#xff0c;这门语言的字母顺序与英语顺序不同。 给定一个字符串列表 words &#xff0c;作为这门语言的词典&#xff0c;words 中的字符串已经 按这门新语言的字母顺序进行了排序 。 请你根据该词典还原出此…

使用vscode进行c/c++开发的时候,输出报错乱码、cpp文件本身乱码的问题解决

使用vscode进行c/c开发的时候&#xff0c;输出报错乱码、cpp文件本身乱码的问题解决 问题描述解决方案问题1的解决方案问题2解决方案 问题描述 本篇文章解决两个问题&#xff1a; 1.当cpp文件出现错误的时候&#xff0c;编译时报错&#xff0c;但是报错内容缺是乱码&#xff0…

现代数据湖架构全景解析:存储、表格式、计算引擎与元数据服务的协同生态

本文全面剖析现代数据湖架构的核心组件,深入探讨对象存储(OSS/S3)、表格式(Iceberg/Hudi/Delta Lake)、计算引擎(Spark/Flink/Presto)及元数据服务(HMS/Amoro)的协作关系,并提供企业级选型指南。 一、数据湖架构演进与核心价值 数据湖架构演进历程 现代数据湖核心价…

主数据编码体系全景解析:从基础到高级的编码策略全指南

在数字化转型的浪潮中&#xff0c;主数据管理&#xff08;MDM&#xff09;已成为企业数字化转型的基石。而主数据编码作为MDM的核心环节&#xff0c;其设计质量直接关系到数据管理的效率、系统的可扩展性以及业务决策的准确性。本文将系统性地探讨主数据编码的七大核心策略&…

Mac电脑上本地安装 MySQL并配置开启自启完整流程

文章目录 一、mysql安装1.1 使用 Homebrew 安装&#xff08;推荐&#xff09;1.2 手动下载 MySQL 社区版1.3 常见问题1.4 图形化管理工具&#xff08;可选&#xff09; 二、Mac 上配置 MySQL 开机自动启动2.1 使用 launchd 系统服务&#xff08;原生支持&#xff09;2.2 通过 H…

SQL Server 事务详解:概念、特性、隔离级别与实践

一、事务的基本概念 事务&#xff08;Transaction&#xff09;是数据库操作的基本单位&#xff0c;它是由一组SQL语句组成的逻辑工作单元。事务具有以下关键特性&#xff0c;通常被称为ACID特性&#xff1a; ​​原子性&#xff08;Atomicity&#xff09;​​&#xff1a;事务…

【C语言极简自学笔记】项目开发——扫雷游戏

一、项目概述 1.项目背景 扫雷是一款经典的益智游戏&#xff0c;由于它简单而富有挑战性的玩法深受人们喜爱。在 C 语言学习过程中&#xff0c;开发扫雷游戏是一个非常合适的实践项目&#xff0c;它能够综合运用 C 语言的多种基础知识&#xff0c;如数组、函数、循环、条件判…

unix/linux source 命令,其发展历程详细时间线、由来、历史背景

追本溯源,探究技术的历史背景和发展脉络,能够帮助我们更深刻地理解其设计哲学和存在的意义。source 命令(或者说它的前身和等效形式)的历史,与 Unix Shell 本身的发展紧密相连。 让我们一起踏上这段追溯之旅,探索 source 命令的由来和发展历程。 早期 Unix Shell 与命令…

720全景展示:VR全景的技术原理及应用

VR720全景展示&#xff1a;技术原理及应用探索 720全景技术&#xff0c;作为当前全球范围内迅速崛起流行的视觉新技术&#xff0c;为用户带来了全新的真实现场感和交互式的体验。凭借全方位、无死角的视觉展示特性&#xff0c;在VR&#xff08;虚拟现实&#xff09;领域中得到…

Python爬虫实战:研究Requests-HTML库相关技术

1. 引言 1.1 研究背景与意义 随着互联网数据量的爆炸式增长,网络爬虫已成为数据获取的重要工具,广泛应用于市场调研、舆情分析、学术研究等领域。传统爬虫技术在面对现代 JavaScript 动态渲染网页时面临挑战,而 Requests-HTML 库通过集成浏览器渲染引擎,为解决这一问题提…

VectorStore 组件深入学习与检索方法

考虑到目前市面上的向量数据库众多&#xff0c;每个数据库的操作方式也无统一标准&#xff0c;但是仍然存在着一些公共特征&#xff0c;LangChain 基于这些通用的特征封装了 VectorStore 基类&#xff0c;在这个基类下&#xff0c;可以将方法划分成 6 种&#xff1a; 相似性搜…

【PyQt5】从零开始的PyQt5 - QLabel篇

从零开始的PyQt5 - QLabel篇 引言一、简述二、例程2.1 显示到QWidget窗口上2.2 重新设置Label大小和对齐方式2.3 添加内容&#xff0c;设置边框2.4 显示富文本 三、参考 引言 QLabel主要用于显示文本或图像&#xff0c;不提供用户交互功能。本文主要简述PyQt5中的QLabel以及展…

论文略读:Uncertainty-Aware Graph Structure Learning

WWW 2025 1 intro 传统GNN忽视了图结构自身存在的缺陷: 图结构常常会出现错误边和缺失边等数据问题&#xff0c;从而限制模型的效果 —>为了解决上述问题&#xff0c;产生了图结构学习算法&#xff08;GSL&#xff09; 目的在于优化结点连接和边权重来生成新的邻接矩阵主流…

HCIE-STP复习

文章目录 STP STP &#x1f3e1;作者主页&#xff1a;点击&#xff01; &#x1f916;Datacom专栏&#xff1a;点击&#xff01; ⏰️创作时间&#xff1a;2025年05月31日13点17STP通过三要素选举消除环路&#xff1a; 根桥&#xff08;BID最小&#xff0c;建议设优先级为0&…

leetcode17.电话号码的字母组合:字符串映射与回溯的巧妙联动

一、题目深度解析与字符映射逻辑 题目描述 给定一个仅包含数字 2-9 的字符串 digits&#xff0c;返回所有它能表示的字母组合。数字与字母的映射关系如下&#xff08;与电话按键相同&#xff09;&#xff1a; 2: "abc", 3: "def", 4: "ghi", …