Skip to content

Root module selection works incorrectly #427

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

Closed
ashakirin opened this issue Sep 20, 2022 · 0 comments · Fixed by #429
Closed

Root module selection works incorrectly #427

ashakirin opened this issue Sep 20, 2022 · 0 comments · Fixed by #429

Comments

@ashakirin
Copy link
Contributor

ashakirin commented Sep 20, 2022

Root module selection sorts absolute module paths alphabetically, that is not correct. For example for paths:
Users/xxx/root/common/pom.xml
Users/xxx/root/services/pom.xml
Users/xxx/root/pom.xml

the Users/xxx/root/common/pom.xml will be selected.

The criteria must be updated to:

        return modules.stream()
                .sorted((m1, m2) -> m1.getBuildFile().getAbsolutePath().toString().length() - m2.getBuildFile().getAbsolutePath().toString().length())
                .findFirst()
                .orElse(modules.get(0));
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant