繁体   English   中英

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

[英]Unresolveable build extension: Plugin org.eclipse.tycho:tycho-maven

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

我收到错误:

无法解析的构建扩展:插件 org.eclipse.tycho:tycho-maven-plugin:0.22.0 或其依赖项之一无法解析:无法读取 org.eclipse.tycho:tycho-maven-plugin:jar 的工件描述符: 0.22.0:无法从中央( https://repo.maven.apache.org/maven2 )传输工件 org.eclipse.tycho:tycho-maven-plugin:pom:0.22.0:连接超时 -> [帮助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>  

我相信你的问题已经解决了。 但是,对于其他有相同错误的人,解决方案是:在父 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>

这不能通过添加来解决

<PluginManagement> 
   ... 
</PluginManagement>

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

在这里找到完整的解决方案: Maven:无法解析的构建扩展

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM