Search code examples
eclipsebatch-fileclearcasecd

Importing Projects and Building workspace from batch file


I have this batch file

@ECHO OFF

ECHO Please Enter Path of the View, you want to update in double quotes.

SET /P variable=
SET ECLIPSE=C:\Users\gdeep\Desktop\TED-4.3.0.20110512190809.lnk
SET WORKSPACE=C:\Users\gdeep\DevCodebase_2

:LOOP
ECHO Press 'g' for Graphical Interface and 'c' for Command line.
SET /P answer=

IF /I "%answer%"=="g" GOTO GRAPHICAL
IF /I "%answer%"=="c" GOTO COMMANDLINE
ECHO Invalid Input. Please Try Again.
GOTO LOOP

:GRAPHICAL
cleartool update -graphical %variable%
GOTO CONTINUE

:COMMANDLINE
cleartool update %variable%
GOTO CONTINUE

:CONTINUE

FOR /D %%i IN (%WORSPACE%) DO RD /S /Q "%%i" DEL /Q "%WORSPACE%\*.*"
START %ECLIPSE% -data %WORSPACE%

D:
chdir "%variable%"\v4electronics

ECHO Please Ensure that Server is killed.
PAUSE
mvn clean install -Dmaven.test.skip=true -Dresource.minify.skip=true

For deleting all the projects i used

  FOR /D %%i IN (%WORSPACE%) DO RD /S /Q "%%i" DEL /Q "%WORSPACE%\*.*"

Can anyone explain this to me? I copied it from somewhere and don't want to use it without understanding. Problem with using above command is althout it seem to work, i see The system cannot find the file specified. The system cannot find the path specified. as the output. Also, the way i am deleting, will it be equivalent to if i delete them from the eclipse, by select all projects and deleting?

Another problem here is that when i have .

 mvn clean install -Dmaven.test.skip=true -Dresource.minify.skip=true

in the end it works fine, otherwise, if there is any other command after it, those commands doesn't run.

After this, I then wanna import all maven projects from the Clearcase %Variable%. And i want to do that by command line only. Can you help me with that?

Thanks for your help. Appreciate your time.


Solution

  • Please correct me, If I'm wrong. I understand that you're in the MS-Windows environment.

    Regarding to the question about if there is another command after the "mvn ...", they are ignored.

    I use the "call" as the following: -

    cd project1
    call mvn clean install
    
    cd project2
    call mvn clean install
    

    I hope this may help.

    Regards,

    Charlee Ch.