Maven support dropped?

226 views
Skip to first unread message

George Leontiev

unread,
Aug 6, 2012, 6:43:35 AM8/6/12
to ens...@googlegroups.com
Hello.
I've noticed, that starting from version 0.9.6 maven support stopped working. The last version, I'm able to use with maven projects is ensime_2.9.2-RC1-0.9.3.RC4.
By "stopped working" I mean following:
When I try to start ensime for the new project, it correctly detects, that it is a maven project, and proceeds with creating an .ensime file. When I run it with M-x ensime afterwards, it starts in seconds (which is cool, of course), but seems to be only compiling the source file, opened in current buffer. It also won't see project's classpath.
Is this a known issue? Will maven support be reenabled in the future?

Aemon Cannon

unread,
Aug 6, 2012, 11:29:59 AM8/6/12
to ens...@googlegroups.com
Hi George, 

Yes, you are correct that the internal support for maven was removed. I'm sorry there wasn't really an announcement.
Going forward, I'd like to generate .ensime files externally, as in the sbt project plugin.

Here's a little python script that prints a very basic project to stdout (obviously a proper maven plugin would be preferred):


##########################
import subprocess

def runProcess(exe):
  p = subprocess.Popen(exe, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
  while(True):
    retcode = p.poll() #returns None while subprocess is running
    line = p.stdout.readline()
    yield line
    if(retcode is not None):
      break

def deps(scope):
  def goodLineP(line):
    return (line and not line.isspace() and
            not line.startswith("[INFO]") and
            not line.startswith("Downloading") and
            not line.startswith("Downloaded"))
  cmd = "mvn dependency:build-classpath -DincludeScope=%s" % scope
  output_lines = [line.strip() for line in runProcess(cmd)
                  if goodLineP(line)]
  return output_lines

def quote(obj):
  return "\"" + str(obj) + "\""

def mkStringList(lst):
  return " ".join([quote(ea) for ea in lst])


projectName = quote("my-app")
compileDeps = mkStringList(deps("") + deps("compile"))
runtimeDeps = mkStringList(deps("runtime"))
testDeps = mkStringList(deps("test"))


print """(
:name %s
:compile-deps (%s)
:runtime-deps (%s)
:test-deps (%s)
)
""" % (projectName, compileDeps, runtimeDeps, testDeps)


##################################################

Aemon Cannon

unread,
Aug 6, 2012, 12:30:19 PM8/6/12
to ens...@googlegroups.com

Aemon Cannon

unread,
Aug 6, 2012, 12:34:49 PM8/6/12
to ens...@googlegroups.com

Aemon Cannon

unread,
Aug 6, 2012, 12:36:38 PM8/6/12
to ens...@googlegroups.com

George Leontiev

unread,
Aug 7, 2012, 11:18:28 AM8/7/12
to ens...@googlegroups.com
Hey.
Thanks for the script, I'll use it for now.
Reply all
Reply to author
Forward
0 new messages