on 03-06-2006 11:54 PM
I have just competed writing a LoginModule that calls our product from WebAS. Until now I was using the NetWeaver Developer Studio to create the SDA file. But we need to create the SDA file (or onother suitable archive file) using ANT scripts so our automated build process can create it along with deployment files for other platforms. Please let me know if anyone can provide any info on this. Search of the forums and help has not yielded any result the whole day.
Thanks in advance.
Roshan
Hi Roshan,
Look at these WebLogs..
/people/david.beisert2/blog/2006/02/13/sdm-deployment-as-ant-task
/people/sap.user72/blog/2005/12/08/compiling-and-packaging-mi-projects-using-ant
Regards,
Karthick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I solved this by creating a zip archive and renaming it to SDA. My SDA library (which NWDS had created) had only jar files + MANIFEST.MF, SAP_MANIFEST.MF, and sda-dd.xml. So I created a zip archive using ANT script to contain exactly the same information and then renamed it to SDA, deployed it using the RemoteGui (RemoteGui.bat)
sda-dd.xml:
<?xml version="1.0" ?>
<SDA>
<SoftwareType>library</SoftwareType>
<engine-deployment-descriptor version="2.0"/>
</SDA>
SAP_MANIFEST.MF:
Manifest-Version: 1.0
Ext-SDM-SDA-Comp-Version: 1
softwaretype: library
JarSAP-Version: 20041217.1600
JarSAPProcessing-Version: 20041217.1600
deployfile: sda-dd.xml
keyname: LoginModuleLibrary
keyvendor: XXX.com
keylocation: localhost
keycounter: 2006.03.08.20.45.42
componentelement: <componentelement name="LoginModuleLibrary" vendor="XXX.com" componenttype="DC" subsystem="NO_SUBSYS" location="localhost" counter="2006.03.08.20.45.42" deltaversion="F" updateversion="LB-20050710163602"/>
JarSL-Version: 20041217.1600
compress: true
MANIFEST.MF:
Manifest-Version: 1.0
Implementation-Title: LoginModuleLibrary
Specification-Vendor: XXX
Implementation-Vendor-Id: XXX.com
Implementation-Version: 2006.03.08.20.45.42
Relevent parts of build.xml:
<target name="make_proj_arch" depends="make_jar">
<zip destfile="${proj.dir}/$.zip" > <fileset dir="${lib.dir}" includes="mylib1.jar"/> <fileset dir="${lib.dir}" includes="mylib2.jar"/> <zipfileset dir="${proj.dir}/META-INF/" prefix="META-INF" includes="**"/> <zipfileset dir="${proj.dir}/server/" prefix="server" includes="**"/> </zip> <rename src="${proj.dir}/$.zip" dest="${proj.dir}/$.sda"/>
</target>
all the three files on top should be in a directory /META-INF. The right do it would be to create the meta files on the fly within the script, rather than hard-coding as I'm doing.
Roshan
I use the ant script below. Probably not 100% correct, but does the work for me.
<target name="init">
<tstamp><format property="buildTime" pattern="yyyy.MM.dd.hh.mm.ss"/></tstamp>
<echoproperties prefix = "buildTime"/>
<mkdir dir="${build.dir}"/>
</target>
<target name="make_manifests">
<manifest file="${META-INF.dir}/MANIFEST.MF">
<attribute name="Implementation-Title" value="$"/> <attribute name="Specification-Vendor" value="HP"/> <attribute name="Implementation-Vendor-Id" value="hp.com"/> <attribute name="Implementation-Version" value="$"/> </manifest> <manifest file="${META-INF.dir}/SAP_MANIFEST.MF"> <attribute name="Ext-SDM-SDA-Comp-Version" value="1"/> <attribute name="softwaretype" value="library"/> <attribute name="JarSAP-Version" value="20041217.1600"/> <attribute name="JarSAPProcessing-Version" value="20041217.1600"/> <attribute name="deployfile" value="sda-dd.xml"/> <attribute name="keyname" value="$"/>
<attribute name="keyvendor" value="hp.com"/>
<attribute name="keylocation" value="localhost"/>
<attribute name="keycounter" value="$"/> <attribute name="componentelement" value="<componentelement name="$" vendor="hp.com" componenttype="DC" subsystem="NO_SUBSYS" location="localhost" counter="$" deltaversion="F" updateversion="LB-20050710163602"/>"/>
<attribute name="JarSL-Version" value="20041217.1600"/>
<attribute name="compress" value="true"/>
</manifest>
</target>
Thanks!
I only want to create new manifest files if the table files are new or updated.
I have this target:
<target name="make_manifests" depends="copy_sources">
<manifest file="META-INF\MANIFEST.MF">
<attribute name="Implementation-Title" value="OnGuardDatabase"/>
<attribute name="Specification-Vendor" value="SAP AG"/>
<attribute name="Implementation-Vendor-Id" value="sap.com"/>
<attribute name="Implementation-Version" value="$"/>
</manifest>
But the manifests are always updated, even if no source file is copied the bin folder.
Another question: do you have a task which deploys the sda to the server?
By the way, I discovered that it is not necessary to rename a zipfile. You can create the sda right away:
<target name="make_archive" depends="copy_sources, copy_manifests">
<zip destfile="mydatabase.sda"
basedir="bin"
includes="META-INF\*,/.gdbtable">
</zip>
</target>
Solved the dependency myself:
<target name="check_manifest_uptodate" depends="copy_sources">
<condition property="manifest.uptodate">
<and>
<uptodate targetfile="META-INF\MANIFEST.MF">
<srcfiles dir="bin" includes="*/"></srcfiles>
</uptodate>
<uptodate targetfile="META-INF\SAP_MANIFEST.MF">
<srcfiles dir="bin" includes="*/"></srcfiles>
</uptodate>
</and>
</condition>
<echoproperties prefix="manifest." />
</target>
Remaining question is: how to deplay the sda to ther server??
Yes, about a month back I discovered that I dont have to rename the zip file, but was too lazy to write it here.
About " do you have a task which deploys the sda to the server?" :
Search the forum. I remember reading something about deploying. There is also a PDF doc "Deploying J2EE Applications on SAP NetWeaver". I can email it to you if you cant find it.
I have some scripts that I copied from the forum but never used. You can check it out if it works:
-
<target name="deploy">
<property name="webas.j2ee.home" value="D:/usr/sap/TWD/JC00/j2ee" />
<property name="webas.deploying.dir" value="${webas.j2ee.home}/deploying" />
<property name="app.name" value="SALoginModule" />
<property name="webas.user" value="Administrator" />
<property name="webas.password" value="Integra7" />
<exec dir="${webas.deploying.dir}" executable="${webas.deploying.dir}/deploymanager.bat">
<arg value="$/sap/Deployer.xml"/> </exec> <telnet server="localhost" port="50008"> <read>Login:</read> <write>${webas.user}</write> <read>Password:</read> <write>${webas.password}</write> <read>></read> <write>JUMP 0</write> <read>You jumped on node</read> <write>ADD DEPLOY</write> <read>></read> <write>START_APP ${app.name}</write> <read>></read> </telnet> </target> -
<pathelement location="$\program\bin\SDM.jar"/> <fileset dir="$\program\lib">
<include name="*/.jar"/>
</fileset>
</classpath>
</taskdef>
<sdm
host="$"
port="$"
password="sdm"
archive="../MY_EAR/MY_EAR.ear"/>
</target>
</project>
Hi Roshan,
are you using the single user NWDS setup or already the JDI? afaik, the JDI uses ANT as its build engine and its scripts are exposed. Using JDI, you could reuse the relevant ANT skripts for your automatic build.
Regards
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.