我使用'Tycho'(Maven)来构建eclipse插件项目。
我发现了一个错误:
无法解析的构建扩展:pluginorg.eclipse.tycho:tycho Plugin :0.22.0或其依赖项无法解决: org.eclipse.tycho:tycho-maven-plugin:jar:0.22.0:读取工件描述符失败不能将工件org.eclipse.tycho:tycho-maven-plugin:pom:0.22.0从/转到中心(https://repo.maven.apache.org/maven2):连接超时->帮助2
POM.xml文件看起来像
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>tycho_example</groupId>
<artifactId>com.codeandme.tycho.plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<tycho.version>0.22.0</tycho.version>
</properties>
<repositories>
<!-- add Mars repository to resolve dependencies -->
<repository>
<id>Mars</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/mars/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<!-- enable tycho build extension -->
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project> 发布于 2017-06-27 22:26:44
我相信你的问题已经解决了。但是,对于其他有相同错误的人,解决方案是:将标记包含在父pom.xml文件中。 <pluginManagement>只是一种在所有项目之间共享相同插件配置的方法,而modules.Here是示例父pom.xml文件。
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>${tycho-groupid}</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>${tycho-groupid}</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<resolver>p2</resolver>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>发布于 2018-11-08 15:53:15
这不能通过添加
<PluginManagement>
...
</PluginManagement>这仅仅是因为eclipse m2e连接器无法从回购系统下载这些插件。打开Maven控制台,看看它是否在保存pom.xml之后打印什么东西,它可能会告诉您,它无法访问回购,或者没有将maven settings.xml分配给m2e连接器。
在这里找到完整的解决方案:Maven: unresolvable build extension
https://stackoverflow.com/questions/36422159
复制相似问题