MCPcopy Index your code
hub / github.com/CycloneDX/cyclonedx-gradle-plugin

github.com/CycloneDX/cyclonedx-gradle-plugin @cyclonedx-gradle-plugin-3.2.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release cyclonedx-gradle-plugin-3.2.4 ↗ · + Follow
203 symbols 577 edges 34 files 46 documented · 23%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Gradle Plugin Portal publishing

Gradle provides a registry of published plugins that can easily be imported into projects without having to modify the pluginManagement resolutionStrategy.

Additionally, gradle provides a plugin to facilitate the building of plugins that does extra validation checks, and another plugin that simplifies the publishing of plugins to the portal.

Register At Gradle Plugin Portal

In order to publish plugins in the portal, you need to register for an account and retrieve your API key. See their website for more details. A summary of steps is listed below.

Instructions Summary

  • Go to https://plugins.gradle.org/user/register
  • Register for an account
  • Log in
  • Go to user page
  • Go to API Keys
  • Generate publishing API keys
  • Copy contents of textbox to ~/.gradle/gradle.properties

Build Gradle Plugin

Though the maven pom.xml is currently the maintained build file for this plugin, a build.gradle file is also provided that can build the plugin and publish it to the portal. Note that the version value in the build.gradle file must be manually maintained in sync with the one in the maven pom.xml

Additionally, per standard gradle convention, a gradle wrapper pinned at a specific version is provided to reduce build environment dependencies.

Performing a build of the plugin is achieved by running

./gradlew clean build

The plugin will be output to builds/libs, and the plugin descriptor output to builds/pluginDescriptors.

Publish locally for testing

To use the gradle build to publish the plugin locally for testing, use

./gradlew publishToMavenLocal

In order to use this locally published plugin, you must declare mavenLocal() as repository in the pluginManagement section of your settings.gradle file:

pluginManagement {
    repositories {
        mavenLocal()
        gradlePluginPortal()
    }
}

Publish to Gradle Plugin Portal

To publish the plugin to the Gradle Plugin Portal, you must first have set up your plugin portal credentials, as describe above. Ensure that the version field in the build.gradle is set to the desired value. Then simply run:

./gradlew publishPlugins

If this is the first time the plugin has been published, the name may need to be approved by the portal maintainers. This typically takes about 12 hours during the work week. You will see on your portal user console page that your plugin is marked 'Pending approval'. After it is approved, the API credentials used to publish will 'own' the plugin name, and plugins will be available in the portal immediately after publishing. Note that every plugin must be published with a NEW version. There is no automatic overwriting of -SNAPSHOT versions. Also you have up to 1 week after publishing to delete an uploaded version if you need to remove it. After that time you need to request support to delete an uploaded version.

Using Portal Published Plugin

To use a portal published version of the plugin, the settings.gradle file modifying the resolutionStrategy is not needed and should be removed. Instead, users can just use the plugin DSL to import the plugin. Note, however, that portal plugins must specify the desired version in the DSL.

plugins {
    id 'org.cyclonedx.bom' version '1.2.1'
}

Core symbols most depended-on inside this repo

getId
called by 28
src/main/java/org/cyclonedx/gradle/model/SbomComponent.java
getName
called by 24
src/main/java/org/cyclonedx/gradle/model/SbomComponentId.java
toString
called by 14
src/main/java/org/cyclonedx/gradle/model/SbomComponentId.java
getLicenses
called by 12
src/main/java/org/cyclonedx/gradle/model/SbomComponent.java
getXmlOutput
called by 10
src/main/java/org/cyclonedx/gradle/BaseCyclonedxTask.java
getJsonOutput
called by 10
src/main/java/org/cyclonedx/gradle/BaseCyclonedxTask.java
getBuildURI
called by 10
src/main/java/org/cyclonedx/gradle/utils/EnvironmentUtils.java
getVersion
called by 10
src/main/java/org/cyclonedx/gradle/model/SbomComponentId.java

Shape

Method 175
Class 27
Function 1

Languages

Java100%
Kotlin1%

Modules by API surface

src/main/java/org/cyclonedx/gradle/model/SbomComponent.java19 symbols
src/main/java/org/cyclonedx/gradle/DependencyGraphTraverser.java16 symbols
src/main/java/org/cyclonedx/gradle/BaseCyclonedxTask.java16 symbols
src/main/java/org/cyclonedx/gradle/SbomBuilder.java15 symbols
src/main/java/org/cyclonedx/gradle/SbomGraphProvider.java13 symbols
src/main/java/org/cyclonedx/gradle/MavenHelper.java13 symbols
src/main/java/org/cyclonedx/gradle/model/SbomMetaData.java11 symbols
src/main/java/org/cyclonedx/gradle/model/SbomComponentId.java11 symbols
src/main/java/org/cyclonedx/gradle/CyclonedxDirectTask.java10 symbols
src/test/java/org/cyclonedx/gradle/utils/EnvironmentUtilsTest.java9 symbols
src/main/java/org/cyclonedx/gradle/GradleAssistedMavenModelResolverImpl.java9 symbols
src/main/java/org/cyclonedx/gradle/CyclonedxPlugin.java7 symbols

For agents

$ claude mcp add cyclonedx-gradle-plugin \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page