With the new Maven support in 12c, it is much simpler now to include our ADF projects in our SOA Application build. Continuing on from this earlier post, we will now add the ADF project.
You can do this by opening the Human Task (from the composite view) and clicking on Form and Auto-Generate Task Form.
Then in the popup Create Project dialog box, give the project a name, I used HTUI1, and click on OK. It will take a few minutes to generate the project. When it is done, do a Save All for good measure.
Now if you want to take a look, you will see that you have three POM files – one for the SOA Project (composite), one for the ADF project, and also your application level POM. If you open the application level POM (that’s the one under Application Resources/Build Files, you will see that is is a multi-modules project that lists the other two, as you can see in the image below. It also has some configuration to tell Maven where to find ojdeploy. In this release, we still need to run ojdeploy to build and package the ADF projects, so you do need to have JDeveloper available to your build server if you want to build ADF projects there.
ojdeploy also expects the have oracleHome set, but to a different value, so let’s go update our SOA project POM to set the oracleHome it expects there:
<oracleHome>c:/bpm1213/soa</oracleHome>
Now we can run our build from the command line or JDeveloper, for example to compile and package the composite and the ADF application, we can say something like this:
mvn package -DoracleHome=c:\bpm1213
Now let’s take that one step further and deploy the ADF application too. You may recall that each ADF HT UI project is built into a WAR and these are then assembled into an EAR file, so it is this EAR file we want to deploy. We can tell Maven to use the WebLogic Maven Plugin to deploy the EAR by adding a plugin entry to the build section of the SOA Application POM. Make sure you put it in the Application level POM! Here is what you need to add:
<plugin> <groupId>com.oracle.weblogic</groupId> <artifactId>weblogic-maven-plugin</artifactId> <version>12.1.3-0-0</version> <executions> <execution> <goals> <goal>deploy</goal> </goals> <phase>pre-integration-test</phase> <configuration> <adminurl>t3://my.server:7001</adminurl> <user>weblogic</user> <password>welcome1</password> <source>${project.basedir}/deploy/HTUI1.ear</source> <verbose>true</verbose> <name>${project.build.finalName}</name> <targets>soa_server1</targets> </configuration> </execution> </executions> </plugin>
Now we can use a command like this to deploy everything to our servers:
mvn pre-integration-test -DoracleHome=c:\bpm1213
Enjoy!