I might be missing what you're trying to do here, and it seems to me that creating a multi-module project, as suggested, would be the best way to go about this. However, what if you bound your source generation to the "generate-sources" phase. I'm not sure of how it would be done in ant, but I know that you can then "add" the generated sources to the list of files to compile in the compile phase and then they should be included in your WEB-INF/classes directory in the war file. They won't be in a jar, but they'll be in your war.
(and you can DEFINITELY guarantee that they will be generated before the war is created - it seems that they are getting generated after the war because you are binding to the packaging phase, which is meant to actually package, and plugin order within a phase is undefined...) I found an article that mentions doing this with a hibernate ant task here: http://www.onjava.com/pub/a/onjava/2005/12/14/hibernate-class-generation-with-hbm2java.html?page=4 Maybe this will be helpful? On 8/31/06, chua <[EMAIL PROTECTED]> wrote:
Hi! I had more or less the same problem as you. One of the solutions is to create a project based on modules. You just have to create a parent pom with: <modules> <module>module_for_jar</module> <module>module_for_war</module> </modules> Then, you have to create two subfolders with the same name as the modules and with the m2 folder structure, each one with its own pom. Now you just have to have in one pom a jar packaging, and in the other a war packaging. The last thing to do is to include the dependency of the jar created in the jar module in the pom.xml of the war module. That´s one solution and it works to me. Be sure your jar module is declared first, and second, declare your war module. I hope I had helped you -- View this message in context: http://www.nabble.com/mvn2%3A-war-packaging-tf2186390.html#a6078489 Sent from the Maven - Users forum at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]