When we build our application using gradle, it is throwing the exception below .Following is the build.gradle code:
buildscript {
repositories{
jcenter()
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.8.1"
classpath "io.spring.gradle:dependency-management-plugin:1.0.9.RELEASE"
}
}
apply plugin: "idea"
apply plugin: "java-library"
apply plugin: "maven-publish"
apply plugin: "com.jfrog.artifactory"
apply plugin: "io.spring.dependency-management"
group = "com.xx.ff"
version = "2.1.5-SNAPSHOT"
wrapper {
gradleVersion = "6.5"
distributionType = Wrapper.DistributionType.ALL
}
repositories {
jcenter()
if (System.getenv('ARTIFACTORY_USER') == null || System.getenv('ARTIFACTORY_PASSWORD') == null) {
logger.warn("Please set environment variables ARTIFACTORY_USER and ARTIFACTORY_PASSWORD")
}
maven {
name "libs-snapshot"
url "https://vvvvvvvvvvvvvvvv/artifactory/libs-snapshot/"
credentials {
username = System.getenv('ARTIFACTORY_USER')
password = System.getenv('ARTIFACTORY_PASSWORD')
}
}
maven {
name "libs-release"
url "https://vvvvvvvvvvvvvvvvvvvvvvvvvv/artifactory/libs-release/"
credentials {
username = System.getenv('ARTIFACTORY_USER')
password = System.getenv('ARTIFACTORY_PASSWORD')
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
idea.module {
outputDir file("build/classes/java/main")
testOutputDir file("build/classes/java/test")
}
dependencyManagement {
imports {
mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
}
}
dependencies {
api("org.springframework.boot:spring-boot-starter-security:${springBootVersion}")
api("org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:${springBootVersion}")
implementation("javax.validation:validation-api:${validationVersion}")
}
artifactory {
contextUrl = "${artifactory_contextUrl}"
publish {
repository {
repoKey = "libs-snapshot-local"
username = System.getenv('ARTIFACTORY_USER')
password = System.getenv('ARTIFACTORY_PASSWORD')
maven = true
}
defaults {
publications("mavenJava")
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
I am getting the below error : Build file, line: 81
Failed to notify build listener.
'org.gradle.api.file.FileCollection org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal.getPublishableFiles()'
Can anyone help me please ?