gpt4 book ai didi

java - 使用 Tycho 构建片段时出错 : "xyz.fragment cannot be installed in this environment because its filter is not applicable"

转载 作者:行者123 更新时间:2023-11-30 08:08:55 25 4
gpt4 key购买 nike

在 Eclipse 中的片段项目上运行 mvn install 时出现此错误:

${fragment name} cannot be installed in this environment because its filter is not applicable.

在 list 中使用 Eclipse-PlatformFilter: (osgi.os=macosx) 会破坏构建。

这是围绕关键错误的输出(已编辑 ID/目录名称):

[INFO] Resolving dependencies of MavenProject: ${fragmentID}:4.3.0-SNAPSHOT @ ${fragmentDir}/pom.xml
[INFO] {osgi.os=linux, org.eclipse.update.install.features=true, osgi.arch=x86_64, osgi.ws=gtk}
[ERROR] Cannot resolve project dependencies:
[ERROR] Problems resolving provisioning plan.:
[ERROR] ${fragment name} cannot be installed in this environment because its filter is not applicable.
[ERROR]
[ERROR] See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.

链接 ( http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting) 没有帮助。

我在网上发现了一些类似的错误(component X cannot be installed in this environment because its filter is not applicable),但它们都适用于它下载软件的情况并且没有解决方案或解决方案不适用于我的情况。

感谢任何帮助!

编辑:我发现在主机插件中使用 Eclipse-PlatformFilter: (osgi.os=macosx) 也可以,而且 Eclipse-PlatformFilter: (| (osgi.os=macosx) (osgi.os =linux) (osgi.os=win32) ) 在片段中有效。构建似乎经历了祖先 pom 中设置的每个环境,并且当片段不适用于这些环境中的任何一个时它就会中断......当然有一些我可以设置的标志来防止这种情况发生?

最佳答案

Tycho 为通过 POM 配置的所有操作系统环境构建。当前无法自动将这些环境过滤为配置为 Eclipse-PlatformFilter 的环境.所以当只为某个操作系统构建片段时,你需要手动覆盖 <environments>片段 POM 中父 POM 的配置:

<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<environments>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>

关于java - 使用 Tycho 构建片段时出错 : "xyz.fragment cannot be installed in this environment because its filter is not applicable",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32854138/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com