cancel
Showing results for 
Search instead for 
Did you mean: 

Creating SDA (or other suitable archives) using ANT

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

there is also a provider.xml the should be under /server directory

Former Member
0 Kudos

I was also looking for a way to use ANT to do all my builds and archive creating for me.

How do you create the manifest files?

Former Member
0 Kudos

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="&lt;componentelement name=&quot;$&quot; vendor=&quot;hp.com&quot; componenttype=&quot;DC&quot; subsystem=&quot;NO_SUBSYS&quot; location=&quot;localhost&quot; counter=&quot;$&quot; deltaversion=&quot;F&quot; updateversion=&quot;LB-20050710163602&quot;/&gt;"/>

<attribute name="JarSL-Version" value="20041217.1600"/>

<attribute name="compress" value="true"/>

</manifest>

</target>

Former Member
0 Kudos

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>

Former Member
0 Kudos

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??

Former Member
0 Kudos

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>&gt;</read> <write>JUMP 0</write> <read>You jumped on node</read> <write>ADD DEPLOY</write> <read>&gt;</read> <write>START_APP ${app.name}</write> <read>&gt;</read> </telnet> </target> -


<project name="test_sdm" basedir="." default="deploy"> <!-- AUTHOR: David Beisert http://www.beisert-btc.de --> <!--property name="server" value="localhost"/> <property name="httpport" value="56000"/> <property name="sdmport" value="56018"/--> <property name="server" value="vmw0004"/> <property name="httpport" value="54100"/> <property name="sdmport" value="54118"/> <property name="SDM_HOME" value="C:/usr/sap/SNE/JC60/SDM"/> <target name="deploy"> <taskdef name="sdm" classname="dbeisert.ant.ext.sap.SDMRemoteDeployTask" > <classpath > <pathelement location="$/sdmAnt.jar"/>

<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>

former_member184385
Active Participant
0 Kudos

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

Former Member
0 Kudos

Hi Gregor,

Unfortunately I am using NWDS in single-user mode. How can I get an example of the ANT script that JDI uses? Thanks for your help.

Regards,

Roshan