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

Message is never displayed, enforcer rule is not mentioned #14

Closed
flangknecht opened this issue Oct 30, 2020 · 1 comment
Closed

Message is never displayed, enforcer rule is not mentioned #14

flangknecht opened this issue Oct 30, 2020 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@flangknecht
Copy link

I'm deliberately trying to get my project to fail by setting project.version to a not compliant string ("-foo").

rule<RequireGradleProperty> {
    enabled.set(true)
    property.set("project.version")
    regex.set("\\d.*\$")
    message.set("Project version must start with a number.")
}

It fails alright, but the specified message is never printed.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':neo-autoconfigure'.
> [BEFORE_PROJECT :neo-autoconfigure] An Enforcer rule has failed

* Try:
Run with --stacktrace option to get the stack trace. Run with --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 2s

Running with --info doesn't yield any additional information (i.e. which enforcer rule caused the build failure).

The enforcer-specific --info output is

[project-enforcer :] phase=AFTER_PROJECT, enabled=true, failFast=true
[project-enforcer :] Detected Java String: '1.8.0_272'
[project-enforcer :] Normalized Java String: '1.8.0-272'
[project-enforcer :] Parsed Version: Major: 1 Minor: 8 Incremental: 0 Build: 272 Qualifier: null
[project-enforcer :] Detected JDK Version: 1.8.0-272 is allowed in the range [1.8,1.9),[11,12),[17,18).

> Configure project :neo-autoconfigure
[project-enforcer :] phase=BEFORE_PROJECT, enabled=true, failFast=true

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
@aalmiray
Copy link
Contributor

The name of the property must be "version", not "project.version".

@aalmiray aalmiray added this to the 0.8.0 milestone Oct 30, 2020
@aalmiray aalmiray added the bug Something isn't working label Oct 30, 2020
@aalmiray aalmiray self-assigned this Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants