I am trying to import a maven based project in IntelliJ.
I can only partially resolve dependences if I am not connected to another host (call it dev-serv
) with lies on a less secure network.
I use sshuttle
to create tunnel between my computer and dev-serv
with the following command :
sshuttle --dns -vr dev-serv -x LOCAL_NETWORK 0.0.0.0/0 -x 127.0.0.1/8
When I try to import the project using IntelliJ, clicking "next" does nothing on the import screen, and IntelliJ logs record an exception :.
2017-12-11 16:47:05,983 [ 18630] ERROR - llij.ide.plugins.PluginManager - IntelliJ IDEA 2017.3 Build #IU-173.3727.127
2017-12-11 16:47:05,983 [ 18630] ERROR - llij.ide.plugins.PluginManager - JDK: 1.8.0_152-release
2017-12-11 16:47:05,983 [ 18630] ERROR - llij.ide.plugins.PluginManager - VM: OpenJDK 64-Bit Server VM
2017-12-11 16:47:05,983 [ 18630] ERROR - llij.ide.plugins.PluginManager - Vendor: JetBrains s.r.o
2017-12-11 16:47:05,983 [ 18630] ERROR - llij.ide.plugins.PluginManager - OS: Mac OS X
2017-12-11 16:47:05,983 [ 18630] ERROR - llij.ide.plugins.PluginManager - Last Action:
2017-12-11 16:47:25,937 [ 38584] WARN - ution.rmi.RemoteProcessSupport - java.rmi.NotBoundException: _DEAD_HAND_
2017-12-11 16:47:25,938 [ 38585] WARN - ution.rmi.RemoteProcessSupport - at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:209)
2017-12-11 16:47:25,938 [ 38585] WARN - ution.rmi.RemoteProcessSupport - at com.intellij.execution.rmi.RemoteServer.start(RemoteServer.java:92)
2017-12-11 16:47:25,938 [ 38585] WARN - ution.rmi.RemoteProcessSupport - at org.jetbrains.idea.maven.server.RemoteMavenServer.main(RemoteMavenServer.java:22)
2017-12-11 16:48:18,021 [ 90668] WARN - ution.rmi.RemoteProcessSupport - The cook failed to start due to java.io.EOFException
2017-12-11 16:48:18,027 [ 90674] ERROR - llij.ide.plugins.PluginManager - Cannot reconnect.
java.lang.RuntimeException: Cannot reconnect. at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:82)
Importing the projet to IntelliJ without sshuttle running works fine (but some dependences are not resolved).
The project can be compiled and run fine using maven on the command line.
This is related to a bug in sshuttle v0.78.3 with MacOs firewall (pf). This is solved in v0.78.4 - UNRELEASED of sshuttle.
To install the correct version of sshuttle :
git clone https://github.com/sshuttle/sshuttle.git
cd sshuttle
python3 -m venv .
source bin/activate
./setup.py install
To run sshuttle :
deactivate
./bin/sshuttle mysshuser@mysshserver
Hope it can help someone else.