Skip to content

Instantly share code, notes, and snippets.

View bclozel's full-sized avatar

Brian Clozel bclozel

View GitHub Profile
@bclozel
bclozel / build-dependencies.log
Created September 21, 2020 09:10
Spring Boot 2.3.4 logging dependencies
➜ demo ./gradlew dependencies
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details
> Task :dependencies
------------------------------------------------------------
Root project
------------------------------------------------------------
annotationProcessor - Annotation processors and their dependencies for source set 'main'.
@bclozel
bclozel / DemoApplicationTests.java
Last active May 28, 2018 11:08
repro sample for Spring Boot issue #13248
package com.example.demo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner;
import org.asciidoctor.Asciidoctor;
import org.asciidoctor.Attributes;
import org.asciidoctor.OptionsBuilder;
import org.asciidoctor.SafeMode;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class IncludeUrlsTests {
@bclozel
bclozel / keybase.md
Created October 10, 2014 07:31
keybase verification

Keybase proof

I hereby claim:

  • I am bclozel on github.
  • I am bclozel (https://keybase.io/bclozel) on keybase.
  • I have a public key whose fingerprint is 3CDA 667B 27A6 35C4 8E4D D88D 903B 8F25 6817 9933

To claim this, I am signing this object:

// SIMPLE
boolean cacheResources = true;
registry.addResourceHandler("/resources/**")
.addResourceLocations("classpath:META-INF/static")
.setCachePeriod(3600)
.resourceChain(cacheResources)
.add(new VersionResolver().addContentVersionStrategy("/**").addFixedVersionStrategy("abc", "/**/*.js"))
.add(new AppCacheManifestTransformer());
@bclozel
bclozel / WebConfigDartCss.java
Last active August 29, 2015 14:04
SPR-11982 - Enhance ResourceHandlerRegistration API for resource transformers/resolvers
/**
* Dart + CSS webapp
* We could do the same for coffeeScript, TypeScript, etc
* just change the file extension accordingly in the version strategies.
*/
if (this.env.acceptsProfiles("development")) {
registry.addResourceHandler("/**")
.addResourceLocations("file:///" + getProjectRootRequired() + "/client/src/")
.addContentVersionStrategy("/**")
<!doctype html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Spring resource handling</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- resource with a MD5 fingerprint in its filename -->
<link rel="stylesheet" type="text/css" href="/css/main-503adc9d6fd0379fe63021d9ff456ac6.css">
@bclozel
bclozel / MultipleResolverResourcesConfig.java
Last active September 24, 2022 13:36
Resource Handling configuration drafts
@Configuration
public class MultipleResolverResourcesConfig extends WebMvcConfigurerAdapter {
// Multiple ResourceResolver configuration
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
List<ResourceResolver> jsResolvers = new ArrayList<>();
jsResolvers.add(new PrefixResourceResolver("hexprefix"));
jsResolvers.add(new PathResourceResolver());
@bclozel
bclozel / mvc-config-content-negotiation-manager-v1.xml
Last active January 3, 2016 14:39
SPR-10163 - Configuring RequestMappingHandlerMapping via XML
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<mvc:annotation-driven content-negotiation-manager="contentNegotiationManager"
use-registered-suffix-pattern-match="true"/>