I am trying to set up a new Spring Boot gradle project, with Spring Initializr. This was giving issues, so to test, I have stripped down to the most basic possible starter – no dependencies.
I set a Gradle project (it sets gradle 7.0.2) and Java 16. Download and import. Set the build JDK appropriately. At this point, everything should be good. But a build fails with the error…
groovy.lang.MissingPropertyException: Could not get unknown property 'compileConfigurationName' for source set 'main' of type org.gradle.api.internal.tasks.DefaultSourceSet.
From what I've been able to find, it looks like compileConfigurationName was deprecated in gradle 6 and removed in 7 (and that compileClasspathConfigurationName should be used instead).
What more in the downloaded starter do I need to fiddle with to get this to work? (Yes, I could drop to JDK 11 and gradle 6.8.3, but I would rather start from the more up-to-date…)
If you are using NetBeans - see this ticket here:
https://issues.apache.org/jira/browse/NETBEANS-5582
"Gradle 7.0 is not supported in NetBeans 12.3".
If I run this project in VS code no issues.
Related
In the help.md file it's telling me that JVM was changed from 11 to 17
this is what the help.md file looks like
The following was discovered as part of building this project:
* The JVM level was changed from '11' to '17', review the [JDK Version Range](https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Versions#jdk-version-range) on the wiki for more details.
and here is an example of later problems
And even if i change the project structure manually to java 11 sdk
i have issues with versions next .
This problem is occurring in the newer version of Spring Boot. So when creating project using Spring Initializr or Spring Starter Project select the older version of Spring Boot (like 3.0.1 or 2.7.7).
This should solve the problem.
When I create a Gradle project in Eclipse the result is a nested project with a -lib folder created automatically. Any ideas on why this is being created?
I tested this on Eclipse 2021-03 using the latest gradle version 7.0-rc-1 and reproduced your issue where a nested project with a lib subproject was created. I then made a new Eclipse project specifying Gradle version 6.6 to be used and the resulting project was not nested. I suggest trying Gradle 6.6 and seeing if you get the same behavior I got. This might fix your project.
Also try running the gradle init command from the command line and see what project structure you get there. I tested this on my PC where I have gradle 5.6 as the default version and got a non nested structure. You can of course always manually modify your gradle project in a few minutes to not be nested.
I'm checking whether we'd be able to migrate from Ant to Gradle, but got confused right at the very beginning of these checks - Apache Netbeans 12 LTS (+ Gradle plugin from official repo) refuses to properly open Gradle projects that were created by a another Netbeans instance, which is a major pain.
I tried to open (in Netbeans) one of the Java library project examples from Gradle docs, only to find out the IDE immediately spews out errors (missing imports for tests) that are unjustified and offers a very limited amount of IDE integration - forget running specific tests, even debugging is all grayed out. Gradle and Netbeans also see different classpaths.
If I create a Gradle project inside Netbeans, everything works fine - no errors, Projects Tree shows an additional tree node, called "Configurations", like in the image below, I'm able to debug and everything just works.
However, even if I just copy/paste this project's directory to a different location, everything breaks after the project is reopened (I also get this issue, same thing happens for example projects found in Gradle docs).
What is going on here? Netbeans seems to know more about a project it created, than about projects that were created outside it or were just relocated. How do I force it to treat all Gradle projects equally (so that they work as expected)?
I used Gradle 7.0.1 and let the New Projects wizard "Initialize the Gradle wrapper" for the project created inside Netbeans 12 LTS. The setting to prefer existing wrappers is enabled in settings if relevant.
Enabling an "experimental" option in Gradle options, called Enable 'lazy' Source Group Initialization does help with simple projects that were created by Netbeans, so they open as expected.
But this does not work for Gradle projects that contain subprojects, such as the example project from Gradle docs:
The issue tracker for this Netbeans plugin has been quite active recently, mentioning issues like this, so perhaps there is hope.
At least part of the problem is that the LTS release of Netbeans (at the time of this writing) doesn't support gradle 7. The latest release, Netbeans 12.4, is the first version that supports gradle 7.
I am using VS Code to compile and debug my Spring Boot Java project with help of Gradle. I recently added Redis dependency to my project. The project compiles in Eclipse, but throws error in VS Code.
I'm not sure this answer becomes helpful to you or not but,
Normally VS code is not comes with default configurational setting of spring boot.
Spring boot project not able to run without dependencies.
So Because of your project not able to find relevant dependencies so it is generate this errors.
It solved using download plugin of vscode-spring-initializer and / or others.
If you need more detail then,
Try recognize your spring boot project in different IDE like IntelliJ or Eclipes. You see that there is some extra files are there like following,
External Libraries - which handle by maven kind of tool for load dependency.
.iml file in intellij : File which handle development module(contain plugins, module and other details).
This files are not existing there so that it generate issue.(That are different based on IDE)
If you have recently modified the pom.xml or build.gradle config file, you need right click on pom.xml or build.gradle file and then run the menu "Update project configuration" to force the language server to update the project configuration/classpath. Otherwise, the java language server cannot recognize the newly added dependency.
I'm using IntelliJ to work with a Gradle project. I noticed that whenever I try to refresh the Gradle project (or when trying to import/re-import a project as a Gradle project) I get the following error:
Error: Could not determine the Java version
$JAVA_HOME is set, the SDK is set to Java 8 (and gradle -version confirms it is also is set to Java 8), and the project builds fine from the command line. Restarting IntelliJ also does nothing. I also deleted the project specific and global .gradle folders, which did not resolve the issue.
I am running IntelliJ 14.1.4 on Ubuntu 15.04 and Gradle 2.5.
EDIT: Tried it on a different machine (also Ubuntu 15.04, Oracle Java 8) running IntelliJ 14.1.1 and it worked correctly.
I had this problem too. It seems it was linked to the project being setup with a rather old gradle build. Changing distributionUrl to a new distribution in /gradle//wrapper/gradle-wrapper.properties solved it
You should try to switch Idea boot jdk. It works for me.