I created bitbucket pipeline to run detekt with check style
image: alvrme/alpine-android:android-34-jdk17
pipelines:
pull-requests:
'**':
- step: # Runs the detekt gradle task
name: Check code quality.
caches:
- gradle
- gradle-wrapper
- gradle-configuration
script:
- JAVA_OPTS="-Xmx2g -XX:MaxPermSize=1g -XX:MaxMetaspaceSize=256m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"
- export GRADLE_OPTS='-XX:+UseG1GC -XX:MaxGCPauseMillis=1000 -Dorg.gradle.jvmargs="-Xmx2g -XX:MaxMetaspaceSize=1g -XX:ReservedCodeCacheSize=440m -XX:+UseCompressedOops -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" -Dorg.gradle.parallel=false -Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=true'
- ./gradlew detekt
after-script: # Post comments based on the report xml created by running detekt command
- pipe: atlassian/checkstyle-report:0.4.0
definitions:
caches:
gradle-wrapper: ~/.gradle/wrapper
gradle-configuration: ~/.gradle/configuration-cache
Unfortunately, check style fails with
Exception in thread "main" java.lang.RuntimeException: java.nio.file.AccessDeniedException: /opt/atlassian/pipelines/agent/build/.gradle/configuration-cache/eof19v0cm74wbz9wrfyaykwjt
at se.bjurr.violations.lib.reports.ReportsFinder.findAllReports(ReportsFinder.java:51)at se.bjurr.violations.lib.ViolationsApi.violations(ViolationsApi.java:89)at com.atlassian.bitbucket.pipelines.checkstyle.report.Main.main(Main.java:98)
Caused by: java.nio.file.AccessDeniedException: /opt/atlassian/pipelines/agent/build/.gradle/configuration-cache/eof19v0cm74wbz9wrfyaykwjtat sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:427)
at java.nio.file.Files.newDirectoryStream(Files.java:457)
at java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:300)
at java.nio.file.FileTreeWalker.next(FileTreeWalker.java:372)
at java.nio.file.Files.walkFileTree(Files.java:2706)
at java.nio.file.Files.walkFileTree(Files.java:2742)
at se.bjurr.violations.lib.reports.ReportsFinder.findAllReports(ReportsFinder.java:28)
... 2 more
What am I missing?
@Dawid Hyzy hi. Seems like the system is not allowing access to the files mentioned in the directory named in the error message.
Check the permissions, ownership and existence of the directory and files within it.
Regards, Igor
This is a Gradle configuration cache file created during the
./gradlew detekt
task execution.
.gradle directory is not committed to the repository.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.