Re: Setting dependency with plugin generated jar
Thanks this helped Regards, B. Ravi Shankar 2010/11/11 Ron Wheeler [via Maven] ml-node+3260435-198418789-143...@n5.nabble.comml-node%2b3260435-198418789-143...@n5.nabble.com War project has almost no code or preferably no code . Code is in jar project. War project has WebContent stuff (configurations, XML, images, JSPs) and depends on your Jar project for its classes. It will create a WAR file with the classes from the dependencies. Ron On 11/11/2010 8:29 AM, banka.ravi wrote: I tried using classifier already, it is not working. Currently, the maven project where I have all the implementations is generating war file. If I add another maven project for generating JAR, from where will this project get the source files from? I can add a dependency on first project then my second project will have access to the war generated, right. What I wrote in my earlier mail was, should my second project extract the war. locate the .class files then again package them in to jar? but that will be lots of work right? Regards, B. Ravi Shankar 2010/11/11 Kalpak Gadre [via Maven] [hidden email] http://user/SendEmail.jtp?type=nodenode=3260435i=0[hidden email] http://user/SendEmail.jtp?type=nodenode=3260435i=1 On Thursday 11 November 2010 03:19 PM, banka.ravi wrote: 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? Use dependency classifier. Specifying type as jar is not required since it is the default. dependency groupIdyour.groupId/groupId artifactIdyour-artifactId/artifactId version${project.version}/version classifiermodals/classifier typejar/type /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? Yes separate module means separate Maven Project. I did not understand the rest of your comment. - Kalpak Regards, B. Ravi Shankar 2010/11/11 Kalpak Gadre [via Maven] [hidden email]http://user/SendEmail.jtp?type=nodenode=3260044i=0[hidden email]http://user/SendEmail.jtp?type=nodenode=3260044i=1 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 groupIdmycorp.groupid/groupId artifactIdmycorp-artifactid/artifactId versionmyversion/version typewar/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=nodenode=3259883i=0 For additional commands, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=3259883i=1 -- View message @ http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.htmlhttp://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=t http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=thttp://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=tby-user=t To unsubscribe from Setting dependency with plugin generated jar, click here http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=t http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=thttp://maven.40175.n5.nabble.com/template/TplServlet.jtp
Re: Setting dependency with plugin generated jar
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=nodenode=3259883i=0 For additional commands, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=3259883i=1 -- View message @ http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.htmlhttp://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=t http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=thttp://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=tby-user=t To unsubscribe from Setting dependency with plugin generated jar, click here http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=t http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=thttp://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=tby-user=t. - To unsubscribe, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=3260044i=2 For additional commands, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=3260044i=3 -- View message @ http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3260044.htmlhttp://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3260044.html?by-user=t To unsubscribe from Setting dependency with plugin generated jar, click here http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=t. - To unsubscribe, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=3260435i=2 For additional commands, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=3260435i=3 -- View message @ http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3260435.html To unsubscribe from Setting dependency with plugin generated jar, click herehttp://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Setting dependency with plugin generated jar
-artifactid/artifactId versionmyversion/version typewar/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=nodenode=3259883i=0 For additional commands, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=3259883i=1 -- View message @ http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.htmlhttp://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=t http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=thttp://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=tby-user=t http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=thttp://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=tby-user=t http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=tby-user=thttp://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=tby-user=tby-user=t To unsubscribe from Setting dependency with plugin generated jar, click here http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=t http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=thttp://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=tby-user=t http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=thttp://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=tby-user=t http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=tby-user=thttp://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=tby-user=tby-user=t. - To unsubscribe, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=3260044i=2 For additional commands, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=3260044i=3 -- View message @ http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3260044.htmlhttp://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3260044.html?by-user=t http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3260044.html?by-user=thttp://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3260044.html?by-user=tby-user=t To unsubscribe from Setting dependency with plugin generated jar, click here http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=t http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=thttp://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=tby-user=t. - To unsubscribe, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=3260435i=2 For additional
Re: Setting dependency with plugin generated jar
2010/11/12 Ron Wheeler rwhee...@artifact-software.com: The war can not be completely tested because it contains visual elements and navigation and flow that usually requires manual testing. Or automated integration/functional testing, for example via Selenium or Canoo WebTest. Antonio - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Setting dependency with plugin generated jar
On Fri, Nov 12, 2010 at 12:24 AM, banka.ravi banka.r...@gmail.com wrote: I am finding a way to generate jar also in the war project and setting fer other projects depend on that. (Aside from all the advice you're getting to move the classes to a separate module...) Use the war plugin configuration that (I think) someone already pointed out, not a separate execution of the jar plugin. http://maven.apache.org/plugins/maven-war-plugin/faq.html#attached -- Wendy - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Setting dependency with plugin generated jar
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-143...@n5.nabble.comml-node%2b3259883-1188320679-143...@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 groupIdmycorp.groupid/groupId artifactIdmycorp-artifactid/artifactId versionmyversion/version typewar/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=nodenode=3259883i=0 For additional commands, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=3259883i=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 herehttp://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=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.
Re: Setting dependency with plugin generated jar
On Thursday 11 November 2010 03:19 PM, banka.ravi wrote: 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? Use dependency classifier. Specifying type as jar is not required since it is the default. dependency groupIdyour.groupId/groupId artifactIdyour-artifactId/artifactId version${project.version}/version classifiermodals/classifier typejar/type /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? Yes separate module means separate Maven Project. I did not understand the rest of your comment. - Kalpak Regards, B. Ravi Shankar 2010/11/11 Kalpak Gadre [via Maven] ml-node+3259883-1188320679-143...@n5.nabble.comml-node%2b3259883-1188320679-143...@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 groupIdmycorp.groupid/groupId artifactIdmycorp-artifactid/artifactId versionmyversion/version typewar/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=nodenode=3259883i=0 For additional commands, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=3259883i=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 herehttp://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Setting dependency with plugin generated jar
I tried using classifier already, it is not working. Currently, the maven project where I have all the implementations is generating war file. If I add another maven project for generating JAR, from where will this project get the source files from? I can add a dependency on first project then my second project will have access to the war generated, right. What I wrote in my earlier mail was, should my second project extract the war. locate the .class files then again package them in to jar? but that will be lots of work right? Regards, B. Ravi Shankar 2010/11/11 Kalpak Gadre [via Maven] ml-node+3260044-659906128-143...@n5.nabble.comml-node%2b3260044-659906128-143...@n5.nabble.com On Thursday 11 November 2010 03:19 PM, banka.ravi wrote: 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? Use dependency classifier. Specifying type as jar is not required since it is the default. dependency groupIdyour.groupId/groupId artifactIdyour-artifactId/artifactId version${project.version}/version classifiermodals/classifier typejar/type /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? Yes separate module means separate Maven Project. I did not understand the rest of your comment. - Kalpak Regards, B. Ravi Shankar 2010/11/11 Kalpak Gadre [via Maven] [hidden email] http://user/SendEmail.jtp?type=nodenode=3260044i=0[hidden email] http://user/SendEmail.jtp?type=nodenode=3260044i=1 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 groupIdmycorp.groupid/groupId artifactIdmycorp-artifactid/artifactId versionmyversion/version typewar/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=nodenode=3259883i=0 For additional commands, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=3259883i=1 -- View message @ http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.htmlhttp://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=t To unsubscribe from Setting dependency with plugin generated jar, click here http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=t. - To unsubscribe, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=3260044i=2 For additional commands, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=3260044i=3 -- View message @ http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3260044.html To unsubscribe from Setting dependency with plugin generated jar, click herehttp://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0. -- View this message in context: http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3260249.html Sent from the Maven - Users mailing list archive at Nabble.com.
Re: Setting dependency with plugin generated jar
War project has almost no code or preferably no code . Code is in jar project. War project has WebContent stuff (configurations, XML, images, JSPs) and depends on your Jar project for its classes. It will create a WAR file with the classes from the dependencies. Ron On 11/11/2010 8:29 AM, banka.ravi wrote: I tried using classifier already, it is not working. Currently, the maven project where I have all the implementations is generating war file. If I add another maven project for generating JAR, from where will this project get the source files from? I can add a dependency on first project then my second project will have access to the war generated, right. What I wrote in my earlier mail was, should my second project extract the war. locate the .class files then again package them in to jar? but that will be lots of work right? Regards, B. Ravi Shankar 2010/11/11 Kalpak Gadre [via Maven] ml-node+3260044-659906128-143...@n5.nabble.comml-node%2b3260044-659906128-143...@n5.nabble.com On Thursday 11 November 2010 03:19 PM, banka.ravi wrote: 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? Use dependency classifier. Specifying type as jar is not required since it is the default. dependency groupIdyour.groupId/groupId artifactIdyour-artifactId/artifactId version${project.version}/version classifiermodals/classifier typejar/type /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? Yes separate module means separate Maven Project. I did not understand the rest of your comment. - Kalpak Regards, B. Ravi Shankar 2010/11/11 Kalpak Gadre [via Maven] [hidden email]http://user/SendEmail.jtp?type=nodenode=3260044i=0[hidden email]http://user/SendEmail.jtp?type=nodenode=3260044i=1 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 groupIdmycorp.groupid/groupId artifactIdmycorp-artifactid/artifactId versionmyversion/version typewar/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=nodenode=3259883i=0 For additional commands, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=3259883i=1 -- View message @ http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.htmlhttp://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=t To unsubscribe from Setting dependency with plugin generated jar, click here http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0by-user=t. - To unsubscribe, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=3260044i=2 For additional commands, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=3260044i=3 -- View message @ http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3260044.html To unsubscribe from Setting dependency with plugin generated jar, click herehttp://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=3259867code=YmFua2EucmF2aUBnbWFpbC5jb218MzI1OTg2N3wtODYyMDIzNzQ0. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Setting dependency with plugin generated jar
2010/11/11 Ron Wheeler rwhee...@artifact-software.com: War project has almost no code or preferably no code . Code is in jar project. War project has WebContent stuff (configurations, XML, images, JSPs) and depends on your Jar project for its classes. It will create a WAR file with the classes from the dependencies. I disagree, you can put code in war projects, as long as it is tightly connected to the web project itself, e.g. actions in an MVC framework, servlets, etc. If you really like to pack all the code into a jar, see here: http://maven.apache.org/plugins/maven-war-plugin/faq.html#attached Antonio - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Setting dependency with plugin generated jar
You are right of course. The point was to explain how not to have duplicate source code and how not to make jars depend on wars. As an aside: I prefer to write libraries of code (deployed as jars) that perform all of the functions that are not related to the view since the model and controller can often be reused in webservices and standalone batch jobs. They are also easier to test and release since they do not require human interaction which war files almost always do. (you can run all the unit tests in the world but if the text on the screen is wrong or the wrong colour or size, you still can't put it in production) The point was to explain how not to have duplicate source code and how not to make jars depend on wars. Ron On 11/11/2010 10:16 AM, Antonio Petrelli wrote: 2010/11/11 Ron Wheelerrwhee...@artifact-software.com: War project has almost no code or preferably no code . Code is in jar project. War project has WebContent stuff (configurations, XML, images, JSPs) and depends on your Jar project for its classes. It will create a WAR file with the classes from the dependencies. I disagree, you can put code in war projects, as long as it is tightly connected to the web project itself, e.g. actions in an MVC framework, servlets, etc. If you really like to pack all the code into a jar, see here: http://maven.apache.org/plugins/maven-war-plugin/faq.html#attached Antonio - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Setting dependency with plugin generated jar
2010/11/11 Ron Wheeler rwhee...@artifact-software.com: The point was to explain how not to have duplicate source code and how not to make jars depend on wars. Agreed Ron :-) When I saw your sentence I wrote that answer to be sure that a wrong message (don't ever put Java code in a war project) passes to the OP. Sorry having misunderstood your phrase. Antonio - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Setting dependency with plugin generated jar
On 11/11/2010 11:29 AM, Antonio Petrelli wrote: 2010/11/11 Ron Wheelerrwhee...@artifact-software.com: The point was to explain how not to have duplicate source code and how not to make jars depend on wars. Agreed Ron :-) When I saw your sentence I wrote that answer to be sure that a wrong message (don't ever put Java code in a war project) passes to the OP. Sorry having misunderstood your phrase. I should have been less extreme in my statement or explained how Maven can support MVC to make projects more stable and easier to test and release. Antonio - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Setting dependency with plugin generated jar
by mentioning Looking for classes, I did not meant the source code, I was mentioning . I extracted the war file manually using 7zip tool and found that it had compiled .class files. I know that war contains all resources. Our project don't have separate modules for Model, View and Controllers. And its high time to setup everything like that. so, I am finding a way to generate jar also in the war project and setting fer other projects depend on that. Regards, B. Ravi Shankar 2010/11/11 Ron Wheeler [via Maven] ml-node+3260435-198418789-143...@n5.nabble.comml-node%2b3260435-198418789-143...@n5.nabble.com War project has almost no code or preferably no code . Code is in jar project. War project has WebContent stuff (configurations, XML, images, JSPs) and depends on your Jar project for its classes. It will create a WAR file with the classes from the dependencies. Ron On 11/11/2010 8:29 AM, banka.ravi wrote: I tried using classifier already, it is not working. Currently, the maven project where I have all the implementations is generating war file. If I add another maven project for generating JAR, from where will this project get the source files from? I can add a dependency on first project then my second project will have access to the war generated, right. What I wrote in my earlier mail was, should my second project extract the war. locate the .class files then again package them in to jar? but that will be lots of work right? Regards, B. Ravi Shankar 2010/11/11 Kalpak Gadre [via Maven] [hidden email] http://user/SendEmail.jtp?type=nodenode=3260435i=0[hidden email] http://user/SendEmail.jtp?type=nodenode=3260435i=1 On Thursday 11 November 2010 03:19 PM, banka.ravi wrote: 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? Use dependency classifier. Specifying type as jar is not required since it is the default. dependency groupIdyour.groupId/groupId artifactIdyour-artifactId/artifactId version${project.version}/version classifiermodals/classifier typejar/type /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? Yes separate module means separate Maven Project. I did not understand the rest of your comment. - Kalpak Regards, B. Ravi Shankar 2010/11/11 Kalpak Gadre [via Maven] [hidden email]http://user/SendEmail.jtp?type=nodenode=3260044i=0[hidden email]http://user/SendEmail.jtp?type=nodenode=3260044i=1 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 groupIdmycorp.groupid/groupId artifactIdmycorp-artifactid/artifactId versionmyversion/version typewar/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=nodenode=3259883i=0 For additional commands, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=3259883i=1 -- View message @ http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.htmlhttp://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=t http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=thttp://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=tby-user=t To unsubscribe from Setting dependency with plugin generated jar, click here http://maven.40175.n5.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode
Re: Setting dependency with plugin generated jar
If you simply have classes for action / view I suppose they should not be referenced outside the war. If you have model classes its good to package them as separate jar. Trying to generate the jar in the same war project will only complicate things for you. You should create a separate module for model classes, which then should create a jar and then it can be referenced by your other components including your war file. Thanks, Kalpak by mentioning Looking for classes, I did not meant the source code, I was mentioning . I extracted the war file manually using 7zip tool and found that it had compiled .class files. I know that war contains all resources. Our project don't have separate modules for Model, View and Controllers. And its high time to setup everything like that. so, I am finding a way to generate jar also in the war project and setting fer other projects depend on that. Regards, B. Ravi Shankar 2010/11/11 Ron Wheeler [via Maven] ml-node+3260435-198418789-143...@n5.nabble.comml-node%2b3260435-198418789-143...@n5.nabble.com War project has almost no code or preferably no code . Code is in jar project. War project has WebContent stuff (configurations, XML, images, JSPs) and depends on your Jar project for its classes. It will create a WAR file with the classes from the dependencies. Ron On 11/11/2010 8:29 AM, banka.ravi wrote: I tried using classifier already, it is not working. Currently, the maven project where I have all the implementations is generating war file. If I add another maven project for generating JAR, from where will this project get the source files from? I can add a dependency on first project then my second project will have access to the war generated, right. What I wrote in my earlier mail was, should my second project extract the war. locate the .class files then again package them in to jar? but that will be lots of work right? Regards, B. Ravi Shankar 2010/11/11 Kalpak Gadre [via Maven] [hidden email]http://user/SendEmail.jtp?type=nodenode=3260435i=0[hidden email]http://user/SendEmail.jtp?type=nodenode=3260435i=1 On Thursday 11 November 2010 03:19 PM, banka.ravi wrote: 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? Use dependency classifier. Specifying type as jar is not required since it is the default. dependency groupIdyour.groupId/groupId artifactIdyour-artifactId/artifactId version${project.version}/version classifiermodals/classifier typejar/type /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? Yes separate module means separate Maven Project. I did not understand the rest of your comment. - Kalpak Regards, B. Ravi Shankar 2010/11/11 Kalpak Gadre [via Maven] [hidden email]http://user/SendEmail.jtp?type=nodenode=3260044i=0[hidden email]http://user/SendEmail.jtp?type=nodenode=3260044i=1 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 groupIdmycorp.groupid/groupId artifactIdmycorp-artifactid/artifactId versionmyversion/version typewar/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=nodenode=3259883i=0 For additional commands, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=3259883i=1 -- View message @ http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.htmlhttp://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=t http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259883.html?by-user=thttp
Setting dependency with plugin generated jar
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 -- View this message in context: http://maven.40175.n5.nabble.com/Setting-dependency-with-plugin-generated-jar-tp3259867p3259867.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Setting dependency with plugin generated jar
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 groupIdmycorp.groupid/groupId artifactIdmycorp-artifactid/artifactId versionmyversion/version typewar/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