# maven-plugin-starter
**Repository Path**: yoqu/maven-plugin-starter
## Basic Information
- **Project Name**: maven-plugin-starter
- **Description**: spring boot appliaciton running script.
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 4
- **Forks**: 0
- **Created**: 2019-10-18
- **Last Updated**: 2022-07-02
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
Maven Plugin Stater
A spring boot applicaiton quick running script.
### [中文文档](./README_ZH_CN.md)
# What this?
> With the rapid development of spring boot, the deployment of a service is now simpler and easier, especially the rise of microservices, docker containerization. Make the spring boot jar advantage more and more only need to use `java -jar xxx.jar` to start.
But at the same time, for traditional enterprises and companies, do not introduce docker containerized deployment plan, and want to use jar package to start independently will encounter the following problems
1. If you need to implement custom jvm parameters or background hangs, you need to manually write the script (each console write code is too tired)
2. The configuration file modification in the jar is very troublesome (sometimes it needs operation and maintenance to maintain the configuration. If you have problems with the configuration, you need to repackage it. It is too time-consuming to encounter the turtle speed network copy package)
3. A server has multiple microservices running, and it doesn't know what service is a certain process (it is known through port checking, but this seems a bit cumbersome).
In summary, this gadget automatically generates startup, stop, and restart scripts after the project is compiled. The deployment package operation and maintenance generated by the user after compilation can be run with only two lines of commands.
1: `unzip xxx.war`
2:`sh xxx/bin/start.sh`.
**Note**:Use tomcat war package is not within the scope of this discussion deployment.
The compiled directory structure of the project:
```
├── META-INF
├── WEB-INF
│ ├── classes
│ └── lib
└── bin
├── restart.sh
├── start.sh
└── stop.sh
```
# Feature
- Automatically generate startup scripts during the packaging process
- No code intrusion, no need to increase jar package dependencies
- Support jvm parameter custom configuration
- Support personalized startup class lookup
- Support remote debug,jmx
- Jps command can display the service name
# Quick Start
1. Set the package mode to war in the pom file.
```xml
war
```
2. The following configuration is introduced under the plugins that set the pom.xml file.
```xml
com.uyoqu.framework
maven-plugin-starter
1.0.0
package
bin
```
The plug-in supports configuration. It can specify the startup main function and jvm parameters. For Spring boot, it supports automatic query of MainClass without manual filling.
example:
```xml
com.uyoqu.framework
maven-plugin-starter
1.0.0
package
bin
-server
-Xmx512m
com.xxx.xxx
App
```
**Note**:
- The jvm parameter is configured in jvms. If the user does not perform this configuration, the default parameters will be filled in the bin script.
- The matchClass parameter can be configured to support rules for finding matches.
- If the mainClass is not configured, the default class with the @SpringBootApplication annotation is found.
- There can only be one startup class, and if it matches more than one, it will report an error.