Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init RequiredGeneratorStep #1455

Closed
wants to merge 1 commit into from

Conversation

MSaguer
Copy link
Contributor

@MSaguer MSaguer commented Apr 23, 2022

Here is a quick proposal as a first step to answer #199.

I propose here to create a new RequiredGeneratorStep annotation to list all GeneratorStep that should have been executed before this step.
The GeneratorHistoryInterceptor has been transformed into GeneratorStepInterceptor to check that all required steps have been executed. If some GeneratorStep miss, the execution is stopped and an exception is raised.

What do you think of this?

If the principle is validated, I will improve the code and add tests.

@pascalgrimaud
Copy link
Member

In fact, it's not so easy, that's why it's not implemented yet.

I give you a use case:

  • I already have an existing Spring Boot project, generated from scratch with Spring Initializr
  • with my team, we added a lot of specific code to our project
  • now, I'd like to add Spring Cloud Config with Consul
  • I'd like to use JHipster Lite as I think it's possible and it should be possible

So the problem with this approach will block this use case, as there is no history

@MSaguer
Copy link
Contributor Author

MSaguer commented Apr 23, 2022

Oh, I see. Far more complex than the use case I understood reading the issue.
So we need to be able to check current project properties just based on files found in project. May be easy for maven/gradle but harder in some other cases.

@pascalgrimaud
Copy link
Member

Yes I'm still thinking and don't have a clear solution, excepting doing manually the check in each context.

For example, if the user wants to add liquibase, we could simply check if there is already an existing datasource in properties, or a driver in pom.xml/gradle

@pascalgrimaud
Copy link
Member

I think the idea is good, but it will be tackle by #1666
So don't hesitate to comment there
So let's close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants