如果在 Eclipse 环境中显示此问题,这是因为 m2e 连接器尝试将插件下载到您的 ~\.m2\ 存储库中
要解决此问题,请打开 Eclipse 设置:Window->Preferences 并转到 ->Maven->User Settings 部分。
检查Global Settings 或User Settings 是否连接到您的Maven 使用的settings.xml 文件。
通常: 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
此外,您可以在 eclipse 环境中添加处理这些生命周期映射的lifecycle-mapping 插件:eclipse m2e lifecycle mappings