java web 極速 框架fastboot 0.5.1上線
最新開源了一個(gè)java web框架
0.5.1集成了mongodb
啟動(dòng)速度極速啟動(dòng)
start server port :8081
[class com.example.Application]
started in : 124ms
快速開始
maven依賴example
@Controller
public class Application {
public static void main(String[] args) {
App.start(Application.class, args);
}
@RequestMapping("/")
public String hello() {
return "hello fastboot";
}
}
maven依賴 example
<parent>
<groupId>io.github.stylesmile</groupId>
<artifactId>fastboot-parent</artifactId>
<version>0.5.1</version>
</parent>
<dependencies>
<dependency>
<groupId>io.github.stylesmile</groupId>
<artifactId>fastboot-core</artifactId>
</dependency>
</dependencies>
### 打包插件 (需要在<manifest>這里指定啟動(dòng)類)
```maven
<plugins>
<!-- 配置編譯插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<compilerArgument>-parameters</compilerArgument>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!-- 配置打包插件(設(shè)置主類,并打包成胖包) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<finalName>${project.artifactId}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<!-- 此處,要改成自己的程序入口(啟動(dòng)類,即 main 函數(shù)類) -->
<manifest>
<mainClass>com.example.Application</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
```
#####如果你管理依賴用的gradle參考gradle配置
https://gitee.com/stylesmile/fastboot/blob/master/fastboot-example/fastboot-web-example/build.gradle
項(xiàng)目地址
https://gitee.com/stylesmile/fastboot
作者:java知路
歡迎關(guān)注微信公眾號(hào) :java知路