0

I have below batch file

cd C:\batchTest\a\a-app
mvn dependency:tree > a.txt
cd C:\batchTest\b\b-app
mvn dependency:tree > b.txt

while running it is giving below output

    C:\batchTest>abcd
    C:\batchTest>cd C:\batchTest\a\a-app
    C:\batchTest\a\a-app>mvn dependency:tree  1>a.txt
    C:\batchTest\a\a-app>

it is not running last two commands. What is missing here?

Thanks for help.

manish
  • 61
  • 1
  • 1
  • 12

1 Answers1

1

mvn is a bat file - so you you need to invoke it like call mvn.. :

@echo off
cd C:\batchTest\a\a-app
call mvn dependency:tree > a.txt
cd C:\batchTest\b\b-app
call mvn dependency:tree > b.txt
Community
  • 1
  • 1
npocmaka
  • 55,367
  • 18
  • 148
  • 187