To make it work the Maven way, you should ideally separate the jar from the war file as an independent module. Your war file will then depend on the jar.

Not sure if your packaging is war, adding maven-jar-plugin creates a jar file? If it does then you can use build-helper-maven-plugin to install the additional jar generated to the repository.

In any case you can even depend on the war file with dependency definition like,

<dependency>
<groupId>mycorp.groupid</groupId>
<artifactId>mycorp-artifactid</artifactId>
<version>myversion</version>
<type>war</type>
</dependency>

But I would strongly recommend separating jar and war as separate module.

- Kalpak

I have a scenario where in my pom generates a war file. Whereas I also need a
jar of the same to be referenced by other projects. So I added a
maven-jar-plug-in to generate a jar for the same. As the pom was installing
this generated jar as the war to the repository. I mentioned a classifier to
differentiate this jar with war. Now the problem is how I should put a
dependency in other projects on this jar file.

Thanks in advance
Ravi



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to