Skip to content

Commit

Permalink
解决main启动报Kotlin: Language version 1.1 is no longer supported错误的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanmabiji committed Oct 10, 2021
1 parent a1e6818 commit 3b4e620
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<module>spring-boot-project</module>
<!-- Samples are built via the invoker plugin -->
<!--新增spring-boot-samples模块-->
<!--<module>spring-boot-samples</module>-->
<module>spring-boot-samples</module>
<module>spring-boot-samples-invoker</module>
<module>spring-boot-tests</module>
</modules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,8 @@ public Iterable<Entry> selectImports() {
.collect(Collectors.toCollection(LinkedHashSet::new));
// 移除掉要排除的自动配置类
processedConfigurations.removeAll(allExclusions);
// 对标注有@Order注解的自动配置类进行排序,
// 对标注有@AutoConfigureOrder,@AutoConfigureBefore @AutoConfigureAfter注解的自动配置类进行排序,
// 【注意】@AutoConfigureOrder,@AutoConfigureBefore @AutoConfigureAfter注解能改变spring.factories中的@Configuration的顺序,并不能决定@Configuration的bean的加载顺序。TODO 自己做个试验
return sortAutoConfigurations(processedConfigurations,
getAutoConfigurationMetadata())
.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ public List<String> getInPriorityOrder(Collection<String> classNames) {
List<String> orderedClassNames = new ArrayList<>(classNames);
// Initially sort alphabetically
Collections.sort(orderedClassNames);
// Then sort by order
// Then sort by order 对@AutoConfigureOrder进行排序,其中getOrder()方法获取@AutoConfigureOrder的顺序数值
orderedClassNames.sort((o1, o2) -> {
int i1 = classes.get(o1).getOrder();
int i2 = classes.get(o2).getOrder();
return Integer.compare(i1, i2);
});
// Then respect @AutoConfigureBefore @AutoConfigureAfter
// Then respect @AutoConfigureBefore @AutoConfigureAfter 对@AutoConfigureBefore @AutoConfigureAfter进行排序
orderedClassNames = sortByAnnotation(classes, orderedClassNames);
return orderedClassNames;
}
Expand Down
4 changes: 4 additions & 0 deletions 编译构建启动问题
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Spring源码编译过程中出现Kotlin: Language version 1.1 is no longer supported; please, use version 1.2

按照这个文档https://blog.csdn.net/qq_42223569/article/details/114073404
在file->project structure->module中选中spring-boot和spring-boot-test的kotlin,选1.2版本即可解决

0 comments on commit 3b4e620

Please sign in to comment.