Successor for spring boot integrated java shell ('CRaSH') in Spring Boot 2.0? - spring-boot

As the spring documentation states the crasshd will be removed in spring boot 2.0.
What will be the replacement?

The previous shell you mentions was a port inside spring-boot 1 and it seems not very active.
In spring Boot 2.0 you can use the spring-shell that you can use in an existing spring-boot app or a specific spring-boot shell that can be deployed as standalone.
After, which option to take would depends on your needs.
On my side, I just created a specific shell for publishing messages in ActiveMQ, you get the whole power of Spring-Boot for automatic configuration of any connectivity with external systems (JMS, JDBC, LDAP, SMTP, etc...).
For doing this, I just added the following pom dependency:
<dependency>
<groupId>org.springframework.shell</groupId>
<artifactId>spring-shell-starter</artifactId>
<version>2.0.0.RELEASE</version>
</dependency>
in my Spring Boot project.
Note that I was able to integrate it in Spring Boot 1.5.15 and 2.1.2 RELEASES.

There is no replacement to be provided by the Spring team.
https://github.com/spring-projects/spring-boot/issues/7044
Sorry, not at the moment. Based on the stats we have, it would appear that the remote shell isn't very widely used. For example, comparing Maven Central downloads for August, the remote shell starter had 2% of the downloads that the web starter had. That means that it's unlikely to be worth investing significant effort in a replacement.
There is a third party replacement, from the ticket,
https://github.com/anand1st/sshd-shell-spring-boot

Related

How do big bundled open source projects like Spring Boot ensure compatibility between modules?

Spring Boot contains loads of dependencies: Spring Framework, Spring Data, etc. How do the Spring maintainers accomplish releasing everything while different teams work on different Spring projects?
We have a similar situation, we have 4-5 teams each making different libraries which are used by other teams. We prefer to be able to allow teams to release independently but this is a huge undertaking to ensure binary compatibility of interface and behaviour.
Each release of Spring Boot provides a curated list of dependencies it supports. In practice, you do not need to provide a version for any of these dependencies in your build configuration as Spring Boot is managing that for you. When you upgrade Spring Boot itself, these dependencies will be upgraded as well in a consistent way.
The curated list contains all the spring modules that you can use with Spring Boot as well as a refined list of third party libraries. The list is available as a standard Bills of Materials (spring-boot-dependencies) and additional dedicated support for Maven and Gradle are available as well.
URL: https://docs.spring.io/spring-boot/docs/1.3.8.RELEASE/reference/html/using-boot-build-systems.html

Which dependency should be used to integrate Apache Camel with Spring Boot

Apache Camel provides two ways to integrate with Spring Boot:
camel-spring-boot
camel-spring-boot-starter
When I look at the starter then I see that it only includes camel-spring-boot and spring-boot-starter. What is the difference then and what are the advantages of using starter?
At the moment of writing this answer, camel-spring-boot is only supported from Camel 2.15 and camel-spring-boot-starter only from Camel 2.17, which is important considering the current version that your project is using.
Then the major difference between these two dependencies, lies in the "opinionated" auto-configuration provided by the starter.
camel-spring-boot, should be used if you want just to include a jar to make your camel routes auto-discovered by spring boot, this also gives you the freedom to update this dependency regardless of your spring-boot version.
camel-spring-boot-starter, (recommended way to go) should be used if you want a collection of dependencies (including camel-spring-boot) that provides the best developer/user experience, due to the fact of customizable properties, additional libraries, and default configuration for the camel library. Check the reference documentation for the starter: https://camel.apache.org/components/latest/spring-boot.html#_spring_boot_auto_configuration
Summary
Use camel-spring-boot, if you want a vanilla jar to use camel with spring boot
Use camel-spring-boot-starter, if you want an automatic-configured component to start to develop with.
You should always use the camel-xxx-starter dependencies, as these are the Camel components that is support with Spring Boot. Also as mentioned they provide auto configuration and some of them additional capabilities.
If there is no camel-xxx-starter component then its because its not supported on Spring Boot with Camel.
See more at: https://github.com/apache/camel/tree/master/platforms/spring-boot/components-starter#camel-component-starters

How to check which Spring Boot version goes with spring-cloud-gcp-starter-data-spanner 1.1.0.RC1?

I intended to use Spring Data Cloud Spanner starter (version 1.1.0.RC1) with Spring Boot application but cannot find the official document of which Spring Boot version it goes with. Running my app and it works well with Spring Boot 2.x.x but not with Spring Boot version 1.x.x (ClassNotFoundException). Could anyone help:
Any document to show which SpringBoot version goes with Spring Data Cloud Spanner starter (version 1.1.0.RC1)?
Any way to make Data Cloud Spanner starter (ideally 1.1.0.RC1) work with SpringBoot version 1.5.17?
Thank you.
TL;DR Spring Boot 2.1 but you shouldn't have to care.
Spring Cloud Data Spanner is part of the Spring Cloud GCP project that recently joined the official Spring Cloud release train.
Rather than figuring out which version of a particular library is needed , I'd strongly recommend you to use proper dependency management in your build and let default apply. That way you can select a Spring Cloud generation (i.e. release train) and the dependencies that you need will be managed for you automatically (that is, no need to provide a version for them).
The latest 1.0 RC, RC2 at the time of writing, is part of the Greenwich release train with a RC2 release this week.
To get started with proper dependency management, go to https://start.spring.io and select "GCP Support" to get a build with the proper BOM import. Once you've done that you can add the starter without a version and things will be managed for you.
The relationships between Spring Boot version and Spring Cloud release train is documented here and on start.spring.io as well.

spring-security-oauth2 vs spring-cloud-starter-oauth2

I am working on building an oAuth2 application using spring boot. However, there are various sample projects in Github using spring-security-oauth2 and spring-cloud-starter-oauth2.
Do we have specific scenarios where we can use a specific jar among both for an application?
Though Spring cloud is mainly used for distributed systems. There are a lot of implementations on Github using spring-cloud-starter-oauth2 for even non-distributed applications. Thanks.
To resolve complex dependency management, Spring Boot starters were introduced. Starter POMs are a set of dependency descriptors (combines multiple commonly used dependencies into one POM) which otherwise you could also manually include in your application individually. Starters are available for web, test, data jpa, security, mailing and more. If it is not starter, it is a module: a simple artifact.
If you want to work with web, you could include tomcat, mvc and jackson all by yourself (manually) - a lot of dependencies for a single simple application. Instead, you just introduce one starter dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
Coming to your question:
spring-security-oauth2 is an artifact of group org.springframework.security.oauth which supports oAuth2 (only) for Spring Security (not cloud), whereas spring-cloud-starter-oauth2 is a set of multiple dependencies like a starter web dependency above. This is OAuth2 starter for Spring Cloud that is only if you are working with Spring cloud. This starter comes with bundle of out-of-the-box dependencies underneath the OAuth2 framework for Spring Cloud like SSO, OAuth2 client.
Spring initially moved oauth2 to spring cloud started but as of version 2.4.0.M1 it was moved to spring security. You will be able to verify on start.spring.io that oauth2 cloud dependency is only in version >=2.0.0.RELEASE and <2.4.0.M1

BPMN for spring boot 2

We have started new project on spring stack and using latest versions. But we have workflow requirement and I used activiti in past. But as I see there is no spring boot 2 support for activiti and camunda. Can anybody suggest which BPM is best that can be integrated with spring boot 2.
You will find a bunch of Spring Boot 2 starters in the Flowable github repo.
The documentation explains step-by-step how to create a BPM enabled Spring Boot application. There is also the blog post The road to Spring Boot 2.0 that the improved support for Flowable within Spring Boot as part of the Flowable 6.3.0 release.
You ask for suggestions on which BPM is best. Well, I cannot be objective since I am part of the Flowable Team, but I can say that our Spring Boot implementation is pretty neat:
All engines are supported (BPMN, CMMN, DMN), both embedded and exposing their respective REST APIs.
There is an automatic configuration of Spring Security to use the Flowable IDM engine (in case no other custom security is configured).
There is no "EE" version of the starter. Flowable provides Spring Boot 2 support 100% Open Source.
The Spring Actuator integration is quite powerful.
Did I mention Open Source? ;-)
In order to get the all engines you would need to use the flowable-spring-boot-starter(-rest) dependency. The (-rest) needs to be used if you want the Flowable REST APIs to be automatically configured.
There is also the option to run the BPMN, CMMN or DMN engines in standalone mode. For that you would need one of the following dependencies:
flowable-spring-boot-starter-process(-rest)
flowable-spring-boot-starter-cmmn(-rest)
flowable-spring-boot-starter-dmn(-rest)
So, compare for yourself, but for me, it's pretty clear and of course I am open to discussion.
The Activiti is working on Activiti Cloud fully based on Spring Boot 2 and Spring Cloud Finchley (targeting kubernetes deployments, but it can be used outside kubernetes if that is not your thing) if you are looking for a BPMN runtime for Cloud Native applications. We are working hard on releasing the first Beta1 release at the moment, and we will very welcome feedback about it. Hope this helps.
If you use the camunda-bpm-spring-boot-starter you can write self contained services running camunda process engine with spring boot 2.

Resources