Notes on Java[tm] Application Verification Kit (AVK) for the Enterprise 5.0

AVK is a great alternative when your NetBeans can’t tell you what’s wrong with your application. Please note that this note is based on the official installation note and the sample build.xml that comes with AVK binary. Here are my notes on doing a static check:

1. Download and install AVK and Glassfish

2. Create a build.properties file and add the following property-value pairs:

avk.home=/path/to/avk/home

3. Create a build.xml file and add the following:

<?xml version="1.0" encoding="iso-8859-1"?><project name="Static Tests" default="static-archive-test" basedir=".">

<property file="./build.properties"/>

<property name="cpath" value="${avk.home}/lib/javke-ant.jar"/>

<taskdef name="ArchiveTest" classname="org.apache.tools.ant.taskdefs.optional.sun.verification.StaticArchiveTest" classpath="${cpath}" />

<target name="static-archive-test" description="static archive tests for application containing enterprise beans and web components, reporting on all tests">

<ArchiveTest appName="./path/to/war/file/under/the/basedir/myapp.war"

reportingOpts="a" />

</target>

</project>

4. Create a script to run ant

#!/bin/sh

ANT_HOME=/path/to/ant/home

AS_HOME=/path/to/glassfish

JAVK_HOME=/path/to/avk

PATH=$ANT_HOME/bin:$AS_HOME/bin:$JAVK_HOME/bin:$PATH

export ANT AS_HOME JAVK_HOME PATH

ant -d -f build.xml

## Note: remove -d if you don't want to see debug output
Advertisements

One thought on “Notes on Java[tm] Application Verification Kit (AVK) for the Enterprise 5.0

  1. Only one day after I installed AVK separately, I realized that NetBeans 5.5 rc1 also have an AVK plug-in. You can use that instead. It was stil good for me to learn how to write my own build.xml for use with ant.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s