0

Rough Project structure is as follows:

Parent module

<groupId>groupId</groupId>
<artifactId>Module-Parent</artifactId>
<packaging>pom</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Parent Project</name>

<modules>
    <module>Module1</module>
    <module>Module2</module>
    <module>PluginModule3</module>
</modules>

<properties>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
</properties>

PluginProject pom.xml
<parent> <groupId>groupId</groupId> <artifactId>Module-Parent</artifactId> <version>0.0.1-SNAPSHOT</version> </parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>PluginProject</artifactId>
<name>Plugin Project</name>
<packaging>eclipse-plugin</packaging> 

<dependencies>
    <dependency>
        <groupId>Module2groupID</groupId>
        <artifactId>module2</artifactId>
        <version>${project.version}</version>
    </dependency>
</dependencies>

// tycho dependencies included

Now since the packaging of the parent and sub-module are different. I am not able to refer the parent classes in my code using eclipse and the maven dependencies/libraries are also not considered. However I am able to build all the modules successfully using maven and Tycho respectively (if I don't refer any classes from parent project).

All the libraries related to Maven are getting removed by itself from the build path of the plugin-project as soon as the eclipse-pluginentry added in sub module pom.xml.

Please help me how to resolve my parent class references in my plugin-project.

Vignesh
  • 9
  • 3
  • Java classes in a `pom` module? How is that supposed to work? – oberlies Oct 21 '14 at 08:01
  • Also, you POM extracts don't make much sense - you should probably edit the question and add larger, syntactically valid POM snippets. – oberlies Oct 21 '14 at 08:01
  • All Modules are java projects basically. Module2 is added as dependency in plugin project. classes of module 2 is not accessible in plugin project via eclipse. And Pom extracts are updated to actual pom. – Vignesh Oct 21 '14 at 10:13
  • This is not a well-worded question because it is not concise. It would have been sufficient to say that you have `jar` and `eclipse-plugin` modules in your reactor, and that you cannot reference classes from the `jar` module in the `eclipse-plugin` module. – oberlies Nov 13 '14 at 13:41

1 Answers1

0

OSGi doesn't support references from bundles to non-bundle libraries.

So if you want to re-use classes from your other modules in the build, they also need to be OSGi bundles, and you need to set the appropriate exports and inports in the OSGi bundle manifests.

oberlies
  • 11,503
  • 4
  • 63
  • 110