OK. I see the purpose of the <module> tag now.

Instinctively, I would have applied that at the <project> level and mapped one 
project to one module (and built multiple modules as an aggregation of multiple 
projects)


Later,

Andy

From: Martin Desruisseaux <martin.desruisse...@geomatys.com>
Date: Friday, 16 May 2025 at 13:58
To: dev@maven.apache.org <dev@maven.apache.org>
Subject: Re: Proposal: new default directory layout for modular project
Le 2025-05-16 à 14 h 27, Andy Law a écrit :

 >> The most natural way is to do parent/moduleX/src/main/java (and
siblings)
 >> and handle the compiler plugin in parent to be jpms specific, no
technical
 >> blocker, no maven core change needed

 > This (^^) just seems so natural, I can’t believe that there is any
discussion about doing it any other way.

One javac execution would compile many Maven subprojects at once. I
don't think that this is so natural in Maven. Aggregated Javadoc is one
of the few plugins doing that, and I have read in some JIRA or wiki that
this is done with a hack not recommended for other plugins.


> And I still don’t understand what the <module> sub-element of the <source> 
> tag is actually for.
It map directly to the "module-name" part of the `--module-source-path
module-name=directory" compiler option. This option is required for
multi-module compilation.

 From a programmatic point of view, since the plugin uses javax.tools
interface, it maps directly to the "moduleName" argument of the
following method, which is invoked by maven-compiler-plugin 4.0.0-beta-3:

https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.oracle.com%2Fen%2Fjava%2Fjavase%2F24%2Fdocs%2Fapi%2Fjava.compiler%2Fjavax%2Ftools%2FStandardJavaFileManager.html%23setLocationForModule&data=05%7C02%7C%7Caedd2b89e04245d947f908dd947955bd%7C2e9f06b016694589878910a06934dc61%7C0%7C0%7C638829971026477970%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=Alv%2FZtLPrOO5NsP6P31JrTbMEoDimYyaFjIoAFEeJVI%3D&reserved=0(javax.tools.JavaFileManager.Location,java.lang.String,java.util.Collection)<https://docs.oracle.com/en/java/javase/24/docs/api/java.compiler/javax/tools/StandardJavaFileManager.html#setLocationForModule>

     Martin



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org
The University of Edinburgh is a charitable body, registered in Scotland, with 
registration number SC005336. Is e buidheann carthannais a th’ ann an Oilthigh 
Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336.

Reply via email to