[ https://issues.apache.org/jira/browse/MCOMPILER-402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17507407#comment-17507407 ]
Piotr Zygielo edited comment on MCOMPILER-402 at 3/16/22, 8:41 AM: ------------------------------------------------------------------- {quote} essentially in the same way as described in [the official example|https://maven.apache.org/plugins/maven-compiler-plugin/examples/module-info.html] {quote} How I see it: reproducer in this issue is very different, not the same at all, in several aspects: # example sets _default_ release as 6 (reproducer: 11) # example has two executions, with the first _including_ MI, targeting release 9 where the idea of MI is known, # example excludes MI in separate execution, which targets release 6, where there is no such thing as MI at all. Thus I propose to reclassify this report as New Feature/Enhancement to support {{implicit}} option in m-c-p configuration - this could be provided by PR#102. -To complete the fix - perhaps the example could be updated then to use {{implicit}} there.- (After having glass of cold water now I think example needs no modification as it's fine as is.) was (Author: pzygielo): {quote} essentially in the same way as described in [the official example|https://maven.apache.org/plugins/maven-compiler-plugin/examples/module-info.html] {quote} How I see it: reproducer in this issue is very different, not the same at all, in several aspects: # example sets _default_ release as 6 (reproducer: 11) # example has two executions, with the first _including_ MI, targeting release 9 where the idea of MI is known, # example excludes MI in separate execution, which targets release 6, where there is no such thing as MI at all. Thus I propose to reclassify this report as New Feature/Enhancement to support {{implicit}} option in m-c-p configuration - this could be provided by PR#102. To complete the fix - perhaps the example could be updated then to use {{implicit}} there. > Not possible to exclude module-info with 'excludes' > --------------------------------------------------- > > Key: MCOMPILER-402 > URL: https://issues.apache.org/jira/browse/MCOMPILER-402 > Project: Maven Compiler Plugin > Issue Type: Bug > Affects Versions: 3.8.0, 3.8.1 > Reporter: Petr Dolezal > Priority: Major > > I tried to use {{excludes}} to exclude {{module-info.java}} from build, > essentially in the same way as described in [the official > example|https://maven.apache.org/plugins/maven-compiler-plugin/examples/module-info.html], > but the file was always compiled anyway. I even tried to use various > patterns with no effect. > This seems weird to me and with the respect to the mentioned example I > consider such a behavior to be a bug. > Since I could not attach the source files, here is the listing for > reproducing the issue: > > {code:java} > <?xml version="1.0" encoding="UTF-8"?> > <project xmlns="http://maven.apache.org/POM/4.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/xsd/maven-4.0.0.xsd"> > <modelVersion>4.0.0</modelVersion> > <groupId>com.example</groupId> > <artifactId>com.example</artifactId> > <version>1.0.0-SNAPSHOT</version> > <packaging>jar</packaging> > <build> > <plugins> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-compiler-plugin</artifactId> > <version>3.8.1</version> > <configuration> > <release>11</release> > <source>11</source> > <target>11</target> > <excludes> > <exclude>module-info.java</exclude> > </excludes> > </configuration> > </plugin> > </plugins> > </build> > </project> > {code} > {code:java} > // src/main/java/module-info.java > module com.example { > exports com.example; > } > {code} > {code:java} > // src/main/java/com/example/Main.java > package com.example; > public final class Main { > public static void main(String... args) { > System.out.println("Hello World"); > } > } > {code} > -- This message was sent by Atlassian Jira (v8.20.1#820001)