Plugin was not found in any of the following sources

I am unable to build a project. It keeps failing with the following error. Any suggestion ?

Build file ‘/Users/randomname/git/product-service/build.gradle’ line: 10

Plugin [id: ‘com.jfrog.artifactory’, version: ‘4.20.0’] was not found in any of the following sources:

  • Try:
    Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is:
    org.gradle.api.plugins.UnknownPluginException: Plugin [id: ‘com.jfrog.artifactory’, version: ‘4.20.0’] was not found in any of the following sources:

  • Gradle Core Plugins (plugin is not in ‘org.gradle’ namespace)
  • Plugin Repositories (could not resolve plugin artifact ‘com.jfrog.artifactory:com.jfrog.artifactory.gradle.plugin:4.20.0’)
    Searched in the following repositories:
    maven(https://randomcompany.jfrog.io/artifactory/maven)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:268)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.access$100(DefaultPluginRequestApplicator.java:63)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator$1.transform(DefaultPluginRequestApplicator.java:93)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator$1.transform(DefaultPluginRequestApplicator.java:89)
    at org.gradle.util.CollectionUtils.collect(CollectionUtils.java:207)
    at org.gradle.util.CollectionUtils.collect(CollectionUtils.java:201)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:89)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:216)
    at org.gradle.configuration.BuildOperationScriptPlugin$1$1.run(BuildOperationScriptPlugin.java:69)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
    at org.gradle.configuration.BuildOperationScriptPlugin$1.execute(BuildOperationScriptPlugin.java:66)
    at org.gradle.configuration.BuildOperationScriptPlugin$1.execute(BuildOperationScriptPlugin.java:63)
    at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:49)
    at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:63)
    at org.gradle.configuration.project.BuildScriptProcessor$1.run(BuildScriptProcessor.java:45)
    at org.gradle.internal.Factories$1.create(Factories.java:26)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:245)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:226)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:42)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:35)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject$1.run(LifecycleProjectEvaluator.java:102)
    at org.gradle.internal.Factories$1.create(Factories.java:26)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:189)
    at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:271)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:265)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:226)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:91)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:63)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:707)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:143)
    at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:36)
    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62)
    at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:61)
    at org.gradle.configuration.BuildOperatingFiringProjectsPreparer$ConfigureBuild.run(BuildOperatingFiringProjectsPreparer.java:52)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
    at org.gradle.configuration.BuildOperatingFiringProjectsPreparer.prepareProjects(BuildOperatingFiringProjectsPreparer.java:40)
    at org.gradle.initialization.DefaultGradleLauncher.prepareProjects(DefaultGradleLauncher.java:218)
    at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:155)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:140)
    at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:120)
    at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:74)
    at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:67)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:189)
    at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
    at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:67)
    at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:56)
    at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner.run(ClientProvidedPhasedActionRunner.java:60)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:63)
    at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
    at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:39)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:51)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:45)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:50)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:47)
    at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:80)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:60)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:38)
    at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)
    at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:68)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)

That project configures https://randomcompany.jfrog.io/artifactory/maven as plugin repository in the settings script. I guess it is some demo project how to us the Artifactory plugin with your own instance and you didn’t replace the placeholder.

I intentionally replaced the repository name as it had the company specific repo to keep it generic.

The Gradle Plugin Portal contains artifacts that are necessary to resolve the plugin IDs. The error states that the plugin can’t be found in the repository located at https://randomcompany.jfrog.io/artifactory/maven.

Ignoring the replaced domain, the /artifactory/maven path sounds like it’s probably a generic virtual repository for this instance. It generally would not contain the Gradle Plugin Portal unless the Gradle Plugin Portal was explicitly configured as a source.

Below is the build.gradle file with actual values.

buildscript {
dependencies {
classpath(‘mysql:mysql-connector-java:8.0.23’)
classpath(‘com.vladmihalcea:hibernate-types-52:2.10.2’)
}
}

plugins {
id ‘java’
id ‘com.jfrog.artifactory’ version ‘4.20.0’

// IDE support related plugins
id 'idea'

// Spring framework related plugins
id 'org.springframework.boot' version '2.3.5.RELEASE'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'

// Add Git properties for actuator/info endpoint
id 'com.gorylenko.gradle-git-properties' version '2.2.4'

// Check the code style guide compliance and violations
id 'checkstyle'

// Add support for DDL migration
id 'org.flywaydb.flyway' version '7.5.2'

// Add support for terminal notification whenever tests are executed
id 'fr.jcgay.gradle-notifier' version '3.0.0'

// Code Coverage
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.10.2'

// Google Container Tools; to build docker image
id 'com.google.cloud.tools.jib' version '2.7.1'

}

ext {
lombokVersion = ‘1.18.18’
mapstructVersion = ‘1.4.2.Final’
hibernateVersion = ‘5.4.28.Final’
}

// Project meta data
group = ‘co.we’
version = ‘0.0.1-SNAPSHOT’
java {
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_11
}

artifactory {
contextUrl = “https://wework.jfrog.io/artifactory
publish {
repository {
repoKey = ‘jvm-releases-local’
username = System.getenv(‘ARTIFACTORY_USER’)
password = System.getenv(‘ARTIFACTORY_APIKEY’)
maven = true
}
}
resolve {
repository {
repoKey = ‘maven’
username = System.getenv(‘ARTIFACTORY_USER’)
password = System.getenv(‘ARTIFACTORY_APIKEY’)
maven = true
}
}
}

repositories {
mavenLocal()
}

// Configure the dependencies with their specific version number.
dependencies {
// Lombok
compileOnly(“org.projectlombok:lombok:{lombokVersion}") annotationProcessor("org.projectlombok:lombok:{lombokVersion}”)
testCompileOnly(“org.projectlombok:lombok:{lombokVersion}") testAnnotationProcessor("org.projectlombok:lombok:{lombokVersion}”)

// MapStruct
implementation("org.mapstruct:mapstruct:${mapstructVersion}")
annotationProcessor("org.mapstruct:mapstruct-processor:${mapstructVersion}")

// Configurations
annotationProcessor('org.springframework.boot:spring-boot-configuration-processor')

// Add JPA & MySQL dependencies
implementation('org.springframework.boot:spring-boot-starter-data-jpa')
implementation('org.springframework.boot:spring-boot-starter-amqp')
runtimeOnly('mysql:mysql-connector-java')
implementation('org.flywaydb:flyway-core')
implementation('com.vladmihalcea:hibernate-types-52:2.10.2')
implementation("org.hibernate:hibernate-core:${hibernateVersion}")
implementation("org.hibernate:hibernate-gradle-plugin:${hibernateVersion}")
testImplementation('org.flywaydb.flyway-test-extensions:flyway-spring5-test:7.0.0')

// Add support for OpenAPI spec generator
implementation('io.springfox:springfox-boot-starter:3.0.0')

// Add support for servlet based container support
implementation('org.springframework.boot:spring-boot-starter-web')
implementation('org.springframework.boot:spring-boot-starter-validation')

// Various utilities
implementation('org.apache.commons:commons-lang3:3.11')
implementation('org.apache.commons:commons-collections4:4.4')
implementation('org.apache.commons:commons-csv:1.8')

// Add Spring Boot Actuator
implementation('org.springframework.boot:spring-boot-starter-actuator')

// Security
implementation('com.wework:we-auth:1.2.2')
implementation('org.springframework.boot:spring-boot-starter-security')

// Add support for testing framework
testImplementation('org.springframework.boot:spring-boot-starter-test')
testImplementation('org.springframework.security:spring-security-test')

// Add Rollbar
implementation('com.rollbar:rollbar-logback:1.+')

// JUnit5
testImplementation('org.mockito:mockito-junit-jupiter:3.7.7')
testImplementation('org.assertj:assertj-core:3.19.0')

// MockWebServer
testImplementation('com.squareup.okhttp3:mockwebserver:4.9.1')
testImplementation('com.squareup.okhttp3:okhttp:4.9.1')

// google guava for caching
implementation('com.google.guava:guava:30.1-jre')
implementation('net.javacrumbs.future-converter:future-converter-guava-rxjava2:1.2.0')
implementation('io.projectreactor.addons:reactor-adapter:3.4.2')
implementation('io.projectreactor.addons:reactor-extra:3.4.2')
implementation('io.reactivex.rxjava2:rxjava:2.2.20')

// Spring WebClient
implementation('org.springframework.boot:spring-boot-starter-webflux')

// Prometheus Support
implementation('io.micrometer:micrometer-registry-prometheus')

// WeAPM
implementation('com.wework:we-apm:1.3.3')

// Smartling
implementation("com.smartling.api:smartling-api-sdk:0.18.0")

// S3
implementation("com.amazonaws:aws-java-sdk:1.11.951")

}

// Add custom configuration for Flyway; for developers
flyway {
url = System.getenv(‘DB_URL’) ?: ‘jdbc:mysql://127.0.0.1:3306/product_dev?allowPublicKeyRetrieval=true&verifyServerCertificate=false&serverTimezone=UTC’
user = System.getenv(‘DB_USER’) ?: ‘app-user’
password = System.getenv(‘DB_PASSWORD’) ?: ‘ThePassword’
}

checkstyle {
toolVersion ‘8.14’
}

task downloadDependencies {
description “Download all dependencies to the Gradle cache”
doLast {
configurations.findAll { it.canBeResolved }.files
}
}

// Log the test build status through STDOUT with only the “passed”, “failed”
// and “skipped” states
test {
environment SPRING_PROFILES_ACTIVE: environment.SPRING_PROFILES_ACTIVE ?: “test”

useJUnitPlatform()

maxHeapSize = '1g'

testLogging {
    events "PASSED", "FAILED", "SKIPPED"
}

// Exclude the pattern if passed through the -PexcludeTests=<comma,separated,patterns>
if (project.hasProperty("excludeTests"))
    exclude project.property("excludeTests").split("\\s*,\\s*")

// Include the pattern if passed through the parameter
if (project.hasProperty("includeTests"))
    include(project.property("includeTests").split("\\s*,\\s*"))

finalizedBy jacocoTestReport

}

// Ensure gradle build continues even though the -PincludeTests=<comma,separated,patterns>
gradle.startParameter.continueOnFailure = true

// Mapstruct integration related overridden configuration
compileJava {
options.compilerArgs = [
‘-Amapstruct.suppressGeneratorTimestamp=true’,
‘-Amapstruct.suppressGeneratorVersionInfoComment=true’,
‘-Amapstruct.defaultComponentModel=spring’
]
}

gitProperties {
failOnNoGitDirectory = false
}

// Boot run with additional arguments
bootRun {
environment SPRING_PROFILES_ACTIVE: environment.SPRING_PROFILES_ACTIVE ?: “local”
if (project.hasProperty(‘args’)) {
args project.property(‘args’).split(’,’)
}
}

idea {
module {
outputDir file(‘build/classes/java/main’)
testOutputDir file(‘build/classes/java/test’)
downloadSources = true
}
}

// Code Coverage: Jacoco, Coveralls
jacoco {
toolVersion ‘0.8.3’
}
coveralls {
jacocoReportPath ‘build/reports/jacoco/test/jacocoTestReport.xml’
saveAsFile = true
sendToCoveralls = false
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled true
}
}

// NewRelic integration
// NewRelic and SpringBoot with gradle | by Sudhin Varghese | Medium
configurations {
newRelic
}
dependencies {
newRelic group: ‘com.newrelic.agent.java’, name: ‘newrelic-agent’, version: ‘6.4.1’
}
task jibNewRelic(type: Copy) {
from configurations.newRelic
into “build/jib-extra/newrelic”
rename ‘(.)-[0-9.](-SNAPSHOT)?\.([^\.]*)’, ‘$1.$3’
}
processResources.dependsOn jibNewRelic

// JIB Docker Builder
jib {
to {
image = System.getenv(‘CIRCLE_SHA1’) ?: project.name + ‘:’ + project.version
}
container {
labels = [
‘org.opencontainers.image.title’ : project.name,
‘org.opencontainers.image.source’ : System.getenv(‘CIRCLE_REPOSITORY_URL’) ?: ‘’,
‘org.opencontainers.image.revision’: System.getenv(‘CIRCLE_SHA1’) ?: ‘’,
‘org.label-schema.schema-version’ : ‘1.0’,
‘org.label-schema.name’ : project.name,
‘org.label-schema.vcs-url’ : System.getenv(‘CIRCLE_REPOSITORY_URL’) ?: ‘’,
‘org.label-schema.vcs-ref’ : System.getenv(‘CIRCLE_SHA1’) ?: ‘’,
‘CIRCLE_REPOSITORY_URL’ : System.getenv(‘CIRCLE_REPOSITORY_URL’) ?: ‘’,
‘CIRCLE_SHA1’ : System.getenv(‘CIRCLE_SHA1’) ?: ‘’,
‘CIRCLE_TAG’ : System.getenv(‘CIRCLE_TAG’) ?: ‘’,
‘CIRCLE_BUILD_URL’ : System.getenv(‘CIRCLE_BUILD_URL’) ?: ‘’,
‘CIRCLE_BRANCH’ : System.getenv(‘CIRCLE_BRANCH’) ?: ‘’
]
extraDirectories {
paths = [‘src/main/jib’, ‘build/jib-extra’]
}
ports = [‘8080’]
jvmFlags = [’-javaagent:newrelic/newrelic-agent.jar’]
}
}

This gives me the following error

  • What went wrong:
    Plugin [id: ‘com.jfrog.artifactory’, version: ‘4.20.0’] was not found in any of the following sources:
  • Gradle Core Plugins (plugin is not in ‘org.gradle’ namespace)
  • Plugin Repositories (could not resolve plugin artifact ‘com.jfrog.artifactory:com.jfrog.artifactory.gradle.plugin:4.20.0’)
    Searched in the following repositories:
    maven(https://wework.jfrog.io/artifactory/maven)

The full build.gradle doesn’t really help here. This is an issue with what’s in settings.gradle not being correct for the configuration at your organization.

Hopefully, you have ARTIFACTORY_USER and ARTIFACTORY_APIKEY referenced in there as well. If that looks good, there’s not much we can help you with as you either need the /artifactory/maven repository configuration modified on the JFrog side or a different URL. Which one is really up to your organization’s design for repository management.