Reputation: 301
I am using Appium test automation framework and i want to upload it on AWS Device Farm. I have updated the pom.xml and zip.xml file. When i run the command 'mvn clean package –-DskipTests=true' i get the following error.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building 1 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.109 s
[INFO] Finished at: 2016-07-25T14:54:43+05:30
[INFO] Final Memory: 7M/77M
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase "?-DskipTests=true". You must specify a valid li
fecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id
>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are
: validate, initialize, generate-sources, process-sources, generate-resources, p
rocess-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-clean, clean, post-cle
an, pre-site, site, post-site, site-deploy. -> [Help 1]
Can any one please give me a solution on this?? Previously i was getting mvn is not recognized as an internal or external command, so I installed maven separately.. Please help
Upvotes: 0
Views: 430
Reputation: 301
You are not specifying goal for maven build.
In your run configuration for maven build like clear, compile, install, package.
Please following below step to resolve it.
right click on your project.
click 'Run as' and select 'Maven Build'
edit Configuration window will open. write any goal but your problem specific write 'package' in Goal text box.
click on 'Run'
Upvotes: 0
Reputation: 1
Make sure all the maven dependencies should be included in pom.xml.
Please refer: AWS Device Farm Setup
Then go to your project folder where your pom.xml is present and enter following command in terminal:
mvn clean package -DskipTests=true
that's it.
Upvotes: 0
Reputation: 107
mvn plugin-prefix:goal or plugin-group-id:plugin-artifact-id:plugin-version:goal
The above should be available i your POM.xml file eg:
--------------
<groupId>com.aws.appium</groupId>
<artifactId>appium-android-test</artifactId>
<version>1.0-SNAPSHOT</version>
-------------
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
Upvotes: 0
Reputation: 5478
If you type in:
mvn -h
You'll get the help page for Maven printed out into the console. There you'll see it says:
usage: mvn [options] [<goal(s)>] [<phase(s)>]
So simply try this:
mvn -DskipTests package
That is, forget about the "=true" bit.
WARNING: Beware of where you copy and paste from. I copied from a Github README.md file and it lost me an hour. There are some typo's out there so subtle they can barely be seen.
This, with a minus/hyphen "-" symbol (ASCII code 45), will work:
mvn -DskipTests package
This, with a dash "–" (ASCII code 150), will not work:
mvn –DskipTests package
So if you've been pasting into the command line and you keep getting the Unknown lifecycle phase "–DskipTests" error regardless of what you try, just type it in to make sure you use the minus/hyphen character.
Upvotes: 1