So let's see how to make this work - in theory as well as with Maven. It comes down to these three steps: 1. compile and test snippet source files 2. reference parts of those files from your documentation 3. configure Javadoc to pick up these files. Here are the details. 👇🏾🧵
So let's see how to make this work - in theory as well as with Maven. It comes down to these three steps: 1. compile and test snippet source files 2. reference parts of those files from your documentation 3. configure Javadoc to pick up these files. Here are the details. 👇🏾🧵
Re 1: I recommend not to reuse tests for snippets and instead create a new source tree `src/demo/java` with `…Demo.java` files. There you can write tests that contain the code you want to embed in Javadoc as well as assertions that verify the correct behavior.