Skip to content

Allow duplicate project names if they have distinct groups #281

Description

@aSemy

Expected and Results

nmcp throws an error if projects have the same name, for example if the root project is called :foo and there's a subproject :bar:foo.

A problem occurred configuring root project 'foo'.
> Nmcp: some projects have the same name: '${it.name}'. This creates issues when resolving the aggregation.
  You can usually resolve this error by renaming your projects (including possibly your root project).
  Or you can disable this check by calling `allowDuplicateProjectNames.set(true)`.
  See https://github.com/gradle/gradle/issues/36167 for more details.

However, in my case the error is not valid. The two subprojects have distinct project.group values. A distinct group allows Gradle to differentiate the projects correctly.

// build.gradle.kts

group = "root"

// foo/build.gradle.kts

group = "foo"

Can the warning be updated to check if the name and group of projects clash?

Related environment and versions

No response

Reproduction steps

No response

Anything else?

'${'$'}{it.name}' -- oops!

Nmcp: some projects have the same name: '${'$'}{it.name}'. This creates issues when resolving the aggregation.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions