Portable adf-config.xml with JDevelopper

On my current project assignment, we use JDevelopper to develop BPEL process. As you might notice, JDevelopper use a hidden folder .adf where it store configuration file to acess MDS location for example (.adf\META-INF\adf-config.xml). As we use different platform (windows for development and linux for continuuous integration with Maven), you can define your adf config file to be portable in both environment.

For example, we have used:

          <metadata-store-usage id="mstore-usage_1">
            <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
              <property name="metadata-path" value="${mds.home}"/>
              <property name="partition-name" value="MDS"/>
          <metadata-store-usage id="mstore-usage_2">
            <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
              <property name="metadata-path"
              <property name="partition-name" value="seed"/>

The mds.home can be defined as an environment variable in Windows and Linux system. The advantage when you use this syntax with Maven, is that it is recognized as a Maven property. Et voila, you don’t need to change .adf\META-INF\adf-config.xml anymore when you switch platform !

I use the following command to start JDevelopper, just to have a control of the jdev config folder. Don’t forget to add the parameter -J-Dmds.home

that match the value defined in environment variable.

title JDeveloper
set JDEV_HOME=C:\LinkyWorkspace\outils\jdev11117
cd %JDEV_HOME%\jdeveloper\jdev\bin\
rem jdev.exe -J-Dide.user.dir=%JDEV_HOME%\jdev_config
jdev.exe -J-Dmds.home=C:\LinkyWorkspace\workspace_bpel\SOCLE -J-Dide.user.dir=%JDEV_HOME%\jdev_config   

You can then validate the JDevelopper recognize this ${mds.home} value:

On Windows command (I have defined this variable as a system variable, this is not working for Windows 7 if you defined this as user variable)

C:\Users\Chenda>echo %MDS.HOME%

About Chenda Mok

19 years of hands on experience in software design and development with emphasis on Enterprise Application Integration (EAI), Services Oriented Architecture (SOA) and Identity Management (IDM) solutions. I’m a software engineer, member of the professional service delivery team working for Salesforce. Prior to this, I worked for Oracle as Solution Architect, through SeeBeyond(06/2005), then SUN’s acquisition (04/2009). After my master’s degree in computer science in 1997; I always delivered consulting on architecture, design, implementation on integration’s field. I’m interested in architecture using EAI/SOA/IDM/BPM/Cloud technologies, software development and Java’s related technologies. I may blog about my work/activities at Salesforce, but I do not speak for my employer, past, present or future.
This entry was posted in bpel, config, DevTools, JDevelopper, Maven and tagged , , . Bookmark the permalink.