nlloyd / SublimeMaven

Sublime Text 2 Plugin providing integration with the Apache Maven build and project management tool
42 stars 14 forks source link

Generate classpath for SublimeJava plugin (if present) #5

Closed nlloyd closed 12 years ago

nlloyd commented 12 years ago

SublimeJava code completion plugin relies on a configured classpath. Good idea to have this plugin check if the SublimeJava plugin exists, and if it does to configure its classpath setting using maven dependencies (all in the repo? all the latest of any given version in the repo? Not yet sure...).

nlloyd commented 12 years ago

Classpath generated is a merged classpath of all dependencies in all poms in the selected directory path. Not ideal but need to sync up with SublimeJava plugin folks for an improved approach.

ziggurat commented 12 years ago

I can't figure out how this works? Should I run a command to have the classpath file generated? How do I set the classpath configuration option of the SublimeJava plugin? Where do I get the generated classpaths based on the poms?

Thanks in advance!

nlloyd commented 12 years ago

Gah, I need to write more documentation. Right click on a folder in the sidebar and is either the folder containing the pom.xml file you care about (or one of its parents). There will be a Maven>Generate Projects from all POMs in path. It will ask you a few simple questions (just hit enter for defaults). Depending on how many pom.xml files are in the tree rooted at the directory you specified this can take a while. Then a new view will appear with a sublime-project configuration for you to evaluate and save/load... classpath will be in there. Note for SublimeJava there are a few silly things you will have to do to get this to work properly... you might be best using my fork of SublimeJava (or at least applying the changes in a very recent "fixed default classpath always used" commit i made to the fork).

I am working on the SublimeJava fork right now to add some brains.

nlloyd commented 12 years ago

Also: instead of getting a single classpath-per-pom you will get a classpath for all pom files in the path specified. My first goal for my forked SublimeJava changes are to add a multiclasspath handling capability (basically: im working on file X in project Y, tell SublimeJava to use classpath for project Y).

ziggurat commented 12 years ago

Beautiful, can I install your fork using Package Manager?

I have a new problem now :) it seems something is not ok with my python installation: SAXReaderNotAvailable: No parsers found

nlloyd commented 12 years ago

sigh Nope. Unfortunately SublimeJava, even the regular one (check his doc) doesn't play nice with Package Manager right now. You will have to cd to your Packages path and do a manual git clone in there.

Apparently he is working with the Package Manager creator on the problem.

i-am-a-paull commented 12 years ago

Ooh, it'll be nice when your multiple classpaths feature gets merged in. Right now with my gradle plugin I can only generate a project file for a project folder and the folders of its dependency projects for fear of classpath conflicts.

I thought about hacking on SublimeJava myself at one point, but I haven't had the time to properly look through it.

nlloyd commented 12 years ago

Yeah I see it as a limitation with SublimeJava, particularly since certain OS (cough windows cough) don't play nice with long classpaths given on the command line, as SublimeJava expects currently.