Olá pessoal.
Estou com o seguinte problema, o spring não consegue iniciar devido a este erro
# Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
# 2023-05-09T15:24:08.844-03:00 ERROR 24996 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
#
# ***************************
# APPLICATION FAILED TO START
# ***************************
#
# Description:
#
# Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
#
# Reason: Failed to determine a suitable driver class
#
#
# Action:
#
# Consider the following:
# If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
# If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
#
Ao tentar configurar o MySQL como o instrutor ensinou, também tive o mesmo problema, porem eu retirei do pom as dependencias do spring jpa, e tinha dado certo. Consegui configurar o mySQL na minha máquina e adicionei nas variáveis de ambiente.
Agora tive que adiciona-las para conseguir usar as notações JPA. E o erro voltou a existir. Alguém me ajuda por favor?
Meu pom está assim:
<?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.0.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>med.voll</groupId>
<artifactId>api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>api</name>
<description>API Rest da aplicação Voll.med</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</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.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>3.0.6</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-mysql</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.32</version>
<scope>runtime</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>
</plugins>
</build>
</project>