I have a JHipster tutorial where I import a JDL file with the application configuration and entities. With JHipster 7.9.3, the application creates a fake data file without any records for my Product entity. So the start-up fails because Liquibase can't create a foreign key relationship to that empty product table.
Motivation for or Use Case
The generated application doesn't start correctly.
INFO! Switching to JHipster installed locally in current project's node repository (node_modules)
(node:58995) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./lib/util/" in the "exports" field module resolution of the package at /Users/karsten/workspaces/me/services/better-projects-faster/test/jhipster-test-3/node_modules/yeoman-environment/package.json.
Update this package.json to use a subpath pattern like "./lib/util/*".
(Use `node --trace-deprecation ...` to show where the warning was created)
Welcome to JHipster v7.9.3
Welcome to the JHipster Information Sub-Generator
##### **JHipster Version(s)**
my-simple-shop@0.0.1-SNAPSHOT /Users/karsten/workspaces/me/services/better-projects-faster/test/jhipster-test-3
└── generator-jhipster@7.9.3
JHipster configuration, a .yo-rc.json file generated in the root folder
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity Product {
name String required unique minlength(2) maxlength(90)
price Float required min(0)
description TextBlob required
picture ImageBlob required
specification AnyBlob
category ProductCategory
inventory Integer required min(0)
}
entity Address {
addressLine1 String required minlength(2) maxlength(80)
addressLine2 String minlength(2) maxlength(80)
city String minlength(2) maxlength(80)
postalCode String minlength(5) maxlength(5)
}
entity ShoppingOrder {
name String required unique minlength(2) maxlength(90)
totalAmount Float min(0)
ordered LocalDate
}
entity ProductOrder {
amount Integer required min(0) max(5)
}
entity Shipment {
shippedAt LocalDate required
}
enum ProductCategory {
Laptop,
Desktop,
Phone,
Tablet,
Accessory
}
relationship OneToOne {
Shipment{order(name) required} to ShoppingOrder{shipment(shippedAt)}
}
relationship OneToMany {
ShoppingOrder{orders} to ProductOrder{overallOrder(name) required}
}
relationship ManyToOne {
Address{user(login) required} to User
ShoppingOrder{buyer(login) required} to User
ProductOrder{product(name) required} to Product
ProductOrder{buyer(login) required} to User
Shipment{shippedBy(login) required} to User
}
dto Product, Address, ShoppingOrder, ProductOrder, Shipment with mapstruct
service Product, Address, ShoppingOrder, ProductOrder, Shipment with serviceImpl
Environment and Tools
openjdk version "17.0.4.1" 2022-08-12
OpenJDK Runtime Environment Temurin-17.0.4.1+1 (build 17.0.4.1+1)
OpenJDK 64-Bit Server VM Temurin-17.0.4.1+1 (build 17.0.4.1+1, mixed mode)
git version 2.37.3
node: v16.17.1
npm: 8.15.0
Docker version 20.10.17, build 100c701
docker-compose version 1.29.2, build 5becea4c
No change to package.json was detected. No package manager install will be executed.
Congratulations, JHipster execution is complete!
Sponsored with ❤️ by @oktadev.
Entity configuration(s) entityName.json files generated in the .jhipster directory
Overview of the issue
I have a JHipster tutorial where I import a JDL file with the application configuration and entities. With JHipster 7.9.3, the application creates a fake data file without any records for my
Product
entity. So the start-up fails because Liquibase can't create a foreign key relationship to that emptyproduct
table.Motivation for or Use Case
The generated application doesn't start correctly.
Reproduce the error
Create a new project folder.
Copy the attached simple-shop-app.txt to that folder.
Change into that folder.
Import it with
jhipster import-jdl simple-shop-app.txt
Run the generated application with
mvnw
/./mvnw
.You'll see an error during start-up like this:
user
/user
.src/main/resources/cocat src/main/resources/config/liquibase/fake-data/product.csv
file. It's empty:Related issues
No
Suggest a Fix
A workaround:
src/main/resources/config/liquibase/fake-data
user
/user
.JHipster Version(s)
It worked with 7.3.1.
JHipster configuration
jhipster info
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Environment and Tools
openjdk version "17.0.4.1" 2022-08-12 OpenJDK Runtime Environment Temurin-17.0.4.1+1 (build 17.0.4.1+1) OpenJDK 64-Bit Server VM Temurin-17.0.4.1+1 (build 17.0.4.1+1, mixed mode)
git version 2.37.3
node: v16.17.1
npm: 8.15.0
Docker version 20.10.17, build 100c701
docker-compose version 1.29.2, build 5becea4c
No change to package.json was detected. No package manager install will be executed. Congratulations, JHipster execution is complete! Sponsored with ❤️ by @oktadev.
Entity configuration(s)
entityName.json
files generated in the.jhipster
directorySee Entities.zip.
Browsers and Operating System
MacBook Pro 16" with M1 Max
macOS Monterey, 12.6
Latest Chrome/Safari versions
Java Eclipse Temurin 17.0.4.1
[X] Checking this box is mandatory (this is just to show you read everything)