SpringBoot + Vue project, gradle build error:
Execution failed for task ':nodeSetup'.
Could not find method layout() for arguments [pattern, com.moowork.gradle.node.task.SetupTask$_addRepository_closure5$_closure7#185cb06f] on object of type org.gradle.api.internal.artifacts.repositories.DefaultIvyArtifactRepository.
Cause: There is a breaking change in gradle 6.8 which is you can checkout here:
https://docs.gradle.org/current/userguide/upgrading_version_6.html#configuring_the_layout_of_an_ivy_repository
"The 'layout' method taking a configuration block has been removed and is replaced by 'patternLayout'.
Check this here.
Related
I'm using Micronaut 3.1.3 together with Gradle 7.2 to build my project.
After switching to Gradle 7.3, built breaks emitting some context-free error message:
$ ./gradlew clean build
Executed by Gradle 7.3
- using Java 11.0.13
- using Kotlin 1.5.31
- using Groovy 3.0.9
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project '[PROJECT]'.
> The value for this property is final and cannot be changed any further.
With --stacktrace a very long trace appears. The following excerpt makes me guess
that the problem might lay in the Micronaut plugin:
* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project '[PROJECT]'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.wrapException(LifecycleProjectEvaluator.java:75)
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:68)
at org.gradle.configuration.project.LifecycleProjectEvaluator.access$400(LifecycleProjectEvaluator.java:51)
[...]
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:61)
Caused by: java.lang.IllegalStateException: The value for this property is final and cannot be changed any further.
at org.gradle.api.internal.provider.AbstractProperty$FinalizedValue.beforeMutate(AbstractProperty.java:489)
at org.gradle.api.internal.provider.AbstractProperty.assertCanMutate(AbstractProperty.java:263)
at org.gradle.api.internal.provider.AbstractProperty.setSupplier(AbstractProperty.java:212)
at org.gradle.api.internal.provider.DefaultProperty.set(DefaultProperty.java:71)
at org.gradle.api.tasks.testing.Test.useTestFramework(Test.java:979)
at org.gradle.api.tasks.testing.Test.useJUnitPlatform(Test.java:1049)
at org.gradle.api.tasks.testing.Test.useJUnitPlatform(Test.java:1032)
at io.micronaut.gradle.MicronautLibraryPlugin.lambda$null$1(MicronautLibraryPlugin.java:103)
at org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:123)
[...]
at org.gradle.api.internal.DefaultDomainObjectCollection.withType(DefaultDomainObjectCollection.java:201)
at io.micronaut.gradle.MicronautLibraryPlugin.lambda$apply$4(MicronautLibraryPlugin.java:101)
at org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:123)
[...]
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:61)
Cause "problem occurred configuring root project" I'm not sure which part of my
build.gradle raises the problem. So following my first guess regarding Micronaut
plugin, here is an excerpt telling you the list of plugins in use and config of this plugin:
plugins {
id('org.jetbrains.kotlin.jvm') version "${kotlinVersion}"
id('groovy')
id('org.jetbrains.kotlin.kapt') version "${kotlinVersion}"
id('com.github.johnrengelman.shadow') version '7.+'
id('io.micronaut.application') version '2.+'
id('org.jetbrains.kotlin.plugin.allopen') version "${kotlinVersion}"
id('com.google.cloud.tools.jib') version '3.+'
id('org.openapi.generator') version '5.+'
id('com.heroku.sdk.heroku-gradle') version '2.+'
}
[...]
micronaut {
runtime('netty')
testRuntime('spock2')
processing {
incremental(true)
annotations('[PACKAGE]')
}
}
Maybe this gives enough information to tackle down the cause of the problem?
If not please let me know.
Regards
I hit the same issue with my Java build and asked for help on gradle slack channel. It found to be a change in Gradle 7.3 behavior.
This issue contains an explanation of the cause and how to fix it.
It helped me to solve the issue with my build: I had options defined in one of the test tasks and then useJUnitPlatform was applied across all test tasks afterwards using this snippet:
tasks.withType(Test).configureEach {
useJUnitPlatform() // <-- this line was breaking the build
}
This broke the build after migrating to Gradle 7.3. Removing options solved the problem for me.
Here's an issue requesting to convert this breaking behavior to a warning in Gradle 7.3 and make it a breaking change in 8.0.
FYI: Upgrade to Gradle 7.3.1 brings back successful builds.
I have updated ByteBuddy Gradle plugin to the version 1.11.18.
Unlikely the previous version, where I could set up byteBuddy.transform.plugin as a string, in the latest version I have to set it up as a class.
Cannot cast object 'com.test.PluginImpl.class' with class 'java.lang.String' to class 'java.lang.Class' due to: java.lang.ClassNotFoundException: com.test.PluginImpl.class
I'm trying to figure out how to get the plugin applied
I followed the readme (https://github.com/raphw/byte-buddy/tree/master/byte-buddy-gradle-plugin#buildgradle):
byteBuddy {
transformation {
plugin = com.test.PluginImpl.class
}
}
However, I've got the error:
* What went wrong:
A problem occurred evaluating root project 'Test'.
> Could not get unknown property 'com' for object of type net.bytebuddy.build.gradle.Transformation.
Did you add the plugin to the buildsource? Groovy is a bit guessy when it comes to these things. Also try importing the class and using the unqualified name.
The old approach did no longer work properly with newer Gradle versions which is why I had to redo it.
Mlunittest is throwing error while running as a gradle comment and I am getting below error
Local message: failed to read resource at resources/marklogic-unit-test: Internal Server Error. Server Message: RESTAPI-INVALIDREQ: (err:FOER0000) Invalid request: reason: Extension marklogic-unit-test or a dependency does not exist: XDMP-MODNOTFOUND: (err:XQST0059) Module /marklogic.rest.resource/marklogic-unit-test/assets/resource.xqy not found
I am using:
MarkLogic 9.0-12 version
Gradle 4.3.1
DHF 4.3.2
This error message suggests that the marklogic-unit-test libraries are not being loaded into the modules database correctly. If you're using ml-gradle to manage your modules you may want to double check your build.gradle file, specifically that marklogic-unit-test is configured as a dependency:
dependencies {
mlBundle "com.marklogic:marklogic-unit-test-modules:1.0.0"
}
You can check out a similar issue that was filed with the marklogic-unit-test and how it was resolved here: https://github.com/marklogic-community/marklogic-unit-test/issues/86
For a more complete example of a build.gradle file that imports marklogic-unit-test into a project check out the marklogic-unit-test project at https://github.com/marklogic-community/marklogic-unit-test#start-using-marklogic-unit-test.
I am facing some issue while building spring-framework source, what is the issue?
FAILURE: Build failed with an exception.
Where:
Build file '/home/steph/workspace_sts/spring-framework/spring-beans/spring-beans.gradle' line: 30
What went wrong:
A problem occurred evaluating project ':spring-beans'.
> No such property: values for class: org.gradle.api.internal.tasks.DefaultTaskDependency
Possible solutions: values
It seems to be saying that the class DefaultTaskDependency does not have a field and getter/setter called getValues()/setValues() but the gradle build file is passing in some data which it is trying to set by calling setValues() and passing whatever data is in the gradle.build file under values. I would double check which version of gradle spring source says it needs to be built with vs. what version you are building it with.
Have integrated scoverare plugin of gradle for scala project and am able to run all the tasks from command line.
the reportScoverage task runs but it skips saying no output type defined.
I tried following
reportScoverage {
coverageOutputHTML = true
}
but it failed with error that no such property "coverageOutputHTML" defined
Scoverage plugin version : 1.1.0
can someone let me know or point to tutorial on how to define it.