When building my EJB project with maven, maven expects the ejb-jar.xml to be in META-INF/. However; I need to be able to put it in directoryA/META-INF.
maven-ejb-plugin doesn’t seem to provide a parameter for specifying where ejb-jar.xml is.
Can you point me in the right direction?
Indeed, the maven-ejb-plugin doesn’t provide any parameter to change the location of the deployment descriptor which is expected to be available at
META-INF/ejb-jar.xml(the location is hard coded in the EjbMojo) or the build will fail at packaging time when building EJB 2.X (which makes sense).So, one way to achieve your goal would be to use the maven-antrun-plugin before the packaging phase to copy the content of
directoryA(assumingdirectoryAwas in a resources directory likesrc/main/resourcesand has been copied totarget/classes) to the expected location (i.e. the root oftarget/classes) and do some clean up, something like this:I don’t find this very clean but it works.