# ============================================================================
# atleap0.56 安装指南:
# ============================================================================
1.建立一个setEnv.bat,内容如下:
注意JDK必须使用JDK1.5以上。Apache Ant最好采用1.6.5.
SET ANT_HOME=C:/apache-ant-1.6.5
SET JAVA_HOME=C:/jdk1.5.0_06
SET ANT_OPTS=-Xmx640m
call C:/WINNT/system32/cmd.exe
其中:
SET ANT_OPTS=-Xmx640m 表示设置ant的heap size 的大小到640M,这样不会导致JVM内存不够用。
将setEnv.bat复制到atleap工程的根目录下,for example:D:/atleap0.56
2.双击setEnv.bat,进入到Dos命令窗口中,cd bin; for example:进入到 D:/atleap0.56/bin
然后直接运行/bin/start-demo.bat命令。系统马上就可以跑动起来
3.运行/bin/stop-demo.bat命令,系统就关闭了。
注意:build.bat仅仅用来build atleap这个项目,建立atleap部署目录和打包等等工作。
只需要设置JAVA_HOME,ANT_HOME,ANT_OPTS变量就可以,因为atleap使用了HyperSonic的嵌入式数据库和Jetty的嵌入式应用服务器。
4.更改数据库和应用服务器,将Jetty改成tomcat,将HyperSonic改成Mysql.
Tomcat可以选择5.0,5.5,6.0。
最好搭配: JDK1.5+Tomcat6.0+MySQL.
安装Tomcat6.0之前首先卸载tomcat5.0,否则会导致问题。
1)首先在atleap根目录下创建一个文件atleap-build.properties,内容如下:
这样做会使得atleap-build.properties中的properties Override build.properties.
以下内容从build.properties复制过来,去掉#就可以了。
webapp.name=atleap
context.doc.base=${webapp.name}
appserver.host=localhost
# ============================================================================
# MySQL Properties
# ============================================================================
database.jar=${mysql.jar}
database.jar.name=${mysql.jar.name}
database.dir=${mysql.dir}
database.version=${mysql.version}
database.type=mysql
database.name=${webapp.name}_db
database.host=localhost
database.port=3306
database.driver_class=com.mysql.jdbc.Driver
database.url=jdbc:${database.type}://${database.host}:${database.port}/${database.name}?characterEncoding=utf-8&useUnicode=true&autoReconnect=true
database.username=test
database.password=test
database.test.tablename=SELECT 1
database.pool.datasource.class=com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
database.pool.size.max=200
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
dbunit.datatype.factory=org.dbunit.ext.mysql.MySqlDataTypeFactory
dbunit.escapepattern=`?`
database.blob.size.max=16777215
# if you need MyISAM type for your database use MySQLMyISAMDialect instead MySQLInnoDBDialect
# for MySQL 4.1 and higher run MySQL daemon with option --default-character-set=utf8
#
# Admin settings
#
# Below settings are required only if you have admin rights to MySQL
database.admin.url=jdbc:${database.type}://${database.host}:${database.port}/mysql
database.admin.username=root
database.admin.password=
# ============================================================================
# Tomcat Properties
# ============================================================================
# Please specify tomcat5 or tomcat5.5
appserver.type=tomcat6
appserver.http.port=8080
appserver.https.port=8443
# You need below properties only if you plan to deploy application when AS is started
# and deploy.force.unpack=false (default)
# Be sure that in $CATALINA_HOME/conf/tomcat-users.xml file there is user which has the manager role.
# <role rolename="manager"/>
# <user username="manager" password="manager" roles="manager"/>
tomcat.manager.host=${appserver.host}
tomcat.manager.port=${appserver.http.port}
tomcat.manager.url=http://${tomcat.manager.host}:${tomcat.manager.port}/manager
tomcat.manager.username=manager
tomcat.manager.password=manager
# Set into true if you want Ant always unpack your app during deployment
# Usually forcing is required when you deploy app in ROOT context
deploy.force.unpack=true
# Usually you do not need to specify below properties
tomcat.home=C:/Tomcat6.0
tomcat.app.base=${tomcat.home}/webapps
tomcat.service.name=Catalina
tomcat.work.dir=${tomcat.home}/work/${tomcat.service.name}/${appserver.host}/${context.doc.base}
tomcat.conf.dir=${tomcat.home}/conf/${tomcat.service.name}/${appserver.host}
2)然后执行setEnv.bat,再cd bin,再运行build clean.
3)再运行build setup.
4)启动Tomcat服务器。在IE中输入http://localhost:8080/atleap/就进入了atleap。
注意事项:
1.tomcat.home=C:/Tomcat6.0 不可以是C:/Tomcat6.0,否则会出错。
2.如果在上面的3)运行start-demo或者build startdemo,不运行build setup的时候,会报告下面的错误。
startdemo:
[echo] Starting application server Jetty. Please wait...
[echo] See files in D:/atleap0.56/logs for more information
那是因为build.bat中:
set DEMO_PORT=8100
set ANT_PROPERTIES="-Dant.home=%ANT_HOME%"
if NOT "%1" == "startdemo" goto antPropertiesSet
set ANT_PROPERTIES=%ANT_PROPERTIES% "-Dappserver.http.port=%DEMO_PORT%"
:antPropertiesSet
start http://localhost:%DEMO_PORT%/atleap/