[英]After changing location in Target file, Tycho can not resolve indirectly referenced dependency
This might be a duplication of Tycho can't resolve indirectly referenced SWT dependencies , but the given answer does not work for me, so I am not sure.这可能是Tycho can't resolve indirect referenced SWT dependencies的重复,但给定的答案对我不起作用,所以我不确定。
My goal is to update my Target Platform definition file version-by-version from Eclipse Luna
to the most recent Eclipse version, which still supports Java 8. But I am stuck in the step from Eclipse 2018-09
to 2018-12
. My goal is to update my Target Platform definition file version-by-version from
Eclipse Luna
to the most recent Eclipse version, which still supports Java 8. But I am stuck in the step from Eclipse 2018-09
to 2018-12
.
Based on Eclipse 2018-09
I can start my application from Eclipse and I can build it with Tycho 1.7.0.基于 Eclipse
2018-09
我可以从 Eclipse 开始我的应用程序,我可以使用 Tycho 1.7.0 构建它。 (Tycho 1.7.0 is also the most current version, which still supports Java 8.) (Tycho 1.7.0也是最新版本,依然支持Java 8。)
The working target file is:工作目标文件是:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="My Target" sequenceNumber="1622530056">
<locations>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.equinox.sdk.feature.group" version="3.15.0.v20180904-1442"/>
<unit id="org.eclipse.sdk.ide" version="4.9.0.I20180906-0745"/>
<unit id="org.eclipse.jdt.feature.group" version="3.15.0.v20180906-0745"/>
<unit id="org.eclipse.e4.tools.compat" version="4.7.200.v20180821-1411"/>
<unit id="org.eclipse.e4.tools.services" version="4.8.100.v20180821-1411"/>
<repository id="eclipse-luna" location="http://download.eclipse.org/releases/2018-09"/>
</location>
</locations>
</target>
Based on Eclipse 2018-12
I can start my application from Eclipse but I can not build it with Tycho 1.7.0.基于 Eclipse
2018-12
我可以从 Eclipse 开始我的应用程序,但我无法使用 Tycho 1.7.0 构建它。
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="My Target" sequenceNumber="1622530674">
<locations>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.equinox.sdk.feature.group" version="3.16.0.v20181130-2106"/>
<unit id="org.eclipse.sdk.ide" version="4.10.0.I20181206-0815"/>
<unit id="org.eclipse.jdt.feature.group" version="3.16.0.v20181206-1038"/>
<unit id="org.eclipse.e4.tools.compat" version="4.7.300.v20181015-0338"/>
<unit id="org.eclipse.e4.tools.services" version="4.8.200.v20181022-1512"/>
<repository id="eclipse-luna" location="https://download.eclipse.org/releases/2018-12"/>
</location>
</locations>
</target>
The error I get is the following:我得到的错误如下:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.7.0:compile (default-compile) on project com.my_plugin: Compilation failure: Compilation failure:
[ERROR] C:\path\to\my_project\my_plugin\SomeClass.java:
[ERROR] package some.package;
[ERROR] ^
[ERROR] The type org.eclipse.swt.widgets.Composite cannot be resolved. It is indirectly referenced from required .class files
I tried to build the project with Tycho 2.3.0 (and Java 11) but I get the indirectly referenced classes error.我尝试使用 Tycho 2.3.0(和 Java 11)构建项目,但我得到了间接引用的类错误。
I tried adding jars.extra.classpath = platform:/plugin/org.eclipse.swt.win32.win32.x86_64
as proposed by Tycho can't resolve indirectly referenced SWT dependencies .我尝试按照 Tycho 的建议添加
jars.extra.classpath = platform:/plugin/org.eclipse.swt.win32.win32.x86_64
can't resolve indirect referenced SWT dependencies 。 But then I get the following error:但后来我收到以下错误:
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: com.my_plugin 5.0.0.qualifier
[ERROR] Missing requirement: com.my_plugin 5.0.0.qualifier requires 'org.eclipse.equinox.p2.iu; org.eclipse.swt.win32.win32.x86_64 0.0.0' but it could not be found
platform:/plugins
and not platform:/plugin
.platform:/plugins
而不是platform:/plugin
。 But that again leads to to the indirectly referenced classes error.The origin of the problem was very mundane.问题的根源很普通。 I was still building my project for Windows 32-bit.
我仍在为 Windows 32 位构建我的项目。
If I remove如果我删除
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
from my target-platform-configuration
the project can be build again.从我的
target-platform-configuration
中,可以再次构建项目。
I tried to replicate the error with the tycho-example
by Vogella and was successful.我试图用 Vogella 的
tycho-example
复制错误并成功了。
If I put the win32_x86
environment as the first environment I get the following error:如果我将
win32_x86
环境作为第一个环境,则会收到以下错误:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:2.3.0:compile (default-compile) on project com.vogella.tycho.p2.ui: Compilation failure: Compilation failure:
[ERROR] C:\Users\gillesB\git\gilles\tycho-example\bundles\com.vogella.tycho.p2.ui\src\com\vogella\tycho\p2\ui\handlers\UpdateHandler.java:[1]
[ERROR] package com.vogella.tycho.p2.ui.handlers;
[ERROR] ^
[ERROR] The type org.eclipse.swt.widgets.Shell cannot be resolved. It is indirectly referenced from required .class files
[ERROR] C:\Users\gillesB\git\gilles\tycho-example\bundles\com.vogella.tycho.p2.ui\src\com\vogella\tycho\p2\ui\handlers\UpdateHandler.java:[20]
[ERROR] import org.eclipse.swt.widgets.Shell;
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The import org.eclipse.swt.widgets.Shell cannot be resolved
[ERROR] C:\Users\gillesB\git\gilles\tycho-example\bundles\com.vogella.tycho.p2.ui\src\com\vogella\tycho\p2\ui\handlers\UpdateHandler.java:[27]
[ERROR] public void execute(final IProvisioningAgent agent, final Shell shell, final UISynchronize sync,
[ERROR] ^^^^^
[ERROR] Shell cannot be resolved to a type
[ERROR] C:\Users\gillesB\git\gilles\tycho-example\bundles\com.vogella.tycho.p2.ui\src\com\vogella\tycho\p2\ui\handlers\UpdateHandler.java:[38]
[ERROR] private IStatus checkForUpdates(final IProvisioningAgent agent, final Shell shell, final UISynchronize sync,
[ERROR] ^^^^^
[ERROR] Shell cannot be resolved to a type
[ERROR] C:\Users\gillesB\git\gilles\tycho-example\bundles\com.vogella.tycho.p2.ui\src\com\vogella\tycho\p2\ui\handlers\UpdateHandler.java:[70]
[ERROR] private void configureProvisioningJob(ProvisioningJob provisioningJob, final Shell shell, final UISynchronize sync,
[ERROR] ^^^^^
[ERROR] Shell cannot be resolved to a type
[ERROR] C:\Users\gillesB\git\gilles\tycho-example\bundles\com.vogella.tycho.p2.ui\src\com\vogella\tycho\p2\ui\handlers\UpdateHandler.java:[98]
[ERROR] private void showMessage(final Shell parent, final UISynchronize sync) {
[ERROR] ^^^^^
[ERROR] Shell cannot be resolved to a type
[ERROR] 6 problems (6 errors)
So the the indirectly referenced classes error also appears.所以间接引用的类错误也会出现。 I built the
tycho-example
with Windows 10 (64-bit) and Java Corretto 11 (64-bit).我使用 Windows 10(64 位)和 Java Corretto 11(64 位)构建了第
tycho-example
。
If I put the win32_x86
environment as the last environment I get another clearer error message, that a 32-bit dependency can not be found.如果我将
win32_x86
环境作为最后一个环境,我会收到另一个更清晰的错误消息,即找不到 32 位依赖项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.