Failed to resolve imported Maven boms: Cannot resolve external dependency - gradle

I'm very new to grails and therefore I'm trying to do the following tutorial with IntelliJ: https://guides.grails.org/creating-your-first-grails-app/guide/index.html
After I cloned the repository, the README is asking me to run the following command:
gradle publishGuide
But I get the following error:
sam#sam-USMC:~/IdeaProjects/creating-your-first-grails-app$ gradle publishGuide
Cannot resolve reloading agent JAR: Failed to resolve imported Maven boms: Cannot resolve external dependency org.springframework.boot:spring-boot-dependencies:2.1.9.RELEASE because no repositories are defined.
Required by:
project :complete
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
* Where:
Build file '/home/sam/IdeaProjects/creating-your-first-grails-app/complete/build.gradle' line: 19
* What went wrong:
A problem occurred evaluating project ':complete'.
> org.codehaus.groovy.runtime.DefaultGroovyMethods.each([Ljava/lang/Object;Lgroovy/lang/Closure;)[Ljava/lang/Object;
* 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
BUILD FAILED in 1s
Line 19 of the build.gradle file looks like this:
apply plugin:"org.grails.grails-web"
Grateful for any help!

Related

Gradle Project declares a dependency from configuration 'detachedConfiguration1' to configuration 'default'

I have a gradle project https://gist.github.com/iva-nova-e-katerina/f5428f52afa36c5f2719d047ccc53213 and run it with "./gradlew build" with following error:
└─$ ./gradlew build
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
Parallel execution is an incubating feature.
> Configure project :
ArtifactoryUser user: null
Using Java from /home/katya/java (version 11.0.2)
Detected development environment
[buildinfo] Properties file path was not found! (Relevant only for builds running on a CI Server)
FAILURE: Build failed with an exception.
* Where:
Script '/home/katya/tmp_work/groovy/gradle/binarycompatibility.gradle' line: 67
* What went wrong:
Could not determine the dependencies of task ':groovy-console:japicmp'.
> Could not resolve all files for configuration ':groovy-console:detachedConfiguration1'.
> Could not resolve org.codehaus.groovy:groovy-console:2.4.16.
Required by:
project :groovy-console
> Project :groovy-console declares a dependency from configuration 'detachedConfiguration1' to configuration 'default' which is not declared in the descriptor for project :groovy-console.
* 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
BUILD FAILED in 3s
Could you explain what is going on? What is 'detachedConfiguratoin1' and how to fix this error?

Plugin with id 'osgi' not found

I am trying to build a project(https://github.com/fge/btf) locally using gradle. There is a plugin "osgi" being used but whenever I build it, I get the error plugin not found. I have tried giving different flavors of OSGi, added the repositories and dependency. Still getting the same error. Please help. Thanks in advance.
FAILURE: Build failed with an exception.
Where:
Build file '/root/btf-1.2/build.gradle' line: 61
What went wrong:
A problem occurred evaluating root project 'btf'.
Plugin with id 'osgi' not found.
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 7.0.
BUILD FAILED in 1s
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings
logs generated are as below
Gradle has discontinued their built-in osgi plugin. Please see the Bnd Gradle plugins.
https://github.com/bndtools/bnd/blob/master/biz.aQute.bnd.gradle/README.md#replacing-use-of-gradles-deprecated-osgi-plugin

build error netflix fenzo library

The Netflix fenzo (https://github.com/Netflix/Fenzo) build fails complaining on gradle plugin from netflix not available.
Stack trace below
> Configure project :
Inferred project: fenzo, version: 1.1.0-SNAPSHOT
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/UKHANVA/git/Fenzo/build.gradle' line: 32
* What went wrong:
A problem occurred evaluating root project 'fenzo'.
> Failed to apply plugin [class 'nebula.plugin.info.dependencies.DependenciesInfoPlugin']
> Could not create plugin of type 'DependenciesInfoPlugin'.
> No signature of method: org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.DefaultVersionComparator.asStringComparator() is applicable for argument types: () values: []
Possible solutions: asVersionComparator()
* 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
BUILD FAILED in 12s
I suspect you are using the version of gradle you have in your path:
gradle build
Try running the build with the gradle wrapper script in the repository:
./gradlew build
The version of gradle used by the wrapper is configured in gradle/wrapper/gradle-wrapper.properties. Fenzo is using 2.13 which is quite old.
By experimenting with the wrapper version, I found that it builds successfully with Gradle 2.x & 3.x but not 4.x.
Gradle 4.0 gave me the exact same error as above. 4.8 also failed but with a different error.

Error resolving jhipster dependency in kotlin enabled project

My spring boot project which uses jhipster is having issue resolving one of its dependencies:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileKotlin'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not resolve io.github.jhipster:jhipster-framework:2.0.6.
Required by:
project :
> Could not resolve io.github.jhipster:jhipster-framework:2.0.6.
> Could not get resource 'https://jcenter.bintray.com/io/github/jhipster/jhipster-framework/2.0.6/jhipster-framework-2.0.6.pom'.
> Could not GET 'https://jcenter.bintray.com/io/github/jhipster/jhipster-framework/2.0.6/jhipster-framework-2.0.6.pom'. Received status code 409 from server:
* 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
BUILD FAILED in 9s
3 actionable tasks: 3 executed
Could not GET 'https://jcenter.bintray.com/io/github/jhipster/jhipster-framework/2.0.6/jhipster-framework-2.0.6.pom'. Received status code 409 from server:
Enable Gradle 'offline mode' and sync project
3:21:15 PM: Task execution finished 'assemble'.
For some reason it's asking me to compile offline when it's unable to resolve the jhipster library. Any ideas?
I configured my project to compile with kotlin but I don't think this is the issue here.
If you go to jcenter and search jhipster-framework, https://bintray.com/bintray/jcenter/io.github.jhipster%3Ajhipster-framework, there isn't a version 2.0.6. The latest version is 2.0.8.

Gradle Build Error Evaluating Root Project for org/gradle/internal/metaobject/MethodMixIn

I've been playing with a legacy project's build script and I get the following error with Gradle 2.13.
myhost jthoms$ gradle clean build
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.13/userguide/gradle_daemon.html.
FAILURE: Build failed with an exception.
* Where:
Build file '/<my-project>/build.gradle' line: 10
* What went wrong:
A problem occurred evaluating root project 'com.mycompany.myorg.myproject'.
> org/gradle/internal/metaobject/MethodMixIn
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.494 secs
My build.gradle file looks as follows:
buildscript {
repositories {
maven { url 'http://<my-nexus-repo>/' }
}
dependencies {
classpath 'com.bmuschko:gradle-clover-plugin:2.1.2'
}
}
apply plugin: 'com.bmuschko.clover'
// more build stuff below irrelevant to error line.
My build fails, so how can this error be fixed?
I worked this error out, but I couldn't find anything related to the class mentioned in the error output, so I thought that I would share my finding here.
I found this thread for a similar error. In the thread, #bmuschko recommended upgrading to a newer version of Gradle. For me, upgrading from Gradle version 2.13 to 3.5.1 worked like a charm.

Resources