I'm currently trying to create a simple discord bot. I finished the code and I'm trying to export it through shadow--> shadowJar. I keep getting this error message:
Plugin [id: 'com.github.johnrengelman.shadow', version: '5.2.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.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:5.2.0')
Searched in the following repositories:
Gradle Central Plugin Repository
I've tried to look up how to fix this, being pretty unsuccessful. I'm very new to this, only having experience with simple Java, like multi-dimensional arrays, classes, objects, etc.
Please help!
Here's my build.gradle:
plugins {
id 'java'
id 'application'
id "com.github.johnrengelman.shadow" version "5.2.0"
}
mainClassName = "Main"
group 'com.mywebsite'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile 'net.dv8tion:JDA:3.5.0_329'
}
At the time of writing this answer, the shadow plugin's latest version is 2.0.3.
So I have no idea where you sourced that 5.2.0 from but this is the issue: there is no shadow plugin version 5.2.0 out there.
Related
I'm trying to configure meecrowave gradle plugin according to this documentation:
This is my script:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.apache.meecrowave:meecrowave-gradle-plugin:1.2.6"
}
}
plugins {
id 'java'
id 'org.apache.meecrowave.meecrowave'
}
meecrowave {
httpPort = 9090
}
I'm getting this error message:
Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-5.0-bin.zip'.
Build file '/home/jcabre/projectes/digital/espaidoc/security/build.gradle' line: 12
Plugin [id: 'org.apache.meecrowave.meecrowave'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (plugin dependency must include a version number for this source)
Plugin [id: 'org.apache.meecrowave.meecrowave'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (plugin dependency must include a version number for this source)
I've also tried with:ยด
plugins {
id 'java'
id 'org.apache.meecrowave.meecrowave' version '1.2.6'
}
Then I get this message:
Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-5.0-bin.zip'.
Build file '/home/jcabre/projectes/digital/espaidoc/security/build.gradle' line: 12
Plugin [id: 'org.apache.meecrowave.meecrowave', version: '1.2.6'] 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 'org.apache.meecrowave.meecrowave:org.apache.meecrowave.meecrowave.gradle.plugin:1.2.6')
Searched in the following repositories:
Gradle Central Plugin Repository
Plugin [id: 'org.apache.meecrowave.meecrowave', version: '1.2.6'] 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 'org.apache.meecrowave.meecrowave:org.apache.meecrowave.meecrowave.gradle.plugin:1.2.6')
Searched in the following repositories:
Gradle Central Plugin Repository
PARENT GRADLE
plugins {
id "base"
id 'com.github.spotbugs' version '1.6.8' apply false
id 'io.franzbecker.gradle-lombok' version '2.0' apply false
id 'fish.payara.micro-gradle-plugin' version '1.0.0' apply false
}
apply from: "$projectDir/gradle/java.gradle"
apply from: "$projectDir/gradle/spotbugs.gradle"
apply from: "$projectDir/gradle/checkstyle.gradle"
apply from: "$projectDir/gradle/pmd.gradle"
apply from: "$projectDir/gradle/jacoco.gradle"
apply from: "$projectDir/gradle/repositories.gradle"
apply from: "$projectDir/gradle/payara.gradle"
The problem is that this plugin is not published to the official Gradle plugins portail , so you cannot use plugins {} DSL (or you need to configure the pluginManagement.resolutionStrategy, see enter link description here )
The other problem is that the documentation you mentioned is not up-to-date !
The plugin ID has been changed to org.apache.microwave.microwave
Easiest way to apply this plugin:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.apache.meecrowave:meecrowave-gradle-plugin:1.2.6"
}
}
// use "new" plugin ID
apply plugin: "org.apache.microwave.microwave"
// or use directly PLugin class
//apply plugin: org.apache.meecrowave.gradle.MeecrowavePlugin
EDIT see Romain's answer for more accurate details about this issue.
just to let you know that the plugin id issue was not a "renaming" but a forgotten renaming (originally meecrowave was named microwave before joining openwebbeans project).
I fixed the plugin id in https://issues.apache.org/jira/browse/MEECROWAVE-186 and updated the doc to reflect that. Note that the doc is not in the sources itself but online at http://openwebbeans.apache.org/meecrowave/meecrowave-gradle/index.html.
Romain
I'm a beginner in gradle, using version 4.8.
Whatever I do , the plugins are never found. I get this error message:
Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.3.20'] 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 'org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.3.20')
Searched in the following repositories:
Gradle Central Plugin Repository
No matter how many repositories I add, it seems it is only looking in "Gradle Central Plugin Repository"
My gradle.build file:
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.20"
classpath "org.jetbrains.kotlin.jvm:kotlin-gradle-plugin:1.3.20"
}
}
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.3.20'
id 'kotlin2js' version '1.3.20'
}
Can you help me?
Try the following gradle.build configuration:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.20"
}
}
plugins {
id 'java'
}
apply plugin: 'kotlin2js'
repositories {
mavenCentral()
}
When you include the plugin by id, it seems Gradle wants to retrieve the plugin from the Gradle plugin portal, but the Kotlin plugin is not there, it's part of the buildscript dependency. Using it with the apply plugin works. You can also find a slightly different working example here.
I had similar problem because i forgot about proxy settings like systemProp.https.proxyHost and systemProp.http.proxyHost and etc. that was set in ~/.gradle/gradle.properties.
I fixed configuration and plugin was successfully dowlnloaded
Check gradle.properties and try to add correct proxy settings if you behind firewall or escape this settings if you not.
you need to add repository mavenCentral() to the buildscript dependencies.
for example: kotlin-gradle-plugin:1.3.20. also the documentation hints for that.
Go to your project and then to the Gradle script. In Gradle, Go to Setting.Gradle and change the Fist Bitray Url to https://plugins.gradle.org/m2/.
I'm tryinging to create a plugin for intellij using gradle, I've followed jetbrains tutorial:
https://www.jetbrains.org/intellij/sdk/docs/tutorials/build_system/prerequisites.html
and I get the following error:
Plugin [id: 'org.jetbrains.intellij', version: '0.3.9'] 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 'org.jetbrains.intellij:org.jetbrains.intellij.gradle.plugin:0.3.9')
Searched in the following repositories:
Gradle Central Plugin Repository
Taking a look at the gradle build file, there is the following lines:
plugins {
id 'java'
id 'org.jetbrains.intellij' version '0.3.9'
}
How do I find out what version of org.jetbrains.intellij I do have? How do I get 0.3.9?
My version of intellij is 2018.2.2 Community
I'm trying to use the gradle plugin gradle-bintray-plugin.
Currently using Gradle 4.4
Following the tutorial in the github page I should add the plugin in this way:
plugins {
...
id "com.jfrog.bintray" version "1.+"
}
I'm receiving this error message and not being able to continue:
Plugin [id: 'com.jfrog.bintray', version: '1.+'] was not found in any
of the following sources:
Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
Plugin Repositories (dynamic plugin versions are not supported) Open File
Dynamic versions were maybe authorized in the past for the plugins block (as the tutorial gives it as an example) but now it's forbidden
if (versionSelectorScheme.parseSelector(markerVersion).isDynamic()) {
result.notFound(SOURCE_NAME, "dynamic plugin versions are not supported");
return;
}
But it's not the case for the old buildscript way and the below code is working fine with Gradle 4.10
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.+'
}
}
I just find out the solution. Looks like it just works specifying the exact version that you want to use.
So changing this:
plugins {
...
id "com.jfrog.bintray" version "1.+"
}
To this:
plugins {
...
id "com.jfrog.bintray" version "1.8.4" // exact version!
}
Now Works!
I am writing a set of Gradle plugins, but I want to control the specific versions of groovy and gradle that are used.
I don't want the plugins to depend on whatever versions of Gradle/Groovy are installed, like the following would do:
dependencies {
compile localGroovy()
compile gradleApi()
}
Another reason I don't want to use the local method - when you use a proper dependency specification, Gradle then knows about the source code for those libs and the IDE plugins can hookup the source automatically.
Below are the relevant sections of my build script:
allprojects { Project iProject ->
apply plugin: 'idea'
apply plugin: 'maven'
repositories {
jcenter()
}
}
subprojects { Project iProject ->
apply plugin: 'groovy'
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.3.2'
}
}
project(':eclipsei2g') {
group = 'eclipsei2g'
version = '0.0.1-SNAPSHOT'
dependencies {
compile 'org.gradle:gradle-core:2.0'
}
}
project(':g2idea13') {
group = 'g2idea13'
version = '0.0.1-SNAPSHOT'
dependencies {
compile 'org.gradle:gradle-core:2.0'
compile 'org.gradle-plugins:gradle-ide:2.0'
}
}
When I run this I get an error resolving the gradle-ide dependency:
Could not resolve all dependencies for configuration ':g2idea13:compile'.
> Could not find org.gradle:gradle-ide:2.0.
Searched in the following locations:
http://jcenter.bintray.com/org/gradle/gradle-ide/2.0/gradle-ide-2.0.pom
http://jcenter.bintray.com/org/gradle/gradle-ide/2.0/gradle-ide-2.0.jar
Required by:
g2idea13:g2idea13:0.0.1-SNAPSHOT
There doesn't seem to be anything on the jcenter repository since 0.9 for the plugins stuff.
I also tried 'org.gradle:gradle-ide:2.0'.
Is this even how I should be doing this? Is there another way to specify a specific gradle version? Am I just using the wrong repository? I couldn't even get gradle-core to resolve on mavenCentral(). Is there an official Gradle repository somewhere that I should be using?
gradleApi() is the way to go. There isn't currently a public list of dependencies for Gradle plugins.