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?
#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/
you should attach debug log by mvn archetype:generate -X
There may be two issue possible.
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.
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
Related
Im using eclipse Neon and working behind a proxy. Below message boxes are displayed when im trying to create a maven project using an archetype.
"Could not resolve archetype XXXXXXXX from any of the configured repositories."
"Creating xxxxx has encountered a problem. Could not resolve archetype xxxx from any of the configured repositories"
I have configured the below settings correctly.
1. Proxy settings in Eclipse
2. Proxy settings in maven setting.xml file
3. Add the remote catalog as "http://repo1.maven.org/maven2/archetype-catalog.xml"
However, when i go to error description, it says "unexpected end of stream on connection" and it shows my proxy IP and port. Just to check, i have altered proxy IP in the setting.xml file and eclipse proxy setting but it shows the same IP and PORT in the error description without any change. I have no idea from where maven refers the proxy settings. Please advice.
Thanks in Advance
The same error made me struggle alot, I could download testNG and other things from eclipse marketplace, but when i'm creating a maven project i got this error. Because my internet connection is going through proxy.
I tried all the above but i couldn't resolve this error, but this guy gave me the solution:
http://www.javahelps.com/2015/08/set-proxy-for-maven-in-eclipse.html
After the above procedure is done, then you have to delete the existing quickstart-archetype from below folder
C:\Users.m2\repository\org\apache\maven\archetypes
then restart the eclipse and create a new maven project with new project name.
Since this is only a proxy issue, so no need to specify the arche types and all. This should work if it's a proxy related issue.
Try the following :
1) Delete your repository at C:/Users/????/.m2/repository
2) Check your C:/Users/????/.m2/settings.xml for correct proxy config
3) Set you M2_HOME environment variable to <MAVEN INSTALL DIR
4) Add %M2_HOME%/bin: to your PATH variable assuming windows (remeber to start a new window after changing ebvironment variables)
5) Try a mvn clean install from the command line - GET THIS WORKING FIRST
6) Then try from netbeans, you do not need a proxy setting it should call the default mvn.
Set proxy setting in eclipse neon as follows:
Window->Preferences->General->Network Connection
Now select Active Provider as Manual.
Now you will get three proxy entries to be configured HTTP, HTTPS and SOCKS. Configure host name, port, username and password in HTTP and HTTPS proxy entries, but not in SOCKS. Try this, it may help.
Also make sure the username and password you are typing is correct.
After configuration please restart eclipse, it is required for taking the effect of configuration.
Proxy setting in .m2/settings.xml may not be required after above setting.
I have just installed netbeans on my windows 7 computer.
This is the first time i have used netbeans!
I am trying to compile a program what is using maven to manage its dependencies.
The problem is i cant seem to compile the program as maven is unable to connect to the URL http://repo.maven.apache.org/maven2
I can get to this directly using a web browser
Now i am sure this is a proxy problem as i also have the same code on a Linux box and i can compile that, and i did have to setup the proxy.
I know maven has its own proxy setting in the settings.xml file and i have edited that with what i believe to be the correct details.
The settings file is in the root folder of my project.
I have also setup the proxy in Netbeans IDE (and pressing the test button works)
But i still cannot compile it on my windows box.
So my question are:
How do I correctly set up the maven proxy when using netbeans?
How can I check to see if my proxy setting are A) correct and B) being used!
It turns out its very easy!
My problem is that the code was put on my hard drive as a simple HG repository.
This means that i had a settings.xml file but it was in the solution folder, along with my pom.xml.
To fix my problem you need to:
Go to the projects tab in Netbeans
Right click the Project Files
Choose create settings.xml
This makes a new settings file in C:\Users\.m2
I then copied and pasted the content from my root settings.xml into this new settings.xml
And Bingo! it works.
I just need to remember to make changes to both settings files so that a working settings document can be saved into source control.
I think I had the same issue Win7/NetBeans/Maven.
Looks to me like Maven needs its own proxy settings and doesn't use the once which are set in NetBeans.
There's a settings.xml in a subdirectory where you installed NetBeans: e.g. c:\NetBeans 8.2\java\maven\conf
Don't forget to remove the surrounding comments from the proxy section.
I am using the libgdx project creator (gdx-setup.jar) to setup a new project. However, I am using a proxy connection on my Windows machine to access the internet and the gdx-setup.jar isn't able to detect the settings, thus I cannot download the required jar files and generate any project. How and where do I change the java proxy settings so that I am able to achieve this?
PS: I have already tried to edit the settings under Control Panel->Java->Network Settings but to no avail.
From Gradle's manual: 12.3. Accessing the web via a proxy
You may need to create a $HOME/.gradle/gradle.properties file. For example:
systemProp.http.proxyHost=10.0.0.1
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=
systemProp.http.proxyPassword=
systemProp.http.nonProxyHosts=*.some.domain.com|localhost
IMPORTANT: There are separate settings for HTTPS.
systemProp.https.proxyHost=www.somehost.org
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=userid
systemProp.https.proxyPassword=password
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost
Then, just run setup like this:
java -Dhttp.proxyHost=10.0.0.1 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=10.0.0.1 -Dhttps.proxyPort=8080 -jar gdx-setup.jar
This works for me, behind a HTTP Proxy. Change it with your proxy settings.
Later, import your projects into Eclipse. And make sure your Eclipse Network Proxy is OK too.
Here is a working solution:
http://badlogicgames.com/forum/viewtopic.php?t=16414&p=70348
For windows 7, gradle.properties is under C:\Users\USER_NAME.gradle\ (or create one if not exist)
Steps:
1. prepare gradle.properties file with following content
org.gradle.daemon=true
org.gradle.jvmargs=-Xms128m -Xmx1500m
org.gradle.configureondemand=true
systemProp.http.proxyHost=
systemProp.http.proxyPort=8080
systemProp.https.proxyHost=
systemProp.https.proxyPort=8080
run the jar through the same proxy
java -Dhttp.proxyHost=**** -Dhttp.proxyPort=** -Dhttp.proxyUser=******** -Dhttp.proxyPassword=**** -jar gdx-setup.jar
If you run gdx-setup.jar from the command line, you should be able to tell the JVM to use the proxy settings using http.proxyHost and http.proxyPort.
See: How do I set the proxy to be used by the JVM for more information.
The command line would be something similar to:
java -Dhttp.proxyHost=10.0.0.1 -Dhttp.proxyPort=8080 -jar gdx-setup.jar
I was able to workaround this problem using Eclipse with proxy configured in
Window -> Preferences -> Network Connections
I think it should be possible also in other IDEs or even Gradle (if you install it manually), provided that they have properly configured proxy.
This is because the Project Creator creates the whole directory structure, classes, etc., it fails later, when trying to download Gradle.
What I did after it failed is I went to Eclipse, I chose 'Import as Gradle project' and then clicked the Build Project button.
This downloaded Gradle and all the needed jars.
Setup
I'm using Netbeans 7.4 on Mac OSX Mavericks and Glassfish 4.0 (build 89) on my dedicated server and JDK 1.7. To use the server locally I setup and ssh-tunnel. The following way:
ssh -L 4848:127.0.0.1:4848 -p 6122 glassfish#XXXXXXXXXX
This is working perfectly fine, I can access the server via localhost without any problems. To use this server I added a server in Netbeans, see prinscreen:
Problem
Now I'd like to deploy the project to the server (Right-Click Project -> Deploy) but I get following Error:
Building jar: /Users/tzhware7/NetBeansProjects/SkyLogicAddon/dist/SkyLogicAddon.war
Distributing /Users/tzhware7/NetBeansProjects/SkyLogicAddon/dist/SkyLogicAddon.war to [glassfish.ivo]
glassfish.ivo, deploy, null, false
/Users/tzhware7/NetBeansProjects/SkyLogicAddon/nbproject/build-impl.xml:1050: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 1 second)
Now I'd checked the line where the Error-Show's up, which is following (1049-1051). For me everything looks normal:
<target if="netbeans.home" name="-run-deploy-nb">
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
</target>
In advance I checked the serverlogs, which are empty - no error is shown. What am I doing wrong? Can someone advice me what to change? Thank you in advance!
Edit 1 - 08.01.2014
Allright, I didn't found a solution for solving the problem above, but following way worked at least to deploy the app manually.
Netbeans -> Right-Click on Project -> Clean/Build (now check your outputlog where it save's the project.
Now go to that path, you'll shoud find a .war file
Log into your glassfish-server -> Click Application's -> Click deploy -> upload the .war file -> Click again deploy
Now glassfish deploys the project for you. :)
Edit 2 - 17.01.2014
I could fix the problem, following was wrong. In netbeans I configured that the Target should be domain1, if you do this, it won't work. Let the target be empty, and everything works fine.
Thank you Tim B for your help!
If NetBeans can't talk to the server when you add it to the list then it silently fails. The server appears in the list but you can't click on the + and expand it out to see what it contains.
Check in your server list that NetBeans can actually see the server. Also keep in mind that NetBeans needs access to the admin port (usually 4848) not the normal web one, although it looks like your tunnel is correct for that.
You also need to turn on remote administration and set up the username and password etc. Try pointing a web browser to your localhost 6122 and check you can log in to the admin panel using the same username and password that netbeans is using.
To turn on remote administration:
https://blogs.oracle.com/quinn/entry/securing_adminstration_in_glassfish_server1
asadmin enable-secure-admin
You will also need to add an administrator username and password.
I am trying to create a Confluence plugin. I have been following theses instructions.
However when I run the atlas-create-confluence-plugin command maven throws SSL errors trying to get resource from https://m2proxy.atlassian.com/repository/public/.
alt text http://img46.imageshack.us/img46/6281/mavenssl.jpg
Do I need to change a setting in my configuration?
System setup: Windows Vista, with Apache Maven 2.1.0 (r755702; 2009-03-18 19:10:27+0000)
Accessing a repository over SSL is not really a Maven issue (which uses HttpClient under the hood and at the end classes from the java.net package), this is a pure Java issue: the certificate of the remote repository has to be trusted i.e. the CA root certificate for this certificate has to be in the cacerts file bundled in the JRE or you need to establish a chain of trust manually.
In the particular case of https://m2proxy.atlassian.com/, the certificate has been issued by DigiCert CA.
The odd part is that recent JDKs (Java 5u15 or later or Java 6u5 or later, see Bug ID:6647251) have a CA root certificate for DigiCert. So, with a recent JDK, things should just work (unless you have a proxy doing some black magic like in this issue).
If you are using an older JDK and can't upgrade, export the certificate from your browser, use keytool to add it to a trust store and setup Java to use this trust store (using the javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword system properties). See the Maven mini guide and/or this blog post for more details on how to do this.
But the easiest way would be to use a recent JDK.
OK this looks like I got the question wrong.
For some reason maven was not downloading the maven-confluence-plugin-3.0.5.jar file. I had to manually download this file from the URL and add it in the correct location .m2 directory.
After that the whole process worked fine.
In most cases, Pascal's answer is the way to go. However, if you're building Maven itself, it doesn't work (as of Maven 3.2.3, at least), because ant fails to pass the necessary javax.net properties when it calls the MavenCli class to let Maven build the remainder of Maven.
The solution to this problem is to modify the build.xml file in the root of the maven source directory, and add these lines to the maven-compile target:
<arg value="-Djavax.net.ssl.trustStore=/path/to/trustStore" />
<arg value="-Djavax.net.ssl.trustStorePassword=TrustStorePassword" />
in windows doing the following helped with command line execution
SET MAVEN_OPTS=-Djavax.net.ssl.trustStore="C:\Program Files\Java\jdk1.8.0_201
jre\lib\security\cacerts"
the error I got was as follows
Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
(one could also adjust mvn.cmd...)
hope this hepls