pact-foundation / pact-jvm

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://docs.pact.io
Apache License 2.0
1.08k stars 479 forks source link

Gradle build failed #235

Closed anurag0249 closed 8 years ago

anurag0249 commented 8 years ago

Hi,

when I am trying to building pact-jvm from cmd by using command "gradlew.bat build". It is failing, Error is given below . Please let me know how can I fix this.

:pact-jvm-consumer_2.11:compileTestScala :pact-jvm-consumer_2.11:processTestResources UP-TO-DATE :pact-jvm-consumer_2.11:testClasses :pact-jvm-consumer_2.11:test

au.com.dius.pact.consumer.PrettyPrinterSpec > header mismatch FAILED org.specs2.reporter.JUnitPrinter$$anon$1 au.com.dius.pact.consumer.PrettyPrinterSpec > path mismatch FAILED org.specs2.reporter.JUnitPrinter$$anon$1 au.com.dius.pact.consumer.PrettyPrinterSpec > body mismatch FAILED org.specs2.reporter.JUnitPrinter$$anon$1 44 tests completed, 3 failed :pact-jvm-consumer_2.11:test FAILED

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 2 mins 55.549 secs

uglyog commented 8 years ago

I've never run the build on windows. I'll need to setup a VM to find out what is happening.

anurag0249 commented 8 years ago

I don't think its OS dependent issue. I am getting same error when building pact-jvm in intellij IDE. As you can see in screenshot. buildfail

uglyog commented 8 years ago

That test works on Linux and OSX, so it must be a windows specific failure. It might be due to windows line endings.

uglyog commented 8 years ago

Don't know why it was failing, but it seems to be an issue with specs2. I converted it to a spock groovy test, and it passes ok.

anurag0249 commented 8 years ago

Still build fail, Please see attached screen buildfail

uglyog commented 8 years ago

All good now, travis CI build is passing: https://travis-ci.org/DiUS/pact-jvm/builds/119204532

anurag0249 commented 8 years ago

Good, But fail somewhere else now, Please see screen. buildfail

uglyog commented 8 years ago

You need to install maven to build the maven plugin.

anurag0249 commented 8 years ago

but as per stack trace it's looking for mvn.bat into "pact-jvm-provider-maven" . Error : Caused by: java.io.IOException: Cannot run program "mvn.bat" (in directory "D:\pact\pact-jvm\pact-jvm-provider-maven"): CreateProcess error=2, The system cannot find the file specifi ed

buildfail

uglyog commented 8 years ago

The maven bin directory needs to be in the path. If the maven you downloaded does not have a mvn.bat in the bin directory, just copy or rename mvn.cmd to mvn.bat.

C:\Users\Ronald\pact-jvm>
C:\Users\Ronald\pact-jvm>set PATH=%PATH%;C:\Users\Ronald\apache-maven-3.3.9\bin

C:\Users\Ronald\pact-jvm>mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T03:41:47+11:00)
Maven home: C:\Users\Ronald\apache-maven-3.3.9\bin\..
Java version: 1.8.0_77, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_77\jre
Default locale: en_AU, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"

C:\Users\Ronald\pact-jvm>mvn.bat --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T03:41:47+11:00)
Maven home: C:\Users\Ronald\apache-maven-3.3.9\bin\..
Java version: 1.8.0_77, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_77\jre
Default locale: en_AU, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
anurag0249 commented 8 years ago

Thanks Ronald, It's working after setup environment variable PATH properly.