maven - Maven 项目无法在 Eclipse 中构建
问题描述
我从 中创建了一个演示 maven 项目start.spring.io
,并尝试mvn clean package
从 Eclipse 运行,但它给了我以下错误:
[INFO] Scanning for projects...
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.0.6.RELEASE/spring-boot-starter-parent-2.0.6.RELEASE.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.example:demo:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.6.RELEASE from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org and 'parent.relativePath' points at no local POM @ line 14, column 10
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.example:demo:0.0.1-SNAPSHOT (C:\Development\demo\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for com.example:demo:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.6.RELEASE from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org and 'parent.relativePath' points at no local POM @ line 14, column 10: Unknown host repo.maven.apache.org -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
Picked up JAVA_TOOL_OPTIONS: -agentpath:"C:\Windows\system32\Aternity\Java\JavaHookLoader.dll"="C:\ProgramData\Aternity\hooks"
有谁知道这个问题?提前致谢。
解决方案
settings.xml
通过在.m2
文件夹中添加解决问题。
推荐阅读
- c# - 为什么组中的以下 LINQ 查询的行为不同
- python - 我的包缺少模块,导入时出现错误“没有命名模块”pip install
- rest - 在 Jasper 中添加一个新角色,只为同步报告执行进行休息调用
- vue.js - 在生产中使用电子加载 nanosql 数据库数据的问题
- r - R从指数随机变量生成二项式随机变量
- c++ - 使用 GCC 对 C 文件进行部分预处理(不删除“定义”指令)
- javascript - 查找两个字符串的最小连接数
- python - 从不同的目录运行 python 文件,包括 sqlite 数据库
- java - 矩形程序不准确
- css - 旧式数字(“onum”)在 Chrome 中不起作用