Virgo Project-GreenPages Sample开发部署

1.开发环境

   JDK1.6.0_33, virgo-tomcat-server-3.0.3.RELEASE, Maven3.0.3, Eclipse Virgo Tooling(virgo.ide-1.0.0.201106220519-M01), OS:Ubuntu10.10, greenpages-2.5.0.RELEASE.zip

   请先安装和配置好相关环境变量,可参考本博客Linux下Java 开发环境篇!

2.部署运行

   (1)下载:http://eclipse.org/virgo/download/

   (2)打包:

   fdc@FDC:~/workspace-sts-2.7.2-1/greenpages-2.5.0.RELEASE$ mvn package

   (3) Copy 该工程需要的依赖至Virgo Tomcat Server

   执行上述命令时mvn 使用dependency:copy-dependencies 插件搜集GreenPages工程所需要的所有依赖Bundle

   (Virgo Tomcat Server不支持的),执行完package阶段后,这些第三方的依赖Bundle可在/home/fdc/workspace-

   sts-2.7.2-1/greenpages-2.5.0.RELEASE/greenpages/target/par-provided 下找到,需要将这些JAR拷贝至

   Virgo Tomcat Server下的/repository/usr 目录下。

    Notice that Virgo Tomcat Server will not necessarily see these dependencies unless its repository
    indexes are rebuilt. Different repositories behave differently in this respect; some are passive
    (their indexes are built only once upon startup ) and some are active (they can detect new files or
    files being removed dynamically ). The usr repository is active so there is no need to restart
    Virgo Tomcat Server when copying these files. The next time Virgo Tomcat Server is started the
    -clean option will cause Virgo Tomcat Server to re-scan the repository directories in any case.
    It is always safe to start Virgo Tomcat Server with the -clean option.

    (4)配置数据库

    启动数据库: fdc@FDC:~/workspace-sts-2.7.2-1/greenpages-2.5.0.RELEASE/db$ ./run.sh

    初始化数据: fdc@FDC:~/workspace-sts-2.7.2-1/greenpages-2.5.0.RELEASE/db$ ./data.sh

    (5)安装GreenPages

    复制greenpages-solution-2.5.0.RELEASE.par至Virgo Tomcat Server 下的pickup目录:

     fdc@FDC:~$ cp /home/fdc/workspace-sts-2.7.2-1/greenpages-2.5.0.RELEASE/greenpages/target/greenpages-2.5.0.RELEASE.par /home/fdc/VTS-3.0.3/pickup/

    (6) 启动VTS

    启动Virgo Tomcat Server With "-claen":

    fdc@FDC:~/VTS-3.0.3/bin$ ./startup.sh -clean

    查看控制台的输出日志信息,检验GreenPages工程启动:

    <DE0005I> Started par 'greenpages' version '2.5.0.RELEASE'.

    控制台默认账户密码:admin/springsource

3. 从Eclipse(STS)中运行GreenPages

    (1)Import Green Pages工程

    (2)配置Virgo Tomcat Server Target Runtime

    在Server视图中,配置Virgo Tomcat Server,指定JDK为JAVA_HOME中的JDK;

    (3)运行GreenPages

    Right click on the Virgo Tomcat Server instance in the Servers view and select the Add and

    Remove… menu item;

    Add greenpages-solution (which is the containing project or PAR) to the server and finish.

猜你喜欢

转载自springsfeng.iteye.com/blog/1165018