2011-10-13 79 views
0

我有一個令我生氣的問題:Tycho忽略了我添加到POM中的所有p2存儲庫。這裏是POM的相關部分:Tycho忽略p2存儲庫

<properties> 
    <tycho-version>0.13.0</tycho-version> 
</properties> 

<repositories> 
    <repository> 
     <id>indigo</id> 
     <layout>p2</layout> 
     <url>http://download.eclipse.org/releases/indigo/</url> 
    </repository> 
</repositories> 

<profiles> 
    <!-- Fix for Eclipse maven plugin which insists to mix its output with Eclipse's --> 
    <profile> 
     <id>eclipse-folders</id> 
     <properties> 
      <target.dir>target-eclipse</target.dir> 
     </properties> 
    </profile> 
</profiles> 

<build> 
    <sourceDirectory>src</sourceDirectory> 
    <directory>${basedir}/${target.dir}</directory> 
    <outputDirectory>${basedir}/${target.dir}/classes</outputDirectory> 
    <testOutputDirectory>${basedir}/${target.dir}/test-classes</testOutputDirectory> 

    <plugins> 
     <plugin> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <configuration> 
       <!-- Compile with Java 5 --> 
       <source>${compileSource}</source> 
       <target>${compileSource}</target> 
       <compilerArguments> 
        <g /> 
       </compilerArguments> 
      </configuration> 
     </plugin> 

     <plugin> 
      <groupId>org.eclipse.tycho</groupId> 
      <artifactId>tycho-maven-plugin</artifactId> 
      <version>${tycho-version}</version> 
      <extensions>true</extensions> 
     </plugin> 

     <plugin> 
      <groupId>org.eclipse.tycho</groupId> 
      <artifactId>target-platform-configuration</artifactId> 
      <version>${tycho-version}</version> 
      <configuration> 
       <resolver>p2</resolver> 
       <environments> 
        <environment> 
         <os>linux</os> 
         <ws>gtk</ws> 
         <arch>x86</arch> 
        </environment> 
        <environment> 
         <os>linux</os> 
         <ws>gtk</ws> 
         <arch>x86_64</arch> 
        </environment> 
        <environment> 
         <os>win32</os> 
         <ws>win32</ws> 
         <arch>x86</arch> 
        </environment> 
        <environment> 
         <os>win32</os> 
         <ws>win32</ws> 
         <arch>x86_64</arch> 
        </environment> 
        <environment> 
         <os>macosx</os> 
         <ws>cocoa</ws> 
         <arch>x86_64</arch> 
        </environment> 
       </environments> 
      </configuration> 
     </plugin> 
    </plugins> 

    <pluginManagement> 
     <plugins> 
      <plugin> 
       <artifactId>maven-clean-plugin</artifactId> 
       <version>2.4.1</version> 
      </plugin> 
      <plugin> 
       <artifactId>maven-resources-plugin</artifactId> 
       <version>2.4.3</version> 
      </plugin> 
      <plugin> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>2.3.2</version> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-source-plugin</artifactId> 
       <version>2.1.2</version> 
      </plugin> 
     </plugins> 
    </pluginManagement> 
</build> 

<distributionManagement> 
    <!-- use the following if you're not using a snapshot version. --> 
    <repository> 
     <id>releases</id> 
     <name>Releases</name> 
     <url>local URL</url> 
    </repository> 
    <!-- use the following if you ARE using a snapshot version. --> 
    <snapshotRepository> 
     <id>snapshots</id> 
     <name>Snapshots</name> 
     <url>local URL</url> 
    </snapshotRepository> 
</distributionManagement> 

在輸出中,我從來沒有看到[INFO] Resolving target platform for project MavenProject[INFO] Adding repository http://download.eclipse.org/releases/indigo/

爲什麼不呢?如果我從http://git.eclipse.org/gitroot/tycho/org.eclipse.tycho.git建立Tycho,它確實有效,所以它與我的settings.xml無關。我也試過Tycho 0.12.0,結果相同。我生成的輸出

有趣的部分:

[INFO] Error stacktraces are turned on. 
[DEBUG] Reading global settings from /home/adigulla/packages/apache-maven-3.0.3/conf/settings.xml 
[DEBUG] Reading user settings from /home/adigulla/.m2/settings.xml 
[DEBUG] Using local repository at /home/adigulla/.m2/repository 
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /home/adigulla/.m2/repository 
[INFO] Scanning for projects... 
[DEBUG] org.eclipse.tycho:tycho-maven-plugin:jar:0.13.0: 
[DEBUG] org.eclipse.tycho:tycho-core:jar:0.13.0:compile 
... 
[DEBUG] Extension realms for project com.avanon.tycho:parent:pom:0.0.1-SNAPSHOT: [ClassRealm[extension>org.eclipse.tycho:tycho-maven-plugin:0.13.0, parent: [email protected]]] 
[DEBUG] Created new class realm project>com.avanon.tycho:parent:0.0.1-SNAPSHOT 
[DEBUG] Populating class realm project>com.avanon.tycho:parent:0.0.1-SNAPSHOT 
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[project>com.avanon.tycho:parent:0.0.1-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]] 
[DEBUG] Extension realms for project de.itemis.xtext:typesystem:jar:2.0.0.2: [ClassRealm[extension>org.eclipse.tycho:tycho-maven-plugin:0.13.0, parent: [email protected]]] 
[DEBUG] Looking up lifecyle mappings for packaging jar from ClassRealm[project>com.avanon.tycho:parent:0.0.1-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]] 
... 
[DEBUG] === PROJECT BUILD PLAN ================================================ 
[DEBUG] Project:  com.avanon.tycho:parent:0.0.1-SNAPSHOT 
[DEBUG] Dependencies (collect): [] 
[DEBUG] Dependencies (resolve): [] 
[DEBUG] Repositories (dependencies): [indigo (http://download.eclipse.org/releases/indigo, disabled), Nexus (http://nexus:8082/nexus/content/groups/public2, releases)] 
[DEBUG] Repositories (plugins)  : [Nexus (http://nexus:8082/nexus/content/groups/public2, releases)] 

正如你所看到的,第谷是公認的,但它說indigo (http://download.eclipse.org/releases/indigo, disabled)。爲什麼?

回答

2

來自Tycho團隊的Igor Fedorenko發現了這個問題。在模塊中,我使用的

<packaging>jar</packaging> 

代替

<packaging>eclipse-plugin</packaging> 
0

您是否嘗試過啓用發佈和快照?

<repository> 
    <id>indigo</id> 
    <layout>p2</layout> 
    <url>http://download.eclipse.org/releases/indigo/</url> 
    <releases> 
     <enabled>true</enabled> 
    </releases> 
    <snapshots> 
     <enabled>true</enabled> 
    </snapshots> 
</repository> 

當調用Maven時,你的命令行是什麼? 另外你說當你「從github構建Tycho」時,這是否意味着你在Eclipse內部使用了m2e嵌入式Maven/Tycho?