Re: jde-maven-build
[email protected] (Przemysław Wojnowski)
| Newsgroups | gmane.emacs.jdee.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi! Both versions are for Maven1, which is pretty old and not used very often. Both versions use "maven" command to run Maven, but version of Joshua Spiewak also can run Maven through maven-console-plugin, which is not available in Maven2 anymore. Since both versions run Maven through command, they both can be easly modified to work with Maven2 (patches attached). Both this files have basic support for Maven - just run maven command on project file with specified goal (task). Both use compilation mode, so user can jump to compilation errors in files. I think that merging this two files and adding some pom parser to generate JDEE settings for project would be enough to include in JDEE. I'll look at this in next few days. Regards, Przemek ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ jdee-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jdee-devel
jde-maven-herzog.diff
(text/x-diff, 3.1 KB)
diff -c /tmp/jde-maven.el /media/disk/projekty/jdee/jde-maven.el
*** /tmp/jde-maven.el 2009-08-19 21:25:58.000000000 +0200
--- /media/disk/projekty/jdee/jde-maven.el 2009-08-19 21:28:41.000000000 +0200
***************
*** 85,98 ****
"Build using maven."
:group 'jde
:prefix 'jde-maven)
! (defcustom jde-maven-command "maven"
"The command to run maven"
:group 'jde-maven
:type 'string)
! (defcustom jde-maven-project-file-name "project.xml"
"The name of the maven project file."
:group 'jde-maven
! :type '(choice (const :tag "Default" "project.xml")
(string :tag "String")))
(defcustom jde-maven-prompt-project-file nil
"Prompt for the project file? If this is nil, jde-maven will look
--- 85,98 ----
"Build using maven."
:group 'jde
:prefix 'jde-maven)
! (defcustom jde-maven-command "mvn"
"The command to run maven"
:group 'jde-maven
:type 'string)
! (defcustom jde-maven-project-file-name "pom.xml"
"The name of the maven project file."
:group 'jde-maven
! :type '(choice (const :tag "Default" "pom.xml")
(string :tag "String")))
(defcustom jde-maven-prompt-project-file nil
"Prompt for the project file? If this is nil, jde-maven will look
***************
*** 235,244 ****
(defun jde-maven-build-command-line(project-file goal arguments)
"Build a Maven command line."
! (concat "cd \"" (file-name-directory project-file)
! "\" && " jde-maven-command " -f " (file-name-nondirectory project-file)
! " " arguments " " goal))
!
;;
--- 235,241 ----
(defun jde-maven-build-command-line(project-file goal arguments)
"Build a Maven command line."
! (concat jde-maven-command " " arguments " " goal))
;;
***************
*** 408,419 ****
(set-buffer-modified-p nil))
(insert (jde-maven-build-command-line (if project-file
! project-file
! (jde-maven-get-project-file))
! jde-maven-console-goal
! (if args
! args
! (jde-maven-get-arguments))))
(setq console
(start-process-shell-command jde-maven-console-process-name
jde-maven-console-log-buffer-name
--- 405,416 ----
(set-buffer-modified-p nil))
(insert (jde-maven-build-command-line (if project-file
! project-file
! (jde-maven-get-project-file))
! jde-maven-console-goal
! (if args
! args
! (jde-maven-get-arguments))))
(setq console
(start-process-shell-command jde-maven-console-process-name
jde-maven-console-log-buffer-name
Diff finished. Wed Aug 19 21:29:06 2009
jde-maven-spiewak.diff
(text/x-diff, 6.3 KB)
diff -c /media/disk/projekty/jdee/jde-maven-2-orig.el /media/disk/projekty/jdee/jde-maven-2.el
*** /media/disk/projekty/jdee/jde-maven-2-orig.el 2009-08-19 15:15:58.000000000 +0200
--- /media/disk/projekty/jdee/jde-maven-2.el 2009-08-19 19:06:48.000000000 +0200
***************
*** 74,90 ****
:group 'jde-maven
:type '(repeat (file :tag "Path")))
! (defcustom jde-maven-program "maven"
"*Specifies name of maven program/script."
:group 'jde-maven
:type 'string)
! (defcustom jde-maven-args "--emacs -o"
"*Specifies arguments to be passed to maven."
:group 'jde-maven
:type 'string)
! (defcustom jde-maven-projectfile "project.xml"
"*Specifies the default projectfile to use."
:group 'jde-maven
:type 'string)
--- 74,90 ----
:group 'jde-maven
:type '(repeat (file :tag "Path")))
! (defcustom jde-maven-program "mvn"
"*Specifies name of maven program/script."
:group 'jde-maven
:type 'string)
! (defcustom jde-maven-args "" ;"--emacs -o"
"*Specifies arguments to be passed to maven."
:group 'jde-maven
:type 'string)
! (defcustom jde-maven-projectfile "pom.xml"
"*Specifies the default projectfile to use."
:group 'jde-maven
:type 'string)
***************
*** 138,144 ****
(defcustom jde-maven-enable-find nil
! "*Specify whether jde-maven finds the project.xml file based on your
current directory. If non-nil, we will search up the directory
hierarchy from the current directory for the project definition
file. Also note that, if non-nil, this will relax the requirement for
--- 138,144 ----
(defcustom jde-maven-enable-find nil
! "*Specify whether jde-maven finds the pom.xml file based on your
current directory. If non-nil, we will search up the directory
hierarchy from the current directory for the project definition
file. Also note that, if non-nil, this will relax the requirement for
***************
*** 202,219 ****
(let* ((MAVEN_HOME_ENV (getenv "MAVEN_HOME"))
(maven-home (if (string= "" jde-maven-home)
! (if MAVEN_HOME_ENV (jde-normalize-path MAVEN_HOME_ENV))
! (jde-normalize-path jde-maven-home)))
(delimiter (if (string= (car jde-maven-invocation-method) "Java")
"'"
"\""))
(maven-command
(concat
(if (string= (car jde-maven-invocation-method) "Script")
! (concat
! maven-home
! "/bin/"
! jde-maven-program))
(if (string= (car jde-maven-invocation-method) "Java")
(concat
(jde-get-jdk-prog 'java)
--- 202,216 ----
(let* ((MAVEN_HOME_ENV (getenv "MAVEN_HOME"))
(maven-home (if (string= "" jde-maven-home)
! (if MAVEN_HOME_ENV (jde-normalize-path MAVEN_HOME_ENV))
! (jde-normalize-path jde-maven-home)))
(delimiter (if (string= (car jde-maven-invocation-method) "Java")
"'"
"\""))
(maven-command
(concat
(if (string= (car jde-maven-invocation-method) "Script")
! jde-maven-program)
(if (string= (car jde-maven-invocation-method) "Java")
(concat
(jde-get-jdk-prog 'java)
***************
*** 222,241 ****
(string-match "sh$" shell-file-name))
delimiter)
(jde-maven-build-classpath)
! (if (and (eq system-type 'windows-nt)
! (string-match "sh$" shell-file-name))
! delimiter)))
! ; " -Dmaven.home="
! ; maven-home
! (if (string= (car jde-maven-invocation-method) "Java")
! (concat
! " "
! "org.apache.tools.maven.Main")))))
(if (not (string= projectfile ""))
(setq maven-command
(concat maven-command
! " --find " delimiter
(jde-normalize-path projectfile)
delimiter)))
--- 219,238 ----
(string-match "sh$" shell-file-name))
delimiter)
(jde-maven-build-classpath)
! (if (and (eq system-type 'windows-nt)
! (string-match "sh$" shell-file-name))
! delimiter)))
! ; " -Dmaven.home="
! ; maven-home
! (if (string= (car jde-maven-invocation-method) "Java")
! (concat
! " "
! "org.apache.tools.maven.Main")))))
(if (not (string= projectfile ""))
(setq maven-command
(concat maven-command
! " --file " delimiter
(jde-normalize-path projectfile)
delimiter)))
***************
*** 273,279 ****
"Get a projectfile interactively. This is used so that code that
needs to read a projectfile from interactive can share the same type
of behavior. This will return a new filename which points to the
! project.xml file to use."
(let (projectfile)
(if jde-maven-read-projectfile
--- 270,276 ----
"Get a projectfile interactively. This is used so that code that
needs to read a projectfile from interactive can share the same type
of behavior. This will return a new filename which points to the
! pom.xml file to use."
(let (projectfile)
(if jde-maven-read-projectfile
***************
*** 591,597 ****
"Find the next Maven projectfile upwards in the directory tree from
DIR. Returns nil if it cannot find a project file in DIR or an
ascendant directory."
! (let ((file (find (cond ((string= jde-maven-projectfile "") "project.xml")
(t jde-maven-projectfile))
(directory-files dir) :test 'string=)))
--- 588,594 ----
"Find the next Maven projectfile upwards in the directory tree from
DIR. Returns nil if it cannot find a project file in DIR or an
ascendant directory."
! (let ((file (find (cond ((string= jde-maven-projectfile "") jde-maven-projectfile)
(t jde-maven-projectfile))
(directory-files dir) :test 'string=)))
Diff finished. Wed Aug 19 21:31:02 2009