PageSourceSearch

https://detekt.dev/assets/js/fb049aab.fc8712cb.js

js detekt.dev collected 2026-10-03 23:08:45 UTC 5,536 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_detekt_website=self.webpackChunk_detekt_website||[]).push([["30225"],{26208(e,t,s){s.r(t),s.d(t,{metadata:()=>n,default:()=>u,frontMatter:()=>r,contentTitle:()=>a,toc:()=>d,assets:()=>l});var n=JSON.parse('{"id":"introduction/snapshots","title":"Using Snapshots","description":"This page explains how you can use our latest snapshots to test upcoming unreleased features.","source":"@site/docs/introduction/snapshots.mdx","sourceDirName":"introduction","slug":"/introduction/snapshots","permalink":"/docs/next/introduction/snapshots","draft":false,"unlisted":false,"editUrl":"https://github.com/detekt/detekt/edit/main/website/docs/introduction/snapshots.mdx","tags":[],"version":"current","sidebarPosition":10,"frontMatter":{"id":"snapshots","title":"Using Snapshots","keywords":["snapshot","releases"],"summary":"This page explains how you can setup snapshots for your detekt build to test the latest unreleased features.","sidebar_position":10},"sidebar":"defaultSidebar","previous":{"title":"Extending detekt","permalink":"/docs/next/introduction/extensions"},"next":{"title":"Compatibility Table","permalink":"/docs/next/introduction/compatibility"}}'),o=s(74848),i=s(28453);let r={id:"snapshots",title:"Using Snapshots",keywords:["snapshot","releases"],summary:"This page explains how you can setup snapshots for your detekt build to test the latest unreleased features.",sidebar_position:10},a,l={},d=[{value:"Where to download snapshots",id:"where-to-download-snapshots",level:2},{value:"Gradle setup with Buildscript",id:"gradle-setup-with-buildscript",level:2},{value:"Gradle setup with Plugin block",id:"gradle-setup-with-plugin-block",level:2}];function p(e){let t={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.p,{children:["This page explains how you can use our ",(0,o.jsx)(t.strong,{children:"latest snapshots"})," to test upcoming unreleased features."]}),"\n",(0,o.jsx)(t.h2,{id:"where-to-download-snapshots",children:"Where to download snapshots"}),"\n",(0,o.jsxs)(t.p,{children:["You can find the latest snapshot on ",(0,o.jsx)(t.a,{href:"https://central.sonatype.com/repository/maven-snapshots/",children:"sonatype"}),". A new snapshot is published after every merge to ",(0,o.jsx)(t.code,{children:"main"})," from the ",(0,o.jsx)(t.a,{href:"https://github.com/detekt/detekt/actions?query=workflow%3A%22Deploy+Snapshot%22",children:"Deploy Snapshot"})," GitHub Action workflow."]}),"\n",(0,o.jsx)(t.h2,{id:"gradle-setup-with-buildscript",children:"Gradle setup with Buildscript"}),"\n",(0,o.jsxs)(t.p,{children:["If you're using Gradle with the ",(0,o.jsx)(t.code,{children:"buildscript"})," block, you should update your top level ",(0,o.jsx)(t.code,{children:"build.gradle"})," file with:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-groovy",children:'buildscript {\n  repositories {\n    maven {\n      url "https://central.sonatype.com/repository/maven-snapshots/"\n    }\n  }\n  dependencies {\n    classpath "dev.detekt:detekt-gradle-plugin:main-SNAPSHOT"\n  }\n}\n\napply plugin: "dev.detekt"\n\nallprojects {\n  repositories {\n    maven {\n      url "https://central.sonatype.com/repository/maven-snapshots/"\n    }\n  }\n}\n'})}),"\n",(0,o.jsxs)(t.p,{children:["Make sure that you're adding the sonatype maven repository to both the ",(0,o.jsx)(t.code,{children:"repositories{}"})," block ",(0,o.jsx)(t.strong,{children:"inside"})," the ",(0,o.jsx)(t.code,{children:"buildscript{}"})," block and outside it."]}),"\n",(0,o.jsx)(t.h2,{id:"gradle-setup-with-plugin-block",children:"Gradle setup with Plugin block"}),"\n",(0,o.jsxs)(t.p,{children:["If you're using the ",(0,o.jsx)(t.code,{children:"plugins{}"})," block to apply detekt, you should update your ",(0,o.jsx)(t.code,{children:"build.gradle"})," file to:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-groovy",children:'plugins {\n  id("dev.detekt") version "main-SNAPSHOT"\n}\n\nallprojects {\n  repositories {\n    maven {\n      url "https://central.sonatype.com/repository/maven-snapshots/"\n    }\n  }\n}\n'})}),"\n",(0,o.jsxs)(t.p,{children:["Plus you need to update the ",(0,o.jsx)(t.code,{children:"settings.gradle"})," file as follows:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-groovy",children:'pluginManagement {\n    resolutionStrategy {\n        eachPlugin {\n            if (requested.id.id == "dev.detekt") {\n                useModule("dev.detekt:detekt-gradle-plugin:${requested.version}")\n            }\n        }\n    }\n    repositories {\n        // Your other repos here.\n        maven {\n            url = uri("https://central.sonatype.com/repository/maven-snapshots/")\n        }\n    }\n}\n'})}),"\n",(0,o.jsxs)(t.p,{children:["Please note that the extra ",(0,o.jsx)(t.code,{children:"resolutionStrategy{}"})," block is needed as we don't publish a Gradle Plugin marker for our snapshots."]})]})}function u(e={}){let{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(p,{...e})}):p(e)}},28453(e,t,s){s.d(t,{R:()=>r,x:()=>a});var n=s(96540);let o={},i=n.createContext(o);function r(e){let t=n.useContext(i);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),n.createElement(i.Provider,{value:t},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.