views:

15

answers:

2

Hi,

We have configured our maven assembly plugin to create individual jars files that are uploaded to our local maven repo via the deploy plugin.

However we need to reference those jar files (the ones created by the assembly plugin) within other projects as maven dependencies. Any ideas on how we can accomplish that would be greatly appreciated.

Regards,

--pok

Update For example :

-client (pom.xml - groupId=com.mycompany artifactId=client)
  |-src
    |-main
      |-java
        |-authentication
        |-billing
        |-reporting

This gets split up into 3 different jar files by the maven assembly plugin and publish to our local repo as :

-client-authentication.jar
-client-billing.jar
-client-reporting.jar

How do we reference client-authentication.jar as a dependency for another project without it having it's own pom file?

A: 

You will need to add that local repo to your other project's poms

<repositories>
  <repository>
     <id>my-local-repo</id>
     <name>My companywide local repo</name>
     <url>{the actual url of your repo}</url>
  </repository>
</repositories>

This being done, you can add the dependency to those artifacts in those same poms

  <dependency>
     <groupId>{some.group}</groupId>
     <artifactId>{my.local.repo.artifact}</artifactId>
     <version>{some.version}</version>
  </dependency>
naikus
pokkie
A: 

Did you try to include the classifier in the dependency (your artifacts have a version, right?):

<dependency>
  <groupId>com.mycompany</groupId>
  <artifactId>client</artifactId>
  <version>1.0-SNAPSHOT</version>
  <classifier>authentication</classifier>
  <type>jar</type>
</dependency>

But I need to stress that you are going against the one artifact per module golden rule, you should split your code into three modules.

Pascal Thivent