remohere
remohere

Reputation: 11

Setting environment variables for application Maven

My question is i have a pom file which calls a bat file which sets environment variables for the application. Then i call the ant script which uses these environment variables to compile and execute. These environment variables cant be recognized by ant script and it fails. I believe its because both run in different context. Can you guys let me know how to link this together.

org.codehaus.mojo exec-maven-plugin 1.1 Pre_Clean pre-clean exec env.bat maven-antrun-plugin Compile compile run

Upvotes: 1

Views: 808

Answers (1)

Chris Nava
Chris Nava

Reputation: 6802

Yes. When the batch file ends the environment changes go out of scope. So, you need to call ant from within your .bat file OR set up the environment before starting maven OR set them up in the POM.

Upvotes: 1

Related Questions