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

Remove project name support in v2 #590

Closed
batsatt opened this issue Dec 20, 2021 · 1 comment · Fixed by #620
Closed

Remove project name support in v2 #590

batsatt opened this issue Dec 20, 2021 · 1 comment · Fixed by #620
Assignees
Milestone

Comments

@batsatt
Copy link
Contributor

batsatt commented Dec 20, 2021

We currently have support for two different "names" with identical default values in the user config:

default.project.name=${init_archetype}-${init_flavor}
default.artifact.id=${init_archetype}-${init_flavor}

The project name is only important for the generated directory name.

The issue is that when in interactive mode with helidon init, it is easy to change one value and not the other, resulting in behavior that violates the principle of least surprise. For example, using "foo" as the project name and accepting the default for artifact id will create a directory name "foo" but the artifact id, jar name, docker image name, etc. will all be based on the default.

Removing support for project name is the cleanest way of avoiding this issue:

  1. Use the artifactId value for the directory name
  2. Add a warning if --name is supplied saying that it will be unused
  3. Add a comment in the generated user config saying that default.project.name is only used for v1

Note that artifactId will now be required and an exception will be thrown if there is no valid value for it.
It will replace the statement below inside ArchetypeEngineV2.

        String projectName = requireNonNull(context.lookup(PROJECT_NAME), "project name is null").asString();
@batsatt batsatt added this to the 3.0.0-M2 milestone Dec 20, 2021
@batsatt batsatt added this to To do in Archetype V2 via automation Dec 20, 2021
@romain-grecourt romain-grecourt moved this from To do to In progress in Archetype V2 Jan 3, 2022
@batsatt
Copy link
Contributor Author

batsatt commented Jan 12, 2022

ArchetypeEngineV2.generate() must be updated to use artifactId for the output directory.
IntegrationTestMojo.processIntegrationTest() must be updated to stop adding the name.

@batsatt batsatt self-assigned this Jan 20, 2022
Archetype V2 automation moved this from In progress to Done Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant