Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

closed as unclear what you're asking by psusi, guntbert, Eric Carvalho, Braiam, Amith KK Feb 17 at 5:12

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Read the error message... it has nothing to do with being in the wrong directory. –  psusi Feb 14 at 2:10
    
@psusi then why does it run normally when I go into the directory manually and run the command that generates the error? –  Wim Ombelets Feb 14 at 7:06
    
2.0 is not a lifecycle phase, you should use the ones listed there. –  Braiam Feb 17 at 1:40
add comment