You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "desruisseaux (via GitHub)" <gi...@apache.org> on 2025/03/25 10:37:16 UTC
Re: [PR] [MNG-8647] Set the default source directory to `src/${scope}/${lang}` as per documentation [maven]
desruisseaux commented on code in PR #2180:
URL: https://github.com/apache/maven/pull/2180#discussion_r2011803703
##########
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultSourceRoot.java:
##########
@@ -65,24 +65,26 @@ public final class DefaultSourceRoot implements SourceRoot {
* @param source a source element from the model
*/
public DefaultSourceRoot(final Session session, final Path baseDir, final Source source) {
- String value = nonBlank(source.getDirectory());
- if (value == null) {
- throw new IllegalArgumentException("Source declaration without directory value.");
- }
- directory = baseDir.resolve(value);
- FileSystem fs = directory.getFileSystem();
+ FileSystem fs = baseDir.getFileSystem();
includes = matchers(fs, source.getIncludes());
excludes = matchers(fs, source.getExcludes());
stringFiltering = source.isStringFiltering();
enabled = source.isEnabled();
moduleName = nonBlank(source.getModule());
- value = nonBlank(source.getScope());
+ String value = nonBlank(source.getScope());
scope = (value != null) ? session.requireProjectScope(value) : ProjectScope.MAIN;
value = nonBlank(source.getLang());
Review Comment:
> Or we need to relax the fact that we disallow inner blocks.
Yes exactly. I thought about relaxing that rule just for this method with a `@SuppressWarnings("checkstyle:...")`, but thought the maybe the community wanted strict adherence to the checkstyle rules.
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org