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

FINERACT-797: Use Spring Boot BOM to avoid maintaining version numbers in dependencies.gradle #662

Merged
merged 5 commits into from Dec 2, 2019

Conversation

xurror
Copy link

@xurror xurror commented Nov 30, 2019

FINERACT-797 - Spring Dependency Management

Description

In an ideal world, in a future PR, it would be really really cool if we could just avoid having to repeat using fixed version, and could use the implicit versions via Spring BOM dependency management, see https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/html/#managing-dependencies ...

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

Our guidelines for code reviews is at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide

@xurror
Copy link
Author

xurror commented Nov 30, 2019

@vorburger please can you review this?

@vorburger
Copy link
Member

@ivan333m do you have any interest in helping to review this, given that this idea originally came up when I reviewed your PR #642? (I'll go over it as well and post some feedback from my side ASAP.)

Copy link
Member

@vorburger vorburger left a comment

Choose a reason for hiding this comment

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

Some minor feedback, and a question:

Would you be able to post a diff of a before/after dependency tree, so that we can see what versions, if any, will effectively change with this PR?

fineract-provider/build.gradle Outdated Show resolved Hide resolved
fineract-provider/build.gradle Outdated Show resolved Hide resolved
fineract-provider/build.gradle Outdated Show resolved Hide resolved
imports {
mavenBom 'org.springframework:spring-framework-bom:5.1.10.RELEASE'
}
dependencies {
Copy link
Member

Choose a reason for hiding this comment

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

I'm probably misunderstanding the Spring BOM, but does it not also define (some of) these versions? Or is this list just the versions of all Fineract dependencies which the Spring BOM does not fix?

Copy link
Author

Choose a reason for hiding this comment

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

Well, the spring framework-bom resolves all spring artifacts(like spring-core etc) without explicitly declaring them since they all use thesame version

It seems there is no spring-boot-bom to handle the spring boot artifacts and dependencies

Copy link
Author

Choose a reason for hiding this comment

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

My primary idea was to use generalized bom that handles dependencies for most of the packages we use and even more but the version conflicts were too big breaking builds

Copy link
Member

Choose a reason for hiding this comment

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

but the version conflicts were too big breaking builds

@xurror OK, then let's do that (you or someone else later) separately; I've just created new https://issues.apache.org/jira/browse/FINERACT-805 so that we don't forget to follow-up on that... (It's surely best to raise small PRs for each one of these, instead of one big one for everything together.)

@ivbond
Copy link

ivbond commented Dec 1, 2019

@xurror Nice changes, thanks.

All points described bellow are OPTIONAL!

I would propose following:

  1. According to the spring doc spring doc
    When you apply the io.spring.dependency-management plugin, Spring Boot’s plugin will automatically import the spring-boot-dependencies bom from the version of Spring Boot that you are using..... So you don't need to specify version on spring boot dependencySet

  2. As I know when you apply bom it controls all third-party dependencies that declared it the bom. Here is a spring boot bom. You can find spring and all related third-party dependencies there. Therefore we could exclude spring framework version and alot of third-party.

You could generate spring boot application on Spring IO initializer and use it as an example.

@xurror
Copy link
Author

xurror commented Dec 1, 2019

@xurror Nice changes, thanks.

All points described bellow are OPTIONAL!

I would propose following:

  1. According to the spring doc spring doc
    When you apply the io.spring.dependency-management plugin, Spring Boot’s plugin will automatically import the spring-boot-dependencies bom from the version of Spring Boot that you are using..... So you don't need to specify version on spring boot dependencySet
  2. As I know when you apply bom it controls all third-party dependencies that declared it the bom. Here is a spring boot bom. You can find spring and all related third-party dependencies there. Therefore we could exclude spring framework version and alot of third-party.

You could generate spring boot application on Spring IO initializer and use it as an example.

Thanks for this review, the new updates I have made should fix that

@vorburger
Copy link
Member

@xurror this now has conflicts, because I just merged #661 ... sorry about that. Would you mind to (manually...) resolve these conflicts? There's really no way to avoid this, so I usually just merge cases like this in the order that such conflicting changes are proposed (e.g. in this csae, @percyashu #661 was before your #662 here). Thank You!

@xurror
Copy link
Author

xurror commented Dec 2, 2019

Resolved conflicts with #661

@@ -79,10 +79,13 @@ public void shouldCorrectlyBuildMap() {
nodes = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream(result.getBytes()))
.getElementsByTagName("Assets");
} catch (final SAXException e) {
// TODO Auto-generated catch block
Copy link
Member

Choose a reason for hiding this comment

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

@xurror this looks weird and given (your) #663 I'm assuming is a mistake - remove?

Suggested change
// TODO Auto-generated catch block

e.printStackTrace();
} catch (final IOException e) {
// TODO Auto-generated catch block
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// TODO Auto-generated catch block

e.printStackTrace();
} catch (final ParserConfigurationException e) {
// TODO Auto-generated catch block
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// TODO Auto-generated catch block

Comment on lines +73 to +74
dependency 'com.squareup.okhttp:okhttp:2.0.0'
dependency 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@vorburger vorburger left a comment

Choose a reason for hiding this comment

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

This would LGTM for me if you could just remove those re-introduced TODOs in XBRLBuilderTest.java? Then I'm happy to merge this. Note to myself, or anyone else (e.g. @awasum) who will merge this: We should "squash" the commits here into 1 via that GitHub UI drop-down merge button.

@vorburger vorburger merged commit a20f76d into apache:develop Dec 2, 2019
@xurror xurror mentioned this pull request May 7, 2020
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants