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

**URL:** https://clojureverse.org/t/why-clojure-maven-plugin-does-not-create-target-test-clojure-core-test-clj-file-to-be-able-to-rt-loadresourcescript-it/6073
**Category:** Beginners
**Created:** [June 8, 2020, 10:06pm UTC](https://clojureverse.org/t/why-clojure-maven-plugin-does-not-create-target-test-clojure-core-test-clj-file-to-be-able-to-rt-loadresourcescript-it/6073 "2020-06-08T22:06:27Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![4mitch](https://clojureverse.org/user_avatar/clojureverse.org/4mitch/32/1255_2.png) [@4mitch](https://clojureverse.org/u/4mitch)
#### Post date: [June 8, 2020, 10:06pm UTC](https://clojureverse.org/t/why-clojure-maven-plugin-does-not-create-target-test-clojure-core-test-clj-file-to-be-able-to-rt-loadresourcescript-it/6073/1 "2020-06-08T22:06:27Z")

</div>

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 ☹  
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?

---

<div class="post-metadata">

### Author: ![Phill](https://clojureverse.org/letter_avatar_proxy/v4/letter/p/779978/32.png) [@Phill](https://clojureverse.org/u/Phill)
#### Post date: [June 8, 2020, 11:15pm UTC](https://clojureverse.org/t/why-clojure-maven-plugin-does-not-create-target-test-clojure-core-test-clj-file-to-be-able-to-rt-loadresourcescript-it/6073/2 "2020-06-08T23:15:19Z")

</div>

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/`?

---

<div class="post-metadata">

### Author: ![4mitch](https://clojureverse.org/user_avatar/clojureverse.org/4mitch/32/1255_2.png) [@4mitch](https://clojureverse.org/u/4mitch)
#### Post date: [June 9, 2020, 10:23am UTC](https://clojureverse.org/t/why-clojure-maven-plugin-does-not-create-target-test-clojure-core-test-clj-file-to-be-able-to-rt-loadresourcescript-it/6073/3 "2020-06-09T10:23:16Z")

</div>

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

```auto
<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>

```

---

<div class="post-metadata">

### Author: ![system](https://clojureverse.org/uploads/default/original/2X/5/51079bf9e4b7d9466242c06cf1e43b9f8bd6da14.png) [@system](https://clojureverse.org/u/system)
#### Post date: [December 8, 2020, 10:23pm UTC](https://clojureverse.org/t/why-clojure-maven-plugin-does-not-create-target-test-clojure-core-test-clj-file-to-be-able-to-rt-loadresourcescript-it/6073/4 "2020-12-08T22:23:17Z")

</div>

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