[ https://issues.apache.org/jira/browse/MNG-8713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17948199#comment-17948199 ]
Martin Desruisseaux commented on MNG-8713: ------------------------------------------ I agree that Maven is mostly about Java. But the {{${lang}}} directory level is there, it was not my choice. If we cannot drop it, then we need to take it in consideration. Furthermore, while I don't think that many peoples would use Maven for managing a pure Python project, managing a project that mixes Java and Python is more common. Especially for peoples doing scientific applications, where Python is the dominant language. Those peoples need Java-Python interaction. It is possible to split a Java module in different directories, like packages. The split between {{main}}, {{test}} and {{resources}} continues to exist no matter which convention we choose. It is mostly a matter of deciding if {{${module}}} should be inserted before or after that split. It think that it is more convenient to insert {{${module}}} before the split, for keeping module assets together. It makes easier to navigate in the directories (smaller distance for going from {{main}} to {{test}}), allows search-and-replace in a single module, _etc_. Of course, this is a change in user's habit. But users who don't care about module source hierarchy don't need to know about that. And users who want module source hierarchy will have to change their habit anyway. For example, the output is no longer {{target/classes/}} but become {{target/classes/${module}}}. And this time, that {{${module}}} level is inserted by {{javac}} itself and is not something that we can choose. > Default source directory should include the module name when present > -------------------------------------------------------------------- > > Key: MNG-8713 > URL: https://issues.apache.org/jira/browse/MNG-8713 > Project: Maven > Issue Type: Improvement > Components: Core > Reporter: Martin Desruisseaux > Priority: Major > > If a {{<source>}} element in POM does not provide any value for the > {{<directory>}} element, the default value is currently defined as > {{src/${scope}/${lang}}}. This default value provides the familiar > {{src/main/java}} and {{src/test/java}} default directories. However, if the > {{<source>}} element contains a {{<module>}} element, the module name must > appear somewhere in the default directory name, otherwise the source code of > multi-modular projects will collide. > Different conventions are possible: > * OpenJDK uses {{src/${module}/}} for the main code and a non-obvious > directory pattern for the tests. > * [Project Jigsaw: Module System Quick-Start > Guide|https://openjdk.org/projects/jigsaw/quick-start] uses > {{src/${module}/}} for main code and does not mention tests. > * > [junit5-modular-world|https://github.com/junit-team/junit5-samples/tree/main/junit5-modular-world] > uses {{src/main/${module}/}} for the main code and {{src/test/${module}/}} > for the test code. However, it also uses {{module-info.java}} in test code, > which I would like to discourage. > * NetBeans Ant modular project uses {{src/${module}/main}} for the main code > and {{src/${module}/test}} for the test code. > I propose the NetBeans's convention with the addition of {{${lang}}. The > default directory would then be {{src/${lang}/${module}/${scope}}} when the > {{<module>}} element is present and non-blank. > h2. Alternative > If it is considered too premature to adopt a default directory name for > modular project, we should at least throw an exception asking users to > specify a directory explicitly if a {{<module>}} element is present. What we > need to avoid is the status-quo, a default without module name. -- This message was sent by Atlassian Jira (v8.20.10#820010)