To work with the Java plugin, we are first going to create a very simple Java source file. We can then use the plugin's tasks to build the source file. You can make this application as complex as you wish, but in order to stay on topic, we will make this as simple as possible.
By applying the Java plugin, we must now follow some conventions for our project directory structure. To build the source code, our Java source files must be in the
src/main/java directory, relative to the project directory. If we have non-Java source files that need to be included in the JAR file, we must place them in the directory
src/main/resources. Our test source files need to be in the
src/test/java directory, and any non-Java source files needed ...