Project

General

Profile

How to download jars from Z2 » History » Revision 5

Revision 4 (Henning Blohm, 22.09.2012 00:46) → Revision 5/9 (Henning Blohm, 03.10.2012 12:03)

h1. How to download jars from Z2 

 In most everyday operations Once in a while you do not need to think about binary build results when using the Z2 environment. In some cases however you need to have compiled binaries at hand. Most notably this is the case when you want to implement test automation from Z2, e.g. for automated unit tests and z2Unit (see also [[how to z2unit]]). tests. 

 Using the "com.zfabrik.dev.util/jarRetriever":http://www.z2-environment.net/javadoc/com.zfabrik.dev.util!2Fjava/impl/com/zfabrik/impl/dev/JarRetriever.html tool you can request binaries of a set of Java components including dependencies. This tool is an example of a Main program running using an embedded Z2 environment (see also "MainRunner":http://www.z2-environment.net/javadoc/com.zfabrik.core.api!2Fjava/api/com/zfabrik/launch/MainRunner.html See "here [doc]":http://www.z2-environment.eu/v21doc#jarRetriever and "Embedded runtime and the Main Runner":http://www.z2-environment.eu/v21doc#Embedded%20runtime%20and%20the%20Main%20Runner). That is, in order to run it you do not need a Z2 server running. You do however need a Z2 home installation. 

 One particular use case is to retrieve Jars from Z2 within an ANT script to run unit tests. 

 The following snippet is an example "here [javadoc]":http://www.z2-environment.net/javadoc/com.zfabrik.dev.util!2Fjava/impl/com/zfabrik/impl/dev/JarRetriever.html for information on how to retrieve all jars, including dependencies for some components from Z2: 

 <pre> achieve that. 
 <code class="xml"> 
 <java classpath="${z2home}/run/bin/z_embedded.jar" classname="com.zfabrik.launch.MainRunner" fork="true"> 
     <!-- general config --> 
     <sysproperty key="java.util.logging.config.file" value="logging.properties" /> 
     <sysproperty key="com.zfabrik.home" value="${z2home}" /> 
     <sysproperty key="com.zfabrik.mode" value="development" /> 
     <sysproperty key="componentName" value="com.zfabrik.dev.util/jarRetriever" /> 
     <!-- output folder --> 
     <arg line="-out ${output}" /> 
     <!-- project to retrieve binaries from --> 
     <arg line="${components}" /> 
 </java> 
 </code></pre> 

 In this example the following properties are expected: 

 |${output}|The folder to store the retrieved jar files| 
 |${components}|A blank-separated list of components to retrieve the jars from| 
 |${z2home}|The installation folder of the Z2 home that is being used to load the jar files from|