Skip to content

Instantly share code, notes, and snippets.

View jebeaudet's full-sized avatar

Jacques-Etienne Beaudet jebeaudet

  • Coveo
  • Quebec, Canada
View GitHub Profile
@jebeaudet
jebeaudet / Dockerfile
Last active July 25, 2023 21:05
Dockerfile for Named Locks using Redisson
FROM maven:3.9.3-eclipse-temurin-17
RUN addgroup --gid 1001 jenkins
RUN adduser --uid 1001 --gid 1001 --disabled-password --gecos '' jenkins
RUN mkdir -p /usr/share/maven/lib/ext/redisson/
RUN apt update
RUN apt install -y wget unzip
@jebeaudet
jebeaudet / Dockerfile|
Created February 23, 2023 16:02
Dockerfile for Named Locks using Redisson
FROM maven:3.9.0-eclipse-temurin-17
RUN addgroup --gid 1001 jenkins
RUN adduser --uid 1001 --gid 1001 --disabled-password --gecos '' jenkins
RUN mkdir -p /usr/share/maven/lib/ext/redisson/
RUN sed -i '/.*${maven.conf}\/logging/a load ${maven.home}/lib/ext/redisson/*.jar' usr/share/maven/bin/m2.conf
RUN apt update
RUN apt install -y wget
@jebeaudet
jebeaudet / patch-ecj.md
Last active April 30, 2024 17:33
Manual patching of ECJ jar for IntelliJ issue

This is what I've done to circumvent this issue. For my project to work, I need the -parameters option and I also like the -preserveAllLocals for debugging.

As IntelliJ accepts a custom ECJ jar, I figured I'd recompile ECJ with the options hardcoded to get around that bug. Unfortunately, the documentation is quite sparse and doesn't show an easy way to build ecj.jar.

I've decided to modify the jar instead! There is a neat tool called Recaf that does just that, decompiles a jar and allow you to easily modify it and repackage it. Neat!

  1. Head to mvn repo to download the latest jar
  2. Download recaf fat jar and execute it with java -jar recaf-2.21.13-J8-jar-with-dependencies.jar
  3. Ope
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class Controller
{
@GetMapping("/")
public String foo(Pojo pojo)
{
return pojo.toString();
FROM adoptopenjdk/maven-openjdk11:latest
RUN addgroup --gid 1001 jenkins
RUN adduser --uid 1001 --gid 1001 --disabled-password --gecos '' jenkins
RUN mkdir -p /usr/share/maven/lib/ext/redisson/
RUN sed -i '/.*${maven.conf}\/logging/a load ${maven.home}/lib/ext/redisson/*.jar' usr/share/maven/bin/m2.conf
RUN apt update
RUN apt install wget
cat /usr/share/maven/bin/m2.conf
main is org.apache.maven.cli.MavenCli from plexus.core
set maven.conf default ${maven.home}/conf
[plexus.core]
load ${maven.conf}/logging
load ${maven.home}/lib/ext/redisson/*.jar
optionally ${maven.home}/lib/ext/*.jar
load ${maven.home}/lib/*.jar
tree $MAVEN_HOME
/usr/share/maven
├── LICENSE
├── NOTICE
├── README.txt
├── bin
│   ├── m2.conf
│   ├── mvn
│   ├── mvn.cmd
│   ├── mvnDebug
mvn compile -Dsisu.debug
TRACE: Sisu - Add publisher: com.google.inject.internal.InjectorImpl@4a11eb84
-----[explicit bindings]-------------------------------------------------------
0. InstanceBinding{key=Key[type=com.google.inject.Stage, annotation=[none]], source=[unknown source], instance=DEVELOPMENT}
1. ProviderInstanceBinding{key=Key[type=com.google.inject.Injector, annotation=[none]], source=[unknown source], scope=Scopes.NO_SCOPE, provider=Provider<Injector>}
2. ProviderInstanceBinding{key=Key[type=java.util.logging.Logger, annotation=[none]], source=[unknown source], scope=Scopes.NO_SCOPE, provider=Provider<Logger>}
3. InstanceBinding{key=Key[type=org.codehaus.plexus.context.Context, annotation=[none]], source=org.codehaus.plexus.DefaultPlexusContainer$ContainerModule.configure(DefaultPlexusContainer.java:831), instance={plexus=org.codehaus.plexus.DefaultPlexusContainer@7c1e2a2d}}
4. InstanceBinding{key=Key[type=org.eclipse.sisu.inject.MutableBeanLocator, annotation=[none]], source=org.codehaus.plex
FROM maven:3.8.1-openjdk-11-slim
RUN addgroup --gid 1001 jenkins
RUN adduser --uid 1001 --gid 1001 --disabled-password --gecos '' jenkins
RUN mkdir -p /usr/share/maven/lib/ext/redisson/
RUN sed -i '/.*${maven.conf}\/logging/a load ${maven.home}/lib/ext/redisson/*.jar' usr/share/maven/bin/m2.conf
RUN apt update
RUN apt install -y wget
@jebeaudet
jebeaudet / gist:e7fedbf1aa3f0b8f5c17f7a739a75526
Last active August 28, 2020 12:21
kubectl list all resources in the current namespace [k8s] [kubernetes]
kubectl api-resources -o name | xargs -I {} kubectl get {} --show-kind --ignore-not-found