0

I have a maven project currently structured that has to build a jar first from some source files, then create an ear file containing that jar along with some other xml resources. The way I do it at the moment is by building the jar seperate in a 'child' pom.xml then at the root of the project folder I have a parent pom that does the ear packaging.

I know it isn't ideal, but I what to be able to compile the jar and then package it into an ear all with just one pom.xml file. Any ideas on how to do this?

javawocky
  • 899
  • 2
  • 9
  • 31
  • 1
    No idea how you can do it in a Single pom.xml. But you should use a Multi module build – Jens Oct 13 '16 at 12:57
  • 1
    Create a multi module build make a separate ear module and your jar project as a module as well. Cleanest way (separation of concerns). – khmarbaise Oct 13 '16 at 13:06
  • Yep I understand the multi module approach but for this particular project that isn't ideal. Even if the single pom solution is a bit hacky thats ok.... – javawocky Oct 13 '16 at 14:04
  • It does not really matter if this is particular project. The best way is to go via multi module build that's it... – khmarbaise Oct 13 '16 at 19:26

0 Answers0