jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.54k stars 4.02k forks source link

JDL import: This Generator is empty #22573

Closed JeroenAdam closed 1 year ago

JeroenAdam commented 1 year ago
JDL import fails with existing .jdl

I created a new v8.0-beta app and try to import an existing .jdl which worked fine on v7.9.2. I had to add the expression 'with builtInEntity' for the relationships with User, that's all I changed.

I copy/pasted my .jdl into jdl studio and there are no errors (excluded 'with builtInEntity' changes).

The following error: ERROR! This Generator is empty. Add at least one method for it to run.

I think I'm missing the application declaration in the .jdl. I'll check and try to apply the docs from my side.

Complete error
Welcome to JHipster v8.0.0-beta.1

INFO! Generating jdls jhipster-jdl.jdl
info: The filter option is set for EducationalResource, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
info: The filter option is set for Subject, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
info: The filter option is set for Topic, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
info: The filter option is set for Skill, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
info: The filter option is set for Votes, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
info: The filter option is set for Notification, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
info: The filter option is set for Message, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
info: The filter option is set for Favorite, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
info: The filter option is set for UserExtended, the 'serviceClass' value for the 'service' is gonna be set for this entity if no other value has been set.
 _______________________________________________________________________________________________________________

  Documentation for creating an application is at https://www.jhipster.tech/creating-an-app/

  Application files will be generated in folder: C:\Users\Adam\projects\ta3lim
 _______________________________________________________________________________________________________________

ERROR! ERROR! This Generator is empty. Add at least one method for it to run.
Error: This Generator is empty. Add at least one method for it to run.
    at SpringWebsocketGenerator.queueOwnTasks (file:///C:/Users/Adam/AppData/Roaming/npm/node_modules/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:181:19)
    at SpringWebsocketGenerator._queueTasks (file:///C:/Users/Adam/AppData/Roaming/npm/node_modules/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:302:14)
    at SpringWebsocketGenerator.queueTasks (file:///C:/Users/Adam/AppData/Roaming/npm/node_modules/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:298:20)
    at async runLoop.add.once (C:\Users\Adam\AppData\Roaming\npm\node_modules\generator-jhipster\node_modules\yeoman-environment\lib\environment.js:1441:28)
ERROR! Unhandled promise rejection at:
FATAL! Error: This Generator is empty. Add at least one method for it to run.

.yo-rc.json file
{
  "applicationType": "monolith",
  "authenticationType": "oauth2",
  "baseName": "ta3lim",
  "buildTool": "maven",
  "cacheProvider": "caffeine",
  "clientFramework": "react",
  "clientTheme": "none",
  "creationTimestamp": 1686931709024,
  "cypressAudit": false,
  "cypressCoverage": null,
  "databaseType": "sql",
  "devDatabaseType": "h2Disk",
  "devServerPort": 9060,
  "dtoSuffix": "DTO",
  "enableGradleEnterprise": null,
  "enableHibernateCache": true,
  "enableSwaggerCodegen": false,
  "enableTranslation": true,
  "entities": [],
  "entitySuffix": "",
  "gradleEnterpriseHost": null,
  "jhiPrefix": "jhi",
  "jhipsterVersion": "8.0.0-beta.1",
  "languages": [
    "en",
    "fr",
    "ar-ly"
  ],
  "messageBroker": false,
  "microfrontend": false,
  "microfrontends": [],
  "nativeLanguage": "en",
  "packageFolder": "com/ta3lim/app",
  "packageName": "com.ta3lim.app",
  "pages": [],
  "prodDatabaseType": "mysql",
  "reactive": false,
  "searchEngine": "elasticsearch",
  "serverPort": null,
  "serverSideOptions": [
    "searchEngine:elasticsearch",
    "websocket:spring-websocket"
  ],
  "serviceDiscoveryType": false,
  "skipCheckLengthOfIdentifier": false,
  "skipClient": false,
  "skipFakeData": false,
  "skipUserManagement": true,
  "testFrameworks": [
    "cypress"
  ],
  "websocket": "spring-websocket",
  "withAdminUi": true
}
my .jdl
entity EducationalResource {
  title String required
  creationDate LocalDate
  description String
  educationalResourceType EducationalResourceType
  ageRange AgeRange
  file Blob
  url String
  author String
  lastUpdated LocalDate
  activated Boolean
  views Long
  votes Long
  approvedBy String
}

enum EducationalResourceType {
  ARTICLES("articles")
  DOCUMENTS("documents")
  PRESENTATION("presentations")
  IMAGES("images")
  URLS("url's")
  ANNOUNCEMENTS("announcements")
  OTHER("other")
}

entity Subject {
  label String
  creationDate LocalDate
}

entity Topic {
  label String
  creationDate LocalDate
}

entity Skill {
  label String
  creationDate LocalDate
}

enum AgeRange {
  AGE_ALL ("all ages")
  AGE_04_06 ("age 4-6")
  AGE_07_09 ("age 7-9")
  AGE_10_12 ("age 10-12")
  AGE_13_15 ("age 13-15")
  AGE_16_18 ("age 16-18")
}

entity Votes {
}

entity Notification {
    creationDate LocalDate
    notificationDate LocalDate
    notificationType NotificationType
    notificationText String
    isDelivered Boolean
    isDeleted Boolean
}

enum NotificationType {
  UNREAD_MESSAGES("Unread messages")
  ACCEPTED("Submission accepted")
  REJECTED("Submission rejected")
  NONE("None")
}

entity Message {
    creationDate LocalDate
    messageText String
    isDelivered Boolean
}

entity Favorite {
    creationDate LocalDate
}

entity UserExtended {
  lastLogin LocalDate
  aboutMe String
  occupation String
  socialMedia String
  civilStatus CivilStatus
  firstchild Children
  secondchild Children
  thirdchild Children
  fourthchild Children
  filesquota Integer
  approverSince LocalDate
  lastApproval LocalDate
}

enum Children {
  AGE_00_03 ("age 0-3")
  AGE_04_06 ("age 4-6")
  AGE_07_09 ("age 7-9")
  AGE_10_12 ("age 10-12")
  AGE_13_15 ("age 13-15")
  AGE_16_18 ("age 16-18")
}

enum CivilStatus {
  MARRIED ("Married")
  DIVORCED ("Divorced")
  WIDOWER ("Widower")
  SEPARATED ("Separated")
  SINGLE ("Single")
  ENGAGED ("Engaged")
  OTHER ("Other")
}

relationship OneToOne {
  UserExtended{user(login)} to User with builtInEntity
}

relationship ManyToOne {
  EducationalResource{user(login)} to User with builtInEntity
  Notification{user(login)} to User with builtInEntity
  EducationalResource{subject(label)} to Subject
  Votes{user(login)} to User with builtInEntity
  Votes{educationalResource(id)} to EducationalResource
  Favorite{user(login)} to User with builtInEntity
  Favorite{educationalResource(id)} to EducationalResource
  Message{receiver(login)} to User with builtInEntity
  Message{sender(login)} to User with builtInEntity
}

relationship ManyToMany {
  EducationalResource{topics(label)} to Topic{educationalresource(id)}
  EducationalResource{skills(label)} to Skill{educationalresource(id)}
}

paginate all with pagination
service all with serviceImpl
dto all with mapstruct
filter *

OS & other:: Windows 11, node v18.13.0, npm: 8.19.3, OpenJDK 17.0.2

JeroenAdam commented 1 year ago

Solved by adding he application declaration at the top of the .jdl