1

I am trying to write tests for Android app using Appium in JAVA (Eclipse). I have added the required jar files into the Build Path of the Project. However "package Appium" is not being recognized and gives me error "Declared package "Appium" does not match the expected package "". "

Also, based on my research on this, I found out that I should have a Maven project so I set up MAVEN but am getting "Build Failed" Error "No prefix found for 'archtype' in the current project and in the plugin groups, available from the repositories", when I run the "mvn archtype:generate" command.

What would be a fix for this?

2 Answers2

1

@Jesseweb suggested that

Your machine is behind a firewall or proxy so your box is not able to hit http://repo1.maven.org/maven2. Try accessing this URL directly in a browser or something to test if you are able to make the request.


This is the issue with your firewall. To check if firewall is on:

Click Start-> click Run-> type wscui.cpl -> click OK. In Windows Security Center-> click Security If net work Network Firewall is "on" you need to set the proxy for maven.

Go to /conf -> open settings.xml with notepad uncomment proxy (if you don't remember proxy settings u can check in webbrowser u r using)

<proxies>
    <proxy>
        <id>optional</id>
        <active>true</active>
        <protocol>http</protocol>
        <username></username>
        <password></password>
        <host>www-proxy.us.oracle.com</host>
        <port>80</port>
        <nonProxyHosts></nonProxyHosts>
    </proxy>
</proxies>

You can leave the username and pwd fields blank and set only host and port.

(Credit goes to hotcoder24)

Resource Link: mvn archetype:generate does not work-no plugin found for prefix 'archetype'

For a full tutorial, you can follow this http://www.swtestacademy.com/appium-using-android-virtual-device/

Community
  • 1
  • 1
SkyWalker
  • 28,384
  • 14
  • 74
  • 132
0

you should attach debug log by mvn archetype:generate -X

There may be two issue possible.

  1. If you are behind windows NTLM proxy then you have to use CNTLM for the same and please refer this step by step guide to get handle on it.
  2. If there is ssl certification issues here is the guide

    • Get SSL certificate by opening https://repo1.maven.org/maven2 into firefox and go to lock symbol just besides your url into address bar and click on it and go into details and export certificate.

    • Follow this guide to install that certificate to your keychain

    • now execute following command to check if things are working

mvn archetype:generate -Djavax.net.ssl.trustStore=trust.jks

Community
  • 1
  • 1
positivecrux
  • 1,307
  • 2
  • 16
  • 35