You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (Jira)" <ji...@apache.org> on 2019/10/19 20:35:00 UTC
[jira] [Commented] (MCOMPILER-402) Not possible to exclude
module-info with 'excludes'
[ https://issues.apache.org/jira/browse/MCOMPILER-402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16955283#comment-16955283 ]
Robert Scholte commented on MCOMPILER-402:
------------------------------------------
Interesting... output says {{[INFO] Compiling 1 source file to ...}} but in the end there are 2 class files.
> 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.3.4#803005)