0

firstly I'm new to maven , so sorry for the question if it's too simple :)

I have main module "main" and child modules : a , b , c , ...

What I want is to share some data which is in child module a , with child module b.

The parent pom looks like : 4.0.0

    <groupId>Parent</groupId>
    <artifactId>Parent</artifactId>
    <packaging>pom</packaging>
    <version>1.0-SNAPSHOT</version>

    <modules>
        <module>a</module>
        <module>b</module>
        <module>c</module>
    </modules>
</project>

The child I want to share looks like :

<parent>
    <artifactId>Parent</artifactId>
    <groupId>Parent</groupId>
    <version>1.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>a</artifactId>
</project>

and "consumer" child looks like :

<parent>
        <artifactId>Parent</artifactId>
        <groupId>Parent</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>b</artifactId>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>a</artifactId>
            <version>${project.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
    </dependencies>

I do see the jar file being added to the "External Library" (I'm using Intellij) But the jar contains only META-INF folder without the code (is it ok ?)

End of story, I cannot use Class ChildA in ChildB classes ... Any help whould be appriciated !!

Igal
  • 4,603
  • 14
  • 41
  • 66

1 Answers1

1

The problem was that I've "btoken" maven's project stracture .... Once I've build the module as it should be by maven , works like a charm :) http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html

Igal
  • 4,603
  • 14
  • 41
  • 66