简体   繁体   中英

Unresolveable build extension: Plugin org.eclipse.tycho:tycho-maven

I am using 'Tycho'(Maven) for eclipse plugin project build .

I am getting the error :

Unresolveable build extension: Plugin org.eclipse.tycho:tycho-maven-plugin:0.22.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.tycho:tycho-maven-plugin:jar:0.22.0: Could not transfer artifact 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 file looks like

<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>  

I am sure your problem is solved. However, for others who have the same error,the solution is : Include the tag <pluginManagement> in parent pom.xml file. <pluginManagement> is only a way to share the same plugin configuration across all your project modules.Here is sample parent pom.xml file

<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>

This can't be solved by adding

<PluginManagement> 
   ... 
</PluginManagement>

It's simply because the eclipse m2e connector can't download these plugins from a repo. Open your Maven Console and see if it prints something after you saved your pom.xml it probably will tell you, that it couldn't acces the repo or no maven settings.xml is assigned to the m2e connector.

Find the full Solution here: Maven: unresolvable build extension

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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