java web 极速 框架fastboot 0.5.1上线
最新开源了一个java web框架
0.5.1集成了mongodb
启动速度极速启动
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>这里指定启动类)
```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>
<!-- 配置打包插件(设置主类,并打包成胖包) -->
<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>
<!-- 此处,要改成自己的程序入口(启动类,即 main 函数类) -->
<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
项目地址
https://gitee.com/stylesmile/fastboot
作者:java知路
欢迎关注微信公众号 :java知路