我想在eclipse中使用liferay-maven-plugin创建一个liferay插件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
答案 0 :(得分:0)
答案 1 :(得分:0)
当我尝试创建Maven项目时,使用Eclipse(实际上是Spring Tool Suite [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进行设置),并且拒绝下载所需的内容。
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 truststore中。为此,我导出了repo.maven.apache.org证书,并使用Java'keytool'命令将其导入。
在这里,我列出了进行证书导入的一种方法。
最后一步,我必须重新启动STS。之后,它似乎对我有用。
对我来说,这里的课程是从头开始在需要的地方使用https,这样我就不会遇到这样的问题。
答案 2 :(得分:0)
似乎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