Build failed using Gradle for spring source files - spring

I followed https://github.com/SpringSource/spring-framework link.
I successfully downloaded spring source with command
git clone git://github.com/SpringSource/spring-framework.git
But when i run
./gradlew build excpetion is thrown with message Execution failed for task':spring-core:compile Java. I am so confused .How to solve this ?

From https://github.com/SpringSource/spring-framework#building-from-source:
prerequisites: Git and the latest Early Access build of OpenJDK 1.8.

Related

Apache Groovy project `gradlew clean dist` fails under JDK 16.0.2 with '/SharedConfiguration...compiled by a more recent of Java...version 61.0

I'm trying to build the Apache Groovy project. The Apache Groovy project recommends asking questions on Slack or StackOverflow. I haven't received the email for Slack invite, so I'm trying StackOverflow first.
Per the README.adoc, I'm using Java 16+. I don't see any other requirements or setup required per the README.adoc, unless I missed something. I appreciate any help.
From a clean git clone of the Apache Groovy project I run ./gradlew clean dist and get the following error:
org/apache/groovy/gradle/SharedConfiguration has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file v
ersions up to 60.0
This can be reproduced as follows:
mkdir groovy-jdk16 && cd "$_"
java -version # initially java is not found (i.e. no conflicting versions)
export PATH="/c/java/jdk-16.0.2/bin:$PATH"
java -version
git clone https://github.com/apache/groovy.git
cd groovy/
./gradlew clean dist
LOG for JDK 16.0.2:
groovy $mkdir groovy-jdk16 && cd "$_"
groovy-jdk16 $java -version # initially java is not found (i.e. no conflicting versions)
bash: java: command not found
groovy-jdk16 $export PATH="/c/java/jdk-16.0.2/bin:$PATH"
groovy-jdk16 $java -version
openjdk version "16.0.2" 2021-07-20
- okio-jvm-2.10.0.jar (com.squareup.okio:okio:2.10.0) from repository Gradle Central Plugin Repository
This can indicate that a dependency has been compromised. Please carefully verify the signatures and checksums.
Open this report for more details: file:///C:/projects/groovy/groovy-jdk16/groovy/build/reports/dependency-verification/at-1671383936580/dependency-verification-report.html
This build uses Gradle Build Scans to gather statistics, share information about
failures, environmental issues, dependencies resolved during the build and more.
Build scans will be published after each build, if you accept the terms of
service, and in particular the privacy policy.
Please read
https://gradle.com/terms-of-service
https://gradle.com/legal/privacy
and then:
- set the `GRADLE_SCANS_ACCEPT` to `yes`/`no` if you agree with/refuse the TOS
- or create the C:\Users\me\.gradle\gradle-scans-license-agree.txt file with `yes`/`no` in it if you agree with/refuse
And we'll not bother you again. Note that build scans are only made public if
you share the URL at the end of the build.
FAILURE: Build failed with an exception.
* What went wrong:
org/apache/groovy/gradle/SharedConfiguration has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recog
nizes class file versions up to 60.0
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 6s
8 actionable tasks: 3 executed, 5 from cache
groovy $
TRY JDK 17.0.2
I see a lot of references to JDK 17 "sealed" classes in the code, so tried JDK 17.0.2 which results in the following error: java.lang.ClassNotFoundException: precompiled_OrgApacheGroovyBadPracticesDetection
This can be reproduced as follows:
mkdir groovy-jdk17 && cd "$_"
java -version # initially java is not found (i.e. no conflicting versions)
export PATH="/c/java/jdk-17.0.2/bin:$PATH"
java -version
git clone https://github.com/apache/groovy.git
cd groovy/
./gradlew clean dist
LOG for JDK 17.0.2:
groovy $mkdir groovy-jdk17 && cd "$_"
java -version
git clone https://github.com/apache/groovy.git
cd groovy/
./gradlew clean dist
groovy-jdk17 $java -version # initially java is not found (i.e. no conflicting versions)
bash: java: command not found
groovy-jdk17 $export PATH="/c/java/jdk-17.0.2/bin:$PATH"
groovy-jdk17 $java -version
openjdk version "17.0.2" 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8-86)
OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)
groovy-jdk17 $git clone https://github.com/apache/groovy.git
Cloning into 'groovy'...
remote: Enumerating objects: 401543, done.
remote: Counting objects: 100% (2177/2177), done.
remote: Compressing objects: 100% (811/811), done.
remote: Total 401543 (delta 1253), reused 2063 (delta 1143), pack-reused 399366
Receiving objects: 100% (401543/401543), 203.41 MiB | 2.73 MiB/s, done.
Resolving deltas: 100% (249207/249207), done.
Updating files: 100% (4979/4979), done.
groovy-jdk17 $cd groovy/
groovy $./gradlew clean dist
Type-safe project accessors is an incubating feature.
> Task :build-logic:compileJava FROM-CACHE
Dependency verification failed for configuration ':build-logic:compileClasspath'
One artifact failed verification: build-info-extractor-gradle-4.30.1.jar (org.jfrog.buildinfo:build-info-extractor-gradle:4.30.1) from repository Gradle Central Plugin Repository
This can indicate that a dependency has been compromised. Please carefully verify the signatures and checksums.
Open this report for more details: file:///C:/projects/groovy/groovy-jdk17/groovy/build/reports/dependency-verification/at-1671384519313/dependency-verification-report.html
> Configure project :
Dependency verification failed for configuration ':classpath'
5 artifacts failed verification:
- build-info-extractor-gradle-4.30.1.jar (org.jfrog.buildinfo:build-info-extractor-gradle:4.30.1) from repository Gradle Central Plugin Repository
- moshi-1.12.0.jar (com.squareup.moshi:moshi:1.12.0) from repository Gradle Central Plugin Repository
- moshi-kotlin-1.12.0.jar (com.squareup.moshi:moshi-kotlin:1.12.0) from repository Gradle Central Plugin Repository
- okhttp-4.9.3.jar (com.squareup.okhttp3:okhttp:4.9.3) from repository Gradle Central Plugin Repository
- okio-jvm-2.10.0.jar (com.squareup.okio:okio:2.10.0) from repository Gradle Central Plugin Repository
This can indicate that a dependency has been compromised. Please carefully verify the signatures and checksums.
Open this report for more details: file:///C:/projects/groovy/groovy-jdk17/groovy/build/reports/dependency-verification/at-1671384519313/dependency-verification-report.html
This build uses Gradle Build Scans to gather statistics, share information about
failures, environmental issues, dependencies resolved during the build and more.
Build scans will be published after each build, if you accept the terms of
service, and in particular the privacy policy.
Please read
https://gradle.com/terms-of-service
https://gradle.com/legal/privacy
and then:
- set the `GRADLE_SCANS_ACCEPT` to `yes`/`no` if you agree with/refuse the TOS
- or create the C:\Users\me\.gradle\gradle-scans-license-agree.txt file with `yes`/`no` in it if you agree with/refuse
And we'll not bother you again. Note that build scans are only made public if
you share the URL at the end of the build.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\projects\groovy\groovy-jdk17\groovy\build.gradle' line: 25
* What went wrong:
An exception occurred applying plugin request [id: 'org.apache.groovy-core']
> Failed to apply plugin 'org.apache.groovy-core'.
> Failed to apply plugin 'org.apache.groovy-common'.
> Failed to apply plugin 'org.apache.groovy-bad-practices-detection'.
> java.lang.ClassNotFoundException: precompiled_OrgApacheGroovyBadPracticesDetection
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 6s
8 actionable tasks: 3 executed, 5 from cache
groovy $
DOH! After switching to the GROOVY_4_0_6 tag branch, ./gradlew clean dist completes successfully under JDK 17.0.2. The issue reported above only occurs on the master branch.

Unable to deploy to cloudhub mule4 application with Gradle

I am trying to build my mule application and deploy it to cloudhub with Gradle (The Gradle version I'm using is: Gradle 4.10.2) . For this I have added the build.gradle file in my project as shown below:
When I give the Gradle build command it is successful as shown below:
But when I execute Gradle deploy (gradle deploy --info) command, it fails with following error:
Any help to resolve the above issue would be appreciated.
That Gradle has been abandoned for some years and seems to be trying to use a CloudHub REST API endpoint that is no longer valid. If you want to use Gradle you will need a newer Gradle plugin that uses the current CloudHub API. Note that MulesSoft only supports Maven.
You can try running with --stacktrace as the error message suggests to find out more details about the error.

CI cannot download gradle distribution snapshot

Our CI suddenly fails with the following error message:
$ ./gradlew clean jar --stacktrace -i --no-daemon
Downloading https://services.gradle.org/distributions-snapshots/gradle-6.8-20201019220035+0000-bin.zip
Exception in thread "main" java.io.FileNotFoundException: https://downloads.gradle-dn.com/distributions-snapshots/gradle-6.8-20201019220035+0000-bin.zip
I don't unterstand why the distribution file is not found anymore and how can we fix it? I tried clearing all caches but it fails with the same error.
There was a new gradle release on that day and upgrade the gradle wrapper solved the issue:
./gradlew wrapper --gradle-version 6.8.1
(remember to run this command twice to really update the complete wrapper)

Corda - Gradle Error With Quasar When Upgrading to Corda 4.3

I've updated my build.gradle file to Corda 4.3, however applying this plugin...
apply plugin: 'net.corda.plugins.quasar-utils'
...causes the following error when trying to refresh gradle...
A problem occurred evaluating root project 'template'.
> Failed to apply plugin [id 'net.corda.plugins.quasar-utils']
> Could not create an instance of type net.corda.plugins.QuasarExtension_Decorated.
> No signature of method: org.gradle.api.internal.provider.DefaultPropertyState.convention() is applicable for argument types: (java.lang.String) values: [co.paralleluniverse]
Any ideas what is causing this?
I had the same problem executing Corda 4.4 release. Basically you have to update your gradle version to recognize some dependencies in gradle.
First of all, execute the comand: gradle -version
After that, you have to update your gradle version according to the gradle version supported by your current Corda version. In my case, It is supported by gradle version 5.4.1. So, to execute an upgrade, try this: ./gradlew wrapper --gradle-version 5.4.1
Next, check again your gradle version using ./gradlew --version (in the CorDapp directory)
Finally, you can execute your task. So, in my case I would like to execute a test with heap dump allocating more memory and check an OOM. I execute the follow command:
./gradlew test -Dlog4j.configurationFile=../config/test/log4j2.xml -Dcapsule.jvm.args=["-Xmx10G","-Xms512m","-XX:+UseG1GC","-XX:+HeapDumpOnOutOfMemoryError"]
That is it!
Have you tried with gradle-5.4.1?
Source : https://www.corda.net/blog/corda-version-upgrade-guide/

Official spring-boot SSL examples failing

I'm finding that the SSL examples provided in the spring-boot project are not working for me.
For this example:
https://github.com/spring-projects/spring-boot/tree/1.5.x/spring-boot-samples/spring-boot-sample-tomcat-ssl/src/main/java/sample/tomcat/ssl
And this example:
https://github.com/spring-projects/spring-boot/tree/1.5.x/spring-boot-samples/spring-boot-sample-tomcat-multi-connectors
Instead of getting 'hello world', I get
The startup log does not seem to show any issues.
Do these sample projects work for others?
For me, it works well. Here is what I did:
Clone the Spring Boot repository:
git clone https://github.com/spring-projects/spring-boot
Checkout the 1.5.7 branch
git checkout v1.5.7.RELEASE
Build
mvn package
Run
java -jar target/spring-boot-sample-tomcat-ssl-1.5.7.RELEASE.jar
Then open a browser on https://localhost:8443, accept the self-signed certificate and read the hello word message.
P.S.: I'm using Oracle JDK 1.8.0_144 and maven 3.5.0

Resources