英文:
importing jdl file creates a lot of conflicts
问题
I am new to jhipster and was trying out the import-jdl feature.
我是JHipster的新手,正在尝试使用import-jdl功能。
I created a sample application which uses mysql as a database and angular for the front end. I used the following configuration to create it. Please note that I didn't choose any cache option.
我创建了一个示例应用程序,它使用MySQL作为数据库,使用Angular作为前端。我使用了以下配置来创建它。请注意,我没有选择任何缓存选项。
When i tried to import it, i got conflicts in a large number of files. I can understand why there were conflicts in UI files. But i am not sure why the import feature tried to change my dev db to h2 and enable ehcache, which I disabled while creating the sample application.
当我尝试导入它时,我在许多文件中遇到了冲突。我可以理解为什么在UI文件中会有冲突。但我不确定为什么导入功能会尝试将我的开发数据库更改为h2并启用ehcache,而我在创建示例应用程序时已禁用了它。
I am using the JHipster 7.9.3 version.
我正在使用JHipster 7.9.3版本。
Can anyone please explain why this is happening and is there any configuration to ensure that the import-jdl feature doesn't change the database and cache configuration?
请问有人可以解释为什么会发生这种情况,是否有配置可以确保import-jdl功能不更改数据库和缓存配置?
英文:
I am new to jhipster and was trying out the import-jdl feature.
I created a sample application which uses mysql as database and angular for front end. i used the following configuration to create it. Please not that i didnt choose any cache option.
? Which *type* of application would you like to create? Monolithic application (recommended for simple projects)
? What is the base name of your application? jdlimporttest
? Do you want to make it reactive with Spring WebFlux? No
? What is your default Java package name? com.mycompany.myapp
? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token)
? Which *type* of database would you like to use? SQL (H2, PostgreSQL, MySQL, MariaDB, Oracle, MSSQL)
? Which *production* database would you like to use? MySQL
? Which *development* database would you like to use? MySQL
? Which cache do you want to use? (Spring cache abstraction) No cache - Warning, when using an SQL database, this will
disable the Hibernate 2nd level cache!
? Would you like to use Maven or Gradle for building the backend? Maven
? Do you want to use the JHipster Registry to configure, monitor and scale your application? No
? Which other technologies would you like to use?
? Which *Framework* would you like to use for the client? Angular
? Do you want to generate the admin UI? Yes
? Would you like to use a Bootswatch theme (https://bootswatch.com/)? Default JHipster
? Would you like to enable internationalization support? No
? Please choose the native language of the application English
? Besides JUnit and Jest, which testing frameworks would you like to use?
? Would you like to install other generators from the JHipster Marketplace? No
I tried to import a dummy jdl file with minimum configurations. which is given below,
application {
config {
baseName jdlimporttest,
applicationType monolith,
packageName com.mycompany.myapp,
authenticationType jwt,
prodDatabaseType mysql,
clientFramework angular
}
entities *
}
entity Product {
productId String
productName String
description String
price Long
specifications String
}
entity Inventory {
id String
inStock Integer
purchased Integer
}
When i tried to import it, i got conflicts in large number of files. I can understand why there was conflicts in ui files. But i am not sure why the import feature, tried to change my dev db to h2 and enable the ehchache, which i disabled while creating the sample application.
I got conflicts in the below files and all the default entities and some ui files,
package.json
src\main\resources\config\liquibase\master.xml
pom.xml
src\main\resources\logback-spring.xml
src\main\resources\config\application.yml
src\main\resources\config\application-dev.yml
src\main\resources\config\application-prod.yml
src\main\java\com\mycompany\myapp\config\WebConfigurer.java
src\main\java\com\mycompany\myapp\config\SecurityConfiguration.java
DatabaseConfiguration.java
ExceptionTranslator.java
logback.xml
I am using the jhipster 7.9.3 version.
Can anyone please explain why this is happening and is there any configuration to make use the import-jdl feature doesnt change the db and cache configuration?
答案1
得分: 2
你不需要顶部的 application
块,因为你已经创建了你的应用程序。如果你移除它,一切应该会运行得更顺畅。
英文:
You don't need the application
block at the top since you already created your application. If you remove it, everything should work much smoother.
答案2
得分: 0
如果您希望应用程序定义匹配,请首先导出现有定义:
jhipster export-jdl
然后将新实体添加到生成的文件中。
英文:
If you want the application definition to match, first export the existing definition:
jhipster export-jdl
Then add your new entities to the generated file.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论