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

gradle build fails due to missing properties #112

Closed
robobario opened this issue Nov 1, 2023 · 2 comments · Fixed by #113
Closed

gradle build fails due to missing properties #112

robobario opened this issue Nov 1, 2023 · 2 comments · Fixed by #113

Comments

@robobario
Copy link
Contributor

Hi!

Commands like ./gradlew build fail with exception

./gradlew build
Starting a Gradle Daemon (subsequent builds will be faster)

> Configure project :
Project : => 'org.pcollections' Java module

FAILURE: Build failed with an exception.

* Where:
Build file '/home/roby/development/redhat-managed-kafka/upstream/pcollections/build.gradle' line: 57

* What went wrong:
A problem occurred evaluating root project 'pcollections'.
> Could not get unknown property 'ossrhUsername' for Credentials [username: null] of type org.gradle.internal.credentials.DefaultPasswordCredentials_Decorated.
... snip
BUILD FAILED in 6s

I think these dynamic properties need to be in a gradle.properties file, I couldn't find a way to pass them as system props.

The context is we are rebuilding pcollections from source and are currently generating a gradle.properties file with dummy values.

It would be convenient if we didn't have to supply the file to run builds.

Maybe using an alternate syntax they could have default values? The sonatype publish would fail unless you have credentials set up on the host machine.

providers.gradleProperty('ossrhUsername').getOrElse('dummy')

Or is there some other way to build without a gradle.properties file?

Thank you!

@hrldcpr
Copy link
Owner

hrldcpr commented Nov 7, 2023

Great question! I'm in between things at the moment, so if you're able to test that getOrElse option and open a pull request, I'd be happy to merge it!

Otherwise, I'll try to look at this soon.

@robobario
Copy link
Contributor Author

Sure, I'll get a PR together, thanks!

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

Successfully merging a pull request may close this issue.

2 participants