mirror of
https://github.com/wahyd4/Martian.git
synced 2026-08-09 05:16:21 +10:00
b4acdbe87531e355c49775a39e9d8a288edfbc10
The Js framework has React, Vue, AngularJS, but the Java framework has only one Spring. Many people say that I am making wheels, but I don't think so, so... it's time to challenge Spring, I hope everyone can get involved, contribute code, and give Java developers another option.
Other project
- Mars-cloud: https://github.com/yuyenews/Mars-cloud
- Mars-start: https://github.com/yuyenews/Mars-start
What can I do
- Simple to build, out of the box
- http service using netty
- Session management using JWT
- Support AOP, IOC, MVC, Mybatis, transaction management
- Distributed deployment via Mars-cloud
- Remote configuration via Mars-config [iteration]
Only need one jar package
<dependency>
<groupId>com.github.yuyenews</groupId>
<artifactId>mars-start-pure</artifactId>
<version>[The latest version, you can see the document]</version>
</dependency>
A configuration file
port: 8088
jdbc:
#Configure the data source, it must be Alibaba's druid data source
dataSource:
name: dataSource
url: jdbc:mysql://10.211.55.5:3306/test?serverTimezone=GMT%2B8
username: root
password: rootroot
driverClassName: com.mysql.cj.jdbc.Driver
Then start from the main method
public class Start {
public static void main(String[] args){
StartMars.start(Start.class);
}
}
No other configuration files other than this
- Many frameworks claim that they don't have a configuration file. In fact, they put the configuration in the Java class, and Mars-java has only one yml, which is more flexible and more code-saving than the Java class.
- Controller, Bean, DAO, single table operations can be completed with pure annotations, and it is simple
----------Upgrade the Mars-java project to the Mars-cloud project and its simplicity----------
Just need to change one start
<dependency>
<groupId>com.github.yuyenews</groupId>
<artifactId>mars-cloud-start</artifactId>
<version>[The latest version, you can see the document]</version>
</dependency>
Add 5 rows configuration
cloud:
# Service name, the name of the load balancing cluster of the same service must be the same, and must be unique between different clusters.
name: cloud-client1
sessionTimeout: 10000
# Whether as a gateway
gateWay: yes
timeOut: 10000
# Zookeeper address, multiple addresses are separated by commas,
# multiple addresses, must be double quotes, otherwise parsing yml files will be wrong
register: 10.211.55.9:2180
Very easy to learn
Document
Expansion pack
Support redis connection
Encapsulates Email, MD5, AES and other tool classes and integrates hutool
Simple comparison
| name | AOP | IOC | MVC | ORM | configuration file | startup method |
| Mars-java | OK | OK | OK | Mybatis,JDBCTemplete | Only one and supports remote configuration | Main Method |
| Springboot | OK | OK | OK | Support most mainstream frameworks | Only one and supports remote configuration | Main Method,War+Tomcat |
Languages
Java
100%
