第谷忽略 p2 存储库

发布于 2024-12-09 18:36:04 字数 7568 浏览 0 评论 0原文

我有一个让我抓狂的问题:第谷忽略了我添加到 POM 的所有 p2 存储库。以下是 POM 的相关部分:

<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] Moving repository http://download.eclipse.org/releases/indigo/

为什么不呢?如果我从 http://git.eclipse.org/gitroot/ 构建 Tycho tycho/org.eclipse.tycho.git,它确实有效,所以它与我的 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: sun.misc.Launcher$AppClassLoader@4aad3ba4]]
[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: sun.misc.Launcher$AppClassLoader@4aad3ba4]]
[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)]

如您所见,Tycho 已被识别,但它显示 indigo (http://download.eclipse.org/releases/indigo,disabled)。为什么?

I have an issue that is driving me mad: Tycho ignores all p2 repositories that I added to the POM. Here is the relevant part of the POM:

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

In the output, I never see [INFO] Resolving target platform for project MavenProject or [INFO] Adding repository http://download.eclipse.org/releases/indigo/

Why not? If I build Tycho from http://git.eclipse.org/gitroot/tycho/org.eclipse.tycho.git, it does work, so it's not related to my settings.xml. I also tried Tycho 0.12.0 with the same result.

Interesting part of the output of my build:

[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: sun.misc.Launcher$AppClassLoader@4aad3ba4]]
[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: sun.misc.Launcher$AppClassLoader@4aad3ba4]]
[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)]

As you can see, Tycho is recognized but it says indigo (http://download.eclipse.org/releases/indigo, disabled). Why?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

来世叙缘 2024-12-16 18:36:04

第谷团队的 Igor Fedorenko 发现了这个问题。在模块中,我使用

<packaging>jar</packaging>

而不是

<packaging>eclipse-plugin</packaging>

Igor Fedorenko from the Tycho team found the problem. In the modules, I used

<packaging>jar</packaging>

instead of

<packaging>eclipse-plugin</packaging>

您是否尝试过启用发布和快照?

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

Have you tried enabling releases and snapshots?

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

And what is your command line when invoking Maven?
Also you say when you "build Tycho from github" does that mean you are using the m2e embedded Maven/Tycho inside Eclipse?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文