piątek, 23 września 2016

How to create new JHipster project with MySQL or MariaDB

Step 1

Create new project catalog.


Step 2

Go to this folder and run:

yo jhipster

It will create all necessary files and folders.

Step 3


In my case I use MariaDB for development and production. [For MySQL should be the same]
Create new database and user [i.e. in phpMyAdmin].

Configure database access in files:

/src/main/resources/config/application-dev.yml

and
/src/main/resources/config/application-prod.yml

Fill your access data in section:

    datasource:
        type: com.zaxxer.hikari.HikariDataSource
        url: jdbc:mariadb://localhost:3306/barfitter
        name: barfitter
        username: barfitter
        password: ************




In /pom.xml fill your access data in section:

            <plugin>
                <groupId>org.liquibase</groupId>
                <artifactId>liquibase-maven-plugin</artifactId>
                <version>${liquibase.version}</version>
                <configuration>
                    <changeLogFile>src/main/resources/config/liquibase/master.xml</changeLogFile>
                    <diffChangeLogFile>src/main/resources/config/liquibase/changelog/${maven.build.timestamp}_changelog.xml</diffChangeLogFile>
                    <driver>org.mariadb.jdbc.Driver</driver>
                    <url>jdbc:mariadb://localhost:3306/barfitter</url>
                    <defaultSchemaName></defaultSchemaName>
                    <username>barfitter</username>
                    <password>************</password>
                    <referenceUrl>hibernate:spring:com.finbarre.barfitter.domain?dialect=org.hibernate.dialect.MySQL5InnoDBDialect&amp;hibernate.ejb.naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringNamingStrategy</referenceUrl>
                    <verbose>true</verbose>
                    <logging>debug</logging>
                </configuration>



Step 4


Create new entities:
yo jhipster:entity newEntityName

Step 5


Run project:
./mvnw

Step 6


Run browsersync:
gulp

Brak komentarzy:

Prześlij komentarz