Skip to content

upgradingdave/maven-mode

Repository files navigation

maven-mode

mvn-mode is a mode for emacs to make working with maven more fun.

Watch the JavaJing Emacs Maven Mode Demo for a quick overview.

Keybindings

All keybindings in maven-mode start with `C-c m` and then a two letter nmemonic shortcut

`ds` (dependency search)
Perform a search against http://search.maven.org for an artifact, choose artifact from results, then choose a version, and then the dependency xml is generated and inserted into current buffer.
`dx` (depenedency xml)
Good for when you know the groupId, artifactId and version and want to generate the dependency xml snippet. For example, enter `log4j:log4j:1.2.17` to generate dependency xml and insert it into current buffer.
`do` (depenedency order)
All dependencies (including dependencies inside dependencyManagement section) will be sorted alphabetically first by groupid, and then by artifactid. Dependencies with scope “test” are put first.

Development

Fetch submodules

cd /path/to/maven-mode
git submodule init
git submodule update

Run ert tests to unit test

Make sure to run `ert` from within test directory.

(require 'mvn-mode-tests)
(ert "^mvn-")

Run features to test high level api

Run the features with ecukes. Currently, if you run ecukes in the terminal, the features don’t work for some reason. But if you run inside current emacs, they work fine.

(add-to-list 'load-path "/path/to/ecukes")
(require 'ecukes)

Then, open any file inside this maven-mode project and run `M-x ecukes`

Credits

Thanks to emacsrocks.com for inspiring me to try and write a emacs minor mode.

ideas for improvements

  • Add functionality to find pom.xml and find depenedency section and add dependencies automtically in correct place
  • Compile using maven
  • Jump to errors: http://www.youtube.com/watch?v=U_t5vLr_jVc
  • Complete as of 200120910 - Add ability to sort dependencies

Releases

No releases published

Packages

No packages published