What i use
Java 9 + Maven + HttpClient (from java 9) jdk.incubator.http.HttpClient
Problem
When creating 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 equals
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 is a forgotten solution, I am not very good with maven and have never been involved in incubator classes before. I was looking for an error, but did not find anything useful. Thanks for the help.
source share