Project Lombok

repository·master·Indexed 12 days ago

https://github.com/projectlombok/lombok

A Java library that automates the generation of repetitive boilerplate code, such as getters, setters, builders, and logging, using annotations during the compilation process. Includes documentation for CLI commands and building Docker images for Ant, Bazel, Gradle, and Maven environments with support for JDK versions 8 through 22.

Tokens
3K
Snippets
22
Records
25
Agent score
95%

What's inside Lombok

  1. Overview of Project Lombok

    master
    Project Lombok is a Java library that reduces boilerplate code by automatically plugging into your editor and build tools. It uses annotations to generate common Java patterns at compile time, such as getters, setters, equals and hashCode methods, builders, and logging variables. This allows developers to write cleaner, more concise Java classes.
  2. Build the Lombok Gradle Docker image

    master

    To build the Docker image, execute the following commands from the <lombokhome>/docker directory. You can build a standard image or provide a specific Lombok JAR version using the lombokjar build argument.

    # Build the default image
    docker build -t lombok-gradle-jdk17 -f gradle/Dockerfile .
    
    # Build with a specific lombok jar version
    docker build -t lombok-gradle-jdk17 --build-arg lombokjar=lombok-1.18.28.jar -f gradle/Dockerfile .
  3. Use a local lombok.jar with Docker

    master

    If you have a recently built or specific lombok.jar on your local system and want to use it instead of the one downloaded during the image build, you can mount it into the container at runtime using a volume mount.

    Mount the file to /workspace/lombok.jar within the container.

    docker run -v /path/to/your/lombok/dist/lombok.jar:/workspace/lombok.jar <image_name>
  4. Run Lombok Maven Docker containers

    master

    You can run the Lombok Maven container interactively. To use a specific Lombok JAR from your local host instead of the one inside the image, use a volume mount (-v) to map your local file to /workspace/lombok.jar inside the container.

    # Run the container interactively
    docker run -it lombok-maven-jdk17
    
    # Run the container and mount a local lombok.jar to the workspace
    docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/lombok.jar lombok-maven-jdk17
  5. Build Lombok Ant Docker images

    master

    To build a Docker image for Lombok with Ant support, execute the build commands from the <lombokhome>/docker directory. You can build a standard image or specify a custom Lombok JAR version using the --build-arg flag.

    # Build the default image
    docker build -t lombok-ant-jdk17 -f ant/Dockerfile .
    
    # Build with a specific lombok jar version
    docker build -t lombok-ant-jdk17 --build-arg lombokjar=lombok-1.18.28.jar -f ant/Dockerfile .
  6. Run the Lombok Bazel Docker container

    master

    You can run the container interactively. To use a local lombok.jar from your host machine inside the container, mount it as a volume to /workspace/lombok.jar.

    # Run the container interactively
    docker run -it lombok-bazel-jdk17
    
    # Run the container and mount a local lombok.jar
    docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/lombok.jar lombok-bazel-jdk17
  7. Build the Lombok Bazel Docker image

    master

    To build the Docker image, execute the following commands from the <lombokhome>/docker directory. You can either build using the default internal JAR or provide a specific version of lombok.jar using the lombokjar build argument.

    # Build using default settings
    docker build -t lombok-bazel-jdk17 -f bazel/Dockerfile .
    
    # Build using a specific lombok.jar version
    docker build -t lombok-bazel-jdk17 --build-arg lombokjar=lombok-1.18.28.jar -f bazel/Dockerfile .
  8. Run Lombok Ant Docker containers

    master

    You can run the Lombok Ant container in interactive mode. To use a specific Lombok JAR from your local host machine, mount it into the container using a volume (-v).

    # Run the container interactively
    docker run -it lombok-ant-jdk17
    
    # Run with a local lombok.jar mounted to /workspace/lombok.jar
    docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/lombok.jar lombok-ant-jdk17
  9. Run the Lombok Gradle Docker container

    master

    You can run the container interactively. To use a specific Lombok JAR from your local filesystem instead of the one inside the image, mount it to /workspace/classpath/lombok.jar using a volume.

    # Run the container interactively
    docker run -it lombok-gradle-jdk17
    
    # Run with a local lombok.jar mounted to the classpath
    docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/classpath/lombok.jar lombok-gradle-jdk17
  10. Build Lombok Maven Docker images

    master

    To build the Lombok Maven Docker images, execute the following commands from the <lombokhome>/docker directory. You can build a standard image or provide a specific lombokjar version via a build argument.

    # Build the default image
    docker build -t lombok-maven-jdk17 -f maven/Dockerfile .
    
    # Build with a specific lombok jar version
    docker build -t lombok-maven-jdk17 --build-arg lombokjar=lombok-1.18.20.jar -f maven/Dockerfile .