You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Problem with the STS/eclipse initializr for custom project types #660
I have customized the initializer with new project types.
When initializing a new project on IntelliJ those new types are available but they do not show up in the STS/eclipse project creation popup.
The custom SpringInitializr code is available here
I think type is misused in the custom initializr project. The starter project is a Maven project and should be Maven Project type. Types are reserved for build type of the project: Maven, Gradle etc. Thus one could use the same starter with a different build: Maven or Gradle. The type makes it into the path of a URL used to download the proper starter.zip (Maven or Gradle version of it).
I suppose IntelliJ simply shows in the wizard what it gets from the Initializr endpoint. In the case of the type Eclipse does not. It has predefined build types for which project import is supported by the Eclipse tooling. Everything not matching is ignored. This is done for a good reason. If a new build type comes in Eclipse tooling would need to execute some build tooling specific command to properly import the project into Eclipse. The new build type would most likely require including some build tooling plugins into STS hence build types are predefined and feels like they should be as you can't import an arbitrary build type project into Eclipse.
Of course we could make it work like IntelliJ by showing this new type and probably based on build type tags figure out that it is really a maven project to be imported. This seems like a wrong thing to do to me though...
It would make sense to do something for extra "type(s)" if there was really a new build type...
What are you thoughts on this @kdvolder and @martinlippert
If the project you are generating is a maven project anyways, then why is it a new 'type'? I guess I don't really understand what you mean by type if it isn't to distinguish between maven and gradle.
Of course we could make it work like IntelliJ by showing this new type and probably based on build type tags figure out that it is really a maven project to be imported. This seems like a wrong thing to do to me though...
I disagree with that. The documentation states that:
The build system must be defined with a build tag providing the name of the BuildSystem to use (e.g. maven, gradle).
In the case of STS, I agree you can't support a custom build system but, as long as the build tag provides the ID of the build system, you should be fine to support additional types.
Activity
BoykoAlex commentedon Jul 30, 2021
I think type is misused in the custom initializr project. The starter project is a Maven project and should be Maven Project type. Types are reserved for build type of the project: Maven, Gradle etc. Thus one could use the same starter with a different build: Maven or Gradle. The type makes it into the path of a URL used to download the proper
starter.zip(Maven or Gradle version of it).I suppose IntelliJ simply shows in the wizard what it gets from the Initializr endpoint. In the case of the type Eclipse does not. It has predefined build types for which project import is supported by the Eclipse tooling. Everything not matching is ignored. This is done for a good reason. If a new build type comes in Eclipse tooling would need to execute some build tooling specific command to properly import the project into Eclipse. The new build type would most likely require including some build tooling plugins into STS hence build types are predefined and feels like they should be as you can't import an arbitrary build type project into Eclipse.
Of course we could make it work like IntelliJ by showing this new type and probably based on build type tags figure out that it is really a maven project to be imported. This seems like a wrong thing to do to me though...
It would make sense to do something for extra "type(s)" if there was really a new build type...
What are you thoughts on this @kdvolder and @martinlippert
marc06210 commentedon Jul 30, 2021
Thx for your quick reply. It makes sense to me (no other type than the one supported by STS/eclipse).
I will think about another implementation 🙂
kdvolder commentedon Jul 30, 2021
If the project you are generating is a maven project anyways, then why is it a new 'type'? I guess I don't really understand what you mean by type if it isn't to distinguish between maven and gradle.
snicoll commentedon Aug 4, 2021
I disagree with that. The documentation states that:
In the case of STS, I agree you can't support a custom build system but, as long as the
buildtag provides the ID of the build system, you should be fine to support additional types.martinlippert commentedon Aug 9, 2021
Thanks @snicoll for pointing us at this. So re-opening this one here, turning it into an enhancement request to support different "types".
We could also go one step further:
WDYT?
BoykoAlex commentedon Aug 25, 2021
Fixed with 51842c8 and available in the nightly build via update site: https://dist.springsource.com/snapshot/TOOLS/sts4/nightly/e4.20