Spring Data MongoDB v3.x - spring

The documentation has details of migration from 2.x to 3.x https://docs.spring.io/spring-data/mongodb/docs/current-SNAPSHOT/reference/html/#upgrading.2-3
However, i cannot find the 3.x maven dependency https://mvnrepository.com/artifact/org.springframework.data/spring-data-mongodb
The latest available is only 2.2.6.RELEASE
Is 3.x not available as of now?

The Spring Data Neumann Release is not GA yet. Please have a look at the wiki for more information on the planned timeline.
Release candidates and snapshot builds are available via repo.spring.io.
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>spring-milestones</id>
<name>libs-milestone</name>
<url>https://repo.spring.io/libs-milestone</url>
</repository>
<repository>
<snapshots />
<id>spring-snapshots</id>
<name>libs-snapshot</name>
<url>https://repo.spring.io/libs-snapshot</url>
</repository>

Related

Vaadin 23 + spring-boot 3.0.2 application not launching

We have a vaadin application on version 23 which was using spring-boot version 2.7.3.
We have some old library high vulnerabilities reported by static scan. so to fix that we tried to use the spring-boot version 3.0.2 with the same application. the application build successfully and also it shows that the application started on port xxxx but the application is not launching and also there are no errors on the console. It just shows the following message:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu Feb 02 16:32:45 CET 2023
There was an unexpected error (type=Not Found, status=404).
No message available
Is it possible to use spring-boot 3.0.2 with vaadin 23?
the application should be accessible on localhost.
You cannot use Vaadin 23 with Spring Boot 3.
Spring Boot 3 support comes with Vaadin 24. The most recent version is 24.0.0.alpha9.
Make sure you add the pre-release repositories:
<repositories>
<!-- The order of definitions matters. Explicitly defining central here to make sure it has the highest priority. -->
<!-- Main Maven repository -->
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>vaadin-prereleases</id>
<url>
https://maven.vaadin.com/vaadin-prereleases/
</url>
</repository>
<!-- Repository used by many Vaadin add-ons -->
<repository>
<id>Vaadin Directory</id>
<url>https://maven.vaadin.com/vaadin-addons</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<!-- The order of definitions matters. Explicitly defining central here to make sure it has the highest priority. -->
<pluginRepository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>vaadin-prereleases</id>
<url>
https://maven.vaadin.com/vaadin-prereleases/
</url>
</pluginRepository>
</pluginRepositories>

Understanding Maven tags

I was using maven in my project, most of the cases I used only dependency tags, but this time I have below tags in use:
<repositories>
<repository>
<id>myrepo</id>
<name>REPO</name>
<url>http://host:8081/nexus/content/repositories/repo/</url>
<layout>default</layout>
</repository>
<repository>
<id>thirdparty</id>
<name>THIRD</name>
<url>http://host:8081/nexus/content/repositories/thirdparty/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>repo-snapshots</id>
<name>REPO-SNAPSHOTS</name>
<url>http://host:8081/nexus/content/repositories/snapshots/</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>repo1-snapshots</id>
<name>REPO1-SNAPSHOTS</name>
<url>http://host1:8081/nexus/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>myplugin</id>
<name>MY-PLUGIN</name>
<url>http://host:8081/nexus/content/repositories/central/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>distr</id>
<name>DISTR</name>
<url>http://host:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>distr</id>
<name>DISTR</name>
<url>http://host:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
I know that repositories is used to configure our remote repositories.
1) But what is the use of releases --> enabled = true indicates
2) also what it indicates when we say snapshots --> enabled=true instead of using releases.
3) Also what it indicates if we say updatePolicy=always and what happens if we do not mention this.
4) What is the use of pluginRepositories here? also the inner releases tag
5) What is the use of distributionManagement and its inner tags repository and snapshotRepository?
1) This means that Maven searches release versions (aka non-SNAPSHOT versions) in this repository.
2) Maven searches SNAPSHOT versions in this repository.
The distinction between (1) and (2) exists because if you do not have repository groups, you usually have different repositories for the different types.
3) This means that SNAPSHOTS are always (read: every build) updated from remote repositories. The standard policy is to cache downloaded SNAPSHOTs for one day (so triggering another build on the same day would not again download the newest SNAPSHOT).
4) These repositories are purely used for the dependencies of your plugins.
5) These are used to deploy artifacts you build yourself.

spring data lovelace m3 and spring boot 2.0

I am using spring boot 2.0.5-RELEASE, and trying to use spring data Lovelace-M3 for it's MongoDB transaction support with MongoTransactionManager class, i added the lovelace-m3 dependency with release train repository as follow :
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-releasetrain</artifactId>
<version>Lovelace-M3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-libs-release</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/libs-release</url>
</repository>
</repositories>
But maven doesn't download the jar of lovealace, only the pom, can't find anywhere lovelace classes. I don't know what i am missing here.
Milestone version does not publish on https://repo.spring.io/libs-release.
Please add the following code into your ...
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
Also, if you need to use milestones plugin, you can add the following code:
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
Spring boot 2.0 does not support Spring data lovelace, if someone want to enjoy MongoDB 4 Transaction feature he needs to wait for Spring boot 2.1 unfortunately.
See : https://github.com/spring-projects/spring-boot/issues/14644

why the project pom.xml is showing this Non-Resolvable error

Dont know whats wrong here. I cloned the project form the bitbucket repo. Upon importing the project as a existing maven project this is occuring
I think the problem is that you are using the snapshot version of the spring boot and these dependencies are not available on the maven central so have to add the additional repository address.
Add the following snippets in the <project> component in your pom.xml
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

Spring SAML2 Sample Compilation Errors

I have downloaded Spring SAML2 core and sample projects. When trying to compile the sample project in eclipse, it shows errors.
For example, in the class org.springframework.security.saml.web.MetadataController there are references to MetadataGenerator.setEntityAlias(..) that do not resolve.
I checked the source code of MetadataGenerator in SAML2 Core project and there is no such method.
What am I missing?
It worked for me with 1.0.0.RC2 and not later versions.
Pointing to the following repository:
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>

Resources