Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step 11 -> java.io.FileNotFoundException #21

Open
JonoH opened this issue Jul 19, 2022 · 1 comment
Open

Step 11 -> java.io.FileNotFoundException #21

JonoH opened this issue Jul 19, 2022 · 1 comment

Comments

@JonoH
Copy link

JonoH commented Jul 19, 2022

There seems to be an issue with directory resolution in step11 for the pactDirectory in consumer build.gradle:

pact {
	publish {
		pactDirectory = 'consumer/build/pacts' // --> This doesn't resolve properly
		pactBrokerUrl = 'http://localhost:8000/'
		pactBrokerUsername = 'pact_workshop'
		pactBrokerPassword = 'pact_workshop'
		tags = [getGitBranch(), 'test', 'prod']
		consumerVersion = getGitHash()
	}
}

When I execute the ./gradlew consumer:test --tests *PactTest* pactPublish command I get the below error (java.io.FileNotFoundException):

...
> Task :consumer:pactPublish FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':consumer:pactPublish'.
> java.io.FileNotFoundException: /Users/jhatting/.gradle/daemon/6.6.1/consumer/build/pacts

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
5 actionable tasks: 1 executed, 4 up-to-date

Seems it's resolving to my root folder and not the project root folder. Managed to fix it by removing pactDirectory from the config completely. Publish to local broker works with the below gradle config:

pact {
	publish {
		pactBrokerUrl = 'http://localhost:8000/'
		pactBrokerUsername = 'pact_workshop'
		pactBrokerPassword = 'pact_workshop'
		tags = [getGitBranch(), 'test', 'prod']
		consumerVersion = getGitHash()
	}
}
@cutestory
Copy link

change the value of pactDirectory to the absolute path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants