1

Please, help to exclude module-info file.

This is my code:

       <plugin>
            <groupId>org.bsc.maven</groupId>
            <artifactId>maven-processor-plugin</artifactId>
            <version>3.3.3</version>
            <executions>
                <execution>
                    <goals>
                        <goal>process</goal>
                    </goals>
                    <phase>generate-sources</phase>
                    <configuration>
                            <excludes>
                                <exclude>${project.basedir}src/main/java/module-info.java</exclude>
                            </excludes>
                    </configuration>
                </execution>
            </executions>
        </plugin>

I also tried:

     <exclude>src/main/java/module-info.java</exclude>
     <exclude>**/module-info.java</exclude>
     <exclude>**/*module-info.java</exclude>

but not one helped.

I need it as I get a lot of error like this:

[ERROR] diagnostic: /home/<deleted>/src/main/java/module-info.java:11: error: module not found: org.slf4j
    requires static org.slf4j;

Could anyone say how to do it?

Pavel_K
  • 10,748
  • 13
  • 73
  • 186

1 Answers1

1

I figure out that exclusion on module-info.java doesn't work as expected, however, I think that the problem here is mostly related to java9 Platform Module System (JPMS).

After reproduced the error (thanks Pavel_K) I got a solution adding all compile and runtime dependencies to --module-path options.

I released version 4.0-rc1 with such fix

bsorrentino
  • 1,413
  • 11
  • 19