本文主要是介绍HAND-HAP-构建项目步骤,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
配置数据源 D:\apache-tomcat-8.5.24\conf\context.xml <Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/hap_shipments" name="jdbc/hap_shipments" type="javax.sql.DataSource" username="hap_dev" password="hap_dev"/>创建项目 mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -D archetypeGroupId=hap -D archetypeArtifactId=hap-webapp-archetype -D archetypeVersion=3.1-SNAPSHOT -D groupId=shipments -D artifactId=ShipmentsParent -D package=shipments.core -D archetypeRepository=http://nexus.saas.hand-china.com/content/repositories/rdcsnapshot新建数据库 create schema hap_shipments default character set utf8;CREATE USER hap_dev@'%' IDENTIFIED BY 'hap_dev';CREATE USER hap_dev@'localhost' IDENTIFIED BY 'hap_dev';GRANT ALL PRIVILEGES ON hap_shipments.* TO hap_dev@'%';GRANT ALL PRIVILEGES ON hap_shipments.* TO hap_dev@'localhost';flush privileges;导入IDEA将sql文件拷入 ShipmentsParent\core-db\src\main\java\shipments\core\db\data\mysql
修改shipments/core/db/2016-06-01-init-data-migration.groovychangeSet(author: "mrz", id: "20171218-mrz-1") {sqlFile(path: MigrationHelper.getInstance().dataPath("com/hand/hap/db/data/"+dbType+"/xxinv_material_item.sql"), encoding: "UTF-8")sqlFile(path: MigrationHelper.getInstance().dataPath("com/hand/hap/db/data/"+dbType+"/xxinv_material_txns.sql"), encoding: "UTF-8")sqlFile(path: MigrationHelper.getInstance().dataPath("com/hand/hap/db/data/"+dbType+"/xxinv_shiped_doc.sql"), encoding: "UTF-8")sqlFile(path: MigrationHelper.getInstance().dataPath("com/hand/hap/db/data/"+dbType+"/xxinv_shiped_doc_lines.sql"), encoding: "UTF-8")}执行 mvn process-resources -D skipLiquibaseRun=false -D db.driver=com.mysql.jdbc.Driver -D db.url=jdbc:mysql://127.0.0.1:3306/hap_shipments -D db.user=hap_dev -D db.password=hap_dev启动redis cd / cd Redis-x64-3.2.100redis-server.exe redis.windows.conf在IDEA中配置TomCat运行 ShipmentsParent\core\overlays\com.hand.hap-3.3.1-RELEASE\WEB-INF\view\index.html创建目录core(前面的包名称)
│ │ │ │
│ │ │ ├── controllers(Controller包)
│ │ │ │ └── DemoController.java(Controller类)
│ │ │ ├── db(数据表结构,数据初始化入口文件)
│ │ │ │ └── liquibase.groovy
│ │ │ ├── dto(Dto包)
│ │ │ │ └── Demo.java(Dto实现类)
│ │ │ ├── mapper(Mapper包)
│ │ │ │ ├── DemoMapper.java(Mapper接口)
│ │ │ └── service(Service包)
│ │ │ ├── IDemoService.java
│ │ │ └── impl(Service实现)
│ │ │ └── DemoServiceImpl.java按照数据表新建Dto实现类,根据字段private、get、set。
觉得有帮助的小伙伴右上角点个赞~
扫描上方二维码关注我的订阅号~
这篇关于HAND-HAP-构建项目步骤的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!