如果在 Eclipse 环境中显示此问题,这是因为 m2e 连接器尝试将插件下载到您的~\.m2\
存储库中
要解决这个问题,请打开 Eclipse Settings:Window->Preferences
并转到->Maven->User Settings
Section。检查是否Global Settings
或User Settings
连接到settings.xml
您的 Maven 使用的文件。
通常: Maven 或您的 m2e 连接器尝试通过您在 settings.xml 中配置的插件存储库下载这些插件,因为存储库未知或无法访问,因为您位于代理后面,所以找不到它们:
08.11.18, 15:54:47 MEZ: [WARN] Failed to build parent project for com.xxx.xxx.xxx:eclipse-plugin:1.0.0-SNAPSHOT
08.11.18, 15:54:47 MEZ: [WARN] Failure to transfer org.apache.maven.plugins:maven-site-plugin/maven-metadata.xml from http://repository.sonatype.org/content/groups/sonatype-public-grid was cached in the local repository, resolution will not be reattempted until the update interval of tycho has elapsed or updates are forced. Original error: Could not transfer metadata org.apache.maven.plugins:maven-site-plugin/maven-metadata.xml from/to tycho (http://repository.sonatype.org/content/groups/sonatype-public-grid): repository.sonatype.org
转到您的settings.xml
文件并添加:
镜像(在此示例中:central
存储库。相应地对任何其他存储库执行此操作,例如tycho
):
<mirror>
<id>central</id>
<name>Our mirror for central repo</name>
<url>http://<your host to>/nexus/content/repositories/central/</url>
<mirrorOf>central</mirrorOf>
</mirror>
存储库:
<repository>
<id>central</id>
<url>http://<your host to>/nexus/content/groups/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
</repository>
这应该可以解决您的问题:
Eclipse 特定的:如果错误盛行(例如未知的包装)添加生命周期映射通过Window->Preferences->Maven->Discovery->Open Catalog
并添加Tycho Connector
进一步您可以添加lifecycle-mapping
在 Eclipse 环境中处理这些生命周期映射的插件:eclipse m2e 生命周期映射