eclipse-jdtls / eclipse.jdt.ls

Java language server
1.75k stars 392 forks source link

Run server in a container #183

Open gorkem opened 7 years ago

gorkem commented 7 years ago

Create a docker container that includes and runs the JDT LS server.

PavelSosin commented 7 years ago

Meanwhile, I'm trying to use named pipes communication in Ubuntu but JDT.LS server is unable to establish connection with readSocket. "Connection refused" is always reported. What is the reason to use org.newsclub.net.unix.AFUNIXSocket library in Linux instead of plain java pipe?

gorkem commented 7 years ago

Plain java APIs have limitations on windows.

PavelSosin commented 7 years ago

But plain java api is used in the case of Windows and in the case of Linux/Unix junixsocket ... if(isWindows()){ RandomAccessFile readFile = new RandomAccessFile(rFile, "rwd"); return Channels.newInputStream(readFile.getChannel()); }else{ AFUNIXSocket readSocket = AFUNIXSocket.newInstance(); readSocket.connect(new AFUNIXSocketAddress(rFile)); return readSocket.getInputStream(); } I expected !isWindows()

gorkem commented 7 years ago

Right. In the early days server would start one of the pipes and client would start the other. We later simplified and moved the responsibility of both to client. I guess we no longer need the AFUNIXSockets. You are welcome to send a PR for removing them.

PavelSosin commented 7 years ago

The following question shell be delegated to the M2E plugin developers but I see that some persons contributed to both projects

How to configure M2E plugin in headless Eclipse without full Eclipse installation? I mean:

  1. Maven repositories
  2. Profiles/Active profile
  3. Proxies

I copied my local maven configuration including settings.xml and add M2_HOME to the environment but it doesn't help - maven looks only at central repository <https://repo.maven.apache.org/maven2)>. I suppose some Eclipse/M2E configuration files shell be updated to accommodate Maven configuration, like in this document: Maven Eclipse Plugin: Usage

fbricon commented 7 years ago

@PavelSosin Generally speaking, if you want to configure m2e settings for an existing eclipse product you need to add org.eclipse.m2e.core/eclipse.m2.userSettingsFile=/path/to/settings.xml to a plugincustomization.ini defined by the product. For instance, Eclipse Java EE has a plugins\org.eclipse.epp.package.jee*\plugin_customization.ini

Now eclipse.jdt.ls doesn't define such customization file, so we don't support it. I believe we should expose a property setting instead, that would be set during calls to workspace/didChangeConfiguration. We'd then basically have to call MavenConfigurationImpl. setUserSettingsFile.

I believe that makes sense to provide that support for when running eclipse.jdt.ls inside a container/cloud environment.

PavelSosin commented 7 years ago

Thanks for hint but I solved it in another way. Since I don't want to modify, i.e. branch original jdt.ls code unless it contains obvious bugs and prefer to use standard product produced by jdt.ls' pom.xml file I had to find the proper maven environment configuration. Finally, I found that if I put our std corporate settings.xml file into the .m2 directory of tomcat (which creates jsd.ls process), then maven gets the desired settings and, even, access the necessary repositories. So, in such simple way I can overcome all restrictions of proxy, corporate network, etc. P.S. M2eclipse plugin code / pom was the last thing which I would like to touch.