tags:

views:

25

answers:

1

Hi!

I have a RMI app and the Stubs are generated with maven (rmic:rmic).

Then I use the rmic:package goal and get a nice little jar with only the stubs.

Now the bis question is: How can I reference this jar from the poms of other projects?

I cant give it an ArtifactId (or do I?!) and when I use the classifier, it downloads all dependecies of the original Project and NOT the jar with the stubs.

Please give me a hint, how I can actually use this jar in a nice behaving maven way :-)

thanks in advance, I vote for stuff and accept answers, so you'll get your points!

A: 

You could indeed create a project/POM for your Stub Project.

You could bind the rmic:rmic goal to the generate-sources phase of a "Stub Project" POM; so that the compile phase of the build 1) creates the stub classes and then 2) compiles them.

This would then allow you to package the project (as a JAR, or whatever else) and deploy it to a Maven repository like any other project.

From there, you would simply reference the artifact as a <dependency> of the projects that depend on the stubs.

matt b