I wanted to do spring junit testing to be implemented in my project, I am facing an issue. 1.I wanted a scenario where i can use one spring version jars for junit(src/test) and another spring version of jars for the running main java class(src/main) is it possible. I mean when spring is in testing phase it should use the spring 3.2.4.release and while building the ear it should use 3.0.5.release jars. is it possible.2.since the project is in 3.0.5.release and we wanted to use #WebAppConfiguration for testing which is not allowed in spring 3.0.5.release is there any way to do this (#WebAppConfiguration) in spring 3.0.5.release
Related
I have one Spring Boot application that uses Bazel to manage all of its dependencies, that I migrated from Maven.
I'm able to launch the app using Bazel, but after checking all of its beans I noticed that are missing the beans of the classes that I created using the #Component, #Service and #Repository annotations.
If I use Maven, these beans are added to the Application context as expected.
Is something missing in my Bazel configuration? How can I generate and add these beans to my application context?
I'm trying to run an application(spring boot v1.5.9.0) with dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-properties-migrator</artifactId>
<scope>runtime</scope>
</dependency>
and getting this error:
org.springframework.boot.SpringApplication - Application startup failed
java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/source/ConfigurationPropertySources
this error, apparently, did not occur before. How do I make the migrator work?
Do I have to change the spring-boot version to 2x before running the migrator?
If so, i don't really get the migrator usage.
As its scope is runtime - I have to make the app run before including it - which means I have to solve all the errors without migrator's advice? What do I use it for afterwards?
You've stated that you're running spring boot v1.5.9.0
It doesn't make sense to run the properties migrator with spring boot 1.5.x. Its primary intention is to "assist" in properties migrations that have changed during migration of spring boot 1.x to spring boot 2.x
As for the error, this specific class is available only since spring boot 2.0. See the comment #since in the sourcefile
In your project, application.properties or application.yml is present or not? Spring boot is auto-configuration. I think those properties will be expecting..Also check what are the annotations used in Spring boot main class..Share that Spring boot main class as well..will check
Is it somehow possible to use Maven dependency with older Spring Boot version? The project is using version 2.x and the custom dependency uses 1.5.x.
Could not found any documentation on the topic.
I'm asking because of getting a NoClassDefFoundError while introspecting class inside the custom jar file.
No. Spring Boot 2.X is a major version which is not backwards compatible with Spring Boot 1.5.X. Same goes for major Spring Framework versions, you can't mix Spring Framework 5.X and 4.X.
Maven only manages project dependencies. It has nothing to do with your problem.
Basically there can only be one version of any given combination of groupId and artifactId in any maven project. So with plain vanilla maven, the answer is 'No'. But there is the maven-shade-plugin that can be used to change the group- and artifact ids of any dependency.
I'm creating a web application with Spring boot 2.1.1.
As soon as I add Spring boot 2.1.1 dependency, the Dynamic Web Module changed from 3.1 (the version I need) to 4.0.
What should I do to set Dynamic Web Module to 3.1.
I tried to edit org.eclipse.wst.common.project.facet.core.xml, clean and update maven dependencies, but the Dynamic Web Module come back to 4.0.
I suppose there is a child dependeny in Spring boot 2.1.1 that force the Dynamic Web Module to be 4.0.
I am using Spring Boot version 2.2.4.
I changed: .settings/org.eclipse.wst.common.project.facet.core.xml
under my project folder.
was:<installed facet="jst.web" version="4.0"/>
to:<installed facet="jst.web" version="3.1"/>
But always that I execute maven update I have to change it again.
Before change I close my eclipse.
Java Spring (3.1.0.RELEASE) application and used maven (Apache Maven 3.2.5 )
I need to migrate hibernate-core 3.6.3.Final to 4.0.0.Final without changing the HibernateTemplate. What should I do?
Is there any possibility to do the migration using any command?