Build Failed pmd error

error :

crio-user@divyashahi139:~/workspace/divyashahi139-ME_QMONEY$ ./gradlew build

Task :qmoney:pmdMain
This analysis could be faster, please consider using Incremental Analysis: https://pmd.github.io/pmd-6.10.0/pmd_userdocs_incremental_analysis.html
12 PMD rule violations were found. See the report at: file:///home/crio-user/workspace/divyashahi139-ME_QMONEY/qmoney/build/reports/pmd/main.html

Task :qmoney:spotbugsMain FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:qmoney:spotbugsMain’.

SpotBugs rule violations were found. See the report at: file:///home/crio-user/workspace/divyashahi139-ME_QMONEY/qmoney/build/reports/spotbugs/main.html

  • 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use ‘–warning-mode all’ to show the individual deprecation warnings.
See https://docs.gradle.org/5.2.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 16s
13 actionable tasks: 6 executed, 7 up-to-date
crio-user@divyashahi139:~/workspace/divyashahi139-ME_QMONEY$

what is meant by this,

pmd errors don’t affect your build success
open the main.html file mentioned in your spotsbug error in a browser and send a pic

never met with this error from where can I open main.html, definitely not in browser
@robsteneha

You need to go in qmoney->build->reports->spotbugs
And then you can view the main.html in browser preview of IDE
Or you can copy the content of main.html into notepad and save it with .html extension and view it in browser

1 Like

you can copy the contents to a .html file in your desktop an dthen run it

and to open the file in your workspace ctrl+click

1 Like


this is the screenshot u asked for @robsteneha

go down you’ll see the errors then send a pic

Provide full screenshot of the file

here it is @visargdesai

In case to know local date is given or not can’t we check it with null

Click on these 3 error and you will get the line numbers.

1 Like

thanks @visargdesai can’t we write abcDate.equals(null) to check if date is null or not, may u hint other equally good methods , in module 3 it was string so it worked quite fine but now here it is localDate

According to me, you dont have to worry about date being null.
You just need to compare 2 dates to see if end date is less than purchase date.
end date is provided as string argument so you need to parse it to LocalDate and then compare both dates

for the 2nd error add a parameter to read the file in utf-8 format

1 Like

why would you wanna check that
also what is abcDate? how did you not get an error for naming a variable like that
anyways which date is it?

actually it is endDate but crio resist pasting exact code so I named it something else here
@robsteneha

oh okay that’s good.
can you try doing what i suggested for 2nd warning and build again to see if it is resolved? it worked in my case

also the end date is already passed in the function so don’t check if it is null and remove that line as well and see if that warning also goes away