当前位置: 首页 > 知识库问答 >
问题:

在eclipse中的项目上运行生成器“Maven Project builder”时出错

隆扬
2023-03-14

我想创建一个在eclipse中使用Lifeay-maven-plugin的Liveay插件portlet,但每次我尝试这样做时,我都会遇到这个错误:

Errors occurred during the build.
Errors running builder 'Maven Project Builder' on project 'sample-portlet'.
Could not calculate build plan: Plugin com.liferay.maven.plugins:liferay-maven-plugin:6.2.1 or one of its dependencies could not be resolved: Failure to find com.liferay.maven.plugins:liferay-maven-plugin:jar:6.2.1 in http://repo.maven.apache.org/maven2
was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
Plugin com.liferay.maven.plugins:liferay-maven-plugin:6.2.1 or one of its dependencies could not be resolved: Failure to find com.liferay.maven.plugins:liferay-maven-plugin:jar:6.2.1 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
Could not calculate build plan: Plugin com.liferay.maven.plugins:liferay-maven-plugin:6.2.1 or one of its dependencies could not be resolved: Failure to find com.liferay.maven.plugins:liferay-maven-plugin:jar:6.2.1 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
Plugin com.liferay.maven.plugins:liferay-maven-plugin:6.2.1 or one of its dependencies could not be resolved: Failure to find com.liferay.maven.plugins:liferay-maven-plugin:jar:6.2.1 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced

共有3个答案

罗飞宇
2023-03-14

maven似乎不再支持不安全的协议,所以我将maven存储库URL从http更改为https,这对我很有用。

<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>https://repo.maven.apache.org/maven2/</url>
</mirror>

查看以下链接了解更多信息https://links.sonatype.com/central/501-https-required

岳曦
2023-03-14

当我尝试创建Maven项目时,我在使用Eclipse(实际上是Spring工具套件[STS])时遇到了类似的错误

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-war-plugin:3.2.1 or one of its dependencies could not be resolved ...

看起来maven不喜欢http(我在某个时候使用.m2/setting.xml设置了http),并且拒绝下载它所需要的内容。

501 HTTPS Required. 
Use https://repo.maven.apache.org/maven2/
More information at https://links.sonatype.com/central/501-https-required

上述网站告诉我:

Effective January 15, 2020, The Central Repository no longer supports insecure 
communication over plain HTTP and requires that all requests to the repository are 
encrypted over HTTPS.

所以我把http改成了https

但是我仍然需要将maven证书导入java信任库。为此,我导出了repo.maven.apache.org证书并使用Java“keytools”命令导入它。

这里我列出了一种进行证书导入的方法。

Spring工具套件-SunCertPathBuilderException:找不到请求目标的有效证书路径

作为最后一步,我必须重新启动STS。从那以后,它似乎对我有用。

对我来说,这里的教训是从一开始就在需要的地方使用https,这样我就不会遇到这样的问题。

公西岳
2023-03-14
  1. 接近日食
  2. 转到您的主目录(例如Windows上的C:/user/your_user_name
  3. 查找并删除. m2/repository文件
  4. 确保您连接到互联网
  5. 开始日食
  6. 保持互联网连接并让maven更新所有依赖项
 类似资料:
  • 我有一个关于如何将包含现有make文件的项目导入Eclipse的问题。通过阅读eclipse文档,我似乎应该使用“makefile项目”,这是正确的吗?如果是这样,那么项目文件的导入似乎是可以的,但是当我运行构建时,我会得到: 生成过程中出现错误。在项目“Proj1”上运行生成器“CDT builder”时出错。内部错误生成项目proj1配置默认java.lang.NullPointerExcep

  • 我在Eclipse中经常遇到这个错误: 生成期间出错。对project project运行生成器“集成外部工具生成器”时出错。找不到生成器启动配置。对project project运行生成器“集成外部工具生成器”时出错。找不到生成器启动配置。

  • 我最近为Java开发人员安装了日食IDE 版: 2019-03 (4.11.0) 内部版本号: 20190314-1200 创建项目时,我收到以下错误: '构建工作区'遇到问题。构建过程中发生错误。 生成期间发生错误。在项目“我的第一个项目”上运行生成器“Java生成器”时出错。java.lang.NullPointerException 请帮帮忙

  • 我在Eclipse上遇到了大麻烦 我下载了最新的ADT包,然后新建了一个新的Android项目,但出现了一个错误: 然后我用谷歌搜索了一下,发现了一些建议,比如新的工作空间,但还是不行 而我发现一个奇怪的现象,java编译器总是改成1.4,而jre总是缺失,每次工作空间改变时都会发生 新项目也很奇怪 我选择项目的属性,另一个错误发生在选择Android时 然后我google错误,发现一个解决方案是

  • 我是Eclipse中的servlet和jsp的新手。我制作了一个简单的Servlet/JSP应用程序,但当我在eclipse中的tomcat服务器上运行它时,我得到了以下错误: 协议暂停信息:暂停ProtocolHandler[“http-bio-8080”]2013年6月21日1:07:08 AM org.apache.coyote.abstract协议暂停信息:暂停ProtocolHandle

  • 试图在一个我已经几个月没做的Android项目上做一些工作,然而每次我试图构建这个项目时,Eclipse都会弹出一个对话框说: 我在Mac上运行Eclipse,其Android项目构建目标为4.0.3(API Level 15),我安装了以下版本 Eclipse-3.7.2 Android开发工具-21.0.1 Android SDK-最多17个 我已经尝试了一些事情,比如启动一个全新的工作区,安