Linux deployment jar package
When deploying jar packages, you need to pay attention to:
- The versions in Linux and your jdk must be the same
- You need to import packaged plugins so that our jar package can run
- The passwords of the database are likely to be inconsistent and need to be modified in advance.
1. Unified jdk version
<properties> <>UTF-8</> <>UTF-8</> <>8</> </properties>
Just specify the jdk version in your Linux system in our dependencies.
2. Packaging plugin dependencies
<build> <plugins> <!-- Spring Boot Packaging plug-ins --> <plugin> <groupId></groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>
3. Modify password
- Method 1: Modify the database password in your/properties file.
- Method 2: Another way is to import a configuration file with the same name in the current directory when you execute the command of this jar package. It will load the configuration file in the directory under this command by default to overwrite the configuration file information in your jar package. Therefore we recommend putting the jar package and configuration files in the same level directory.
4. Execute the jar package
java -jar [jarPackage name]
Summarize
The above is personal experience. I hope you can give you a reference and I hope you can support me more.