Why clojure-maven-plugin does not create target/test/clojure/core_test.clj file to be able to RT.loadResourceScript it?

I am playing with mixed Java/Clojure setup. And my idea was to start using clojure from Test part first.
I am thinking of calling some clojure tests from Java, like in examples with src/main/clojure/ part

For example, to have /src/test/java/MyTest.java with following code:

// running my clojure code
RT.loadResourceScript("com/mycompany/app/core_test.clj");
IFn test = RT.var("com.mycompany.app.core-test", "-test");
System.out.println( test.invoke(42) );

But problem is that I cannot make maven-clojure-plugin to put core_test.clj file to target/test-classes/com/mycompany/app folder :frowning:
All .class files are there after mvn clojure:testCompile, but not .clj (in contrast with core.clj which is copied to /target/classes/com/mycompany/app folder as expected)

Or am I wrong and clojure tests are not supposed to be called from Java code like this?

It seems like the sort of thing that should be possible.

Where is com/mycompany/app/core_test.clj? Is it in src/test/resources/?

Ok, I found a way. Just added this to pom.xml

<plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-resources-plugin</artifactId>
         <version>3.1.0</version>
         <executions>
           <execution>
             <id>test-resources</id>
             <phase>compile</phase>
             <goals>
               <goal>testResources</goal>
             </goals>
           </execution>
         </executions>
</plugin>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.