我使用初始化器创建了一个spring Boot 应用,并选择了以下设置:
1.版本:3.1.5
- lang:groovy
1.软件包:jar - java:17
1.依赖关系:spring Boot dev tools,lombok,spring web,spring session,spring security,spring data JAP(我猜我需要连接到数据库),H2 Db
然后我在intellij中打开这个项目,将项目结构java版本设置为17,它在“problems”中没有显示任何错误。
然而,当我在intellij中点击“RUN”按钮时,它编译然后退出而不启动tomcat。不知道如何调试这个,或者绕过这个问题来获得一个将运行的空白spring Boot 项目。
输出如下:
/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home/bin/java -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=56487:/Applications/IntelliJ IDEA CE.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Users/simon/.m2/repository/org/junit/platform/junit-platform-launcher/1.9.3/junit-platform-launcher-1.9.3.jar:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar:/Applications/IntelliJ IDEA CE.app/Contents/plugins/junit/lib/junit5-rt.jar:/Applications/IntelliJ IDEA CE.app/Contents/plugins/junit/lib/junit-rt.jar:/Users/simon/dev/nutmix-github/bomg/target/test-classes:/Users/simon/dev/nutmix-github/bomg/target/classes:/Users/simon/.m2/repository/org/springframework/boot/spring-boot-starter-data-jpa/3.1.5/spring-boot-starter-data-jpa-3.1.5.jar:/Users/simon/.m2/repository/org/springframework/boot/spring-boot-starter-aop/3.1.5/spring-boot-starter-aop-3.1.5.jar:/Users/simon/.m2/repository/org/aspectj/aspectjweaver/1.9.20/aspectjweaver-1.9.20.jar:/Users/simon/.m2/repository/org/springframework/boot/spring-boot-starter-jdbc/3.1.5/spring-boot-starter-jdbc-3.1.5.jar:/Users/simon/.m2/repository/com/zaxxer/HikariCP/5.0.1/HikariCP-5.0.1.jar:/Users/simon/.m2/repository/org/springframework/spring-jdbc/6.0.13/spring-jdbc-6.0.13.jar:/Users/simon/.m2/repository/org/hibernate/orm/hibernate-core/6.2.13.Final/hibernate-core-6.2.13.Final.jar:/Users/me/.m2/repository/jakarta/persistence/jakarta.persistence-api/3.1.0/jakarta.persistence-api-3.1.0.jar:/Users/me/.m2/repository/jakarta/transaction/jakarta.transaction-api/2.0.1/jakarta.transaction-api-2.0.1.jar:/Users/me/.m2/repository/org/jboss/logging/jboss-logging/3.5.3.Final/jboss-logging-3.5.3.Final.jar:/Users/me/.m2/repository/org/hibernate/common/hibernate-commons-annotations/6.0.6.Final/hibernate-commons-annotations-6.0.6.Final.jar:/Users/me/.m2/repository/io/smallrye/jandex/3.0.5/jandex-3.0.5.jar:/Users/me/.m2/repository/com/fasterxml/classmate/1.5.1/classmate-1.5.1.jar:/Users/me/.m2/repository/net/bytebuddy/byte-buddy/1.14.9/byte-buddy-1.14.9.jar:/Users/me/.m2/repository/org/glassfish/jaxb/jaxb-runtime/4.0.3/jaxb-runtime-4.0.3.jar:/Users/me/.m2/repository/org/glassfish/jaxb/jaxb-core/4.0.3/jaxb-core-4.0.3.jar:/Users/simon/.m2/repository/org/eclipse/angus/angus-activation/2.0.1/angus-activation-2.0.1.jar:/Users/me/.m2/repository/org/glassfish/jaxb/txw2/4.0.3/txw2-4.0.3.jar:/Users/me/.m2/repository/com/sun/istack/istack-commons-runtime/4.1.2/istack-commons-runtime-4.1.2.jar:/Users/me/.m2/repository/jakarta/inject/jakarta.inject-api/2.0.1/jakarta.inject-api-2.0.1.jar:/Users/me/.m2/repository/org/antlr/antlr4-runtime/4.10.1/antlr4-runtime-4.10.1.jar:/Users/me/.m2/repository/org/springframework/data/spring-data-jpa/3.1.5/spring-data-jpa-3.1.5.jar:/Users/me/.m2/repository/org/springframework/data/spring-data-commons/3.1.5/spring-data-commons-3.1.5.jar:/Users/me/.m2/repository/org/springframework/spring-orm/6.0.13/spring-orm-6.0.13.jar:/Users/me/.m2/repository/org/springframework/spring-context/6.0.13/spring-context-6.0.13.jar:/Users/me/.m2/repository/org/springframework/spring-tx/6.0.13/spring-tx-6.0.13.jar:/Users/simon/.m2/repository/org/springframework/spring-beans/6.0.13/spring-beans-6.0.13.jar:/Users/simon/.m2/repository/jakarta/annotation/jakarta.annotation-api/2.1.1/jakarta.annotation-api-2.1.1.jar:/Users/simon/.m2/repository/org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar:/Users/simon/.m2/repository/org/springframework/spring-aspects/6.0.13/spring-aspects-6.0.13.jar:/Users/simon/.m2/repository/org/springframework/boot/spring-boot-starter-security/3.1.5/spring-boot-starter-security-3.1.5.jar:/Users/simon/.m2/repository/org/springframework/boot/spring-boot-starter/3.1.5/spring-boot-starter-3.1.5.jar:/Users/simon/.m2/repository/org/springframework/boot/spring-boot-starter-logging/3.1.5/spring-boot-starter-logging-3.1.5.jar:/Users/simon/.m2/repository/ch/qos/logback/logback-classic/1.4.11/logback-classic-1.4.11.jar:/Users/simon/.m2/repository/ch/qos/logback/logback-core/1.4.11/logback-core-1.4.11.jar:/Users/simon/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.20.0/log4j-to-slf4j-2.20.0.jar:/Users/simon/.m2/repository/org/apache/logging/log4j/log4j-api/2.20.0/log4j-api-2.20.0.jar:/Users/simon/.m2/repository/org/slf4j/jul-to-slf4j/2.0.9/jul-to-slf4j-2.0.9.jar:/Users/simon/.m2/repository/org/yaml/snakeyaml/1.33/snakeyaml-1.33.jar:/Users/simon/.m2/repository/org/springframework/spring-aop/6.0.13/spring-aop-6.0.13.jar:/Users/simon/.m2/repository/org/springframework/security/spring-security-config/6.1.5/spring-security-config-6.1.5.jar:/Users/simon/.m2/repository/org/springframework/security/spring-security-web/6.1.5/spring-security-web-6.1.5.jar:/Users/simon/.m2/repository/org/springframework/spring-expression/6.0.13/spring-expression-6.0.13.jar:/Users/simon/.m2/repository/org/springframework/boot/spring-boot-starter-web/3.1.5/spring-boot-starter-web-3.1.5.jar:/Users/simon/.m2/repository/org/springframework/boot/spring-boot-starter-json/3.1.5/spring-boot-starter-json-3.1.5.jar:/Users/simon/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.15.3/jackson-databind-2.15.3.jar:/Users/simon/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.15.3/jackson-annotations-2.15.3.jar:/Users/simon/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.15.3/jackson-core-2.15.3.jar:/Users/simon/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.15.3/jackson-datatype-jdk8-2.15.3.jar:/Users/simon/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.15.3/jackson-datatype-jsr310-2.15.3.jar:/Users/simon/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.15.3/jackson-module-parameter-names-2.15.3.jar:/Users/simon/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/3.1.5/spring-boot-starter-tomcat-3.1.5.jar:/Users/simon/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/10.1.15/tomcat-embed-core-10.1.15.jar:/Users/simon/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/10.1.15/tomcat-embed-el-10.1.15.jar:/Users/simon/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/10.1.15/tomcat-embed-websocket-10.1.15.jar:/Users/simon/.m2/repository/org/springframework/spring-web/6.0.13/spring-web-6.0.13.jar:/Users/simon/.m2/repository/io/micrometer/micrometer-observation/1.11.5/micrometer-observation-1.11.5.jar:/Users/simon/.m2/repository/io/micrometer/micrometer-commons/1.11.5/micrometer-commons-1.11.5.jar:/Users/simon/.m2/repository/org/springframework/spring-webmvc/6.0.13/spring-webmvc-6.0.13.jar:/Users/simon/.m2/repository/org/apache/groovy/groovy/4.0.15/groovy-4.0.15.jar:/Users/simon/.m2/repository/org/springframework/session/spring-session-core/3.1.3/spring-session-core-3.1.3.jar:/Users/simon/.m2/repository/org/springframework/spring-jcl/6.0.13/spring-jcl-6.0.13.jar:/Users/simon/.m2/repository/org/springframework/boot/spring-boot-devtools/3.1.5/spring-boot-devtools-3.1.5.jar:/Users/simon/.m2/repository/org/springframework/boot/spring-boot/3.1.5/spring-boot-3.1.5.jar:/Users/simon/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/3.1.5/spring-boot-autoconfigure-3.1.5.jar:/Users/simon/.m2/repository/com/h2database/h2/2.1.214/h2-2.1.214.jar:/Users/simon/.m2/repository/org/projectlombok/lombok/1.18.30/lombok-1.18.30.jar:/Users/simon/.m2/repository/org/springframework/boot/spring-boot-starter-test/3.1.5/spring-boot-starter-test-3.1.5.jar:/Users/simon/.m2/repository/org/springframework/boot/spring-boot-test/3.1.5/spring-boot-test-3.1.5.jar:/Users/simon/.m2/repository/org/springframework/boot/spring-boot-test-autoconfigure/3.1.5/spring-boot-test-autoconfigure-3.1.5.jar:/Users/simon/.m2/repository/com/jayway/jsonpath/json-path/2.8.0/json-path-2.8.0.jar:/Users/simon/.m2/repository/jakarta/xml/bind/jakarta.xml.bind-api/4.0.1/jakarta.xml.bind-api-4.0.1.jar:/Users/simon/.m2/repository/jakarta/activation/jakarta.activation-api/2.1.2/jakarta.activation-api-2.1.2.jar:/Users/simon/.m2/repository/net/minidev/json-smart/2.4.11/json-smart-2.4.11.jar:/Users/simon/.m2/repository/net/minidev/accessors-smart/2.4.11/accessors-smart-2.4.11.jar:/Users/simon/.m2/repository/org/ow2/asm/asm/9.3/asm-9.3.jar:/Users/simon/.m2/repository/org/assertj/assertj-core/3.24.2/assertj-core-3.24.2.jar:/Users/simon/.m2/repository/org/hamcrest/hamcrest/2.2/hamcrest-2.2.jar:/Users/simon/.m2/repository/org/junit/jupiter/junit-jupiter/5.9.3/junit-jupiter-5.9.3.jar:/Users/simon/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.9.3/junit-jupiter-api-5.9.3.jar:/Users/simon/.m2/repository/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar:/Users/simon/.m2/repository/org/junit/platform/junit-platform-commons/1.9.3/junit-platform-commons-1.9.3.jar:/Users/simon/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar:/Users/simon/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.9.3/junit-jupiter-params-5.9.3.jar:/Users/simon/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.9.3/junit-jupiter-engine-5.9.3.jar:/Users/simon/.m2/repository/org/junit/platform/junit-platform-engine/1.9.3/junit-platform-engine-1.9.3.jar:/Users/simon/.m2/repository/org/mockito/mockito-core/5.3.1/mockito-core-5.3.1.jar:/Users/simon/.m2/repository/net/bytebuddy/byte-buddy-agent/1.14.9/byte-buddy-agent-1.14.9.jar:/Users/simon/.m2/repository/org/objenesis/objenesis/3.3/objenesis-3.3.jar:/Users/simon/.m2/repository/org/mockito/mockito-junit-jupiter/5.3.1/mockito-junit-jupiter-5.3.1.jar:/Users/simon/.m2/repository/org/skyscreamer/jsonassert/1.5.1/jsonassert-1.5.1.jar:/Users/simon/.m2/repository/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar:/Users/simon/.m2/repository/org/springframework/spring-core/6.0.13/spring-core-6.0.13.jar:/Users/simon/.m2/repository/org/springframework/spring-test/6.0.13/spring-test-6.0.13.jar:/Users/simon/.m2/repository/org/xmlunit/xmlunit-core/2.9.1/xmlunit-core-2.9.1.jar:/Users/simon/.m2/repository/org/springframework/security/spring-security-test/6.1.5/spring-security-test-6.1.5.jar:/Users/simon/.m2/repository/org/springframework/security/spring-security-core/6.1.5/spring-security-core-6.1.5.jar:/Users/simon/.m2/repository/org/springframework/security/spring-security-crypto/6.1.5/spring-security-crypto-6.1.5.jar com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 @w@/private/var/folders/0m/w52yvpkn4lngbwfb8slbf_m80000gn/T/idea_working_dirs_junit.tmp @/private/var/folders/0m/w52yvpkn4lngbwfb8slbf_m80000gn/T/idea_junit.tmp -socket56486
23:05:12.598 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class [com.ohds.bomg.BomgApplicationTests]: BomgApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
23:05:12.645 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Found @SpringBootConfiguration com.ohds.bomg.BomgApplication for test class com.ohds.bomg.BomgApplicationTests
23:05:12.783 [main] INFO org.springframework.boot.devtools.restart.RestartApplicationListener -- Restart disabled due to context in which it is running
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v3.1.5)
2023-10-30T23:05:12.875+01:00 INFO 27787 --- [ main] com.ohds.bomg.BomgApplicationTests : Starting BomgApplicationTests using Java 17.0.9 with PID 27787 (started by simon in /Users/simon/dev/nutmix-github/bomg)
2023-10-30T23:05:12.875+01:00 INFO 27787 --- [ main] com.ohds.bomg.BomgApplicationTests : No active profile set, falling back to 1 default profile: "default"
2023-10-30T23:05:13.129+01:00 INFO 27787 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2023-10-30T23:05:13.139+01:00 INFO 27787 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 6 ms. Found 0 JPA repository interfaces.
2023-10-30T23:05:13.321+01:00 INFO 27787 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2023-10-30T23:05:13.405+01:00 INFO 27787 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection conn0: url=jdbc:h2:mem:871bde75-74fc-4a36-bd8c-54c89f860bfb user=SA
2023-10-30T23:05:13.405+01:00 INFO 27787 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2023-10-30T23:05:13.426+01:00 INFO 27787 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2023-10-30T23:05:13.451+01:00 INFO 27787 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 6.2.13.Final
2023-10-30T23:05:13.452+01:00 INFO 27787 --- [ main] org.hibernate.cfg.Environment : HHH000406: Using bytecode reflection optimizer
2023-10-30T23:05:13.564+01:00 INFO 27787 --- [ main] o.s.o.j.p.SpringPersistenceUnitInfo : No LoadTimeWeaver setup: ignoring JPA class transformer
2023-10-30T23:05:13.708+01:00 INFO 27787 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000489: No JTA platform available (set 'hibernate.transaction.jta.platform' to enable JTA platform integration)
2023-10-30T23:05:13.709+01:00 INFO 27787 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2023-10-30T23:05:13.778+01:00 WARN 27787 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2023-10-30T23:05:13.952+01:00 WARN 27787 --- [ main] .s.s.UserDetailsServiceAutoConfiguration :
Using generated security password: c16c063a-3661-4fbd-8224-80b00d2c0425
This generated password is for development use only. Your security configuration must be updated before running your application in production.
2023-10-30T23:05:14.020+01:00 INFO 27787 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@6719f206, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@5ae16aa, org.springframework.security.web.context.SecurityContextHolderFilter@12ebfb2d, org.springframework.security.web.header.HeaderWriterFilter@7bde704a, org.springframework.security.web.csrf.CsrfFilter@23263ba, org.springframework.security.web.authentication.logout.LogoutFilter@28269c65, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@3605ab16, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@27a6384b, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@344a065a, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@333a2df2, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@629600d7, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@61c145cb, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@3051e476, org.springframework.security.web.access.ExceptionTranslationFilter@76134251, org.springframework.security.web.access.intercept.AuthorizationFilter@76105ac0]
2023-10-30T23:05:14.045+01:00 INFO 27787 --- [ main] com.ohds.bomg.BomgApplicationTests : Started BomgApplicationTests in 1.263 seconds (process running for 1.809)
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
2023-10-30T23:05:14.394+01:00 INFO 27787 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2023-10-30T23:05:14.395+01:00 INFO 27787 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2023-10-30T23:05:14.396+01:00 INFO 27787 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
Process finished with exit code 0
字符串
这是pom.xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.ohds</groupId>
<artifactId>bomg</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>bomg</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<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>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>1.13.1</version>
<executions>
<execution>
<goals>
<goal>addSources</goal>
<goal>addTestSources</goal>
<goal>generateStubs</goal>
<goal>compile</goal>
<goal>generateTestStubs</goal>
<goal>compileTests</goal>
<goal>removeStubs</goal>
<goal>removeTestStubs</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
型
这就是生成的main类的样子:
@SpringBootApplication
class BomgApplication {
static void main(String[] args) {
SpringApplication.run(BomgApplication, args)
}
}
型
当我用初始化器创建一个项目时,如果我选择Maven+Java,它会失败,如果我选择gradle+groovy,它会工作,但如果我选择Maven和groovy,它会失败。
仍然找不到任何方法让spring Boot 项目在mac上用maven或java运行。
也许我试图以错误的方式运行项目?我从“运行”菜单中选择“运行”。然后它会弹出一些东西,询问你第一次运行时应该运行什么,它给出的唯一选项是“all in Bomg”或类似的东西。我在spring上找到的各种教程使用intellij没有提到如何设置配置文件来运行应用程序,他们只是说运行它。
1条答案
按热度按时间lhcgjxsq1#
我找到了缺少的东西。与VS Code不同,在intellij中,你必须告诉它主类在哪里。你必须创建一个运行配置,并指定要运行的类和你希望它用途:的JDK:
的数据
然后你可以运行这个项目,它将启动tomcat。