gpt4 book ai didi

java - Emacs Java 马拉巴模式

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:02:18 24 4
gpt4 key购买 nike

我在 Emacs 中为我的 java 项目使用 JDEE。 JDEE 不适用于 Maven。最近我遇到了 Malabar 模式,它更好地支持 Emacs 中基于 Maven 的 Java 项目。

我设法在 M-x list-packages 中使用 melpa 安装了 malbar-mode。但是当我在我的简单应用程序的 mvn package 上收到错误消息时 https://github.com/vijayendra/JavaSrc/tree/master/my-app

Projects.get('/home/egnyte/src/my-app/pom.xml', []).run(['package'], [], [:])
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building my-app Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.081s
[INFO] Finished at: Sat Dec 06 23:55:22 PST 2014
[INFO] Final Memory: 20M/48M
[INFO] ------------------------------------------------------------------------
[ERROR] Execution error
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for or\
g.apache.maven.plugins:maven-resources-plugin:jar:2.5
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:129)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:142)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:261)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:185)

我的emacs版本如下:

emacs -version
GNU Emacs 24.3.1
Copyright (C) 2013 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

我的.emacs文件如下:

(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa-stable" . "http://stable.melpa.org/packages/") t)
;; unstable packages
;; (add-to-list 'package-archives
;; '("melpa" . "http://melpa.org/packages/") t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line

(require 'cedet)
(require 'semantic)
(load "semantic/loaddefs.el")
(semantic-mode 1)
(setq malabar-groovy-lib-dir "~/.m2/repository/com/software-ninja/malabar/1.5.10")
(require 'malabar-mode)
(add-to-list 'auto-mode-alist '("\\.java\\'" . malabar-mode))

我的maven版本如下:

mvn -version
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T13:58:10-07:00)
Maven home: /home/egnyte/lib/apache-maven-3.2.3
Java version: 1.7.0_65, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.8.0-29-generic", arch: "amd64", family: "unix"

我怎样才能让马拉巴尔模式工作?

最佳答案

有两个答案。

首先,malabar-mode 停留在 maven 3.0.4,所以请尝试该版本。也不要设置 lib 目录。它应该自动设置。

其次,为了避开 maven 版本,我从头开始重写 malabar-mode。按照 https://github.com/m0smith/malabar-mode/blob/develop/doc/2.0/INSTALL.md 上的说明进行操作.这个版本应该适用于 3.0.4 之后的所有版本的 maven。这是一项正在进行的工作,尚未提供所有功能。
如果您有问题或建议,请在 GitHub 存储库中创建问题,因为现在是表达您的愿望的好时机

编辑:malabar 2.0 已发布到 MELPA。现在安装:

```

(load-file "~/projects/cedet/cedet-devel-load.el")
(add-hook 'after-init-hook (lambda ()
(message "activate-malabar-mode")
(activate-malabar-mode)))

(add-hook 'malabar-java-mode-hook 'flycheck-mode)
(add-hook 'malabar-groovy-mode-hook 'flycheck-mode)

```

关于java - Emacs Java 马拉巴模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27340830/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com