I am using java 11, using sts IDE, I compile and run the springboot application fine from the IDE, but when I compile it from command line using mvn
mvn clean verify
I got this error
cannot find symbol [ERROR] symbol: method toList()
the code snippet is
......
......
return addressRepository.getAddressesBySystemUserId(systemUserId).stream().map(e -> {
AddressDto dto = null;
dto = AddressMapper.mapAddressToAddressDto(e);
return dto;
}).toList();
......
snippet of the pom file
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>