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

Gradle 4.8 no longer considers versions equal when using dependencySubstitution and failOnVersionConflict #5692

Closed
alpar-t opened this issue Jun 11, 2018 · 1 comment
Assignees
Milestone

Comments

@alpar-t
Copy link

alpar-t commented Jun 11, 2018

Expected Behavior

Depending on both a sub-project and something which is substituted to the same sub-project triggers a failure when the configuration is configured with failOnVersionConflict. This only happens with Gradle 4.8.

Current Behavior

The dependency resolutions should succeed just like in 4.7

Context

The [elastic/elasticsearch] build uses failOnVersionConflict and substitutions to be able to build some sub-projects (also) stand-alone. We encountered this issue trough a chain of transitive dependencies, much less obvious than the example below.

Steps to Reproduce (for bugs)

git clone git@github.com:atorok/gradle4.8_dependencySubstitution_failOnVersionConflict_reproduce.git
./gradlew assemble 

this fails with:

* What went wrong:
Could not determine the dependencies of task ':compileJava'.
> Could not resolve all dependencies for configuration ':compileClasspath'.
   > A conflict was found between the following modules:
      - gradle_test:sub1:0.0.1
      - gradle_test:sub1:0.0.1

Your Environment

@ljacomet
Copy link
Member

Thanks for the report and reproducible test case.
Looks like some refactoring around dependency management made a shortcut disappear which was handling modules having the exact same version.

alpar-t added a commit to elastic/elasticsearch that referenced this issue Jun 18, 2018
alpar-t added a commit to alpar-t/elasticsearch that referenced this issue Jun 22, 2018
alpar-t added a commit to elastic/elasticsearch that referenced this issue Jun 28, 2018
* Move to Gradle 4.8 RC1

* Use latest version of plugin

The current does not work with Gradle 4.8 RC1

* Switch to Gradle GA

* Add and configure build compare plugin

* add work-around for gradle/gradle#5692

* work around gradle/gradle#5696

* Make use of Gradle build compare with reference project

* Make the manifest more compare friendly

* Clear the manifest in compare friendly mode

* Remove animalsniffer from buildscript classpath

* Fix javadoc errors

* Fix doc issues

* reference Gradle issues in comments

* Conditionally configure build compare

* Fix some more doclint issues

* fix typo in build script

* Add sanity check to make sure the test task was replaced

Relates to #31324. It seems like Gradle has an inconsistent behavior and
the taks is not always replaced.

* Include number of non conforming tasks in the exception.

* No longer replace test task, create implicit instead

Closes #31324. The issue has full context in comments.

With this change the `test` task becomes nothing more than an alias for `utest`.
Some of the stand alone tests that had a `test` task now have `integTest`, and a
few of them that used to have `integTest` to run multiple tests now only
have `check`.
This will also help separarate unit/micro tests from integration tests.

* Revert "No longer replace test task, create implicit instead"

This reverts commit f1ebaf7.

* Fix replacement of the test task

Based on information from gradle/gradle#5730 replace the task taking
into account the task providres.
Closes #31324.

* Only apply build comapare plugin if needed

* Make sure test runs before integTest

* Fix doclint aftter merge

* PR review comments

* Switch to Gradle 4.8.1 and remove workaround

* PR review comments

* Consolidate task ordering
alpar-t added a commit to elastic/elasticsearch that referenced this issue Jun 28, 2018
* Move to Gradle 4.8 RC1

* Use latest version of plugin

The current does not work with Gradle 4.8 RC1

* Switch to Gradle GA

* Add and configure build compare plugin

* add work-around for gradle/gradle#5692

* work around gradle/gradle#5696

* Make use of Gradle build compare with reference project

* Make the manifest more compare friendly

* Clear the manifest in compare friendly mode

* Remove animalsniffer from buildscript classpath

* Fix javadoc errors

* Fix doc issues

* reference Gradle issues in comments

* Conditionally configure build compare

* Fix some more doclint issues

* fix typo in build script

* Add sanity check to make sure the test task was replaced

Relates to #31324. It seems like Gradle has an inconsistent behavior and
the taks is not always replaced.

* Include number of non conforming tasks in the exception.

* No longer replace test task, create implicit instead

Closes #31324. The issue has full context in comments.

With this change the `test` task becomes nothing more than an alias for `utest`.
Some of the stand alone tests that had a `test` task now have `integTest`, and a
few of them that used to have `integTest` to run multiple tests now only
have `check`.
This will also help separarate unit/micro tests from integration tests.

* Revert "No longer replace test task, create implicit instead"

This reverts commit f1ebaf7.

* Fix replacement of the test task

Based on information from gradle/gradle#5730 replace the task taking
into account the task providres.
Closes #31324.

* Only apply build comapare plugin if needed

* Make sure test runs before integTest

* Fix doclint aftter merge

* PR review comments

* Switch to Gradle 4.8.1 and remove workaround

* PR review comments

* Consolidate task ordering
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants