Wheel in eclipse but the project build with orjdbc7.rar jar does not work

0

Hello, how are you?

I'm having trouble generating .jar from a Spring Boot + Maven project In Eclipse it runs smoothly

But when I run the build with this command

./mvnw package && java -jar target/ff-back-boilerplate-0.0.1-SNAPSHOT.jar

It's the problem with the Oracle driver

Failed to bind properties under 'spring.datasource' to javax.sql.DataSource:

Property: spring.datasource.driver-class-name
Value: oracle.jdbc.OracleDriver
Origin: class path resource [application.yml]:22:24
Reason: Failed to load driver class oracle.jdbc.OracleDriver in either of HikariConfig class 
loader or Thread context classloader

Action:

Update your application's configuration

I've tried using this code and  put in maven's dependencies

mvn install:install-file -Dfile=ojdbc7.jar -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0 -Dpackaging=jar

I think you have to set some ambiemte variable because the driver in eclipse is in Referenced Libraries

My application.yml is like this but I do not think it's a problem because it runs in eclipse

management:
  endpoints:
    web:
      exposure:
        include: "*"

spring: 
  jpa:
    database: default
    properties.hibernate.id.new_generator_mappings: false


  datasource:
      #Oracle DB - PROTPROD
    jdbc-url: jdbc:oracle:thin:@erp12.*****.com:1521/orcl
    username: *******
    password: *******
    driver-class-name: oracle.jdbc.OracleDriver


mysql-local: 
  datasource:
    #Mysql DB - test
    jdbc-url: jdbc:mysql://localhost:3306/test
    username: felipe  
    password: password
    driver-class-name: com.mysql.jdbc.Driver  


security:
  oauth2:
    resource:
      user-info-uri: https://orion44.*****.com/me

My pom.xml does not have dependency because eclipse does not let me put it but it is running in the IDE.

What to do?

    
asked by anonymous 03.12.2018 / 22:22

0 answers