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

Made spring scope provided #264

Merged
merged 1 commit into from
May 17, 2018
Merged

Made spring scope provided #264

merged 1 commit into from
May 17, 2018

Conversation

whiskeysierra
Copy link
Collaborator

@whiskeysierra whiskeysierra commented May 16, 2018

Description

Motivation and Context

Fixes #194

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@whiskeysierra
Copy link
Collaborator Author

Each of the scopes (except for import) affects transitive dependencies in different ways, as is demonstrated in the table below. If a dependency is set to the scope in the left column, transitive dependencies of that dependency with the scope across the top row will result in a dependency in the main project with the scope listed at the intersection. If no scope is listed, it means the dependency will be omitted.

https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope

compile provided runtime test
compile compile(*) - runtime -
provided provided - provided -
runtime runtime - runtime -
test test - test -

On the other hand, optional should also work:

Marking dependencies as optional will not resolve them as transitive dependencies in the application which use your library (even if the scope is compile).

https://stackoverflow.com/a/5861855/232539

@whiskeysierra
Copy link
Collaborator Author

Somebody who depends on logbook-spring-boot-starter will use scope compile. The dependency to spring is now marked as provided and will in turn be omitted. Should solve the problem.

@whiskeysierra whiskeysierra merged commit 63cfbe9 into master May 17, 2018
@whiskeysierra whiskeysierra deleted the feature/spring-provided branch May 17, 2018 20:45
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.

Support Spring 5 and Spring Boot 2
1 participant