Installing Spring Cloud CLI - which version with Spring boot 2.4.5 - spring

I want to install Spring Cloud CLI, but am not clear which version to use.
This Spring cloud page https://spring.io/projects/spring-cloud shows the compatible versions of Spring Cloud with Boot. For example
Release Train
Boot Version
2020.0.x aka Ilford
2.4.x
Hoxton
2.2.x, 2.3.x (Starting with SR5)
I have Spring boot 2.4.5 installed. This implies I should use Spring cloud version 2020.0.x
If I check https://repo.spring.io/release/org/springframework/cloud/spring-cloud/ I do not see a version 2020.0.x
If I use
spring install org.springframework.cloud:spring-cloud-cli:2020.0.1
I get an error "could not find artifact org.springframework.cloud:spring-cloud-cli:jar:2020.0.1 "
If I use
$ spring install org.springframework.cloud:spring-cloud-cli:2.2.0.RELEASE
it appears to install correctly, however I get errors when I try to run commands like
$ spring cloud eureka.
My question is what version of cloud should I install with spring boot v 2.4.5 ?

2020.0.x is the version of the Spring Cloud release train, not of the single modules itself. The release train version can be used, if you use the Spring Cloud BOM to include the dependencies, as described here: https://spring.io/projects/spring-cloud.
This would look similar to this then:
<properties>
<spring.cloud-version>Hoxton.SR8</spring.cloud-version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring.cloud-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
If you only want to use single modules, then you need to find out, which versions belong to the release train, by either looking in the respective spring-cloud-dependencies POM (https://repo.spring.io/release/org/springframework/cloud/spring-cloud-dependencies/2020.0.2/), or in the release notes, which also contain the module versions: https://spring.io/blog/2021/03/18/spring-cloud-2020-0-2-aka-ilford-is-available
So in your case, the proper version for spring-cloud-cli would be 3.0.2.

Related

Upgrading Spring boot version to version 3. Problem with javax.cache library

I'm trying to upgrade spring boot from 2.7.x to 3.0.1. The last thing I have left to upgrade is the library.
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
<version>1.1.1</version>
</dependency>
Have any of you had a similar problem? I didn't see any information on how to do this in the guide.
Remove this dependency and use from spring boot starters.
This is already having Vulnerabilities from dependencies:CVE-2020-15250.MVN REPO CACHE 1.1.1

How to change the micrometer's version of Spring-boot-actuator 2.3.0

In our project, we use spring-boot 2.3.0.RELEASE.
Default, spring-boot-actuator is the 2.3.0 and it uses the 1.5.1 micrometer-core.
However, I want it use the 1.9.0 micrometer because I want to use the 1.9.0 micrometer-registry-influx.
I loaded the 1.9.0 micrometer-core in maven ,but it makes no sense.
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
<version>1.9.0</version>
</dependency>
Our spring-boot version is not to be allowed to change, so I want to change the micrometer's version in 2.3.0.RELEASE spring-boot-actuator.What should I do next?
You should upgrade Boot so that it will bring in the latest Micrometer.
You can force your build system to resolve 1.9.x but you might need to do it for multiple dependencies (e.g.: micrometer-core, xyz-registry, etc.)

How to override the spring boot version used by jhipster

my JHipster generated application uses
<jhipster-dependencies.version>2.0.28</jhipster-dependencies.version>
which includes Spring Boot v.2.0.6
But I want to use Spring Boot 2.1.1
What do I need to change in my pom.xml to achieve that.
I tried to set <spring-boot.version>2.1.1.RELEASE</spring-boot.version>
But when I build & run, still v2.0.6 is used.
Thanks for asking this question. The comment to your question by Gael pointed me in the right direction. I've just completed an upgrade of my legacy project. Here is how I did it:
Go to this link: https://www.jhipster.tech/upgrading-an-application/
Follow the instructions for automatic upgrade ( Make sure before you upgrade that you create a new branch, there are sure to be merge conflicts).
Resolve the merge conflicts and run your tests.
Commit the changes to avoid having to repeat the work.
Above all read the instructions and understand them before beginning because otherwise you will become frustrated.
You can get the list of JHipster release versions here: https://www.jhipster.tech/releases/
I faced the same problem, my jhipster version is 3.9.1 and spring boot's version is 2.2.7.RELEASE.
So to upgrade spring-boot.version to latest 2.7.5:
Add dependency management from Spring Boot before Jhipster as follow:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.github.jhipster</groupId>
<artifactId>jhipster-dependencies</artifactId>
<version>${jhipster-dependencies.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
It worked for me

How to determine the version of Glassfish's dependencies?

I'm working on a project that incorporates some Jersey dependencies not packaged with Glassfish and need to know what version of Jersey Glassfish 4.1.1 is using.
In the Glassfish Maven pom.xml, here
https://maven.java.net/content/repositories/releases/org/glassfish/main/extras/glassfish-embedded-all/4.1.1/glassfish-embedded-all-4.1.1.pom, there is a reference to Jersey:
<dependency>
<groupId>org.glassfish.main.packager</groupId>
<artifactId>jersey</artifactId>
<version>${project.version}</version>
<type>zip</type>
<optional>true</optional>
</dependency>
Which is actually a reference to the Jersey version embedded in Glassfish, here https://maven.java.net/content/repositories/releases/org/glassfish/main/packager/jersey/4.1.1/jersey-4.1.1.pom.
So from my understanding, Glassfish copies its dependencies at the time they are included into its own repository without retaining version information. How do I get that version information?
As mentioned in Updating Jersey 2 in GlassFish 4, two options mentioned are to:
Just unzip one of the Jersey jars e.g. (jersey-common) and look at the Bundle-Version in the META-INF/MANIFEST.MF file. You can find the jars in <glassfish-home>/glasssfish/modules
Just start up the server, with a JAX-RS application running and
log
Initiating Jersey application, version Jersey: 2.5.1 2014-01-02 13:43:00...]]

How to override the managed version of dependencies in Spring Boot

Spring Boot allows us to change the Java version using:
<properties>
<java.version>1.8</java.version>
</properties>
Is there any property to change the Java EE version or spring version in my Spring Boot pom.xml?
Currently I override the managed version using:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>
Is there a better way to do this, like just setting properties?
Spring Boot 1.2.3 gives you Spring 4.1.6 by default.
How can I force Spring Boot to give me 4.1.5 instead, just by setting properties?
This in your pom.xml should do it:
<properties>
<spring.version>4.1.5.RELEASE</spring.version>
</properties>
All straight from the docs.
Before you go overboard overriding versions of dependencies, heed this advise (from the link above):
Each Spring Boot release is designed and tested against a specific set of third-party dependencies. Overriding versions may cause compatibility issues.

Resources