desruisseaux commented on code in PR #11632: URL: https://github.com/apache/maven/pull/11632#discussion_r2678609848
########## impl/maven-core/src/test/projects/project-builder/mixed-sources/pom.xml: ########## @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Tests mixed source configuration: + - Modular sources for main Java (should override sourceDirectory) + - Classic testSourceDirectory (should be used since no modular test sources) +--> +<project xmlns="http://maven.apache.org/POM/4.1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.1.0 https://maven.apache.org/xsd/maven-4.1.0.xsd"> + <modelVersion>4.1.0</modelVersion> + + <groupId>org.apache.maven.tests</groupId> + <artifactId>mixed-sources-test</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>jar</packaging> + + <build> + <!-- Classic sourceDirectory - should be IGNORED because <sources> has main java --> + <sourceDirectory>src/classic/main/java</sourceDirectory> + <!-- Classic testSourceDirectory - should be USED because <sources> has no test java --> + <testSourceDirectory>src/classic/test/java</testSourceDirectory> + + <sources> + <!-- Modular main java sources - these should override sourceDirectory --> + <source> + <scope>main</scope> + <lang>java</lang> + <module>org.foo.moduleA</module> + </source> + <source> + <scope>main</scope> + <lang>java</lang> + <module>org.foo.moduleB</module> + </source> + <!-- No test sources defined - testSourceDirectory should be used --> Review Comment: This is ambiguous: how could a single `testSourceDirectory` be used for two modules? I suggest to allow `<sourceDirectory>` and `<testSourceDirectory>` only for non-modular projects, and emit a warning or error for modular projects. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
