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.
Related
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
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.
I have been working on this web application using Eclipse and m2e (maven plugin for Eclipse).
After a while I decide to change the project name in eclipse doing: Right click on project >> refactor >> rename
Following this I see a few errors coming up, mostly to do with classpath configuration & java versions mismatch. I fix them, adding the maven dependencies to the build path, and updating the java versions to be used during compilation & run time.
I rebuild my web app & restart my server (Tomcat in this case). Open my browser to go to my app's root url. And I get a 404 page (everything looks fine in the console btw).
I've been going through my buildpath and classpath config to double check if anything was coming from there but everything seems fine. I'm confused and unsure where to look at.
Thanks in advance
This really depends on your Setup. If you are using the default path, it is (as Kal said) myserver/newappname.
If you are using a url that you have configured in webserver for easier readability like (myapp.myserver.com) you would have to change the redirection in your server from your old appname to the new one.
Actually,
404 HTTP standard response code indicating that the client was able to communicate with the server, but the server could not find what was requested.
1. Check your path with newapplication name.
2. See inside your server, Is there a resource with (newNameApp.war)?
3. As you are using maven, try to build the project and see the log, by which name war is generated, and where the war got placed.
I faced the same situation and simply restarted Eclipse and no more 404 afterward
Would someone please be able to explain to me how to properly install JavaMail and have it to execute in Eclipse please.
I have been trying for the past few hours and I am completely lost as to why this is.
This is from trying to execute their demo projects msgsend.java and msgshow.java.
I either find an error message stating invalid protocol or could not connecto to SMTP host: localhost, port 25;
What I suggest.
Open Eclipse
Create a new Java project
Create a new Java class which contains a main method (entry point)
Create a folder "libs" inside which you put your JavaMail jar library and other external dependencies
Right-click (from within eclipse) on the added JavaMail jar file and choose Build path and add to build path.
Now you project should be ok in terms of dependencies and you can start coding your test logic within your main method or other classes you create
Once coded, Run your project, by right-clicking on the class which represents your app's entry point and select Run and run as Java application
(That's all I can provide given the details in your question ;) )
If you're running the examples and it's using "localhost:25" as the server, you'll need to have an SMTP server running on the same machine.
If you don't have a local SMTP server, then try replacing "localhost" with the SMTP server hostname that your ISP provides you.
If you are getting an exception being thrown which is stating that it could not correct to an SMTP host (it may be helpful if you posted the exact error) that means that Javamail is correctly installed in your classpath but that it could not find the given SMTP host.
Keep in mind that by merely dropping Javamail into Eclipse will not automatically result in an SMTP server running on localhost (aka your own machine).
So, either set up an SMTP server on your machine or just use your ISP's server for test purposes.
I would suggest the later, but if you are interested in the former, you may want to check out:
http://www.ericdaugherty.com/java/mailserver/
It includes an Eclipse plugin.