我遇到了以下情况: 一个 Eclipse rcp 项目,它需要另一个包(其中包含一些 jar)才能运行。当我从 Eclipse 启动它时,它运行得很好。现在我想用 maven 和 tycho创建一个可运行的 jar (这很重要)。
eclipse rcp项目中的pom.xml长这样
<properties>
<tycho-version>0.16.0</tycho-version>
</properties>
<repositories>
<repository>
<id>helios</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/helios</url>
</repository>
<repository>
<id>galileoTest</id>
<layout>p2</layout>
<url>http://download.eclipse.org/eclipse/updates/3.6-JUnit-Tests/</url>
</repository>
</repositories>
<build>
<plugins>
<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>
<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>
</build>
构建过程“成功”,但生成的 jar 为 olny 74kb(必须超过 15mb)并且不可执行(未找到主类)。