0

I am building an eclipse rcp application using Maven/tycho. I have added few dependencies into pom.xml and now i want these dependencies to be part of packaged jar which will be created after building my application. In manifest file its giving me some error as "Package 'com.sun.xml.stream.dtd' does not exist in this plug-in". enter image description here

Attached is the manifest.mf and here is my pom.xml 4.0.0 com.test.jars com.test.jars 2.22.0.qualifier eclipse-plugin com.test com.test.sampleapp.build 1.0.0-SNAPSHOT ../com.test.sampleapp.build/pom.xml

<dependencies>
    <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>1.6</version>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
    </dependency>
    <dependency>
        <groupId>poi</groupId>
        <artifactId>poi-2.5.1-final</artifactId>
        <version>20040804</version>
    </dependency>
    <dependency>
        <groupId>poi</groupId>
        <artifactId>poi</artifactId>
        <version>1.8.0-dev-20020919</version>
    </dependency>

    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jsr173_api</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.stream</groupId>
        <artifactId>sjsxp</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.14</version>
    </dependency>
    <dependency>
        <groupId>net.jimmc</groupId>
        <artifactId>jshortcut</artifactId>
        <version>0.4-oberzalek</version>
    </dependency>
    <dependency>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4</version>
    </dependency>

</dependencies>
Diptish
  • 9
  • 2
  • Eclipse [Orbit](https://projects.eclipse.org/projects/tools.orbit) has lots of prebuilt plug-ins for many common libraries. You may be able to use those. – greg-449 Mar 14 '21 at 08:55
  • Can you please elaborate?? – Diptish Mar 14 '21 at 09:39
  • You add the plug-ins from Eclipse Orbit to your target platform. Then add the appropriate plug-in to your plug-in's dependencies. – greg-449 Mar 14 '21 at 09:44
  • To use a plain jar in a plug-in it must be in the `Bunde-Classpath` in the plug-in's MANIFEST.MF and must be included in the plug-in. I don't know if tycho can do that. – greg-449 Mar 14 '21 at 09:46
  • How can we add maven dependencies into manifest.mf under bundle-Classpath element?? – Diptish Mar 14 '21 at 09:50
  • As far as I know you can't. That is why I suggested looking at Eclipse Orbit which has a lot of common things as plug-ins that you can add to the dependencies. Eclipse already has some apache plug-ins included - `org.apache.commons.io` for example – greg-449 Mar 14 '21 at 10:06
  • As far as I know, what we include in build.properties file gets added into packaged jar. But here the problem is how I can add those entries in this property file because these dependencies gets downloaded during maven build – Diptish Mar 14 '21 at 12:27
  • 1
    Read https://läubisoft.gmbh/en/articles/using-maven-artifacts-in-pde-rcp-and-tycho-builds/ (which requires [Tycho 2.2](https://wiki.eclipse.org/Tycho/Release_Notes/2.2)) – howlger Mar 14 '21 at 12:34
  • can someone tell me how to add maven dependencies into classpath? As per me, we dont need to add maven dependencies into classpath because it automatically gets added. – Diptish Mar 14 '21 at 13:17
  • To which classpath? In OSGi you do not have a classpath. [The `Bundle-ClassPath` is only for special cases](https://stackoverflow.com/a/16939053/6505250). – howlger Mar 14 '21 at 16:16
  • My purpose is too add maven dependencies to the packaged jar. I am building my project using Tycho/maven. What I need to do to get those dependencies into the packaged jar?? – Diptish Mar 15 '21 at 14:57

0 Answers0