How to package convert to lib or jar in spring boot? - java

I upgraded the project to Java 17, Spring Boot 2.7.4 version. And I migrated from Couchbase SDK 2 to SDK 3. After that, I faced an issue with package com.couchbase.client.java.query.dsl. It was not supported, so I added to the project package com.couchbase.client.java.query.dsl manually. After that, issues are fixed. Now, I have a problem, my test case coverage is down. Do you have any idea to fixed it or do you know convert package com.couchbase.client.java.query.dsl to lib file or jar file?
What would be the best possible options?

Related

MergedAnnotations Search Strategy failing after adding a dependency for com.graphql-java-kickstart

I was trying to include graphql integration test cases in an already existing maven project using java springframework v.4.1.0, for which I added library com.graphql-java-kickstart » graphql-spring-boot-starter-test v.6.0.0.
But after adding this, I got the following error for an existing and working test case:
java.lang.NoClassDefFoundError: org/springframework/core/annotation/MergedAnnotations$SearchStrategy
Could someone please help resolving this conflict. Is there some version of this library that is compatible with MergedAnnotations library of springframework. Or is there some other similar library available for implementing java graphql test cases. Also it will be very difficult to upgrade the springframework version because its a huge project and has a lot of dependencies.
I tried upgrading a few versions of com.graphql-java-kickstart » graphql-spring-boot-starter-test but nothing really worked as some or the other part of the project was getting affected.Also tried upgrading springframework version but could not do so because of the libraries and dependencies included.

Problem while creating a new spring boot project

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.

VS Code not able to resolve Springframework Data Redis related dependencies, however, project builds completely fine in Eclipse

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.

ApacheCXF 3.1.4 and Spring 4.2.4 compatability

I am trying to upgrade my libraries: ApacheCXF 2.7.7 --> 3.1.4. Spring 2.5.5 --> 4.2.4.
My Hudson build keeps failing because it cannot find packages/classes, org.springframework.context.ApplicationContext, for example. The classpath in cxf-manifest.jar, as part of ApacheCXF, refers specifically to Spring 4.1.7 jars.
I've tried loading both Spring 4.1.7 and 4.2.4 versions, but no joy. (Is loading multiple lib versions even possible?).
I've tried removing cxf-manifest.jar from the classpath/buildpath. Eclipse is happy with that and it finds the desired classes in the Spring 4.2.4 jars, but Hudson is still not happy.
I've considered moving to Spring 4.1.7, but I don't see the point of upgrading partially.
Is ApacheCXF 3.1.4 specifically incompatible with Spring 4.2.4? And how would I get Hudson to be happy with the upgraded libraries?
Turns out that I forgot to add the specific directory containing the Spring jars to my build.xml script.
ApacheCXF 3.1.4 IS compatible with Spring 4.2.4
Edit: Apparently I was wrong.

where is repository with spring sources

In spring and cantral repo i can find e.g. spring-support-2.0.8.jar but what repo should I add to my pom to make my ide automatically download sources? I don't see any repo with spring-support-2.0.8-sources.jar
Unfortunately, not all Spring versions were deployed with sources. In a nutshell, from version 2.5, all Spring JARs come with sources.
If the source is missing, then you'll have to find it elsewhere and either add it manually to your projects or you can install a Maven mirror at your company and deploy the sources there after packaging them in a JAR file.
I suggest to try to upgrade to Spring 2.5. Newer versions of Spring are usually drop in replacements of older ones. Most of the time, the upgrade takes a couple of hours.
spring-support doesn't exist in Spring 2.5 anymore; the classes in there are now in spring-context-support.
You can use the fc: prefix to find the JARs which contain missing classes: http://search.maven.org/#search%7Cga%7C1%7Cfc%3Aorg.springframework.mail
As Looking for spring-hibernate3-2.0.8 sources mentions, the source jars were not consistently published back then. The suggestion from that question is to:
get the sources of the old monolithic spring-2.0.8-sources.jar

Categories

Resources