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
Related
I have successfully published to Artifact Registry, and I can use artifacts from there in "normal" use: dependencies { implementation("mygroup:myartifact:myversion") }.
My issue is plugins. I have created a plugin. I can successfully publish it to Artifact Registry and also to Maven local. I can use it from Maven local, but I can't get my build script to take it from Artifact Registry.
buildscript {
repositories {
maven(url = uri("artifactregistry://us-west1-maven.pkg.dev/glitchy-maven/repo"))
}
}
plugins {
id("com.google.cloud.artifactregistry.gradle-plugin") version "2.1.1"
id("com.glitchybyte.gradle.plugin.buildinfo") version "1.0.0"
`java-library`
}
And I get:
* What went wrong:
Plugin [id: 'com.glitchybyte.gradle.plugin.buildinfo', version: '1.0.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.glitchybyte.gradle.plugin.buildinfo:com.glitchybyte.gradle.plugin.buildinfo.gradle.plugin:1.0.0')
Searched in the following repositories:
Gradle Central Plugin Repository
So, it's not looking into Artifact Registry for plugins. I know I'm missing something, but I don't know what.
...Update...
I removed buildscript from build.gradle.kts, and instead I added this to settings.gradle.kts:
pluginManagement {
plugins {
id("com.google.cloud.artifactregistry.gradle-plugin") version "2.1.1"
}
repositories {
maven(url = uri("artifactregistry://us-west1-maven.pkg.dev/glitchy-maven/repo"))
}
And I get:
* What went wrong:
Error resolving plugin [id: 'com.glitchybyte.gradle.plugin.buildinfo', version: '1.0.0']
> Could not resolve all dependencies for configuration 'detachedConfiguration1'.
> Not a supported repository protocol 'artifactregistry': valid protocols are [http, https, file, gcs, s3, sftp]
Good day,
The following is part of my code in build.gradle:
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8"
}
}
plugins {
//id 'org.sonarqube' version '2.6.2'
id 'org.sonarqube' version '2.8'
}
apply plugin: 'nebula.nebula-release'
apply plugin: "org.sonarqube"
apply from: "gradle/locations.gradle"
apply from: "gradle/buildEnvironment.gradle"
apply from: "gradle/project.gradle"
apply from: "gradle/versions.gradle"
apply from: "gradle/jacoco.gradle"
apply from: "gradle/sonarqube.gradle"
apply from: "gradle/testing.gradle"
When i run gradle command, it will hit the following error:
* What went wrong:
Plugin [id: 'org.sonarqube', version: '2.8'] 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.sonarqube:org.sonarqube.gradle.plugin:2.8')
Searched in the following repositories:
Gradle Central Plugin Repository
However, if I change the id 'org.sonarqube' version '2.8' in my build.gradle to id 'org.sonarqube' version '2.6.2', it will build success.
May I know what mistake I make?
** I am very new to gradle **
Adding dependency manually and applying it is not recommended (read Legacy Plugin Application). Plugins DSL is a recommended way. Definitely you shouldn't use both at the same time.
Your fragment should be changed to:
plugins {
id 'nebula.nebula-release' version '4.0.1'
id 'org.sonarqube' version '2.8'
}
repositories {
jcenter()
mavenCentral()
}
apply from: "gradle/locations.gradle"
apply from: "gradle/buildEnvironment.gradle"
apply from: "gradle/project.gradle"
apply from: "gradle/versions.gradle"
apply from: "gradle/jacoco.gradle"
apply from: "gradle/sonarqube.gradle"
apply from: "gradle/testing.gradle"
I don't know which version of the nebula.nebula-release plugin you use, so I took the latest.
I just ran into the same problem. In my case, I was running Gradle offline so it was not able to download the plugin.
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.
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 am trying to run the following minimal gradle build file including the dependency management plugin:
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
plugins {
id "java"
id "io.spring.dependency-management" version "1.0.4.RELEASE"
}
But then running gradle fails:
* What went wrong:
Plugin [id: 'io.spring.dependency-management', version: '1.0.4.RELEASE'] 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 'io.spring.dependency-management:io.spring.dependency-management.gradle.plugin:1.0.4.RELEASE')
Searched in the following repositories:
Gradle Central Plugin Repository
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.5.1/userguide/command_line_interface.html#sec:command_line_warnings
Is there a missing dependency in the gradle file?
The plugin cannot be found because you defined repositories inside your build script and tried to use plugin outside it. Remove buildscript or add repositories for your build file also.
(Dependencies and repositories defined inside build script are accessible in that buildscript scope)
Example:
plugins {
id "java"
id "io.spring.dependency-management" version "1.0.4.RELEASE"
}
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}