Fork me on GitHub

XXX has been compiled by a more recent version of the Java Runtime (class file version 61.0)

maven版本未指定导致编译失败问题

Execution default of goal org.springframework.boot:spring-boot-maven-plugin:3.1.3:repackage faile
d: Unable to load the mojo 'repackage' in the plugin 'org.springframework.boot:spring-boot-maven-plugin:3.1.3' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/springfra
mework/boot/maven/RepackageMojo has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
image

解决方案

指定version即可

<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<version>2.3.5.RELEASE</version>
				<executions>
					<execution>
						<goals>
							<goal>repackage</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
posted @ 2023-08-28 22:38  秋夜雨巷  阅读(596)  评论(0编辑  收藏  举报