Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-2146

Exclude source files from Source Packages node when excluded from Maven build in compiler plugin configuration

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 10.0
    • None
    • None

    Description

      I have a Maven project that is built with compiler source and target version 8. Because the source directory includes module-info.java, this project won't compile unless I exclude it from the build: 

      <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
      </properties>
      
      <build>
        <sourceDirectory>../src/main/java</sourceDirectory>
      
        <pluginManagement>
          <plugins>
            <plugin>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                <excludes>module-info.java</excludes>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
      

      The project builds correctly, but the Source Packages node still includes the file, and displays it as containing errors because it requires at least Java 9.

      It would be nice if source files excluded from the build would also be excluded from the Source Packages node, or at least grayed out and without displaying errors.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Nibsi Stephan van Hulst
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: