Eclipse Mars m2e plugin fails to download repository index updates on startup. I run Eclipse behind a company firewall but the proxy settings work fine for "check for updates", "eclipse marketplace", and eclipse's built-in browser.
I have tried the following:
Deleting the cache directory \eclipse\p2\org.eclipse.equinox.p2.repository\cache and then refreshing the repositories. Preferences -> Install Update -> Available Software Sites => select the entry and click "Reload"
Adding -Djava.net.preferIPv4Stack=true to -vmargs in eclipse.ini
Edit: Proxy configurations are correctly set in $HOME/.m2/settings.xml
Edit: Seems like a bug. So I raised a bug request with eclipse.org. You can view it here
Due to this issue, eclipse fails to search and add dependency from maven repositories.
Here is the error in .metadata/.log
eclipse.buildId=4.5.0.I20150603-2000
java.version=1.8.0_60
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_IN
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product
!ENTRY org.eclipse.m2e.logback.appender 4 0 2015-09-30 14:39:59.820
!MESSAGE Unable to update index for central|https://repo.maven.apache.org/maven2
!STACK 0
java.net.ConnectException: Connection timed out: connect
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at com.squareup.okhttp.internal.Platform.connectSocket(Platform.java:107)
at com.squareup.okhttp.Connection.connect(Connection.java:156)
at com.squareup.okhttp.Connection.connectAndSetOwner(Connection.java:175)
at com.squareup.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:120)
at com.squareup.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:330)
at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:319)
at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:241)
at com.squareup.okhttp.Call.getResponse(Call.java:271)
at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:228)
at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:199)
at com.squareup.okhttp.Call.execute(Call.java:79)
at io.takari.aether.okhttp.OkHttpAetherClient.execute(OkHttpAetherClient.java:154)
at io.takari.aether.okhttp.OkHttpAetherClient.get(OkHttpAetherClient.java:100)
at org.eclipse.m2e.core.internal.index.nexus.AetherClientResourceFetcher.retrieve(AetherClientResourceFetcher.java:79)
at org.apache.maven.index.updater.AbstractResourceFetcher.retrieve(AbstractResourceFetcher.java:35)
at org.apache.maven.index.updater.DefaultIndexUpdater.downloadIndexProperties(DefaultIndexUpdater.java:452)
at org.apache.maven.index.updater.DefaultIndexUpdater.access$100(DefaultIndexUpdater.java:75)
at org.apache.maven.index.updater.DefaultIndexUpdater$IndexAdaptor.setProperties(DefaultIndexUpdater.java:607)
at org.apache.maven.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:788)
at org.apache.maven.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:135)
at org.eclipse.m2e.core.internal.index.nexus.NexusIndexManager.updateRemoteIndex(NexusIndexManager.java:1127)
at org.eclipse.m2e.core.internal.index.nexus.NexusIndexManager.updateIndex(NexusIndexManager.java:1084)
at org.eclipse.m2e.core.internal.index.nexus.NexusIndexManager$1.run(NexusIndexManager.java:656)
at org.eclipse.m2e.core.internal.index.nexus.IndexUpdaterJob.run(IndexUpdaterJob.java:72)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
I've found solution. It's quite simple. After some code investigation I've found following thing:
https://github.com/eclipse/m2e-core/blob/releases/1.6/1.6.2.20150902-0002/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java#L1226
So m2e scans proxy list and trying to find correct by protocol. If you look at central url: https://repo.maven.apache.org/maven2. It's starts from "https".
Your proxy settings should looks like that (one proxy for http and second for https):
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>myproxy.company.com</host>
<port>8080</port>
</proxy>
<proxy>
<active>true</active>
<protocol>https</protocol>
<host>myproxy.company.com</host>
<port>8080</port>
</proxy>
</proxies>
Although you have configured proxy in eclispe, you have to do the same config for maven, into settinggs.xml file. Here you have my proxy configuration section:
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>myproxy.company.com</host>
<port>8080</port>
</proxy>
</proxies>
Then you have to ensure in eclipse that you are using the configured settings.xml file, in window->preferences-maven->user settings.
Hope it helps.
Maven uses its own proxy settings, defined in .m2/settings.xml. You can find the settings used my m2e plugin in Eclipse's menu: Windows / Preferences / Maven / User Settings. Remember to hit the Update Settings -button after editing:
<!-- proxies
| This is a list of proxies which can be used on this machine to connect to the network.
| Unless otherwise specified (by system property or command-line switch), the first proxy
| specification in this list marked as active will be used.
|-->
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>proxy.host.net</host>
<port>80</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
-->
</proxies>
Related
I need to develop applications here at the company. And inside the company's network there is a *.pac file that determine the destination according to the request.
I'm using git as the version control and maven as the dependency manager, after searching on the internet I've found the following link which helped me configure git to work properly:
Getting git to work with a proxy server
Unfortunately, for Maven I couldn't find a way to make it work.
I've checked the following links but none seemed to work either:
https://www.mkyong.com/maven/how-to-enable-proxy-setting-in-maven/
https://maven.apache.org/guides/mini/guide-proxies.html
Some comments were telling to configure the settings.xml file in the .m2 folder, I configured it like that:
<proxies>
<proxy>
<id>p1</id>
<active>true</active>
<protocol>http</protocol>
<host>hostname</host>
<port>3129</port>
<username>user</username>
<password>password</password>
</proxy>
<proxy>
<id>p2</id>
<active>true</active>
<protocol>https</protocol>
<host>hostname</host>
<port>3443</port>
<username>user</username>
<password>password</password>
</proxy>
</proxies>
Even so it doesn't work.
Has anyone went through this problem, does anyone know how to solve it?
Man, cut this id off and use only http, something like:
<proxy>
<!--<id>optional</id> -->
<active>true</active>
<protocol>http</protocol>
<username>user</username>
<password>passwrod</password>
<host>proxy address without "http://" </host>
<port>proxyport</port>
<nonProxyHosts>*.yourdomain.com</nonProxyHosts>
</proxy>
I put the file setting.xml with this configuration only in my .m2 folder and works like a charm to me.
I am working on a java maven project in eclipse using the m2e plugin. I configured maven plugin with eclipse but some problems occurred.
1.
Alfesco maven sdk link is not working in eclipse its not downloading the required Archetype which is alfresco- amp archtype.
I searched them alot bu I am new to maven and eclipse and, after a day of googling, I still haven't managed to find a solution for this.
Update
Maven Settings are given as follows is there any problem in maven settings. Is there any problem with local repository/catalog then how to change it?
Setttings.xml:
http://maven.apache.org/xsd/settings-1.1.0.xsd">
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>172.16.0.9</host>
<port>8080</port>
</proxy>
</proxies>
</settings>
I am working on Spring MVC web-abblication and I need it to work on Jetty server (Jetty should be Servlet Cobtainer).
I addded Jetty server to my app by "Edit run configuration".
Edit Run Config
Here are application server settings:
App server settings
But, when I launch my application IDEA gives me this:
"C:\Program Files\Java\jdk1.8.0_65\bin\java" -DSTOP.PORT=0 -Dcom.sun.management.jmxremote= -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -DOPTIONS=jmx -Didea.launcher.port=7535 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.4\bin" -Dfile.encoding=windows-1251 -classpath "D:\jetty-distribution-9.3.7.v20160115\start.jar;C:\Program Files\Java\jdk1.8.0_65\lib\tools.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.4\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.eclipse.jetty.start.Main --module=jmx C:\Windows\Temp\context4config\jetty-contexts.xml
[2016-03-03 07:17:55,511] Artifact DVDExchange:war exploded: Server is not connected. Deploy is not available.
Detected server http port: 8080
java.nio.file.AccessDeniedException: C:\Windows\Temp\context4config\jetty-contexts.xml
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:90)
at sun.nio.fs.WindowsLinkSupport.getRealPath(WindowsLinkSupport.java:259)
at sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:836)
at sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:44)
at org.eclipse.jetty.start.FS.toRealPath(FS.java:165)
at org.eclipse.jetty.start.StartArgs.addUniqueXmlFile(StartArgs.java:217)
at org.eclipse.jetty.start.StartArgs.resolveExtraXmls(StartArgs.java:1123)
at org.eclipse.jetty.start.Main.processCommandLine(Main.java:342)
at org.eclipse.jetty.start.Main.main(Main.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Usage: java -jar start.jar [options] [properties] [configs]
java -jar start.jar --help # for more information
Disconnected from server
Process finished with exit code -9
Maybe one of the reasons is epmpty jetty-web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
</Configure>
But actually how Should I make jetty work with Spring web-app in proper way.
Could someone give complete list if things I have to do. Well structured and detailed tutorial would the best answer. I really need to handle that jetty.
Thanks in advance!
This question would suffice your needs,
Debug web app in IntelliJ, webapp built by maven, run by jetty
You need to add the embedded maven-jetty plugin to your pom.xml and run the maven goals to start the jetty server, mvn jetty:run
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.8.v20121106</version>
<configuration>
<contextPath>/</contextPath>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<!--<port>8085</port>-->
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<stopKey>stop</stopKey>
<stopPort>8089</stopPort>
</configuration>
</plugin>
</plugins>
</build>
I Created a Maven project following this tutorial, and it worked properly. Now when I create a Maven project again, it gives the following error.
Could anyone help me to solve this issue?
I found same error and resolved using this question of StackOverflow
solution-1 (please follow this link for further assistance)
By following below steps
Open Window > Preferences
Open Maven > Archetypes
Click 'Add Remote Catalog' and add the
following:
Catalog File: http://repo1.maven.org/maven2/archetype-catalog.xml
Description: maven catalog
Maven > User Setting > c:\Users\xxxxxxxx.m2\settings.xml
If you are a proxy, you need this configuration:
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
| -->
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>******</username>
<password>*******</password>
<host>*****proxy_host*****</host>
<port>8080</port>
</proxy>
</proxies>
When I'm trying to use Robolectric I got following errors (I can't paste more, because I'm new here). How can I solve it?
Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/android-all-4.3_r2-robolectric-0.pom from repository central at
http://repo1.maven.org/maven2
[WARNING] Unable to get resource 'org.robolectric:android-all:pom:4.3_r2-robolectric-0' from repository sonatype
https://oss.sonatype.org/content/groups/public/
Error transferring file: Connection refused: connect
UPDATE:
I solved my problem. Using proxy caused that.
You should write correct proxy settings for maven.
Create settings.xml file in your ~/.m2 directory
<settings>
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host></host>
<port></port>
<username></username>
<password></password>
</proxy>
</proxies>
</settings>
You can read additional info here https://maven.apache.org/guides/mini/guide-proxies.html