Professional Java Tools for Extreme Programming [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Professional Java Tools for Extreme Programming [Electronic resources] - نسخه متنی

Richard Hightower, Warner Onstineet al.

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید











Using AntHill with Petstore

Now that we have a good idea of how to use AntHill for a project, let's look at how to put our Petstore application into AntHill. The first step is to impound the Petstore application in the repository. Before

actually impounding the code, add a text file to the root directory of your Petstore code called version, and set the version within to 0.5.0 or some other text. Change to the root directory of the Petstore code and issue a command like the following:

cvs –d ~/repository import –m “” petstore petstore initial

As you might expect, we are going to have to do a little surgery on the build.xml file to make sure the artifacts for the Petstore are placed in the right directory once it is built. The first step in the process is to include the following <property> tags in the build.xml file:

<property name="deployDir" location="dist"/>
<property name="dist.dir" location="${deployDir}"/>

There are two different places where the deployDir needs to be used. The first is within the <target name=" "> element. The code is:

   <target name="prepare" depends="init"
description="prepare the output directory.">
<mkdir dir="${lib}" />
<mkdir dir="${dist}" />
<mkdir dir="${deployDir}" />
</target>

Simply change the ${deploy} variable to ${deployDir}. The same thing needs to be done in the <target name="package"> element.

    <target name="package" depends="build">
<copy file="./META-INF/application.xml" todir="${dist}/META-INF" />
<jar jarfile="${deployDir}/pet.jar"
basedir="${dist}" />
</target>

Once the build.xml file has been changed, commit the changed file to the source code repository.


Creating a Project


With the code committed to the repository and the build file changed, it's time to create an appropriate project. The changes necessary are as follows:



Set anthill.project.name to an identifier such as Petstore.



Configure anthill.repository.adapter for the username and project under which the Petstore code was impounded.



Set anthill.build.script to build.xml.



Set the e-mail address as needed and any of the other optional parameters, and update the project. If successful, the project will appear in your Project list.




Doing a Build


Now it's time to check to see if things worked out. Click the Build link for the Petstore project. Be sure to enable the Force Build checkbox. After some time, you should see a successful build. If not, check the buildLogs and make any appropriate changes. Again, most problems with the build will be related to the source code repository if the build.xml script works outside the AntHill system.

/ 228