Skip to content

Problem with the STS/eclipse initializr for custom project types #660

Closed

Description

@marc06210

Hello,

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

Import the project, start it and from the IDE when trying to initialize a new Spring project select http://localhost:8080 as server URL.

have you already tried to define a new project type and create such a project within STS/eclipse?

Thx for your answer

Marc

edit: addition of the GitHub repository with source code with custom project type Mgu

Activity

  1. added this to the 4.11.1.RELEASE milestone on Jul 30, 2021
  2. BoykoAlex commented on Jul 30, 2021

    @BoykoAlex
    Contributor

    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

  3. marc06210 commented on Jul 30, 2021

    @marc06210
    Author

    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 🙂

  4. kdvolder commented on Jul 30, 2021

    @kdvolder
    Member

    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.

  5. snicoll commented on Aug 4, 2021

    @snicoll
    Member

    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.

  6. martinlippert commented on Aug 9, 2021

    @martinlippert
    Member

    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:

    • if there is a build type that the IDE understands (Maven or Gradle in our case), use it and import the generated project as a Maven or Gradle project
    • if there is a build type that the IDE doesn't understand, tell the user and provide an option to import the project as a plain project
    • if there is no build type specified, tell the user and provide an option to import the project as a plain project

    WDYT?

  7. BoykoAlex commented on Aug 25, 2021

    @BoykoAlex
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions