在Java8流中,我可以修改/更新其中的对象吗?例如.List<User> users:
users.stream().forEach(u -> u.setProperty("value"))
Run Code Online (Sandbox Code Playgroud) 我收到错误
说明 资源路径 位置类型 无法读取 org.springframework:spring-core:jar:5.2.0.BUILD-SNAPSHOT org.eclipse.aether.resolution.ArtifactDescriptorException 的工件描述符:无法读取 org.springframework:spring-core:jar:5.2.0.BUILD-SNAPSHOT 的工件描述符
甚至认为这个 https://repo.spring.io/libs-snapshot/org/springframework/spring-core/5.2.0.BUILD-SNAPSHOT/存在
这是我的 POM
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>com.pluralsight</groupId>
<artifactId>HelloWorld</artifactId>
<version>1.0-SNAPSHOT</version>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>15</release>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.4.1.Final</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.2.0.BUILD-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-snapshot</id>
<url>http://repo.spring.io/libs-snapshot/</url>
<snapshots><enabled>true</enabled></snapshots>
<releases><enabled>false</enabled> </releases>
</repository>
</repositories>
Run Code Online (Sandbox Code Playgroud)