# Gatling Java Maven don't work

**URL:** <https://community.gatling.io/t/gatling-java-maven-dont-work/4460>\
**Category:** Gatling (Open-Source)\
**Created:** [August 22, 2018, 11:54am UTC](https://community.gatling.io/t/gatling-java-maven-dont-work/4460 "2018-08-22T11:54:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Sheykin](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Alexander\_Sheykin](https://community.gatling.io/u/Alexander_Sheykin)\
**Post date:** [August 22, 2018, 11:54am UTC](https://community.gatling.io/t/gatling-java-maven-dont-work/4460/1 "2018-08-22T11:54:47Z")

</div>

Hello!

I tried run gatling using maven but faced with issue. If i use java classes in simmulation class I get error: Caused by: java.lang.IllegalArgumentException: The requested class ‘com.testpackage.SessionSimulation’ can not be found in the classpath or does not extends Simulation.

My pom.xml:

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [August 22, 2018, 1:00pm UTC](https://community.gatling.io/t/gatling-java-maven-dont-work/4460/2 "2018-08-22T13:00:59Z")

</div>

You’ve explicitly disabled gatling-maven-plugin’s compiler. The only situation it makes sense if that you want the scala-maven-plugin to take care of compiling.

That the class was not found can only mean your maven command is wrong and doesn’t trigger scala-maven-plugin’s testCompile goal.

---

<div class="post-metadata">

**Author:** ![Alexander\_Sheykin](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Alexander\_Sheykin](https://community.gatling.io/u/Alexander_Sheykin)\
**Post date:** [August 22, 2018, 2:08pm UTC](https://community.gatling.io/t/gatling-java-maven-dont-work/4460/3 "2018-08-22T14:08:37Z")

</div>

I tried two options:

1. Enable gatling-maven-plugin’s compiler. Run by maven command: **clean gatling:test**

```auto
<build>
        <testSourceDirectory>src/test/scala</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>${scala-maven-plugin.version}</version>          
            </plugin>

            <plugin>
                <groupId>io.gatling</groupId>
                <artifactId>gatling-maven-plugin</artifactId>
                <version>${gatling.maven.version}</version>
                <configuration>
                    <simulationClass>com.testpackage.SessionSimulation</simulationClass>                                  
                </configuration>
            </plugin>
        </plugins>
    </build>

```

```auto

```

```auto
Got error: Caused by: java.lang.ClassNotFoundException: .\target\test-classes\com\testpackage\SessionSimulation

```

```auto

```

```auto

```

```auto
2. Disabled gatling-maven-plugin's compiler and trigger scala-maven-plugin's testCompile goal: **clean test-compile gatling:test**.

```

```auto

```

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [August 22, 2018, 2:26pm UTC](https://community.gatling.io/t/gatling-java-maven-dont-work/4460/4 "2018-08-22T14:26:40Z")

</div>

Java version?

---

<div class="post-metadata">

**Author:** ![Alexander\_Sheykin](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Alexander\_Sheykin](https://community.gatling.io/u/Alexander_Sheykin)\
**Post date:** [August 22, 2018, 2:35pm UTC](https://community.gatling.io/t/gatling-java-maven-dont-work/4460/5 "2018-08-22T14:35:55Z")

</div>

1.8 . Via sbt works fine.

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [August 22, 2018, 2:40pm UTC](https://community.gatling.io/t/gatling-java-maven-dont-work/4460/6 "2018-08-22T14:40:38Z")

</div>

Works just fine on my side.  
Must be something on your side (typo, missing .scala file extension, etc).

---

<div class="post-metadata">

**Author:** ![Alexander\_Sheykin](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Alexander\_Sheykin](https://community.gatling.io/u/Alexander_Sheykin)\
**Post date:** [August 22, 2018, 2:49pm UTC](https://community.gatling.io/t/gatling-java-maven-dont-work/4460/7 "2018-08-22T14:49:26Z")

</div>

I created maven project using io.gatling.highcharts:gatling-highcharts-maven-archetype. Didn’t add anything else in project structure. Сan you please give an example: file structure and pom.xml.

---

<div class="post-metadata">

**Author:** ![Alexander\_Sheykin](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Alexander\_Sheykin](https://community.gatling.io/u/Alexander_Sheykin)\
**Post date:** [August 22, 2018, 9:01pm UTC](https://community.gatling.io/t/gatling-java-maven-dont-work/4460/8 "2018-08-22T21:01:59Z")

</div>

I refactored pom.xml and everything have worked. I don’t know how 🙂 Excuse for troubling. Thanks for the help.
