views:

207

answers:

2

I am noticing that Oracle ADF has its own EAR structure. There is an adf folder created like so, inside the EAR, along with the WAR file and standard META-INF directory is this 'adf' directory:

adf
  /com
    /companypackagehere
      bc4j.xcfg
  /META-INF
    adf-config.xml
    connections.xml

Must I recreate this using file moves...? And how can I create an Oracle ADF and weblogic compliant EAR with maven?

edit: I noticed that when JDeveloper creates said ear file, the source folder layout and the EAR folder layout (as described) are hardly similar. So it is taking various xml files and from various places and placing them in the described layout. How can I achieve this in maven? What plugin(s)/tricks do I need?

A: 

I don't have any experience with Oracle ADF but I think that you could just put the adf directory in the ${basedir}/src/main/application directory of your EAR module (this is the default value of the earSourceDirectory property which points to a single directory for extra files to include in the EAR).

Something like this:

. 
|-- ear
|   |-- src
|   |   `-- main
|   |       `-- application
|   |           |-- META-INF
|   |           |   `-- application.xml
|   |           `-- adf
|   |               |-- com
|   |               |   `-- companypackagehere
|   |               |       `-- bc4j.xcfg
|   |               `-- META-INF
|   |                   |-- adf-config.xml
|   |                   `-- connections.xml
|   `-- pom.xml
|-- web
|   +-- src
|   `-- pom.xml
`-- pom.xml

And packaging this project would result in something approaching this (assuming you don't have EJBs or other libraries):

ear-1.0 
|-- META-INF
|   `-- application.xml
|-- adf
|   |-- com
|   |   `-- companypackagehere
|   |       `-- bc4j.xcfg
|   `-- META-INF
|       |-- adf-config.xml
|       `-- connections.xml
`-- web-1.0.war
Pascal Thivent
@Pascal Thivent, see my update/edit.
Zombies
@Zombies I don't understand the update (very likely because I don't know JDeveloper and ADF) and I'm afraid I won't be helpful behind what I posted. Maybe you'll find more hints in this [this pretty recent thread](http://kr.forums.oracle.com/forums/thread.jspa?messageID=4256995).
Pascal Thivent
+1  A: 

I assume you are using JDeveloper, one tool you might want to try using is ojdeploy

It is a tool to generate deployable EAR files from your JDeveloper project. It's much easier to work with than an external tool since you don't need to keep your deployment & development build scripts in sync.

Mark Robinson
We are using ojdeploy atm, but we want to use the features maven has to offer.
Zombies
I've never used maven, only ant, so I can't help you there.Could you create a maven task which invokes ojdeploy?
Mark Robinson
Maybe... but doesn't ojdeploy just recompile and build based on the deployment profile? It would seem maven's features would just be ignored (compiling and adding dependent jars to the class path).
Zombies
I'm not intimately familiar with Maven, so I couldn't know. But that is the point of using ojdeploy, you define the build process once and it handles the dependencies.
Mark Robinson