I'm trying to create a shell script that will automate the creation of a Maven project. The last line throws an error
[ERROR] Unknown lifecycle phase "–Dwtpversion=2.0". You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean, post-clean. -> [Help 1]
The script I have so far is:
#!/bin/bash clear echo "Create Maven/Eclipse WebApp Project" echo "Close Eclipse or this script will NOT succeed" echo -n "Enter project name: " read name echo -n "Enter groupId: " read groupId mvn archetype:generate -DgroupId=$groupId -DartifactId=$name -DarchetypeArtifac$ cd $name mvn eclipse:eclipse –Dwtpversion=2.0
I read and tried some of the suggestions in this post but to no avail, it's not going into the newly created project directory.
How should I approach this?
Also, I forgot to add the most important piece of information: when I go into the project root directory manually and execute
mvn eclipse:eclipse -Dwtpversion=2.0
it runs successfully.