-
Notifications
You must be signed in to change notification settings - Fork 284
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
Migrate build system from Maven to Gradle #1121
Conversation
328b85d
to
e21acbe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please limit scope of the PR just to migration from maven to gradle build system. Anything not directly related to maven->gradle migration such as UT, java doc, JDK version upgrade should be part of a separate PR(s).
e21acbe
to
08a3f69
Compare
@@ -1,5 +1,5 @@ | |||
distributionBase=GRADLE_USER_HOME | |||
distributionPath=wrapper/dists | |||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip | |||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If gradle version upgrade is necessary, please move that to a separate PR as well.
build.gradle
Outdated
} | ||
|
||
dependencies { | ||
compile('org.elasticsearch.plugin:transport-netty4-client:7.10.2') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compile
is deprecated in favor of implementation
. Can we use that instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replacing all compile
with implementation
fails compileJava
task. Some of them indeed can be replaced. I didn't change them for consistency.
build.gradle
Outdated
compile('org.apache.httpcomponents:httpclient-cache:4.5.3') { | ||
exclude group: 'org.apache.httpcomponents', module: 'httpcore' | ||
} | ||
compile('org.elasticsearch.client:elasticsearch-rest-high-level-client:7.10.2') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please define variable and reuse for same versions. Eg: 7.10.2 is used for a couple of dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
build.gradle
Outdated
testImplementation 'org.elasticsearch:elasticsearch-ssl-config:7.10.2' | ||
testImplementation 'org.elasticsearch.plugin:percolator-client:7.10.2' | ||
compile 'org.elasticsearch.plugin:lang-mustache-client:7.10.2' | ||
compile 'org.elasticsearch.plugin:parent-join-client:7.10.2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Group all testImplementation, implementation, compileOnly, runtimeOnly dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By group, do you mean put dependencies with same scope together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
configurations.all { | ||
if (it.state != Configuration.State.UNRESOLVED) return | ||
resolutionStrategy { | ||
force 'commons-codec:commons-codec:1.14' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do all the dependencies need force?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, all these need force because otherwise some dependency conflicts come out.
I've excluded java doc from compilation, I can remove the change in java doc. |
Change PR and commit title to something like "migrate build system from maven to gradle" |
Changing PR title is necessary to avoid confusion regarding the goal of the PR, but it will not help with other issues. If version of gradle needs to be upgraded, it should be a separate PR and commit as in one large PR it is impossible to distinguish changes required for gradle upgrade and changes required for migrating from maven to gradle. The same applies to all other unrelated to maven -> gradle changes. |
08a3f69
to
ff003b2
Compare
3184226
to
c9b98cd
Compare
c9b98cd
to
3c360dc
Compare
Will re-open later if needed. |
Signed-off-by: Peter Nied <[email protected]> Co-authored-by: Darshit Chanpura <[email protected]>
opendistro-for-elasticsearch/security pull request intake form
Please provide as much details as possible to get feedback/acceptance on your PR quickly
Category: (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)
Maintenance
Github Issue # or road-map entry, if available:
Description of changes:
Why these changes are required?
Security plugin has 2 build systems: Maven and Gradle(building
.rpm
and.deb
packages). It's necessary to combine them into a single one(Gradle).What is the old behavior before changes and new behavior after changes? (Please add any example/logs/screen-shot if available)
Testing done: (Please provide details of testing done: Unit testing, integration testing and manual testing)
./gradlew clean build --no-daemon -Dbuild.snapshot=false -x test
, artifacts are generated ingradle-build/distributions/
opendistro_security-1.13.1.0.jar
opendistro-security-1.13.1.0.zip
opendistro-security-1.13.1.0-securityadmin-standalone.zip
opendistro-security-1.13.1.0-securityadmin-standalone.tar.gz
elasticsearch-7.10.2/plugins/opendistro_security/securityconfig
install_demo_configuration.sh
, security settings are added intoelasticsearch.yml
file.elasticsearch-7.10.2/plugins
isopendistro_security
TO-DOs, if any: (Please describe pending items and provide Github issues# for each of them)
Is it backport from main branch? (If yes, please add backport PR # and commits #)
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.