0
votes

I am trying to build eclipse plugin using tycho-compiler-plugin from maven. I have resolved many bundled dependencies from p2 repo. I have some jar dependencies which are present in bundle-classpath in manifest.mf -

  Bundle-ClassPath: .,
    lib/test1.jar,
    lib/test2.jar

These jars are present in lib folder which is present at root level i.e where pom is present.

POM file looks like -

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

Now ti builds eclipse plugin properly , but while packaging it also includes lib folder. Attached jar screenshot - enter image description here I want to exclude this lib folder from jar.I have tried configuration in tycho-packaging-jar plugin to exclude it. But not working. How to exclude it?

1

1 Answers

1
votes

Using a <directory> or <buildDirectory> outside the current project’s base directory looks fairly non-standard. In fact, I have never had the need to explicit configure either of these – or <sourceDirectory>, for that matter. That’s what the build.properties file is for, which is the default way to configure these things in both Eclipse PDE and Tycho.

From the screenshot it looks like there is no build.properties file present. I would suggest you configure the various locations through its properties rather than through POM elements. Something along the lines of this example, with bin.includes and bin.excludes handling your JAR inclusions.