Gradle 7.1.1 Could not find jp.classmethod.aws:gradle-aws-plugin - maven

I was using gradle 5.x until now and am trying to upgrade to 7.1.1. With this, I am running into this error -
> Could not find jp.classmethod.aws:gradle-aws-plugin:0.36.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/jp/classmethod/aws/gradle-aws-plugin/0.36/gradle-aws-plugin-0.36.pom
- https://plugins.gradle.org/m2/jp/classmethod/aws/gradle-aws-plugin/0.36/gradle-aws-plugin-0.36.pom
Required by:
project : > jp.classmethod.aws:jp.classmethod.aws.gradle.plugin:0.36
project : > jp.classmethod.aws.s3:jp.classmethod.aws.s3.gradle.plugin:0.36
In my build.gradle -
plugins {
id 'java-library'
//id 'maven' //this does not work with 7.1.1 either
id 'jp.classmethod.aws' version '0.36'
id 'jp.classmethod.aws.s3' version '0.36'
}
From the error, it is looking for the pom in -
https://repo.maven.apache.org/maven2/jp/classmethod/aws/gradle-aws-plugin/0.36/gradle-aws-plugin-0.36.pom
when actually, it is present in -
https://plugins.gradle.org/m2/jp/classmethod/aws/jp.classmethod.aws.gradle.plugin/0.36/jp.classmethod.aws.gradle.plugin-0.36.pom
I tried specifying the repository this way -
buildscript {
repositories {
mavenCentral()
//jcenter() //gradle 7.1.1 does not like this
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://plugins.gradle.org/m2/jp/classmethod/aws/jp.classmethod.aws.gradle.plugin/0.36/" }
maven { url "https://plugins.gradle.org/m2/jp/classmethod/aws/s3/jp.classmethod.aws.s3.gradle.plugin/0.36/" }
}
dependencies {
classpath "gradle.plugin.org.scoverage:gradle-scoverage:4.0.1"
classpath "jp.classmethod.aws:gradle-aws-plugin:0.36"
classpath "jp.classmethod.aws:gradle-aws-plugin:0.36"
}
}
apply plugin: "jp.classmethod.aws"
apply plugin: "jp.classmethod.aws.s3"
in which case it gives me this -
> Could not find jp.classmethod.aws:gradle-aws-plugin:0.36.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/jp/classmethod/aws/gradle-aws-plugin/0.36/gradle-aws-plugin-0.36.pom
- https://plugins.gradle.org/m2/jp/classmethod/aws/gradle-aws-plugin/0.36/gradle-aws-plugin-0.36.pom
- https://plugins.gradle.org/m2/jp/classmethod/aws/jp.classmethod.aws.gradle.plugin/0.36/jp/classmethod/aws/gradle-aws-plugin/0.36/gradle-aws-plugin-0.36.pom
- https://plugins.gradle.org/m2/jp/classmethod/aws/s3/jp.classmethod.aws.s3.gradle.plugin/0.36/jp/classmethod/aws/gradle-aws-plugin/0.36/gradle-aws-plugin-0.36.pom
Any clues how to fix this?
Thanks!!

Related

Missing spring-boot-buildpack-platform

I'm using gradle plugin:
id 'org.springframework.boot' version '2.7.2'
And getting this. Am I missing something?
Could not resolve all files for configuration ':classpath'.
> Could not find org.springframework.boot:spring-boot-buildpack-platform:2.7.2.
Searched in the following locations:
- https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-buildpack-platform/2.7.2/spring-boot-buildpack-platform-2.7.2.pom
If the artifact you are trying to retrieve can be found in the repository but
without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ...
}' of the repository declaration.
Required by:
project : >
org.springframework.boot:org.springframework.boot.gradle.plugin:2.7.2 >
org.springframework.boot:spring-boot-gradle-plugin:2.7.2
> Could not find org.springframework.boot:spring-boot-loader-tools:2.7.2.
Searched in the following locations:
- https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-loader-
tools/2.7.2/spring-boot-loader-tools-2.7.2.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
project : >
org.springframework.boot:org.springframework.boot.gradle.plugin:2.7.2 >
org.springframework.boot:spring-boot-gradle-plugin:2.7.2
When repository gradlePluginPortal() doesn't have it, try mavenCentral():
runtimeOnly 'org.springframework.boot:spring-boot-buildpack-platform:2.7.1'
But there no version 2.7.2 yet. Not sure if these versions would have to match, but in case of, downgrading to id 'org.springframework.boot' version '2.7.1' might be your best chance.
Just see for yourself, it's imply not there. Please don't ask me why they've not published it.
When versions can be mixed, one can use resolutionStrategy to change the version it will resolve:
In file settings.gradle:
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
}
resolutionStrategy {
eachPlugin {
if (it.requested.id.getName() == 'org.springframework.boot') {
if (it.requested.id.id == 'spring-boot-buildpack-platform') {
it.useModule('org.springframework.boot:spring-boot-buildpack-platform:2.7.1')
}
println ">> ${it.target}"
} else {
println "> ${it.target}"
}
}
}
}
Either with it.useModule or it.version. println ">> ${it.target}" is just there for tesing.
Option B will work while the public API of spring-boot-buildpack-platform hasn't changed.

Why can't Gradle resolve org.connectbot.jbcrypt:jbcrypt:1.0.0 from the Maven Central Repository?

I'm using Gradle 6.9 and here is my build.gradle file:
plugins {
id "groovy"
id "java"
}
group "com.matthiasdenu"
version "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven {
url 'https://repo.jenkins-ci.org/releases/'
}
}
ext {
jobDslVersion = "1.77"
jenkinsVersion = "2.252"
}
sourceSets {
jobs {
groovy {
srcDirs "jobs"
compileClasspath += main.compileClasspath
}
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}
dependencies {
compile("org.jenkins-ci.main:jenkins-war:${jenkinsVersion}"){
// https://github.com/sheehan/job-dsl-gradle-example/issues/87
exclude group: "org.jenkins-ci.ui", module: "bootstrap"
}
}
test {
useJUnitPlatform()
}
This is the error message I'm getting:
Execution failed for task ':compileTestGroovy'.
> Could not resolve all files for configuration ':testCompileClasspath'.
> Could not find org.connectbot.jbcrypt:jbcrypt:1.0.0.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/org/connectbot/jbcrypt/jbcrypt/1.0.0/jbcrypt-1.0.0.pom
- https://repo.jenkins-ci.org/releases/org/connectbot/jbcrypt/jbcrypt/1.0.0/jbcrypt-1.0.0.pom
Required by:
project : > org.jenkins-ci.main:jenkins-war:2.252 > org.jenkins-ci.main:jenkins-core:2.252
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
What's odd is that the 1.0.0 artifact doesn't show up at https://repo.maven.apache.org/maven2/org/connectbot/jbcrypt/. I also noticed that the urls don't quite match either. Like if I try to get v1.0.1 it doesn't resolve either because it expects an extra "jbcrypt" for the group name.
I have this problem even when using the latest jenkins-war release (2.304).
What's going on?
You have to add the Jenkins public repository to your configuration. It contains all libraries available in the releases repository and all required dependencies.
The file exists: https://repo.jenkins-ci.org/public/org/connectbot/jbcrypt/jbcrypt/1.0.0/jbcrypt-1.0.0.jar
repositories {
mavenCentral()
maven {
url 'https://repo.jenkins-ci.org/public/'
}
}

Add specific plugin version in Gradle using 'Apply'

How to apply a specific plugin version using newer Gradle syntax? I would like to do something like this but this gives an error of unknown property 'version':
apply plugin: 'com.bmuschko.docker-remote-api', version: '2.0.3'
The new plugin syntax can be seen on the Gradle Plugins Repository page for the plugin you wish to apply: https://plugins.gradle.org/plugin/com.bmuschko.docker-remote-api
Using the plugins DSL:
plugins {
id "com.bmuschko.docker-remote-api" version "6.1.3"
}
Using legacy plugin application:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.bmuschko:gradle-docker-plugin:6.1.3"
}
}
apply plugin: "com.bmuschko.docker-remote-api"
In your build.gradle file, apply the plugin with a plugins block near the top of your script:
plugins {
id "com.bmuschko.docker-remote-api" version "2.0.3"
}
The syntax you have there is not new, it the legacy plugin application
To specify the version for the legacy way, you need to use the buildscript { } block:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.bmuschko:gradle-docker-plugin:2.0.3"
}
}
apply plugin: "com.bmuschko.docker-remote-api"

Gradle plugin with custom group id

Gradle 6.1
I am having difficulties to use the new plugin configuration mode in Gradle with a custom plugin coming from a custom repository.
buildscript {
repositories {
maven {
url = uri("https://custom")
}
mavenCentral()
jcenter()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
}
plugins {
java
idea
id("com.custom.gradle.plugin.myplugin") version "1.1.0"
}
I get this error:
Plugin [id: 'com.custom.gradle.plugin.myplugin', version: '1.1.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.custom.gradle.plugin.myplugin:com.custom.gradle.plugin.myplugin:1.1.0')
Searched in the following repositories:
Gradle Central Plugin Repository
Gradle will use the plugin id as its group id.
It works if I use the old ways:
buildscript {
repositories {
maven {
url = uri("https://custom")
}
mavenCentral()
jcenter()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
dependencies {
classpath("com.custom:com.custom.gradle.plugin.myplugin:1.1.0")
}
}
apply(plugin = "com.custom.gradle.plugin.myplugin")
Is there a way to specify the group id with the 'id' command? Or am I breaking the plugin definition's contract with that old plugin?
In order to use the newer/preferred plugins { } DSL, the custom plugin must publish a plugin marker artifact.
If the custom plugin is able to be modified, then I suggest updating to make use of the Java Gradle Plugin Development plugin which will create the marker for you.
If the plugin is not able to be updated, then you can still use the plugins { } block, but you'll need to manually resolve the plugin:
In the main build.gradle:
plugins {
id("com.custom.gradle.plugin.myplugin") version "1.1.0"
}
Then resolve the plugin manually in settings.gradle:
pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.id == "com.custom.gradle.plugin.myplugin") {
useModule("com.custom:com.custom.gradle.plugin.myplugin:${requested.version}")
}
}
}
}
See Plugin Resolution Rules
for more details.

How can I disable cache-redirector of `org.jetbrains.intellij` for some dependencies?

I want to introduce com.alibaba:fastjson:1.2.58 in my plugin project, but when gradle resolve dependencies, the org.jetbrains.intellij plugin redirect the download request to https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/releases/com/alibaba/fastjson/1.2.58/fastjson-1.2.58.pom, which is not exists.
How can I force gradle download this dependency from mavenCentral ?
Here is my build.gradle:
buildscript {
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url 'https://dl.bintray.com/jetbrains/intellij-plugin-service'
}
}
}
plugins {
id "org.jetbrains.intellij" version "0.4.4"
}
dependencies {
implementation 'com.alibaba:fastjson:1.2.58'
}
apply plugin: 'idea'
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
intellij {
version ideaVersion
updateSinceUntilBuild false
plugins = [
"com.jetbrains.php:${phpPluginVersion}",
"com.jetbrains.php.blade:${bladePluginVersion}",
'CSS',
'java-i18n',
'properties',
'git4idea'
]
pluginName 'tw tools'
}
patchPluginXml {
sinceBuild '173'
}
group 'com.baiguiren'
version '1.2'
wrapper {
gradleVersion '5.4.1'
}
Output of ./gradlew clean && ./gradlew build:
BUILD SUCCESSFUL in 0s
1 actionable task: 1 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':prepareSandbox'.
> Could not resolve all files for configuration ':runtimeClasspath'.
> Could not find com.alibaba:fastjson:1.2.58.
Searched in the following locations:
https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/releases/com/alibaba/fastjson/1.2.58/fastjson-1.2.58.pom
https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/releases/com/alibaba/fastjson/1.2.58/fastjson-1.2.58.jar
file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIU/2018.3.5/3abea719ce307bc4f573cba4e3d86f4e35cab07/ideaIU-2018.3.5/com.alibaba/fastjson/1.2.58/ivy-1.2.58.xml
file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIU/2018.3.5/3abea719ce307bc4f573cba4e3d86f4e35cab07/ideaIU-2018.3.5/fastjson-1.2.58-withKotlin-withSources.xml
file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIU/2018.3.5/3abea719ce307bc4f573cba4e3d86f4e35cab07/ideaIU-2018.3.5/com.alibaba/fastjson/1.2.58/fastjson-1.2.58.jar
file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIU/2018.3.5/3abea719ce307bc4f573cba4e3d86f4e35cab07/ideaIU-2018.3.5/fastjson.jar
file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2018.3.5/78cbcd517ec112fbb0c7b45b00b464c1aa6371f3/fastjson-1.2.58-[classifier].jar
https://cache-redirector.jetbrains.com/plugins.jetbrains.com/maven/com/alibaba/fastjson/1.2.58/fastjson-1.2.58.pom
https://cache-redirector.jetbrains.com/plugins.jetbrains.com/maven/com/alibaba/fastjson/1.2.58/fastjson-1.2.58.jar
file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/com.alibaba/fastjson-1.2.58.xml
file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIU/2018.3.5/3abea719ce307bc4f573cba4e3d86f4e35cab07/ideaIU-2018.3.5/plugins/fastjson/fastjson.jar
file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/fastjson-1.2.58/fastjson.jar
file:/Users/ruby/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2018.3.5/78cbcd517ec112fbb0c7b45b00b464c1aa6371f3/fastjson-2018.3.5.jar
Required by:
project :
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
I have tried to Invalid caches and restart, but not work.
I even tried to remove org.jetbrains.intellij plugin, but it's required by the project.
There is nothing wrong with cache-redirector, it's just one of the repositories registered in the project, Gradle checks them all.
Try to add the mavenCentral repo to your build.gradle (at the moment it's defined for buildscript only):
repositories {
mavenCentral()
}

Resources