i'm trying to publish a Pact-File to my Pact-Broker with maven-plugin this way (taken from github Pact-Project):
<build>
<plugins>
<plugin>
<groupId>au.com.dius</groupId>
<artifactId>pact-jvm-provider-maven_2.12</artifactId>
<version>3.5.11</version>
<configuration>
<pactDirectory>${project.build.directory}/pacts</pactDirectory>
<pactBrokerUrl>mybrokerurl.de</pactBrokerUrl>
<projectVersion>${project.version}</projectVersion>
<trimSnapshot>true</trimSnapshot> <!-- Defaults to false -->
</configuration>
</plugin>
</plugins>
</build>
If i try to execute the maven build with pact:publish, i get following error:
Failed to execute goal au.com.dius:pact-jvm-provider-maven_2.12:3.5.11:publish (default-cli) on project myproject-test: Execution default-cli of goal au.com.dius:pact-jvm-provider-maven_2.12:3.5.11:publish failed: A required class was missing while executing au.com.dius:pact-jvm-provider-maven_2.12:3.5.11:publish: kotlin.TypeCastException
Top of Stack-Trace:
Error injecting: au.com.dius.pact.provider.maven.PactPublishMojo
java.lang.NoClassDefFoundError: kotlin.TypeCastException
at java.lang.J9VMInternals.prepareClassImpl(Native Method)
Pact-File Creation with a JUnit-Tests works fine, so I assumed i had the correct dependencies and required files in classpath.
What am I missing? It seems, the kotlin.TypeCastExeption-Class is in package
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-runtime</artifactId>
so i tried to add the dependency (version 1.2.0) to my pom after i got this error - but this didn't help.
Does anyone know a solution for my problem?