How to make your own ear file in maven
Here is my call, I need to make an ear file for a specific container. To be more specific, how this ear will be created:
- This is a standard j2ee ear file with 1 WAR in it.
- The container it is deployed to will expect certain xml files (which can be easily found (somewhere) inside the original project).
Here are my obstacles
- The source folder contains various container-specific XML files. But these files do not directly map to where the container expects them in the EAR file. For example, there will be a file that this container expects in "EARFILE.ear / config / connections.xml". But this file is located (in the source) in the / some / obscure / unrelated / directory. This applies to approximately 5-7 files.
- I cannot completely change the original layout of the original project.
So how can I create a compatible EAR file that I need. At the moment there is no plugin for the container I am using, I definitely looked.
Update:
Original layout for JDeveloper:
.adf
/META-INF/
(some xml files to map to various locations in the EAR)
Model
ViewController
public_html
src/
META-INF/
(some xml files to map to various locations in the EAR)
a source to share
This is a j2ee standard ear file that has 1 WAR in it. The container it is deployed to will expect certain xml files (which can easily be found (somewhere) inside the original project).
As I said in this previous answer , a typical layout for a maven project with war and ear module would look like this:
... | - ear | | - src | | `- main | | `- application | | | - META-INF | | | `- application.xml | | `- config | | `- connections.xml | `- pom.xml | - web | + - src | `- pom.xml `- pom.xml
If the files in the directory ${basedir}/src/main/application
will be included in the EAR (this is the default setting earSourceDirectory
).
The source folder contains various container XML files. But these files do not directly map to where the container expects them in the EAR file. (...)
Sorry, but ... what is the source folder? It might be possible to use the Maven AntRun plugin to copy some files into the ear project from somewhere else, but 1. that would be very messy and 2. without any details it is impossible to give more guidance.
I cannot completely change the original layout of the original project.
What does it look like? You really need to provide more details (and if you can't change anything, mavenizing this project can be tricky at all, especially if you're new to maven).
a source to share