2013-09-30 97 views
0

我試圖從IntelliJ和「La Clojure」插件執行一個簡單的Clojure測試。Clojure編譯器錯誤:沒有這樣的文件或目錄

當我嘗試編譯Clojure的文件(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))) 
+0

您可以包括ABSOLUTEPATH,至少從項目目錄起? – Jared314

+0

@ Jared314 ABSOLUTEPATH是/ Users/my-computer-username/Documents/projects/company-name/projects/project-name/module-name/src/test/clojure/com/nameofthepackage /。我重命名了一些目錄,但是結構是一樣的。 –

+0

您的測試目錄是否設置爲模塊屬性中的Test Sources目錄? – Jared314

回答

0

最後,我發現這是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> 
相關問題