Wednesday, February 3, 2010

Exporting WebLogic Workshop as Ant Script

this will create:
${workspace-dir}/workshop-lib/
${workspace-dir}/workspace.xml
${workspace-dir}/${project-dir}/build.xml

you should specify these properties:
workspace
wl.home
workshop.home

(
the wizard suggests you to declare:
wl.home=C:/beawli/wlserver_10.3
workshop.home=C:/beawli/workshop_10.3
workspace.dir=C:/beawli/user_projects/workspaces/default
)


How to export Ant in Workshop :

http://download.oracle.com/docs/cd/E13224_01/wlw/docs102/guide/ideuserguide/build/conUseCustomAntBuild.html

this http://www.oracle.com/technology/pub/articles/liptak-workshop-ant.html talks more on the subject

You can export ALL the build.xml in one go (select all the projects you need in the wizard).

To run the build:

declare


cd C:\beawli\user_projects\workspaces\default\JAWWAL_INTEG_WEB

c:\beawli\wlserver_10.3\common\bin\commEnv.cmd

#this takes care of the java.lang.NoClassDefFoundError: weblogic/logging/NonCatalogLogger
set CLASSPATH=C:\beawli\wlserver_10.3\server\lib\wls-api.jar;%CLASSPATH%

set WL_HOME=c:\beawli\wlserver_10.3\
set WORKSHOP_HOME=C:\beawli\workshop_10.3
set WORKSHOP_WORKSPACE=C:\beawli\user_projects\workspaces\default\
set WORKSHOP_LIB_DIR=C:\beawli\user_projects\workspaces\default\workshop-lib

copy C:\beawli\wlserver_10.3\server\lib\wls-api.jar C:\beawli\user_projects\workspaces\defaultworkshop-lib

ant -verbose build archive

or if you want more info:

ant -verbose -diagnostics build archive > antlog.log

With log4j enabled:
set ANT_OPTS=-Dlog4j.debug -Dlog4j.configuration=file:./log4j.propertiesset CLASSPATH=C:\beawli\modules\org.apache.beehive_1.0.2.2\apache-beehive-svn-snapshot\lib\common\log4j-1.2.8.jar;%CLASSPATH%
ant -listener org.apache.tools.ant.listener.Log4jListener -verbose -buildfile build.xml build


To run an automate build from Hudson/CVS, remember to copy:
a build.xml per each project
a workspace.xml medatata file
the .metadata workspace directory
workshop-lib directory

No comments: