maven.help - Run help:describe for plugin at point.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Fri, 28 Feb 2014 16:38:33 +0200
changeset 1108 8e730890ac85
parent 1107 cc1303629cde
child 1109 09d967bff50f
maven.help - Run help:describe for plugin at point.
maven-central.el
--- a/maven-central.el	Tue Feb 04 21:52:43 2014 +0200
+++ b/maven-central.el	Fri Feb 28 16:38:33 2014 +0200
@@ -130,6 +130,24 @@
       (maven-central.versions groupId artifactId))
     ))
 
+(defvar maven.command "mvn")
+
+(defvar maven.help-buffer-name "*Maven Help*")
+
+(defun maven.help ()
+  "Run help:describe for plugin at point."
+  (interactive)
+  (let (dependency groupId artifactId)
+    (setq dependency (maven-central.parse-pom-dependency))
+    (setq groupId (elt dependency 0))
+    (setq artifactId (elt dependency 1))
+    (if (not (and groupId artifactId))
+        (message "Can't find `groupId' or `artifactId'")
+      (shell-command
+       (format "%s help:describe -DgroupId=%s -DartifactId=%s" maven.command groupId artifactId)
+       (switch-to-buffer maven.help-buffer-name)) )
+    ))
+
 ;; (maven-central.last-version "junit" "junit")
 
 (provide 'maven-central)