ashald / EnvFile

EnvFile 3.x is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations from one or multiple files.
MIT License
539 stars 129 forks source link

EnvFile does not work with normal Application run configs when "Build and run using" ist set to "Gradle" #108

Open pilzm opened 4 years ago

pilzm commented 4 years ago

EnvFile works with

However, when normal Application run configs are used in conjunction with delegated Gradle actions, the EnvFile plugin will not work. After investigating the issue, I believe this is because the userData set on the ApplicationConfiguration object is not propagated to the GradleRunConfiguration generated by IntelliJ.

Steps to reproduce:

I created a post on the IDEA Plugins forum with more details and will update this issue as I learn more information: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360007941620-UserData-and-GradleApplicationEnvironmentProvider

markuskruse commented 4 years ago

What version of intellij? I missed then EnvFile in my run config this morning but saw that Intellij had upgraded to 2020.1. After downgrading to 2019.3, it worked again.

pilzm commented 4 years ago

I encountered this issue using both 2019.3 and 2020.1. @markuskruse the issue you're seeing is #100 and should be fixed in 3.2.1. I elaborated the description to be a bit more informational

ashald commented 4 years ago

@pilzm thanks for the PR! I merged it and will do a bit more testing before releasing a new version to see how stable it is. I will keep this issue open until then. I assume you can unblock yourself by building a version of the plugin manually and using it in your environment.

amin3mej commented 4 years ago

@ashald Did you release this MR?

lightoze commented 4 years ago

@ashald I'm getting into this issue with 2020.1 and EnvFile 3.2.1

liudongcxw commented 4 years ago

I am using IDEA 200.2 and envFile 3.2.1, but the problem is not solved.

iThinker commented 3 years ago

Same here. Original solution with disabling delegated build works though.

fkrauthan commented 3 years ago

I have the same issue. Switching from Build and Run Via: Gradleto Intellij fixes it.

jasonleibowitz commented 3 years ago

I'm also getting this issue with IntelliJ CE 2021.1.1 and EnvFile 3.2.1. When running Gradle build my env variables are picked up, but they're not with Gradle run 😕