2016-04-05 33 views
1

我正在使用'Tycho'(Maven)进行eclipse插件项目构建。无法解析的构建扩展插件org.eclipse.tycho:tycho-maven

我收到错误:

Unresolveable新建扩建:插件org.eclipse.tycho:第谷 - Maven的插件: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) :连接超时 - > [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> 
+0

您在代理相同的插件配置的方法吗? – Tunaki

+0

不,我不使用代理 –

+0

这是不正常的,因为工件存在https://repo.maven.apache.org/maven2/org/eclipse/tycho/tycho-maven-plugin/0.22.0/。错误消息是*连接超时*,这意味着有什么阻止Maven下载。 – Tunaki

回答

1

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