What I am Using
Java 9 + Maven + HttpClient (from java 9) jdk.incubator.http.HttpClient
Problem
When building my project with maven I get the following error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project Core: Compilation failure: Compilation failure:
[ERROR] Foo.java:[4,21] package jdk.incubator.http is not visible
Line 4 of Foo is
import jdk.incubator.http.HttpClient;
Pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>me.bar</groupId>
<artifactId>foo</artifactId>
<version>0.0.0-SNAPSHOT</version>
</parent>
<artifactId>Core</artifactId>
<build>
<finalName>${project.artifactId}</finalName>
<sourceDirectory>${project.basedir}/src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>9</source>
<target>9</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Note
Sorry, if you think this has an oblivious fix, I am not very good with maven and never have had to deal with the incubator classes before. I have searched for the error but haven't found anything useful. Thanks for the help.