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

Getting rid of direct cross-project dependencies to avoid gradle warnings #1868

Merged
merged 3 commits into from
Jan 13, 2022

Conversation

masseyke
Copy link
Member

This commit avoids gradle warnings when running ./gradlew :qa:kerberos:compileJava. The :qa:kerberos project
had been directly pulling in the itest.runtimeClasspath from the storm and hadoop-mr projects, which is not allowed
in gradle 8.

@masseyke
Copy link
Member Author

Here's an example of the warning I had been getting before this change:

Resolution of the configuration :elasticsearch-hadoop-mr:itestRuntimeClasspath was attempted from a context different than the project context. Have a look at the documentation to understand why this is a problem and how it can be resolved. This behaviour has been deprecated and is scheduled to be removed in Gradle 8.0. See https://docs.gradle.org/7.3/userguide/viewing_debugging_dependencies.html#sub:resolving-unsafe-configuration-resolution-errors for more details.
Resolution of the configuration :elasticsearch-storm:itestRuntimeClasspath was attempted from a context different than the project context. Have a look at the documentation to understand why this is a problem and how it can be resolved. This behaviour has been deprecated and is scheduled to be removed in Gradle 8.0. See https://docs.gradle.org/7.3/userguide/viewing_debugging_dependencies.html#sub:resolving-unsafe-configuration-resolution-errors for more details.

FAILURE: Build failed with an exception.

* What went wrong:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0```

Copy link
Contributor

@jakelandis jakelandis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. I think it can be simplified a little by declaring the configuration and artifact in org.elasticsearch.hadoop.gradle.BuildPlugin#createItestTask

        Configuration itestJarConfig = project.getConfigurations().maybeCreate("itestJarConfig")
        itestJarConfig.canBeConsumed = Boolean.TRUE
        itestJarConfig.canBeResolved = Boolean.FALSE
        project.getArtifacts().add(itestJarConfig.getName(), itestJar)

just after the declaration or configuration of itestJar

Copy link
Contributor

@jakelandis jakelandis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@masseyke masseyke merged commit bb20a44 into elastic:master Jan 13, 2022
@masseyke masseyke deleted the fix/gradle-warnings branch January 13, 2022 20:34
masseyke added a commit to masseyke/elasticsearch-hadoop that referenced this pull request Jan 13, 2022
…ings (elastic#1868)

This commit avoids gradle warnings when running ./gradlew :qa:kerberos:compileJava. The :qa:kerberos project
had been directly pulling in the itest.runtimeClasspath from the storm and hadoop-mr projects, which is not allowed
in gradle 8.
masseyke added a commit that referenced this pull request Jan 13, 2022
…ings (#1868) (#1869)

This commit avoids gradle warnings when running ./gradlew :qa:kerberos:compileJava. The :qa:kerberos project
had been directly pulling in the itest.runtimeClasspath from the storm and hadoop-mr projects, which is not allowed
in gradle 8.
@masseyke
Copy link
Member Author

Closes #1812

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

Successfully merging this pull request may close these issues.

2 participants