The original tutorial was here https://spring.io/guides/tutorials/react-and-spring-data-rest/ but now deleted. Some steps still can be found in Github and all these together with the latest code (updated April 2020) is here here https://github.com/spring-attic/tut-react-and-spring-data-rest/. It simply does not work with the latest versions of Spring and other dependencies. I managed to run it and updated all the dependencies.
Build from command line: mvn clean package
- From command like this
java -jar spring-rest-react-jpa-0.0.1-SNAPSHOT.jar
- From eclipse open and run this class:
com.greglturnquist.payroll.ReactAndSpringDataRestApplication
- Webapp will be available by this link http://localhost:8080
- Check the latest version of
spring-boot-starter-parent
artifact and update it if needed inpom.xml
inside<parent>
tag. - Check in the google for latest stable version of node.js or here https://nodejs.org/en/download (LTS version).
- Update node.version and npm.version inside
pom.xml
to the values from step 2 above. - Get latest stable version of frontend-maven-plugin here https://github.com/eirslett/frontend-maven-plugin/tags
- Update
frontend-maven-plugin.version
to the values from step 4 above. - Go to folder
target\node
and runnpm install npm-check-updates
- Copy file
package.json
from root of the project totarget\node
folder - Run
.\node_modules\.bin\ncu --format group
from foldertarget\node
. It will return list of modules to update like this
Minor Backwards-compatible features
@babel/core ^7.10.5 → ^7.22.20
@babel/preset-env ^7.10.4 → ^7.22.20
@babel/preset-react ^7.10.4 → ^7.22.15
Major Potentially breaking API changes
babel-loader ^8.1.0 → ^9.1.3
webpack ^4.43.0 → ^5.88.2
webpack-cli ^3.3.12 → ^5.1.4
- Update versions in
package.json
in the root of the project (not insidetarget\node
) manually.