Soaplab is installed and built by Ant.
Ant is a very powerful tool that can do almost everything. It can be also widely configured, by setting various properties, in order to customise user's actions. Which means that its usage can sometimes become a bit confusing. Therefore, this documents starts by explaining few basic rules how to use Ant, and only the next chapter describes how to use it for building Soaplab2.
ant -projecthelpIt displays something like this:
Main targets: all Clean, compile, etc.. axis1deploy Deploy (copy) an Axis-1 war file to a Tomcat server axis1dist Populate Axis-1 services distribution space axis1war Create a Axis-1 war file for services distribution bootstrap Fetch Maven library - needed only the first time. clean Remove all generated files. cleanxml Remove all generated service metadata compile Compile all source code (default) config Create all run-time scripts and configuration files. docs Generate documentation. gen Generate service metadata from all ACD files genebi Generate XML metadata for EBI's sample services. genemboss Generate XML metadata for EMBOSS (needs EMBOSS installed). gengowlab Generate XML metadata for Gowlab services. gensowa Generate XML metadata for Sowa services. info-list Show a list of available services initeclipse For Eclipse users... create pom files in the right place install Install and build Soaplab2 install-clients Install and build Soaplab2 clients jars Create all jar files related to this project. jaxdeploy Deploy (copy) a JAX-WS war file to a Tomcat server jaxdist Populate JAX-WS services distribution space jaxwar Create a JAX-WS war file for services distribution test-junit Run the junit test casesSoaplab2 uses Ant version 1.6.5 and later. Check your version. For example:
ant -version Apache Ant version 1.7.0 compiled on December 13 2006The Ant can be (and, in some point, should be) customised by defining some properties in the file
compile.deprecation = true compile.warnings = true tomcat.home = /home/senger/Software/jakarta-catalina emboss.home = /home/senger/Software/embossThe usual problem with properties could be to mix together properties used by Ant and properties used by Soaplab2. The properties used by Ant are usually referred to as build-time properties, while the Soaplab2 properties, used in the run-time by Soaplab2 services, are called run-time properties.
What adds to the confusion is also a fact that Ant helps to build run-time property files for Soaplab2 by re-using (propagating) some build-time properties to the run-time properties. Sorry about it...
ant -Dcompile.warnings=true compile ant -Dcompile.warnings=true -Dcompile.debug=false compileThe whole construct with the -D option must constitute a single command-line parameter. Therefore, this is wrong:
ant -D compile.warnings=true compile
ant "-Dbig.apple=New York"
tomcat.home = /home/senger/Software/jakarta-catalinaOther properties that you may use are described later in this document, when individual Ant's targets (tasks) are explained. The best way (but not always an easy) way to find what properties can be used, is to look into build.xml file (and its include files in the xmls directory).
For enabling typed interface for your Soaplab Web Services please check typed interface help page.
This is especially true for the
Ant calls Maven whenever you build Soaplab2 to find whether there are some unresolved third-party dependencies. If there are - and definitely there are the first time you build Soaplab2 - Maven downloads them to your computer. It creates a local Maven repository - which is a directory in your home directory (the name depends on the platform: on Linux, its name is .m2). This repository can be used by more projects using Maven. Important is to know that:
There is an article describing details how the Ant-Maven marriage is handled. It is from another project, but the principles (and files) are very similar to Soaplab2 (because both Soaplab2 and the article share the same author ). The article also explains what to do if you wish to have the local Maven repository created elsewhere - which you may need if your home directory has some space limits.
ant installThe installation is nothing more than calling several Ant's task in a row.
Next, it checks that you have installed Perl. This is a legacy issue and will, sooner or later, disappear. The goal is to have Soaplab2 pure Java. The only remaining non-Java part is the converter between ACD and XML files (more about ACD files in the metadata guide).
After that, it reminds you to create the build.properties file and put there properties locating the place where you have installed Tomcat. These properties are not used yet, but ultimately they will be needed when you deploy your Soaplab2 services (see more about that step in the deployment guide document).
Then the real installation starts. In a series of steps, Ant downloads many third-party libraries, builds the whole Soaplab2, generates XML files for several testing services, and as a jewel at the end, it runs one testing service, the HelloWorld service.
ant jaxdeployThis will deploy few testing services into your Tomcat and you can start using them (see the command-line client document how to use your services from the command-line):
build/run/run-cmdline-client -name classic.helloworld -w -rOr, perhaps even easier, you can open your browser and point it to your Tomcat and use the Spinet client. Unless you run Tomcat on a different port, or unless you deployed your services into a different context, the URL to open should be this: http://localhost:8080/soaplab2/.
The installation task can be repeated anytime without any harm.
More Ant tasks (the more specialised ones) are described in separate documents. The deployment tasks:
axis1deploy Deploy (copy) an Axis-1 war file to a Tomcat server axis1dist Populate Axis-1 services distribution space axis1war Create a Axis-1 war file for services distribution jaxdeploy Deploy (copy) a JAX-WS war file to a Tomcat server jaxdist Populate JAX-WS services distribution space jaxwar Create a JAX-WS war file for services distributionare in the deployment guide, and the metadata tasks:
cleanxml Remove all generated service metadata gen Generate service metadata from all ACD files genebi Generate XML metadata for EBI's sample services. genemboss Generate XML metadata for EMBOSS (needs EMBOSS installed). gengowlab Generate XML metadata for Gowlab services. gensowa Generate XML metadata for Sowa services.are in the service metadata guide.
The remaining tasks are:
Most of the new created files (those that can be re-generated anytime later) are generated in the build directory.
Note that other libraries can be (and are) fetched later by Maven, but Maven itself needs a library which obviously "cannot be fetched before it is fetched". That's why we have here a separate task for it. Probably we should call it better a Catch-22 task .
ant clean compile
You can influence how the Java compiled code is produced by setting compilation properties. The default values are:
compile.debug = true compile.verbose = false compile.deprecation = false compile.optimize = false compile.warnings = false
Generally, it transforms template files (sitting mostly in the directory src/etc/config) into real configuration files and puts them into build/classes directory where they are used by Soaplab services.
The template files do not contain any local dependencies (such as a full path to your soaplab2 directory). The config task injects the "local knowledge" into them during the copying. The "injection" is done on places marked in the templates by pairs of the @ characters. You do not need to know it - unless you wish to write your own template file. Please check the template what injection points are used. Here is an example of two pairs of replacement tokens (from the soaplab.properties.template:
base.dir = @PROJECT_HOME@ metadata.dir = @METADATA_DIR@ ...If you have your own template file, you need to let Ant know about it by setting a build-time property pointing to your template file. For example, for the major Soaplab2 configuration file, you set the property my.soaplab.properties:
my.soaplab.properties = testing.soaplab.propertiesOther build-time properties for setting other configuration files are:
log4j.configuration = testing.log4j.properties my.soaplab.client.properties = testing.soaplab.client.propertiesExamples and details about configuration files are in the configuration guide.
The config task also generates run-time scripts into build/run directory. The scripts can be used to start various Soaplab2 client and administrative command-line programs (as shown in the command-line client and administrative tools documents).
The run-time scripts are also a good place where you can see names and location of all third-party libraries Soaplab2 is using.
The Soaplab2 is distributed together with the full documentation. In includes also hyper-links to the API documentation - which must be first created by this task. Whenever you see a dead link in the Soaplab pages, a chance is that it may be revived by running this task.
[service] alignment.wu_blastn_raw [service] alignment.wu_blastn_xml [service] alignment.wu_blastp_raw [service] alignment.wu_blastp_xml [service] alignment.wu_blastx_raw [service] alignment.wu_blastx_xml [service] alignment.wu_tblastn_raw [service] alignment.wu_tblastn_xml [service] alignment.wu_tblastx_raw [service] alignment.wu_tblastx_xml [service] alignment_consensus.cons [service] alignment_consensus.megamerger [service] alignment_consensus.merger [service] alignment_differences.diffseq [service] alignment_dot_plots.dotmatcher [service] alignment_dot_plots.dotpath [service] alignment_dot_plots.dottup [service] alignment_dot_plots.polydot [service] alignment_global.est2genome ...It also creates a file services.list. Its name can be changed by the property
ant -Dservices.names.file=my.services info-listThe file contains nothing more than the service names, each one on a separate line.
Before running them, it compiles them first (the testing classes are not part of the normal compilation). Running this task may give you the following error:
================================= WARNING ================================ Junit library is not present in a correct directory. Tests not executed. The library (junit.jar) is, however, in your local Maven repository. Therefore: Put it in your ${ANT_HOME}/lib directory. Or, put in your ${HOME}/.ant/lib directory. Or start ant with -lib <your junit library>. ==========================================================================
First, you need to install a Maven plug-in into your Eclipse. Then, you need to create several pom.xml files - the files where the Eclipse Maven plug-in looks for the dependencies. These files are created by running the Ant's initeclipse task (which is often invoked from other tasks automatically, but can be run also separately). Make sure that you enable Maven plug-in only after the pom.xml files have been created.
This is the sequence of steps I usually follow when Eclipse is not happy (which happens when Soaplab2's dependencies or Soaplab2's version change):