paulschwarz / spring-dotenv

Provides a Dotenv property source for Spring
MIT License
301 stars 23 forks source link

didn't processing with comment #28

Closed Jeongyong-park closed 7 months ago

Jeongyong-park commented 7 months ago

I needed a comment among the settings in the .env file, so I wrote down the value by adding a hashtag to the right of the value.

Looking at the error log, the value injected with spring-dotenv includes a hashtag annotation marked as a comment.

my .env file

DB_HOSTNAME = 192.168.10.172 #localhost
DB_PORT = 15432
spring:
    application:
        name: pdp22backend
    profiles:
        active: native, default;
    datasource:
        driver-class-name: org.postgresql.Driver
        url: jdbc:postgresql://${DB_HOSTNAME}:${DB_PORT}/${APP_DB_NAME}
...

error log

Caused by: java.net.UnknownHostException: 192.168.10.172 #localhost
        at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567) ~[na:na]
Jeongyong-park commented 7 months ago

sorry, I used 3.0.0 version, but it look like fixed on 4.0.0