S
S
Sergey Vyvolokin2021-03-26 11:13:00
Java
Sergey Vyvolokin, 2021-03-26 11:13:00

Building and properly migrating Spring?

Hello, I want to learn how to create a project correctly and transfer it to VPS (Tomcat), what tools should I use?
1. I create a project ---> download (example.zip) and unpack it on localhost, then open it in my favorite editor ---> make changes ---> pack and transfer to Tomcat on VPS as a War archive. Maybe it's better to use github, excluding dependency folders and other things, so that he would update himself when building a project on a VPS?
2. Is there a fundamental difference between JAVA versions on VPS(JAVA 16) and localhost(JAVA 15), or is it better to use one version everywhere?
3. Can you advise something, otherwise I'm just starting to work with JAVA.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2021-03-26
@psychedelic74

Good afternoon!
1) As you know, you can pack the project into jar or war. Moreover, if packaged in jar, then Spring has a built-in Tomcat (inside Spring Web), which allows you to quickly deploy the project on the server. If you are building a WAR, then exclude the embedded Tomcat from the project. Accordingly, the project itself will need to be launched in the already installed Tomcat on the server. You can go a little further and create an image for Docker, where you can register all the configurations necessary for deployment (for example, download Tomcat, Maven, etc.). It all depends on how exactly you want to deploy the application. Of course, the presence of Maven || Gradle Wrapper Will be a plus. Don't forget to also have separate configuration profiles (yml or properties) for development and production.
2) There is a fundamental difference. Versions of java 8, 11, 17 are LTS.
I have heard that Java versions above 11 can sometimes have problems with Spring, but I have not personally encountered it. It is generally recommended to use java 8 & 11. But of course, newer versions of Spring should also work.
https://www.infoq.com/news/2018/09/spring-51-java-11/3
)

Maybe you will advise something, otherwise I'm just starting to work with JAVA.

It is difficult to advise anything without knowing the level of your knowledge in Java. In a nutshell, you need to have Java Junior level knowledge in order to start developing with Spring. Strengthen your knowledge in Java SE (jcf, jdbc) & EE (orm, hibernate, jpa, servlet, jsp, jstl). Learn Spring Framework and then Spring Boot etc.
The answer to your question on Habré was given more than once. Just search and see what needs to be learned.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question