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

Support java modules for azure-spring-data-cosmos #14636

Merged

Conversation

saragluna
Copy link
Member

@saragluna saragluna commented Aug 31, 2020

Support Java modules for azure-spring-data-cosmos: #14378.

module-info.java added to the core project azure-spring-data-cosmos-core and the name for this core module is com.azure.spring.data.cosmos.

For the two pom file projects, azure-spring-data-2-3-cosmos and azure-spring-data-2-2-cosmos, an Automatic-Module-Name entry added to the maven-jar-plugin so these two could be automatic modules when used in Java modules. If we don't add such entry, the automatic module names for these two are like azure.spring.data.2.2.cosmos which is not valid and will cause runtime exceptions.

We could choose to add module-info.java for the azure-spring-data-2-3-cosmos, but the maven-compiler-plugin would fail when it compiles this artifact against Java8, complaining it doesn't support Java module even though we exclude the module-info.java in such execution.

I also created a WIP PR to the sample project showing the changes users need to include when creating a modular application. Azure-Samples/azure-spring-data-cosmos-java-sql-api-getting-started#2

Copy link
Member

@kushagraThapar kushagraThapar left a comment

Choose a reason for hiding this comment

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

Overall looks good to me. @srnagar - can you please verify this PR to make sure spring-data-cosmos-core is now complying with java 11 support?

@@ -32,7 +32,7 @@
exports com.azure.cosmos.util;

// exporting some packages specifically for Jackson
opens com.azure.cosmos to com.fasterxml.jackson.databind;
opens com.azure.cosmos to com.fasterxml.jackson.databind, org.apache.commons.lang3;
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

But that code piece is in spring-data-cosmos-core and here we are exporting apache commons lang 3 to azure-cosmos module, which doesn't use this dependency at all. Let's discuss this offline today.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, cosmos package should have no dependency or reference to org.apache.commons.lang3.

@saragluna
Copy link
Member Author

/azp run java - cosmos - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@kushagraThapar kushagraThapar left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @saragluna
@srnagar - can you please confirm these changes ?

@kushagraThapar kushagraThapar merged commit d890893 into Azure:master Sep 4, 2020
@saragluna saragluna deleted the feature/spring-data-cosmos-modular branch September 7, 2020 03:25
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 this pull request may close these issues.

4 participants