首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SpringNative0.9.1-快照在IDEA中无法启动

SpringNative0.9.1-快照在IDEA中无法启动
EN

Stack Overflow用户
提问于 2021-03-20 14:34:59
回答 2查看 5.2K关注 0票数 4

刚生成的https://start.spring.io/ SpringBoot2.4.4项目中添加了SpringBootNative0.9.1-快照

而且它不能从观念中开始(所以还不是作为本土形象)。

'org.springframework.aot.StaticSpringFactories‘无法启动,因为无法找到由Spring插件生成的

全输出

代码语言:javascript
复制
/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin/java "-javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=52158:/Applications/IntelliJ IDEA CE.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath ....
2021-03-20 22:07:21.264 ERROR 10192 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

The ApplicationContext could not start as 'org.springframework.aot.StaticSpringFactories' that is generated by the Spring AOT plugin could not be found.

Action:

Review your local configuration and make sure that the Spring AOT plugin is configured properly.
If you're trying to run your application with 'mvn spring-boot:run', please use 'mvn package spring-boot:run' instead.
See https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#spring-aot for more details.


Process finished with exit code 1

我注意到,对于我通常使用Web和hibernate的JPA的项目,Initializr添加了一些额外的maven插件:

代码语言:javascript
复制
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                    <image>
                        <builder>paketobuildpacks/builder:tiny</builder>
                        <env>
                            <BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
                        </env>
                    </image>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.experimental</groupId>
                <artifactId>spring-aot-maven-plugin</artifactId>
                <version>${spring-native.version}</version>
                <executions>
                    <execution>
                        <id>test-generate</id>
                        <goals>
                            <goal>test-generate</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>generate</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.hibernate.orm.tooling</groupId>
                <artifactId>hibernate-enhance-maven-plugin</artifactId>
                <version>${hibernate.version}</version>
                <executions>
                    <execution>
                        <id>enhance</id>
                        <goals>
                            <goal>enhance</goal>
                        </goals>
                        <configuration>
                            <failOnError>true</failOnError>
                            <enableLazyInitialization>true</enableLazyInitialization>
                            <enableDirtyTracking>true</enableDirtyTracking>
                            <enableAssociationManagement>true</enableAssociationManagement>
                            <enableExtendedEnhancement>false</enableExtendedEnhancement>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-03-21 05:23:32

一定要仔细阅读https://docs.spring.io/spring-native/docs/current/reference/htmlsingle/#spring-aot,它有正确的步骤(以及Eclipse的提示)

在Maven工具窗口中的

,转到"Plugins“并映射:

  • 右键单击spring-aot:generate,然后单击“生成后”.

configurations.

  • 添加JUnit配置(或只尝试运行第一时间测试),然后右键单击‘select :测试-生成’,然后单击“执行运行/调试…​”,然后选择JUnit测试…​
票数 4
EN

Stack Overflow用户

发布于 2021-04-23 02:44:14

下面是在我的IDE中配置它的快照。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66722787

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档