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

Add support for logical dependency #152

Open
snicoll opened this issue Oct 21, 2015 · 9 comments
Open

Add support for logical dependency #152

snicoll opened this issue Oct 21, 2015 · 9 comments

Comments

@snicoll
Copy link
Contributor

snicoll commented Oct 21, 2015

It would be nice that Spring Initializr had the concept of logical dependency (that is a dependency entry that represents several dependencies).

Concretely, this means that adding a dependency (a checkbox in the UI) has the effect of adding several dependencies in the project. This is a good alternative for things that are frequently used but for which we don't want/need an explicit starter.
#151 is a good example

@rwinch
Copy link

rwinch commented Feb 26, 2016

@snicoll Another good example would be adding Spring Security should also add spring-security-test.

@snicoll
Copy link
Contributor Author

snicoll commented Feb 26, 2016

I guess you mean the security starter, right?

@rwinch
Copy link

rwinch commented Feb 26, 2016

@snicoll Right. If you add spring-security-starter, then it should also add spring-security-test.

@ndrone
Copy link

ndrone commented Aug 6, 2016

I wrote something like this in the fork that Kroger (the company I work for) is using. Let me see if I can pull it from there and contribute.

@sdeleuze
Copy link
Contributor

Maybe this issue could allow to fix the very annoying Kotlin module issue described in #400, by managing logicial dependencies with language related conditions.

@snicoll
Copy link
Contributor Author

snicoll commented Jul 15, 2017

Unfortunately I believe it would not. If that was so easy, we would have cooked a request post processor by now.

The problem with the issue described in #400 is that we have no way to know that jackson has been added but to inspect the transitive dependencies of the starters that were selected by the user. I believe documentation (and the guide you offered to write in #400) are a more realistic option at this point.

@sdeleuze
Copy link
Contributor

sdeleuze commented Jul 15, 2017

I truly understand this is not an easy one, but even with documentation, projects using Boot + Kotlin + Jackson (vast majority of Kotlin projects) are broken out of the box for use cases as simple as writing a REST webservice. IMO even experienced developers will forget to add it 50% of the time because with start.spring.io, we have the habits of just generating a project, write classes, run and it works. So when I saw this issue I thought it would be interesting to discuss if it could be use to help for such use case (even if maybe it is not).

Having the capability to add a post-processor able to inspect transitive dependencies and add jackson-kotlin-module dependency when jackson-databind is found in transitive dependencies and when "language == 'kotlin'" would be awesome, but as you said that's not possible easily currently and that's not what I had in mind.

My proposal is a more basic approach where we leverage the new feature discussed here to add for dependencies like "Web" and "Reactive Web" (maybe a few others like "Ratpack" or "Vaadin" if that makes sense) an additional jackson-kotlin-module dependency if a condition like "language == 'kotlin'" is fulfilled. This is not a perfect solution (duplication in the meta-data, will not cover all use cases if we focused on the most common dependencies requiring Jackson) but given the current set of constraints, I thought it could be a possible one.

Any thoughts?

@snicoll
Copy link
Contributor Author

snicoll commented Jul 16, 2017

Any thoughts?

Yes, I don't think this discussion belongs here as I really think this request is unrelated to what you are trying to address. Can you please copy/paste your comment in a new issue and we can take it from there?

@snicoll
Copy link
Contributor Author

snicoll commented Mar 23, 2018

We'd like to experiment some metadata change where we'd be able to provide a versionRange constraint and additional dependencies when that constraint matches. This would replace 3 post processors we currently have in initializr-service that look identical.

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

No branches or pull requests

4 participants