How to set scala compiler version used by gatling maven plugin

576 views
Skip to first unread message

Rajiv Jivan

unread,
Apr 28, 2016, 3:34:40 PM4/28/16
to Gatling User Group
When running the target gatling:execute the plugin is looking for scala compiler 2.11.6 even though I have set the scala version to 2.11.7 in my POM.  Is there a way to set the compiler version to 2.11.7? My POM is 
<?xml version="1.0" encoding="UTF-8"?>
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.test</groupId>
  <artifactId>gatling</artifactId>
  <version>1.0-SNAPSHOT</version>

  <properties>
    <junit.version>4.11</junit.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <gatling.version>2.1.7</gatling.version>
    <gatling-plugin.version>2.1.7</gatling-plugin.version>
    <slf4j.version>1.7.12</slf4j.version>
    <log4j2.version>2.3</log4j2.version>
    <scala.version>2.11.7</scala.version>
    <scala.maven-plugin.version>3.2.2</scala.maven-plugin.version>
  </properties>

  <dependencies>
   

    <!-- LOGGING DEPENDENCIES -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>

    <!-- TEST DEPENDENCIES -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.gatling.highcharts</groupId>
      <artifactId>gatling-charts-highcharts</artifactId>
      <version>${gatling.version}</version>
    </dependency>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>
      <version>${scala.version}</version>
    </dependency>
  </dependencies>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-library</artifactId>
        <version>${scala.version}</version>
      </dependency>
      <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-compiler</artifactId>
        <version>${scala.version}</version>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>

      <plugin>
        <groupId>io.gatling</groupId>
        <artifactId>gatling-maven-plugin</artifactId>
        <version>${gatling-plugin.version}</version>
        <dependencies>
          <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-compiler</artifactId>
            <version>${scala.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <configFolder>src/main/resources</configFolder>
          <dataFolder>src/main/resources/data</dataFolder>
          <simulationsFolder>src/main/scala/com/test/gatling/simulation</simulationsFolder>
          <resultsFolder>target/gatling/results</resultsFolder>
        </configuration>

        <executions>
          <execution>
            <goals>
              <goal>execute</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- Required because Scala-classes now need to be built by maven and not by Gatling -->
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
        <version>${scala.maven-plugin.version}</version>
        <dependencies>
          <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-compiler</artifactId>
            <version>${scala.version}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <scalaVersion>${scala.version}</scalaVersion>
          <jvmArgs>
            <jvmArg>-Xms64m</jvmArg>
            <jvmArg>-Xmx1024m</jvmArg>
          </jvmArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.3</version>
        <executions>
          <!-- Run shade goal on package phase -->
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <!-- Exclude Manifest signatures to avoid security exceptions -->
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
              <transformers>
                <!-- add Main-Class to manifest file -->
                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                  <mainClass>com.test.gatling.Engine</mainClass>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
Reply all
Reply to author
Forward
0 new messages