Java Project Directory Structure Agreement

I worked on maven projects that look like a directory structure:

src/ main/ java/ test/ java/ 

I was wondering if other directory structure conventions exist. Is this convention specific to maven or is it applicable to all Java? I have a project that requires several programming languages, and was curious if there was any standard.

+6
source share
2 answers

This is a contextual directory structure based on Maven, however, it is becoming quite popular even outside the Maven world, because it is good (like any other agreement that makes sense), and there is no reason why not using it with Ant is a managed project or just plain Java project. Even the Java nature of the project is not required. For example, there is a FlexMojos project that allows you to manage Flex projects using Maven.

If you plan to use many programming languages, you need to use some additional plugins that extend the possibilities of Maven. For example, you can use the GMaven plugin to enable Groovy language support in a Maven project. Then there is a convention (in fact: the default setting for the plugin) to put Groovy sources in src/main/groovy . By default, only Java is supported.

+6
source

The agreement should follow the default folders folder in Maven . In addition, other programming languages ​​follow conventions such as src / main / C ++, etc.

+3
source

Source: https://habr.com/ru/post/915727/


All Articles