Use ANT to build the portlet project 11G

By W.ZH July 22 2009

If you develop a portlet project, it is in fact has many differences with the normal web application, But when you develop project in the Jdev 11g, it developed as a normal project., when u do the deploy from Jdev, it will ask to develop as a web app or a portlet app. (This is a simple article, but it is very trick practice in your real project. it may take several days if you explore how to do this by ur self. )

But how to deploy the portlet project in ANT?

1. first you deply in jdev , you can get the ear file and war file. unzip that file to see what is inside.

2. you design a normal web build.xml for your project.

3. notice the major difference that jdev changed during the deploy for the portlet proejct are:

  • under the WEB-INF/lib there are some jar files you need to include. you copy them out , use the ant copy to copy these files before you start build your war file.
  • under the WEB-INF/wsdl there are some xml and ws config files you need to include. you copy them out , use the ant copy to copy these files before you start build your war file.
  • there are some files in the WEB-INF are new added for WSRP, you need get them and copy to your WEB-INF folder. Such as for mine:

WSRP_v1_Service-java-wsdl-mapping.xml

WSRP_v2_Service-java-wsdl-mapping.xml

wsrp_mime_cs_mappings.properties

standard-webservices.xml

oracle-webservices.xml

  • and also in the WEB-INF, weblogic.xml and web.xml file has beed changed. you need copy them out and use these to build the war file for your portlet deploy.

Basically, if you include all these, your build should be able to build the project as a portlet deployment.

There are some tips in ANT build file:

1. when you compile use <javac in ant, it will not auto copy any non java file to your classes dir, you need take note your properties, xml, xsd, wsdl files in the src folder to include them into your war file , after compile.

2. If you have the webservice /client proxy in your src, then then will create some *.xsd and *.wsdl in the src, you need to remeber to copy them to your classes folder.

Advertisements