Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Pull request Compare This branch is 4 commits ahead, 65 commits behind aludwiko:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

#FluentBuilderGenerator BLUECARAT Edition The FluentBuilderGenerator helps to implement the Builder Pattern for object creation by generating builder classes for you. With help of these generated classes it is possible to create custom objects in a fluent syntax style. The generator uses Maven's Annotation Processing Tool and is perfectly suited for test object creation.

The BLUECARAT Edition is a fork of the original FluentBuilderGenerator project written by A. Ludwikowski, which can be found at:


  • generating of builder classes
  • creation of custom objects in fluent style syntax
  • setting of inherited and hidden fields (BLUECARAT Edition)
  • invocation of a particular constructor (BLUECARAT Edition)
  • support for classes with no default constructor without the need to modify the generated code (BLUECARAT Edition)

GitHub Repository:

GitHub Wiki:

##Getting Started

###Setup Code Generation

To use the FluentBuilderGenerator for generating builder classes you need to add it as a dependency to your Maven POM. After that you must also add the maven-processor-plugin to the build plugins.

            <compilerArguments>-Adebug=true -AuseIndefineArticles=true -encoding UTF-8</compilerArguments>

Now add a @GenerateBuilder annotation (and its import) to every class for which you want to generate a builder.

import de.bluecarat.fluentbuilder.annotation.GenerateBuilder;

public class SampleClass {

With these settings builder classes for every annotated class in "src/test/java/de/bluecarat/dummy/example" and its subdirectories will be generated. This will take place during the "generate-test-sources" phase. The generated builders can be found in "target/generated-sources". The "compilerArguments" tag can be used to set additional parameters and settings for the generator which are further explained in the GitHub wiki.

###How to use the generated code

At first you have to make sure that your "target/generated-sources" (or custom directory) is in your project's build path during the test phase. The build-helper-maven-plugin can help with that:


After that you can statically import the necessary builders into your test class.

import static de.bluecarat.dummy.example.SampleClassBuilder.aSampleClass;

Now you can create custom ExampleClass objects by chaining your parameters together and initializing it with the build() method at the end of your chain.

final SampleClass testObject = aSampleClass.withName("Test").withId(0).build();

More information can be found in the GitHub wiki at:

##Changelog 1.0.13:

  • initial fork
  • basic refactoring of the original code
  • added support for inherited fields
  • added support for classes without default constructor
  • added support for selecting a particular constructor
  • extended support for classes without default constructor

##Company Information Forked by BLUECARAT AG

values at work.

Albin-Köbis-Straße 4

51147 Köln

##License Information Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

You can’t perform that action at this time.