当前位置: 首页 > news >正文

我的常见问题记录

1,maven在idea工具可以正常使用,在命令窗口执行出现问题

代码:

E:\test-hello\simple-test>mvn clean compile
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.consola:simple-test:jar:1.0-SNAPSHOT
[WARNING] 'dependencies.dependency.version' for org.junit.jupiter:junit-jupiter:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 14, column 22
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ----------------------< org.consola:simple-test >-----------------------
[INFO] Building simple-test 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.apache.maven.plugins:maven-clean-plugin:jar:2.5 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.146 s
[INFO] Finished at: 2021-01-06T16:03:38+08:00
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "dev" could not be activated because it does not exist.
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Cannot access nexus-aliyun (http://maven.aliyun.com/nexus/content/group
s/public) in offline mode and the artifact org.apache.maven.plugins:maven-clean-plugin:jar:2.5 has not been downloaded from it before. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

中文意思:

无法激活请求的配置文件“dev”,因为它不存在。
[错误]插件org.apache.maven网站.插件:maven资源插件:2.6或其某个依赖项无法解析:无法访问nexus aliyun(http://maven.aliyun.com/nexus/content/g
脱机模式下的组/公共)和工件org.apache.maven网站.插件:maven资源插件:jar:2.6版本以前没有下载过。->[帮助1]
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完全调试日志记录。

  1. 提示其实也非常的明显,无法访问地址....
  2. 我将这块注释掉就好了,这块镜像的私有仓库不能访问,这样就可以正常执行了,
  3. 使用命令的话要么在环境变量里配置setting.xml,要不就修改maven路径下的配置文件,一般是放在:C:\Users\简悦\.m2目录下边
  4. 我环境变量里没有配置,使用的是maven文件下的setting.xml

2, mvn archetype:generate构建项目是出现问题

错误码:

E:\test-hello>mvn archetype:generate
[WARNING]
[WARNING] Some problems were encountered while building the effective settings
[WARNING] expected START_TAG or END_TAG not TEXT (position: TEXT seen ...epo.rdc.aliyun.com/repository/129186-release-u560yC/</url>\n\ua0 \t\t\t<r... @351:8)  @ C:\Users\简悦\.m2\settings.xml, line 351, column 8
[WARNING]
[INFO] Scanning for projects...
[WARNING] The POM for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or one of its dependencies could not be resolved: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.apache.maven.plugins:maven-antrun-plugin:jar:1.3 has not been downloaded from it before.
[WARNING] The POM for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5 or one of its dependencies could not be resolved: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5 has not been downloaded from it before.
[WARNING] The POM for org.apache.maven.plugins:maven-dependency-plugin:jar:2.8 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-dependency-plugin:2.8: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.8 or one of its dependencies could not be resolved: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.apache.maven.plugins:maven-dependency-plugin:jar:2.8 has not been downloaded from it before.
[WARNING] The POM for org.apache.maven.plugins:maven-release-plugin:jar:2.5.3 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-release-plugin:2.5.3: Plugin org.apache.maven.plugins:maven-release-plugin:2.5.3 or one of its dependencies could not be resolved: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.apache.maven.plugins:maven-release-plugin:jar:2.5.3 has not been downloaded from it before.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.226 s
[INFO] Finished at: 2021-01-06T17:21:04+08:00
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "dev" could not be activated because it does not exist.
[ERROR] No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (F:\maven\Repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

具体错误信息的翻译:

无法激活请求的配置文件“dev”,因为它不存在。
[错误]在当前项目和插件组中找不到前缀“archetype”的插件[org.apache.maven网站.插件,网址:org.codehaus.mojo]可从存储库[本地(F:\maven\Repository),中心(https://repo.maven.apache.org/maven2)]->[帮助1]
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完全调试日志记录。
[错误]
[错误]有关错误和可能的解决方案的详细信息,请阅读以下文章

连接不到服务器,一方面是这个的问题,但是换了镜像地址还是不能访问,

使用maven debug的方式看一下具体的问题,win下使用cls进行清屏

执行命令:  mvn archetype:generate -X

[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Cannot access repo2 (https://mvnrepository.com/) in offline mode and the artifact org.apache.maven.plugins:maven-clean-plugin:jar:2.5 has not been downloaded from it before.
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Cannot access repo2 (https://mvnrepository.com/) in offline mode and the artifact org.apache.maven.plugins:maven-clean-plugin:jar:2.5 has not been downloaded from it before.at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve (DefaultPluginDependenciesResolver.java:131)at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor (DefaultMavenPluginManager.java:182)at org.apache.maven.plugin.DefaultBuildPluginManager.loadPlugin (DefaultBuildPluginManager.java:86)at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolveFromProject (DefaultPluginPrefixResolver.java:139)at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolveFromProject (DefaultPluginPrefixResolver.java:121)at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve (DefaultPluginPrefixResolver.java:85)at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.findPluginForPrefix (MojoDescriptorCreator.java:266)at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor (MojoDescriptorCreator.java:220)at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments (DefaultLifecycleTaskSegmentCalculator.java:104)at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments (DefaultLifecycleTaskSegmentCalculator.java:83)at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:89)at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke (Method.java:497)at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Cannot access repo2 (https://mvnrepository.com/) in offline mode and the artifact org.apache.maven.plugins:maven-clean-plugin:jar:2.5 has not been downloaded from it before.

翻译具体的信息

未能检索的插件描述符org.apache.maven网站.插件:maven clean plugin:2.5:插件org.apache.maven网站.插件:maven clean plugin:2.5或其依赖项之一无法解析:无法访问repo2(https://mvnrepository.com/)在离线模式和工件org.apache.maven网站.插件:maven clean plugin:震击器:2.5不曾以前下载过。
org.apache.maven网站.plugin.PluginResolutionException异常:插件org.apache.maven网站.插件:maven clean plugin:2.5或其依赖项之一无法解析:无法访问repo2(https://mvnrepository.com/)在离线模式和工件org.apache.maven网站.插件:maven clean plugin:震击器:2.5以前没有下载过。

这个应该是和我的配置有关,之前配置只能引用本地的包,不在网上下载

终于解决了,把下面这些镜像仓库都配置上,就不会有问题了

	<!-- 阿里云仓库 --><mirror><id>alimaven</id><mirrorOf>central</mirrorOf><name>aliyun maven</name><url>http://maven.aliyun.com/nexus/content/repositories/central/</url></mirror><!-- 中央仓库1 --><mirror><id>repo1</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://repo1.maven.org/maven2/</url></mirror><!-- 中央仓库2 --><mirror><id>repo2</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://repo2.maven.org/maven2/</url></mirror><mirror><id>repo3</id><mirrorOf>central</mirrorOf><name>Human Readable Name for this Mirror.</name><url>https://mvnrepository.com/</url></mirror>

 这边要选择一个快速创建的模板,上边有编号,我选择了自己创建直接回车.

添加坐标,建包,选版本号,最后确认

成功!!,主要还是镜像源的问题,多添加几个就好了,有的镜像源不稳定.

相关文章:

我的常见问题记录

1,maven在idea工具可以正常使用,在命令窗口执行出现问题 代码: E:\test-hello\simple-test>mvn clean compile [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for org.consola:simple-test:jar…...

Python 3.12 环境搭建(Windows版)

目录 1. 下载Python 3.12安装包2. 安装Python 3.123. 验证安装5. &#xff08;可选&#xff09;配置其他开发工具 在Windows系统中搭建Python 3.11环境&#xff0c;可以按照以下步骤进行&#xff0c;以确保过程清晰且详细&#xff1a; 1. 下载Python 3.12安装包 打开浏览器&a…...

植物大战僵尸杂交版如何手动修改金币钻石数

前言 最近在玩植物大战僵尸杂交版&#xff0c;非常好玩&#xff0c;但是刷钻石真的好慢&#xff01;只能在排山倒海里眼巴巴等着黄金吞噬者产钻石qaq 但是好歹咱是学CS的&#xff0c;怎会被这点困难难住&#xff01;挑战不用修改器手动修改配置文件&#xff01; 原参考文章&…...

Salia PLCC cPH2 远程命令执行漏洞(CVE-2023-46359)

漏洞描述 Salia PLCC cPH2 v1.87.0 及更早版本中存在一个操作系统命令注入漏洞&#xff0c;该漏洞可能允许未经身份验证的远程攻击者通过传递给连接检查功能的特制参数在系统上执行任意命令。 产品界面 fofa语法 "Salia PLCC" POC GET /connectioncheck.php?ip1…...

路由表操作

路由表&#xff08;Routing Table&#xff09;是网络设备&#xff08;如计算机、路由器、交换机等&#xff09;用来确定数据包传输路径的数据库。每当网络设备收到一个数据包时&#xff0c;它会查找路由表&#xff0c;决定将数据包转发到哪个网络接口或网关。下面介绍路由表的基…...

羊大师:拒绝心灵内耗:走向高效与平和

在繁忙的生活中&#xff0c;我们时常感到疲惫不堪&#xff0c;仿佛心灵被无形的枷锁束缚&#xff0c;这就是精神内耗。它让我们在思考、决策和行动中犹豫不决&#xff0c;消耗着我们的精力和时间&#xff0c;让我们无法专注于真正重要的事情。然而&#xff0c;我们有能力打破这…...

IOS Swift 从入门到精通:Swift 简介,Swift中变量和常量,Swift中字符串,Swift中整数和浮点数

文章目录 为什么选择 Swift如何创建变量和常量如何创建变量和常量为什么 Swift 有常量和变量?如何创建字符串为什么 Swift 需要多行字符串?如何存储整数如何存储十进制数为什么选择 Swift 编程语言有很多,但我认为你会非常喜欢学习 Swift。这部分是出于实际原因——你可以在…...

聚焦AIoT最后一公里:EasyCVR+AI视频技术在各领域的创新应用

随着5G、AI、边缘计算、物联网&#xff08;IoT&#xff09;、云计算等技术的快速发展&#xff0c;万物互联已经从概念逐渐转变为现实&#xff0c;全新的行业生态AIoT正在开启新时代。巨大的市场潜力与AI等新兴技术不断融合形成的庞大市场缺口&#xff0c;深度场景化应用落地诉求…...

怎样利用 Groovy 的元编程特性来创建自定义的 DSL(领域特定语言)?

使用Groovy的元编程特性可以方便地创建自定义的领域特定语言&#xff08;DSL&#xff09;。下面是一些利用Groovy元编程特性创建DSL的步骤&#xff1a; 定义DSL的语法结构&#xff1a;首先&#xff0c;您需要确定DSL的语法结构&#xff0c;包括关键字、表达式和语句的格式等。可…...

自动预约申购 i茅台工具完善

自动预约申购茅台工具 概述新的改变界面预览 概述 今天刷到一个windows自动刷茅台的工具&#xff0c;是用wpf实现的&#xff0c;看到作者最后是2023年更新的&#xff0c;评论中有好多人提出一些需求&#xff0c;刚才在学习wpf&#xff0c;就试着完善了一下。 工具下载&#x…...

Jitter Injection详解

一、定义与作用 Jitter Injection&#xff0c;即抖动注入&#xff0c;是一种在通信系统中人为地添加抖动的技术。该技术通过在发送端对数据包进行延迟和抖动调整&#xff0c;以实现对整个通信系统的时延和抖动的控制。其主要作用包括&#xff1a; 改善传输质量&#xff1a;通…...

基于SSM+Jsp的校园餐厅管理

开发语言&#xff1a;Java框架&#xff1a;ssm技术&#xff1a;JSPJDK版本&#xff1a;JDK1.8服务器&#xff1a;tomcat7数据库&#xff1a;mysql 5.7&#xff08;一定要5.7版本&#xff09;数据库工具&#xff1a;Navicat11开发软件&#xff1a;eclipse/myeclipse/ideaMaven包…...

无线麦克风哪个品牌音质最好,一文告诉你无线领夹麦克风怎么挑选

随着直播带货和个人视频日志&#xff08;Vlog&#xff09;文化的兴起&#xff0c;以及自媒体内容创作的蓬勃发展&#xff0c;我们见证了麦克风行业的迅猛发展。在这一浪潮中&#xff0c;无线领夹麦克风以其无与伦比的便携性和操作效率&#xff0c;迅速赢得了广大视频制作者的喜…...

Docker配置国内镜像加速-2

Docker 官方镜像仓库&#xff08;如 Docker Hub&#xff09;可能由于网络原因&#xff0c;在某些地区或网络环境下下载速度较慢。使用镜像加速可以从距离用户更近、网络条件更好的镜像服务器获取镜像&#xff0c;从而显著提高下载速度&#xff0c;节省时间。 1.测试是否安装 d…...

前后端分离项目面试总结

一&#xff1a;是否登录状态 服务端登录的时候&#xff0c;给分配一个session用于存储数据&#xff0c;同时将sessionID返回给浏览器&#xff0c;浏览器通过cookie把sessionID存储起来&#xff0c;下次访问时携带上&#xff0c;服务端就可以通过sessionID来确定用户是否登录。 …...

力扣刷题笔记

记录5-6月力扣刷题&#xff0c;持续刷题中~ 2024.05 15.三数之和 双指针或者哈希表&#xff0c;注意去重的操作要考虑仔细 class Solution { public:vector<vector<int>> threeSum(vector<int>& nums) {vector<vector<int>> result;sort…...

【JS逆向百例】某点数据逆向分析,多方法详解

前言 最近收到粉丝的私信&#xff0c;其在逆向某个站点时遇到了些问题&#xff0c;在查阅资料未果后&#xff0c;来询问K哥&#xff0c;K哥一向会尽力满足粉丝的需求。网上大多数分析该站点的教程已经不再适用&#xff0c;本文K哥将提供 3 种解决方案&#xff0c;对于 webpack…...

windows系统docker镜像导出

docker镜像导入导出(windows)_windowdocker下载镜像导出-CSDN博客https://blog.csdn.net/qq_22211217/article/details/93936363...

selenium前期准备

驱动地址&#xff1a; a. chromedriver:https://googlechromelabs.github.io/chrome-for-testing/ b. https://registry.npmmirror.com/binary.html?pathchromedriver/ selenium原理&#xff1a;Selenium 是一个用于自动化测试 Web 应用程序的工具集 a. 浏览器驱动&#xff0…...

[Python人工智能] 四十六.PyTorch入门 (1)环境搭建、神经网络普及和Torch基础知识

从本专栏开始,作者正式研究Python深度学习、神经网络及人工智能相关知识。前文讲解合如何利用keras和tensorflow构建基于注意力机制的CNN-BiLSTM-ATT-CRF模型,并实现中文实体识别研究。这篇文章将介绍PyTorch入门知识。前面我们的Python人工智能主要以TensorFlow和Keras为主,…...

CanFestival实战:从心跳、TPDO/RPDO配置到回调函数的完整链路解析

1. CanFestival协议栈基础认知 第一次接触CanFestival时&#xff0c;我也被各种专业术语搞得晕头转向。简单来说&#xff0c;它就是个开源的CANopen协议栈实现&#xff0c;专门用于嵌入式设备间的通信。就像两个说同一种方言的人能顺畅交流一样&#xff0c;CanFestival让不同厂…...

避坑指南:连接UR5实体机械臂与ROS MoveIt时,你最容易忽略的这3个配置细节

避坑指南&#xff1a;连接UR5实体机械臂与ROS MoveIt时&#xff0c;你最容易忽略的这3个配置细节 当仿真环境中的UR5机械臂完美运行MoveIt规划路径&#xff0c;却在切换到实体设备时遭遇连接失败&#xff0c;这种落差感往往源于几个隐蔽的配置陷阱。本文将从工业现场调试经验出…...

【力扣100题】48.乘积最大子数组

题目描述 给你一个整数数组 nums&#xff0c;请你找出数组中乘积最大的非空连续子数组&#xff08;该子数组中至少包含一个数字&#xff09;&#xff0c;并返回该子数组所对应的乘积。 测试用例的答案是一个 32 位整数。注意&#xff0c;一个只包含一个元素的数组的乘积就是这个…...

高效风扇控制完全指南:5步打造静音散热系统

高效风扇控制完全指南&#xff1a;5步打造静音散热系统 【免费下载链接】FanControl.Releases This is the release repository for Fan Control, a highly customizable fan controlling software for Windows. 项目地址: https://gitcode.com/GitHub_Trending/fa/FanContro…...

Cool-Request全局请求头配置终极指南:告别重复配置的API测试新体验

Cool-Request全局请求头配置终极指南&#xff1a;告别重复配置的API测试新体验 【免费下载链接】cool-request IDEA API、Java Method debug tools 项目地址: https://gitcode.com/gh_mirrors/co/cool-request 你是否厌倦了在每个API请求中重复配置相同的认证Token、内容…...

反向海淘代购集运系统三种搭建路径对比:自研、开源二开、SaaS

「技术、数据、接口、系统问题欢迎留言私信沟通」引言&#xff1a;标准业务架构# 系统演示、API测试控制台&#xff1a;http://console.open.onebound.cn/console/?iRookie用户层&#xff08;Web / App / 小程序&#xff09;↓ 网关层&#xff08;Nginx / Gateway&#xff09;…...

告别卡顿!CXPatcher:让Mac上的Windows游戏性能飙升的终极修复工具

告别卡顿&#xff01;CXPatcher&#xff1a;让Mac上的Windows游戏性能飙升的终极修复工具 【免费下载链接】CXPatcher A patcher to upgrade Crossover dependencies and improve compatibility 项目地址: https://gitcode.com/gh_mirrors/cx/CXPatcher 你是否曾在Mac上…...

STM32 HAL库实战:用CD74HC4067扩展16路模拟输入,附多路复用防干扰代码

STM32 HAL库实战&#xff1a;用CD74HC4067扩展16路模拟输入&#xff0c;附多路复用防干扰代码 在嵌入式开发中&#xff0c;资源有限的微控制器常常面临模拟输入通道不足的问题。以STM32F103C8T6为例&#xff0c;虽然性能强大&#xff0c;但ADC通道数量有限&#xff0c;难以满足…...

PX4飞控IMU频率上不去?手把手教你用MAVLink命令和SD卡配置文件,稳定提升到200Hz

PX4飞控IMU频率优化实战&#xff1a;从原理到200Hz稳定配置 引言 在无人机开发领域&#xff0c;IMU数据的高频采集对于飞行控制精度至关重要。许多开发者在使用PX4飞控时都遇到过这样的困扰&#xff1a;默认的50Hz IMU频率无法满足高动态飞行需求&#xff0c;而手动调整后要么…...

Go语言工厂模式:对象创建封装

Go语言工厂模式&#xff1a;对象创建封装 1. 简单工厂 type Product interface {Operation() string }type ConcreteProductA struct{}func (p *ConcreteProductA) Operation() string {return "Product A" }type ConcreteProductB struct{}func (p *ConcreteProduct…...