hybris 环境配置详细文档

来源:互联网 发布:阿里云建立pptp 编辑:程序博客网 时间:2024/05/19 17:56

HYBRIS基础学习

hybris环境搭建

 <文档编号/版本号1.0>

 

 

 

 

 

 

文档作者:

创建日期:March 8, 20177

更新日期:March 8, 20177

文档编号: 

当前版本:1.0

 

Note: Title, Subject, Last Updated Date, Reference Number,and Version are marked by a Word Bookmark so that they can be easily reproduced in the header and footer of documents.  When you change any of these values, be careful not to accidentally delete the bookmark.  You can make bookmarks visible by selecting Tools->Options…View and checking the Bookmarks option in the Show region.

 

 

审批签字:

XX       项目经理

 

实施方  项目经理

 

Note: To add additional approval lines, press [Tab] from the last cell in the table above.

Note: You can delete any elements of this cover page that you do not need for your document.  For example, Copy Number is only required if this is a controlled document and you need to track each copy that you distribute.

 

文档控制

 

变更记录

3

日期

作者

版本

变更说明

 

 

 

 

March 8, 20177


1.0

初版

 

 

 

 

 

 

 

 

 

 

 

 

 

 

审阅

 

姓名

职位

 

 

 

 

 

 

 

 

 

 

 

 

分发

 

拷贝编号

姓名

位置/岗位

 

 

 

1

 

 

2

 

 

3

 

 

4

 

 

Note: The copy numbers referenced above should be written into the Copy Number space on the cover of each distributed copy.  If the document is not controlled, you can delete this table, the Note To Holders, and theCopy Number label from the cover page.

 

目录

文档控制ii

1.Hybris 环境搭建1

. Hybris环境搭建7

. Hybris环境搭建8

更改历史9

 

Note: To update the table of contents, put the cursor anywhere in the table and press [F9].  To change the number of levels displayed, select the menu option Insert>Index and Tables, make sure the Table of Contents tab is active, and change the Number of Levels to a new value.

 


1.Hybris 环境搭建

此页面提供了跟踪以及使用hybris套件开发软件的基本信息,主要展示如下:

获得hybris并在Eclipse中运行

Eclipse中调试

Ant调用构建框架

检查源代码

 

1.1准备工作

Hybris 账号:https://wiki.hybris.com/dashboard.action(自行申请一个账户)

 

1.2环境配置

Install JDK

下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html

Version  1.8.XX

 

配置环境变量   路径:Computer->Advanced system settings->Environment variables

Variable name

Variable value

JAVA_HOME

C:\Program Files\Java\jdk1.8.0_XX

CLASSPATH

.;%JAVA_HOME%\lib

Path

%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin; %PATH%

ANT_H0ME

{YOUR_HYBRIS_PATH}\bin\platform\apache-ant-1.9.1

注:path变量已经存在,将表格中变量值加到最前面即可。

 

Install Hybris

下载地址:http://yunpan.cn/cHThWWNRE2PyT     访问密码 9ce9

1. 新建目录 Workspace_Hybris_training 并将 HYBRISCOMM5400P_9-70000141.zip 解压缩至此目录下

2. 打开DOS窗口,进入到目录 {YOUR_HYBRIS_PATH}/bin/platform(或直接从/bin/platform 出shift+右键直接从此处的命令窗口进入)然后输入指令 setantenv.bat进入环境。

 

3. 编译。输入命令:ant all

注意:This will prompt you for a configuration template - press enter to specify the default setting develop

当输出 BUILD SUCCESSFUL 时,说明ant all成功了。

 

 

4. 启动Hybris服务。输入命令:hybrisserver.bat

Stopping the server: If you need to stop the server type CTRL + C in the console window.

(注意: 编辑hybris / config / localextensions.xml文件,用项目需要的文件替换原文件,然后重新ant all)

5. 登录hac

http://localhost:9001/hac  admin/nimda

Platform->Initialization,执行初始化

 

Install Eclipse

下载:http://www.eclipse.org/downloads/

选择 java EE 版本

1. 增加JVM内存。

进入安装目录,修改文件 eclipse.ini,将-Xmx256m 替换成  -Xmx1024m(若内存足够,可以分配更大)。

2.配置默认workspace 。

打开Eclipse,并选择Workspace_Hybris_training目录作为workspace。

3.设置文件编码方式为“UTF-8”

Window->Preferences->General->Workspace

 

4.使用Hybris提供的配置文件。

下载地址:https://wiki.hybris.com/display/tr51/Trail+~+Eclipse+Configuration+Files

 

退出Eclipse,将Hybris提供的以上四个文件覆盖至目录:Workspace_Hybris_training/.metadata/.plugins/org.eclipse.core.runtime/.settings

ANT_HOME

        Path:Window->Preferences->General->Workspace->Ant->Runtime

 

{YOUR_HYBRIS_PATH}\bin\platform\apache-ant-1.9.1

 

 

 

1.3项目创建

Import Project

1. File->Import…            

 

2.根据配置文件 config/localextensions.xml选择需要的project

 

3.处理报错的project

选中project点击右键->Properties -> Java Compiler->Errors/Warnings,勾掉Enable project specific settings

注意:每次导入新项目时都需要去修改配置文件,追加该项目!例:<extension name="cuppy" />

 

Step1: Eclipse->Window->Show View->Others->Ant->Ant

Step2: Add Buildfiles

Step3:选择 “platform->build.xml(若在elicpseant all,则直接双击“all[default])

 

Step4:双击 “extgen(若新建一个项目“training)

 

Step5:选择模版 “yempty

 

Step6:输入Extension的名称 “training

 

Step7:输入javapackage路径 “hand.training”(路径随意)

 

 1.4Import the existing Extension(导cuppy.zip(版本与hybris的对应))

1、将cuppy.zip 复制并解压缩至目录 {YOUR_HYBRIS_PATH}\bin\custom 下

注:需要新建custom目录,以后的定制化开发项目都放在此目录下

2、Tell Hybris about the new Extension      Configuration  config/localextensions.xml ,在<extensions>标签中添加一行:注:只有在这里配置了之后,编译以及启动服务时才能找到这个Extension

 

3,如果服务器正在运行,请停止它。

4,在控制台(ant all)或Eclipse中重建hybris。

5,启动服务器

 

6.更新系统(第一次更新全选,以后更新根据需要选择)

 

7. 登陆cuppy项目,查看运行http:// localhost:9001 / cuppy

pp / 1234

 

 1.5New Extension(cuppytrain)

1.在Eclipse中打开Ant视图,并调用平台的任务extgen。

a.扩展模板选择yempty

b.输入扩展名的名称cuppytrail。

c.输入包前缀de.hybris.platform.cuppytrail

2.Ant脚本现在将在YOURPATH / bin / custom / cuppytrail中为您创建一个框架扩展,但这尚未导入到Eclipse中。

3.将新扩展附加到config / localextensions.xml:

config/localextensions.xml

           <extensions>

           .......

          <extension name="cuppytrail" />

          </extensions>

4.停止应用程序服务器。

5.运行ant all

6.启动应用程序服务器

7.将生成的扩展cuppytrain导入Eclipse环境

a.右键单击软件包资源管理器,然后选择导入

b.选择General Existing Projects到工作区并浏览到新的扩展YOURPATH / bin / custom / cuppytrail

c.在单击Copy projects into workspace 将项目复制到工作区复选框,在选择finsh键

d.现在应该在Eclipse Package Explorer中看到该扩展

8.在Web浏览器中打开hybris管理控制台http:// localhost:9001 / platform / extensions,并以admin nimda身份登录。 将获得有关可用扩展的概述,扩展带有核心扩展模块,hmc扩展模块,webroot描述的web模块和核心+扩展模块。 cuppytrail包含一个核心模块和一个web模块。

 

9.若不需要此基本扩展程序的网络模块,可以禁用此模块cuppytrail/extensioninfo.xml文件中

 

10.运行ant all(检查hybrisserver之后重新启动),并验证没有可访问的webroot的cuppytrail

 

一. Hybris环境搭建

关于Hybris New Extension的讲解

(2016-09-09 15:32:30)

转载

标签: 

hybris

extension

扩展

依赖

分类: IT技术类(Hybris) 

最近参照wiki.hybris做了几个Extension,并设置了依赖。在此把需要注意的点和步骤做下记录。
1.打开ANT,执行命令extgen


2.根据弹出的ANT命令填入对应的templateExtension Name、包。


3.config/localextension.xml中添加extension name="cuppytrail"
4.执行ANT all命令。
5.完成上述步骤后会在Hybris\hybris-commerce-suite-5.1.0.0\hybris\bin\custom(你自定义的文件夹)下产生你的扩展。
6.将产生的Extension导入到eclipse中,注意,按照默认设置导入即可,无需设置copy to workspace等。
7.在导入的Extension/extensioninfo.xml中添加
8.保存,ANT  all大功告成!

 

二. Hybris环境搭建

更改历史

 

1 0