Spring Boot written in Spring Tool Suite make automatically udate by all tasks, if i make a change in only one task. How to stop this problem, please? - spring

My question is about Spring Boot written in STS. If while working I make a change at the level of a project in a task, all the other projects automatically update and display the same modifications in the other tasks. How can I stop this?

Related

Debug Spring Boot 3 in IntelliJ Community

Since the migration to Spring Boot 3 my application doesn't hold at breakpoints any more, when I run the Maven Spring Boot goal mvn spring-boot:run.
This is because Spring forks the thread or the process and the debugger is not attached to this.
In former Spring-Boot versions you could disable forking by passing -Dspring-boot.run.fork=false (see How to debug spring-boot application with IntelliJ IDEA community Edition?).
Unfortunatly this option was removed as you can read in the Spring Boot 3.0 Migration Guide:
The fork attribute of spring-boot:run and spring-boot:start that was deprecated in Spring Boot 2.7 has been removed.
Is there any possibility to make breakpoints work again?
Ideas so far
Of course IntelliJ Ultimate has better Spring Boot integration. I'm trying to make it work with the Community Edition.
I also tried not to run the Maven goal but to make an Application run configuration. This failed so far, because of java.lang.ClassNotFoundException, it doesn't find the Main class. Not sure if I should investigate that option further.
Last idea was to start the Maven goal with debug options such that an external debugger can attach. That didn't work either and even if it would, I could only attach the debuger after startup with would make debugging the creation of spring context impossible.

Is it necessary to use a spring initializr for creating spring applications?

I have started learning about spring and in every tutorial they start from spring initializr, i was wondering is it necessary to use it or we can create a project without using spring initializr ?
No, it is no necessary. You can do everything by your own hands. It just helps you to start quicker so that you focus more on the Spring concepts instead of spending much time on "infrastructure" like configuring dependencies. You run it and it just works. Then you can extend it step by step. This can be especially helpful if you just start learning Spring. Later on you should of course spend some time on other aspects that initializr provides you.
Adding to whatever is already mentioned.
No , it is not necessary to create a project with Spring Initializr
The site provides a curated list of dependencies that you can add to
your application based on the selected Spring Boot version. You can
also choose the language, build system and JVM version for the
project.
https://spring.io/blog/2019/02/20/what-s-new-with-spring-initializr.
https://github.com/spring-io/initializr/
Using Spring Initializr the right dependencies are preconfigured for the Spring Boot version used. These preconfigured projects reduces the setup time and one can start implementing the code rather than investing time on which dependencies to go with.

Does spring boot come in to picture only while creating the project?

I've been learning spring boot for a while and as per my understanding, we use spring boot only to create the project along with dependencies and embedded servers. It doesn't have much of a role while working on the project or after the project is created.
I mean, if i were to work on an enterprise application for a company, chances are that, there is already a project created using springboot and I don't have to really use spring boot anywhere while working on that project.
Is my understanding correct?
I've tired googling, but did not find a clear answer.
No. You may still need to use the following spring-boot features after creating a project :
Externalise the application properties
Test the application using testing utilities and annotations provided by spring-boot
Use its auto-configuration feature to quickly configure if you need to enhance your application with other library/framework afterwards.
Use its developer tool to make you have a better Dev experience (e.g automatic restart the app when code changes , hot-reload static content etc.)
Use Actuator to monitor your application health and gather metrics.
I mean, if i were to work on an enterprise application for a company, chances are that, there is already a project created using springboot and I don't have to really use spring boot anywhere while working on that project.
I think you can say pretty much the same about any framework out there. I can't agree with this statement in general.
Every framework (including spring boot) provides a set of features that you may opt to use or not to use in your project.
So yes, for each existing microservice you'll have a #SpringBootApplication class.
Also probably set of configurations / practices how to work with configurations.
You'll already have also spring beans on existing project.
However software constantly evolves (otherwise it doesn't make sense to hire programmers, you know).
So when you (as a new employee) need to create a new micro service then, congratulations, you're using Spring boot features.
Other day-to-day tasks include (just a couple of example out of the head):
Create Integration Tests (#SpringBootTest)
Define new configuration Properties
Use Actuator
Use Metrics + define new metrics
Reconfigure Logging
Writing Liquidbase/Flyway migrations
Integrate new set of beans (Configurations)
Use Autoconfigurations
and so on and so forth.
If you want to really understand what you're doing while implementing these tasks you should know how do relevant features provided by spring boot work.

Minimal and latest way of triggering batch job in the world of Spring Boot

I have setup a batch job with Spring Boot 1.5.8 and relevant Spring Batch and Integration starters. I want to kick off the job using incoming file using file poller.
I have used Spring Integration in old days to trigger batch job with file poller. Is this still stands same ? Does Spring Batch itself has this very basic functionality or do I have to have Spring Integration involved as well ?
Even if Spring Integration is needed, can anybody point to Annotation based sample application doing the same ?
Good questions. Let's answer each of them:
Is this still stands same ? Yes
Does Spring Batch itself has this very basic functionality or do I have to have Spring Integration involved as well ? No, you have to use Spring Integration
Even if Spring Integration is needed, can anybody point to Annotation based sample application doing the same ?
We are in the midst of updating all the Batch docs to include annotation as well as XML based configurations. Here is a doc that is in PR but will be merged in the next release that has the examples you are looking for:
https://github.com/cppwfs/spring-batch/blob/1f7cada52aba95bcb23d06bc034b21fe1de0a7a5/spring-batch-docs/asciidoc/spring-batch-integration.adoc#launching-batch-jobs-through-messages

Spring boot + Activiti explorer

Is it possible to integrate activiti explorer maven plugin with activiti Spring boot app?, so that we can make use of activit-explorer to view deployed process in activit-spring boot engine.
I know we can use rest-api over spring boot to query process engine, but I want to know if it is possible to run the explorer over spring boot by adding it as a maven plugin during deployment?Or can we tweak the activit-explorer.war somehow to point to spring-boot activiti engine?
activiti-explorer.war is standalone webapp by itself. I've write some guideline on how to manually to embed activiti-explorer to you own app. http://blog.canang.com.my/2016/05/12/embedding-activiti-explorer-to-your-application/
Most probably step 5 in my blog is your solution.
btw, there's reason why the name is 'default'. I can't recall it atm
I thought of answering my own question so that it will be useful for other developers with similar requirement. If you want to make an eco-system where activiti-rest, explorer and your custom end points co-exist, please refer this thread from activit forum. I have tried this and is working fine. link to thread
I would like to give my observation here. In order to avoid getting into pulling source and trying to build myself, I achieved partial success, by installing the activit-explorer as part of the usual standalone installation.Started the standalone activiti-explorer using Apache-Tomcat but I configured the database for Activiti as same as (MYSQL in my case) I used in my spring-boot application to hit the common ground.
But apparently the activiti version in my spring boot app was 5.19.0.0 and that for activiti-explorer was 5.22.0.0, which created some misalignment for spring boot application startup to fail. I am hopeful that with matching versions it might succeed. When I get some more time on me I will try and update. Since then may be someone can use this route.

Resources