I have Spring-Boot Eclipse project which displays the subject message in the eclipse problems. My single test method in org.test.Test is:
package org.test;
public class Test
{
public static void main(String[] strings) {
}
}
my module-info.java is:
open module ws.daley.pihome.environ
{
exports org.test;
requires com.google.gson;
}
my pom.xml is:
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.0-M1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org-test</groupId>
<artifactId>test</artifactId>
<version>0.1.81</version>
<name>test</name>
<description>test</description>
<properties>
<start-class>org.test.Test</start-class>
<spring-boot.version>3.4.0-M1</spring-boot.version>
<java.version>21</java.version>
</properties>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
<repository>
<id>central</id>
<name>Maven Central</name>
<url>https://repo1.maven.org/maven2/</url>
</repository>
</repositories>
</project>
In the module_info.java file, the line:
requires com.google.gson;
is flagged and com.google.gson is underlined in red.
I’m running Spring Tool Suite 4.22.1, Eclipse 2024-06, and Java Zulu21.34+19-CA.
How do I resolve the error?