The plugin requires minimum maven 3.1
To use the plugin in your project:
<build> <plugins> <plugin> <groupId>net.java.javabuild</groupId> <artifactId>builder-maven-plugin</artifactId> <version>1.1</version> <extensions>true</extensions> <!-- For m2eclipse to detect the source folder --> <executions> <execution> <id>add-source</id> <goals> <goal>add-source</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>net.java.javabuild</groupId> <artifactId>builder-api</artifactId> <version>1.1</version> </dependency>
@Builder public class MyCustomBuilder { private final static Logger LOGGER = LoggerFactory .getLogger(MyCustomBuilder.class); @Execute(phase = Phase.GENERATE_SOURCES) public void sayHello() { LOGGER.info("Hello world"); }
In your build classes, you can generate java sources, test sources, resources, add files to a webapp (for war projects) and add pages to the project’s site. You just have to place the files in the following folders:
For examples, look at project “builder-maven-plugin-test”.