Clojure编译器错误:没有这样的文件或目录
我正在尝试从IntelliJ和“La Clojure”插件执行一个简单的Clojure测试 当我试图编译Clojure文件(helloTest.clj)时,我遇到以下错误:Clojure编译器错误:没有这样的文件或目录,clojure,intellij-idea,la-clojure,Clojure,Intellij Idea,La Clojure,我正在尝试从IntelliJ和“La Clojure”插件执行一个简单的Clojure测试 当我试图编译Clojure文件(helloTest.clj)时,我遇到以下错误: Clojure Compiler: java.io.IOException: No such file or directory, compiling:(/ABSOLUTEPATH/helloTest.clj:1) 但是,当我通过终端检查绝对路径时,我可以看到helloTest.clj文件存在 那么,如果文件存在,编译器怎
Clojure Compiler: java.io.IOException: No such file or directory, compiling:(/ABSOLUTEPATH/helloTest.clj:1)
但是,当我通过终端检查绝对路径时,我可以看到helloTest.clj文件存在
那么,如果文件存在,编译器怎么可能找不到它呢
为了以防万一,我添加了helloTest.clj文件的内容:
(ns com.nameofthepackage.helloTest
(:use clojure.test))
(deftest test1
(is (= 1 3)))
(deftest test2
(is (= 2 2)))
这个问题在IDEA 13的插件中得到了修复,对于IDEA 12插件(以及解决方法),请参见最后,我发现clojure插件存在Maven问题 我已经将这个配置添加到pom.xml中,然后它就工作了
<plugin>
<groupId>com.theoryinpractise</groupId>
<artifactId>clojure-maven-plugin</artifactId>
<version>1.3.13</version>
<extensions>true</extensions>
<configuration>
<sourceDirectories>
<sourceDirectory>src/main/clojure</sourceDirectory>
</sourceDirectories>
<testSourceDirectories>
<sourceDirectory>src/test/clojure</sourceDirectory>
</testSourceDirectories>
</configuration>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test</id>
<phase>verify</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
理论与实践
clojure maven插件
1.3.13
真的
src/main/clojure
src/test/clojure
编译
编译
编译
测试
验证
测试
您能否至少从项目目录中包括绝对路径?@Jared314绝对路径是/Users/my computer username/Documents/projects/company name/projects/project name/module name/src/test/clojure/com/nameofpackage/。我已经重命名了一些目录,但其结构是相同的。您的测试目录是否在模块属性中设置为测试源目录?@Jared314是的,我已将“clojure”目录设置为“测试源根目录”,也许这有助于包含更多的堆栈跟踪