maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "banka.ravi" <banka.r...@gmail.com>
Subject Re: Setting dependency with plugin generated jar
Date Thu, 11 Nov 2010 09:49:31 GMT

The jar file is getting generated (as "projectVersion-modals.jar", but the
war file is named as "projectVersion.war") and also getting installed to the
repository. But wen I try to reference it in the pom of the dependent
project, the wizard don't work, it shows only the "projectVersion.war".
How do I add the "projectVersion.jar" as a dependency?

Separate modules you mean separate Maven Projects? Then I don't get the
other modules source files right. I will have to unpack the war and repack
them as jar?

Regards,
B. Ravi Shankar

2010/11/11 Kalpak Gadre [via Maven] <
ml-node+3259883-1188320679-143892@n5.nabble.com<ml-node%2B3259883-1188320679-143892@n5.nabble.com>
>

>   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: [hidden email]<http://user/SendEmail.jtp?type=node&node=3259883&i=0>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3259883&i=1>
>
>
>
> ------------------------------
>  View message @
> http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html
> To unsubscribe from Setting dependency with plugin generated jar, click
> here<http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3259867&code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0>.
>
>
>

-- 
View this message in context: http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259993.html
Sent from the Maven - Users mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message