不可解析的构建扩展:插件org.eclipse.tycho:tycho-maven

问题描述 投票:1回答:2

我使用'Tycho'(Maven)进行eclipse插件项目构建。

我收到错误:

不可解析的构建扩展:插件org.eclipse.tycho:tycho-maven-plugin:0.22.0或其中一个依赖项无法解析:无法读取org.eclipse.tycho的工件描述符:tycho-maven-plugin:jar: 0.22.0:无法传输工件org.eclipse.tycho:tycho-maven-plugin:pom:0.22.0 from / to central(https://repo.maven.apache.org/maven2):connect timed out - > [Help 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>  
maven eclipse-plugin maven-3 tycho
2个回答
1
投票

我相信你的问题已经解决了。但是,对于具有相同错误的其他人,解决方案是:在父pom.xml文件中包含标记<pluginManagement><pluginManagement>只是一种在所有项目模块中共享相同插件配置的方法。这是示例父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>

0
投票

这不能通过添加来解决

<PluginManagement> 
   ... 
</PluginManagement>

这只是因为eclipse m2e连接器无法从repo下载这些插件。打开你的Maven控制台,看看它是否在保存你的pom.xml之后打印出来,它可能会告诉你,它无法访问repo或没有maven settings.xml被分配给m2e连接器。

在这里找到完整的解决方案:Maven: unresolvable build extension

© www.soinside.com 2019 - 2024. All rights reserved.