【问题标题】:Loading Clojure Leiningen projects in Eclipse在 Eclipse 中加载 Clojure Leiningen 项目
【发布时间】:2013-03-31 00:51:57
【问题描述】:

Clojure/Leiningen/Eclipse(和 Java)newby。我正在尝试让 Eclipse 加载 Clojure/Leiningen 项目,但在搜索 Lein 插件解决方案时,我看到了令人困惑/矛盾的结果。

面向 Java 开发人员的 Eclipse IDE 版本:Juno Service Release 2 版本号:20130225-0426 (Windows 8)

我在 .lein\profiles.clj 中有以下用户配置文件

{:user {:plugins [ [lein-eclipse "1.0.0"]
]}}

还有以下 Leiningen 项目文件:

(defproject firstclojureproj "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [
                [org.clojure/clojure "1.5.1"]
                [lein-eclipse "1.0.0"]
                ]
)

做一个 lein 帮助我得到以下(我认为这是我的问题的根源)

leiningen.eclipse  Problem loading: Could not locate clojure/contrib/duck_streams__init.class or clojure/contrib/duck_streams.clj on classpath:

此外,当我尝试将/现有项目导入工作区/并选择包含我的 Leiningen 项目的文件夹时,该文件夹显示为灰色并带有一个复选框,我无法选择它。

【问题讨论】:

标签: clojure leiningen


【解决方案1】:

不需要特殊的插件。

创建一个 Maven pom 文件:

→ lein pom
Wrote /home/jhoetzel/clojure/hellop/pom.xml

使用 Maven eclipse:eclipse 目标生成 Eclipse 配置文件:

→ mvn eclipse:eclipse
[INFO] Wrote Eclipse project for "hellop" to /home/juergen/clojure/hellop.

【讨论】:

    【解决方案2】:

    [no-man-is-an-island/lein-eclipse "2.0.0"] 添加到project.clj 下的:plugins。然后运行:

    >lein deps
    >lein eclipse
    

    输出应该是:

    Created .classpath
    Created .project
    

    您现在可以在 Eclipse(逆时针)中将您的项目文件夹作为“现有项目到工作区”导入。

    【讨论】:

      【解决方案3】:

      lein-eclipse 插件是 leiningen 的插件,用于生成 eclipse 项目文件。它位于 project.clj 文件的 :plugins 部分。

      :plugins [[lein-eclipse "x.y.z"]]
      

      (假设您使用的是 lein 2.1.x+)

      lein-eclipse "1.0.0" 已经过时了(3 年),无法与现代版本的 leiningen 一起使用。 clojars 上有一个“2.0.0”版本,尽管我还没有仔细研究过它是否更好用。

      【讨论】:

      • 其实是 [no-man-is-an-island/lein-eclipse "2.0.0"] lein eclipse 现在构建了 .project 和 .classpath,加载到 Eclipse 中。
      猜你喜欢
      • 2017-07-29
      • 1970-01-01
      • 2011-10-31
      • 2017-04-17
      • 1970-01-01
      • 2013-09-04
      • 2012-07-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多