当前位置: 首页 > 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>

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

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

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

相关文章:

  • 学习C++第二天
  • Springboot微服务整合缓存的时候报循环依赖的错误 两种解决方案
  • 深入理解go语言反射机制
  • 电压互感器在线监测的原理
  • AI 大模型企业应用实战(10)-LLMs和Chat Models
  • AI大模型企业应用实战(14)-langchain的Embedding
  • Qt异常处理
  • 软件测试过程中用接口怎么将web系统的多页数据展示在1页
  • 罗盘时钟lua迷你世界
  • Parallels Desktop 19 for mac破解版安装激活使用指南
  • ArcgisEngine 释放内存案例
  • React 中的 ErrorBoundary
  • 数据分析:置换检验Permutation Test
  • 【JavaEE】Spring Web MVC详解
  • 【ajax核心05】宏任务与微任务
  • 77. Combinations
  • angular组件开发
  • JSDuck 与 AngularJS 融合技巧
  • Linux快速复制或删除大量小文件
  • Making An Indicator With Pure CSS
  • SegmentFault 社区上线小程序开发频道,助力小程序开发者生态
  • Spark学习笔记之相关记录
  • Vue--数据传输
  • 对话:中国为什么有前途/ 写给中国的经济学
  • 基于Javascript, Springboot的管理系统报表查询页面代码设计
  • 面试遇到的一些题
  • 推荐一款sublime text 3 支持JSX和es201x 代码格式化的插件
  • 新手搭建网站的主要流程
  • 一道面试题引发的“血案”
  • 应用生命周期终极 DevOps 工具包
  • Redis4.x新特性 -- 萌萌的MEMORY DOCTOR
  • ​RecSys 2022 | 面向人岗匹配的双向选择偏好建模
  • #DBA杂记1
  • (10)工业界推荐系统-小红书推荐场景及内部实践【排序模型的特征】
  • (苍穹外卖)day03菜品管理
  • (附源码)spring boot儿童教育管理系统 毕业设计 281442
  • (经验分享)作为一名普通本科计算机专业学生,我大学四年到底走了多少弯路
  • (免费领源码)python+django+mysql线上兼职平台系统83320-计算机毕业设计项目选题推荐
  • (算法设计与分析)第一章算法概述-习题
  • (一) 初入MySQL 【认识和部署】
  • (转)拼包函数及网络封包的异常处理(含代码)
  • .mat 文件的加载与创建 矩阵变图像? ∈ Matlab 使用笔记
  • .NET 8.0 发布到 IIS
  • .net core 3.0 linux,.NET Core 3.0 的新增功能
  • .net core Swagger 过滤部分Api
  • .net mvc actionresult 返回字符串_.NET架构师知识普及
  • .NET 事件模型教程(二)
  • .net6Api后台+uniapp导出Excel
  • .Net6使用WebSocket与前端进行通信
  • .NET开源、简单、实用的数据库文档生成工具
  • /使用匿名内部类来复写Handler当中的handlerMessage()方法
  • @RequestMapping-占位符映射
  • [ C++ ] STL---string类的模拟实现
  • [ IO.File ] FileSystemWatcher
  • [] 与 [[]], -gt 与 > 的比较