Code Monkey home page Code Monkey logo

spring-session-bom's Introduction

Spring Session BOM Revved up by Gradle Enterprise

This repository contains Spring Session Maven Bill of Materials (BOM).

Using the BOM with Maven

With Maven, you need to import the BOM first:

<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.springframework.session</groupId>
			<artifactId>spring-session-bom</artifactId>
			<version>2021.1.1</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>

Notice the use of the <dependencyManagement> section and the import scope.

Next, add your dependencies to the project without a <version>:

<dependencies>
	<dependency>
		<groupId>org.springframework.session</groupId>
		<artifactId>spring-session-data-redis</artifactId>
	</dependency>
</dependencies>

Using the BOM with Gradle

With Gradle’s native support for Maven BOMs, import the BOM using:

dependencies {
	implementation platform('org.springframework.session:spring-session-bom:2021.1.1')
}

Alternatively, you can use Spring’s Dependency management plugin.

Apply the plugin from Gradle Plugin Portal:

plugins {
	id 'io.spring.dependency-management' version '1.0.11.RELEASE'
}

Then use it to import the BOM:

dependencyManagement {
	imports {
		mavenBom 'org.springframework.session:spring-session-bom:2021.1.1'
	}
}

Finally, add a dependency to the project without a version:

dependencies {
	implementation 'org.springframework.session:spring-session-data-redis'
}

Getting Help

Reporting Issues

If you want to raise an issue, please report it in the appropriate Spring Session project:

Code of Conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

License

Spring Session is Open Source software released under the Apache 2.0 license.

spring-session-bom's People

Contributors

eleftherias avatar erichaagdev avatar gregturn avatar jxblum avatar marcusdacoregio avatar rwinch avatar spring-operator avatar vpavic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-session-bom's Issues

Bom's jar artifact inhibits its use with Gradle's platform and enforcedPlatform

Here's a (rather contrived) example:

repositories {
	mavenCentral()
}

configurations {
	loader
}

dependencies {
	loader platform("org.springframework.session:spring-session-bom:Bean-SR1")
	loader "org.springframework.boot:spring-boot-loader:2.1.0.RELEASE"
}

task resolveLoaderJar {
	doLast {
		println configurations.loader.files
		println configurations.loader.singleFile
	}
}

If you run resolveLoaderJar with Gradle 5.0 it will fail:

$ ./gradlew resolveLoaderJar

> Task :resolveLoaderJar FAILED
[/Users/awilkinson/.gradle/caches/modules-2/files-2.1/org.springframework.session/spring-session-bom/Bean-SR1/ca5b7eae6cc4fc4e77b159ddd89fa44644f5c38d/spring-session-bom-Bean-SR1.jar, /Users/awilkinson/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-loader/2.1.0.RELEASE/e487a0f91576e79a686dde29c7c34b6cfdd44496/spring-boot-loader-2.1.0.RELEASE.jar]

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/awilkinson/dev/temp/enforced-platform-pollution/build.gradle' line: 17

* What went wrong:
Execution failed for task ':resolveLoaderJar'.
> Expected configuration ':loader' to contain exactly one file, however, it contains more than one file.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
1 actionable task: 1 executed

The bom's jar artifact has resulted in the loader configuration being polluted with a jar file that the author of a build should not have to care about. I don't think the jar serves any purpose so would it be possible to stop publishing it?

A workaround is to filter the configuration:

task resolveLoaderJar {
	doLast {
		println configurations.loader.files
		println configurations.loader.filter{it.name.startsWith("spring-boot-loader-")}.singleFile
	}
}

Create Boot Ticket

We should let the Boot team know that we have a bom and submit a ticket for them to use it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.