Categories
Mastering Development

Maven returns unknown lifecycle error when invoked from an sh file

I am running the following command, from a sh file.

echo "This is job" $SLURM_ARRAY_TASK_ID
#! Command line that we want to run:
SLURM_ARRAY_TASK_ID=0
varData='mvn -e clean compile exec:java -Dexec.mainClass=App.Main -Dexec.args="wikiLineSPlits/wiki-004/ wiki-004-'$SLURM_ARRAY_TASK_ID'.txt wiki-004-'$SLURM_ARRAY_TASK_ID' wikiOuts/  wiki-004"'
echo $varData
$varData

Here, running the code results in the following output:

mvn -e clean compile exec:java -Dexec.mainClass=App.Main -Dexec.args="wikiLineSPlits/wiki-004/ wiki-004-0.txt wiki-004-0 wikiOuts/ wiki-004"

Unknown lifecycle phase "wiki-004-0.txt"

But if I copy-paste the output from echo $varData to my terminal screen, then the program executes scuesfully. I am not sure what is the source of error. Any help would be appreciated.

Output from echo $varData:

 mvn -e clean compile exec:java -Dexec.mainClass=App.Main -Dexec.args="/home/ak2329/rds/hpc-work/feverDataset/wikiLineSPlits/wiki-004/ wiki-004-0.txt wiki-004-0 /home/ak2329/rds/hpc-work/feverDataset/wikiOuts/ wiki-004"

Leave a Reply

Your email address will not be published. Required fields are marked *