• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

extract <jarModule> from pom when building EAR

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i am creating an EAR file using maven-ear-plugin.
the EAR that I am creating has a unique structure, it must includes folders,sub-folders, war files and jars.
i was able to create the structure i wanted by using the jarModule, for example:


By doing the above the POM file has gotten huge and I am trying to find a way to reduce its size and make it more generic.
this is the structure of what i have so far, will try to make it short:

What I am trying to achieve here is either to move the jarModule/webModule to a different file and include them in my pom, or perhaps inject the modules from a different location.
My desired end result here is that i could use this pom for various projects and each project would only have to update the web/jar modules.
Regarding the dependencies i assume that they should remain in this pom but i am open for other suggestions as well
your advice would be greatly appreciated, thank you!
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The thing about maven is that if you do things that are non-standard, it makes life tough for you. You need to ask yourself :- am I creating an EAR file? Or am I creating a tooally new packaing structure and calling it an EAR file?. The thing is an "EAR" file is defined by it's internal structure, not by it's extension. A EAR file should have a structure that conforms to the structure specified by J2EE spec here. Just because you put a .ear extension on a file doesn't make it an ear

The maven-ear-plugin is designed to create a EAR file that conforms to the structure specified in the J2EE spec. If you have come up with your own packaging structure, then you shouldn't be using maven-ear-plugin to package your file. If you do, then you make life difficult for yourself (as you have already found out). WHat you should do is create your own maven plugin that packages the files in the structure that you want to package in.

Maven is extensible. You can customize it to do non-standard things by implementing your own plugins. If you are doing something non-standard, you should write your own plugin.
 
Think of how dumb the average person is. Mathematically, half of them are EVEN DUMBER. Smart tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic