add Artifactory, PMD, CycloneDX BOM, OSV Scanner

This commit is contained in:
Jörg Prante 2024-07-19 15:20:08 +02:00
parent 3bcfc1366c
commit d05f00d7cb
13 changed files with 64 additions and 39 deletions

Binary file not shown.

View file

@ -0,0 +1 @@
v1.8.2

Binary file not shown.

View file

@ -4,6 +4,9 @@ plugins {
id 'maven-publish'
id 'signing'
id "io.github.gradle-nexus.publish-plugin" version "2.0.0-rc-1"
id "com.jfrog.artifactory" version "5.2.3"
id "org.cyclonedx.bom" version "1.8.2"
id 'com.fizzpod.osv-scanner' version '3.0.9'
}
wrapper {
@ -27,11 +30,15 @@ ext {
}
subprojects {
apply from: rootProject.file('gradle/repositories/maven.gradle')
apply from: rootProject.file('gradle/repositories/artifactory.gradle')
apply from: rootProject.file('gradle/repositories/forgejo.gradle')
apply from: rootProject.file('gradle/compile/java.gradle')
apply from: rootProject.file('gradle/test/junit5.gradle')
apply from: rootProject.file('gradle/publish/maven.gradle')
apply from: rootProject.file('gradle/quality/pmd.gradle')
apply from: rootProject.file('gradle/publish/maven.gradle')
}
apply from: rootProject.file('gradle/publish/sonatype.gradle')
apply from: rootProject.file('gradle/publish/forgejo.gradle')
apply from: rootProject.file('gradle/quality/cyclonedx.gradle')
apply from: rootProject.file('gradle/quality/osv-scanner.gradle')
apply from: rootProject.file('gradle/publish/xbib/forgejo.gradle')
apply from: rootProject.file('gradle/publish/hbz/artifactory.gradle')
//apply from: rootProject.file('gradle/publish/maven-central/sonatype.gradle')

View file

@ -0,0 +1,27 @@
if (project.hasProperty('artifactoryUser')) {
artifactory {
publish {
contextUrl = project.property('artifactoryUrl')
repository {
repoKey = project.property('artifactoryRepoKey')
username = project.property('artifactoryUser')
password = project.property('artifactoryPassword')
}
defaults {
publications("${project.name}")
publishBuildInfo = false
publishArtifacts = true
publishPom = true
}
}
}
}
if (project.hasProperty("signing.keyId")) {
pluginManager.withPlugin('maven-publish') {
apply plugin: 'signing'
signing {
sign publishing.publications."${project.name}"
}
}
}

View file

@ -1,27 +0,0 @@
apply plugin: 'ivy-publish'
publishing {
repositories {
ivy {
url = "https://xbib.org/repo"
}
}
publications {
ivy(IvyPublication) {
from components.java
descriptor {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
author {
name = 'Jörg Prante'
url = 'http://example.com/users/jane'
}
descriptor.description {
text = rootProject.ext.description
}
}
}
}
}

View file

@ -1,3 +1,11 @@
if (project.hasProperty("signing.keyId")) {
apply plugin: 'signing'
signing {
sign publishing.publications."${project.name}"
}
}
if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
nexusPublishing {
repositories {

View file

@ -42,10 +42,3 @@ publishing {
}
}
}
if (project.hasProperty("signing.keyId")) {
apply plugin: 'signing'
signing {
sign publishing.publications."${project.name}"
}
}

View file

@ -2,7 +2,7 @@ cyclonedxBom {
includeConfigs = [ 'runtimeClasspath' ]
skipConfigs = [ 'compileClasspath', 'testCompileClasspath' ]
projectType = "library"
schemaVersion = "1.4"
schemaVersion = "1.5"
destination = file("build/reports")
outputName = "bom"
outputFormat = "json"

View file

@ -0,0 +1,6 @@
apply plugin: 'com.fizzpod.osv-scanner'
osvScanner {
format = "json"
sbom = rootProject.file('build/reports/bom.json')
}

View file

@ -0,0 +1,5 @@
repositories {
maven {
url = 'https://repo.hbz-nrw.de/artifactory/gradle-dev/'
}
}

View file

@ -0,0 +1,5 @@
repositories {
maven {
url = 'https://xbib.org/api/packages/joerg/maven'
}
}