通过 tycho 构建时,lib 文件夹与 eclipse 插件 jar 打包在一起
Lib folder gets packaged with eclipse plugin jar while building through tycho
我正在尝试使用 Maven 的 tycho-compiler-plugin 构建 eclipse 插件。
我已经解决了 p2 repo 中的许多捆绑依赖项。我有一些 jar 依赖项存在于 manifest.mf -
的 bundle-classpath 中
Bundle-ClassPath: .,
lib/test1.jar,
lib/test2.jar
这些 jar 存在于 lib 文件夹中,该文件夹位于根级别,即存在 pom 的位置。
POM 文件看起来像 -
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>com.test.plugin</artifactId>
<version>0.0.0</version>
<packaging>eclipse-plugin</packaging>
<repositories>
<repository>
<id>Mars</id>
<layout>p2</layout>
<url>file:///E:/repo/eclipseRepo/</url>
</repository>
</repositories>
<build>
<directory>../../../../target</directory>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>0.25.0</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>0.25.0</version>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>0.25.0</version>
<configuration>
<buildDirectory>../../../../plugin</buildDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>
现在 ti 正确构建了 eclipse 插件,但在打包时它还包括 lib 文件夹。附上 jar 截图 -
我想从 jar.I 中排除此 lib 文件夹已尝试在 tycho-packaging-jar 插件中配置以排除它。但没有工作。如何排除?
在当前项目的基本目录之外使用 <directory>
或 <buildDirectory>
看起来很不标准。事实上,就此而言,我从来不需要显式配置其中任何一个 - 或 <sourceDirectory>
。这就是 build.properties
文件的用途,这是在 Eclipse PDE 和 Tycho 中配置这些东西的默认方式。
从屏幕截图来看,似乎没有 build.properties
文件。我建议您通过 its properties rather than through POM elements. Something along the lines of this example 配置各个位置,使用 bin.includes
和 bin.excludes
处理您的 JAR 包含。
我正在尝试使用 Maven 的 tycho-compiler-plugin 构建 eclipse 插件。 我已经解决了 p2 repo 中的许多捆绑依赖项。我有一些 jar 依赖项存在于 manifest.mf -
的 bundle-classpath 中 Bundle-ClassPath: .,
lib/test1.jar,
lib/test2.jar
这些 jar 存在于 lib 文件夹中,该文件夹位于根级别,即存在 pom 的位置。
POM 文件看起来像 -
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>com.test.plugin</artifactId>
<version>0.0.0</version>
<packaging>eclipse-plugin</packaging>
<repositories>
<repository>
<id>Mars</id>
<layout>p2</layout>
<url>file:///E:/repo/eclipseRepo/</url>
</repository>
</repositories>
<build>
<directory>../../../../target</directory>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>0.25.0</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>0.25.0</version>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>0.25.0</version>
<configuration>
<buildDirectory>../../../../plugin</buildDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>
现在 ti 正确构建了 eclipse 插件,但在打包时它还包括 lib 文件夹。附上 jar 截图 -
在当前项目的基本目录之外使用 <directory>
或 <buildDirectory>
看起来很不标准。事实上,就此而言,我从来不需要显式配置其中任何一个 - 或 <sourceDirectory>
。这就是 build.properties
文件的用途,这是在 Eclipse PDE 和 Tycho 中配置这些东西的默认方式。
从屏幕截图来看,似乎没有 build.properties
文件。我建议您通过 its properties rather than through POM elements. Something along the lines of this example 配置各个位置,使用 bin.includes
和 bin.excludes
处理您的 JAR 包含。