原文:http://www.oracle.com/technetwork/articles/adf/part4-098813.html
Oracle JDeveloper 11g makes it easy to compile applications, generate deployment artifacts (such as Java archives [JARs], Web application archives (WARs), and enterprise archives [EARs]), and deploy applications from within the IDE, but what if you want to be able to perform such tasks outside of the Oracle JDeveloper IDE? For example, if you are using a continuous-build tool or if you need to build an EAR file from a machine that does not have Oracle JDeveloper installed? You could create hand-coded scripts to do these tasks, but that would be quite tedious. The alternative is to use a build tool such as Ant.
关于ojdeploy
Oracle JDeveloper 11g includes a new command-line tool called ojdeploy that can compile and create JAR/WAR/EAR files by referring to the information in the application (jws) and project (jpr) files; ojdeploy also has a corresponding Ant task, so you can use the same capabilities from within Ant. However, a drawback of ojdeploy (both the command-line tool and the Ant task) is that it requires Oracle JDeveloper to be installed on the machine on which you are doing the build. In addition, at the time of this writing, there appears to be a bug in the Ant task for ojdeploy that prevents it from creating the application EAR file properly. This article will show you how to build your applications with Ant without using ojdeploy, in order to eliminate these two drawbacks.
这篇文章介绍了如何在不安装jdeveloper和weblogic server的情况下使用ant来build ADF projects。
You create the build scripts by following these steps: 1)Create an Oracle JDeveloper project to hold the Oracle ADF libraries and other libraries normally provided by Oracle JDeveloper. You do this so the required libraries will be available on the “clean” computer. 2)Create an Ant script containing library definitions for all the required libraries. 3)Identify the JAR files that comprise the required libraries and copy them from the Oracle JDeveloper installation to the new project’s directory. 4)Create an Ant build script to compile the Model project. 5)Create an Ant build script to compile the ViewController project. 6)Create an Ant build script to create WAR/EAR files.
这个过程是利用jdeveloper来创建一个个对应的build.xml,然后再修改对应的path和参数,最后形成一个build.xml.
build.xml包括几部分:依赖包的配置,Model project的build, ViewController的build,deploy的build. 具体步骤可以参考原文,解释的很清楚,此处不再多言。
编译一个ADF project所需要的所有的依赖包
更多参考:
http://www.oracle.com/technetwork/articles/adf/adf-essentials-098792.html
Part 1 - Version Control with Subversion: Using a Repository for Single-User Projects
Learn how to create a repository and start using Subversion for version control in a single-user environment.
Part 2 - Version Control with Subversion: Managing Versions in a Team Environment
Use Subversion to help you manage versions in a team environment.
Part 3 - Version Control with Subversion: Avoiding "Gotchas"
How to avoid or circumvent some of the common "gotchas" that arise when using Subversion for Oracle ADF development.
Part 4 - Building Projects using Ant
Tips for building Oracle ADF projects using Ant outside of the Oracle JDeveloper environment.
Part 5 - Unit Testing Your Application with JUnit
A primer on creating unit tests for Oracle ADF projects and executing them from within Oracle JDeveloper.
Part 6 - Testing Your Oracle ADF Faces Application with Selenium
How to use Selenium and JUnit together to build unit tests that test Web UIs.
Part 7 - Continuous Integration with Hudson
The basics of installing and configuring the Hudson integration engine to continuously build and test Oracle ADF applications
Part 8 - Building Customizable Applications Using Oracle Metadata Services
Get a hands-on introduction to Oracle ADF's services for personalization and customization
Part 9 - Building Customizable Applications Using Oracle Metadata Services (II)
A hands-on introduction to Oracle ADF's services for personalization and customization (continued) - in this installment, creating seeded customizations.
Part 10 - Building Customizable Applications Using Oracle Metadata Services (III)
A hands-on introduction to Oracle ADF's services for personalization and customization (continued) - in this installment, installing and configuring a repository for persistent storage of customizations.