Issue while building spring-framework source - spring

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.

Related

SpringBoot +Vue Project: Gradle Build Error

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.

Specifying plugin class in bytebuddy gradle plugin

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.

Could not get unknown property 'a.b.c' for root project

I got some source code and was asked to build it. It was a Gradle project. So I changed to the project directory and ran:
$ gradle clean assemble
and the following error came up:
...
* What went wrong:
A problem occurred evaluating root project 'pcase'.
> Could not get unknown property 'postgresql.jdbc' for root project 'pcase' of type org.gradle.api.Project.
...
There is a settings.gradle file in the project folder too. It contains:
rootProject.name = 'pcase'
I took a look at build.gradle and found lots of occurrences like
${project['x']}
For example:
buildscript {
dependencies {
...
// FlywayDB, JOOQ.
classpath "org.postgresql:postgresql:${project['postgresql.jdbc']}"
classpath "org.flywaydb:flyway-gradle-plugin:${project['flywaydb.plugin.version']}"
classpath "nu.studer:gradle-jooq-plugin:${project['jooq.plugin.version']}"
...
What could be ${project['x']}? Looks like associative array in bash and the build script tries to get the value of the key 'x'.
But I didn't find the place in code where this array would be declared and initialized.
The question is: Is the project buildable or is it better to consult the company that worked at it before me?
From the information provided, the project is perfectly buildable, to some certain extend. First of all, project['a.b.c'] is Groovy syntax to access properties from the project object. They're referred to as project properties.
They can be set via
Project properties via command line: gradle -Ppostgresql.jdbc=x.y.z
System properties via command line: gradle -Dorg.gradle.project.postgresql.jdbc=x.y.z
System properties via gradle.properties: org.gradle.project.postgresql.jdbc=x.y.z
All 3 properties (postgresql.jdbc, flywaydb.plugin.version, jooq.plugin.version) denote the version numbers of the particular build script dependencies. However, which versions to use best is beyond my knowledge. I would certainly consult the respective project websites, Maven artifact search or simply ask the company.
org.postgresql:postgresql is the database JDBC driver and certainly depends on the database version.
org.flywaydb:flyway-gradle-plugin is for database migrations. Try with the latest version.
I wasn't able to find gradle-jooq-plugin on Maven central. It's most likely available on the Gradle Plugin Portal.

Drools 7.7.0.Final generateModel fails with line and column information but no file information

I'm trying to build a kjar from our existing drools project with lots of individual rules file.
To speed up deployment I would like to generate the model into the kjar as introduced with Drools 7.7.0.Final.
The command I use is: mvn clean install -DgenerateModel=WITHDRL -X
Pretty soon I get an error message:
[ERROR] Failed to execute goal org.kie:kie-maven-plugin:7.7.0.Final:generateModel (default-generateModel) on project foobar: Execution default-generateModel of goal org.kie:kie-maven-plugin:7.7.0.Final:generateModel failed: (line 1,col 33) Parse error. Found ",", expected one of "%=" "&=" "*=" "++" "+=" "--" "-=" "/=" ";" "<<=" "=" ">>=" ">>>=" "^=" "|="
[ERROR] Problem stacktrace :
[ERROR] org.drools.javaparser.GeneratedJavaParser.generateParseException(GeneratedJavaParser.java:11460)
There is no information in which file this error occured. Since our project contains >300 DRL Files it is a bit hard to find the culprit.
Is there any way to get more information out of the Drools Maven Plugin on which file is causing the issue?
That's bug of kie-maven-plugin.
There are the bug's JIRA below.
DROOLS-3505
DROOLS-3523
If dialect is java and your rules have connect expressions with "comma" inside a modify block, The workaround is that
property inside modify block one by one.
the other workaround is changing dialect to mvel.
But, you have to write 'dialect "mvel"' in each rule file.
because dialect species isn't shared in package.

Gradle: try to skp sonarqube results in error

I have a gradle script that uses Sonarqube plugin (org.sonarqube). If I let the publish task depends on it, it works fine.
The problem is to run sonarqube only if a condition is true. So I tried (as described in gradle documentation) all of these three statements:
sonarqube.enabled (false)
sonarqube.enabled=false
sonarqube.onlyIf { false }
Each results in an error, here the one I got trying the first statement
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\Eclipse\workspace3.6\at.mic.hermes\build.gradle' line: 208
* What went wrong:
A problem occurred evaluating root project 'at.mic.hermes'.
> Could not find method enabled() for arguments [false] on org.sonarqube.gradle.SonarQubeExtension_Decorated#412196.
To be sure to have not typo in the code I tried all statements with the test task, e.g.
test.enabled(false)
and this results (as expeted) in
:test SKIPPED
Any ideas what I made wrong / what must be changed? Thx in advance!
Frank
I think the problem come from a name conflict. There are 2 objects named 'sonarqube':
The SonarQube task
The SonarQube extension
It seems to not break your build, but here when you write sonarqube.enabled it access to the extension (according to your stacktrace).
The solution is probably to disambiguate using tasks.sonarqube.enabled. See https://docs.gradle.org/current/userguide/more_about_tasks.html#N11143

Resources