提交 883961e1 编写于 作者: 如梦技术's avatar 如梦技术 🐛

🎉 v0.0.1-RC1

上级
# http://editorconfig.org
root = true
# 空格替代Tab缩进在各种编辑工具下效果一致
[*]
indent_style = space
indent_size = 4
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
[*.java]
indent_style = tab
[*.{json,yml}]
indent_size = 2
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
### gradle ###
.gradle
!gradle/wrapper/gradle-wrapper.jar
### STS ###
.settings/
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
bin/
### IntelliJ IDEA ###
.idea
out/
*.iws
*.iml
*.ipr
### NetBeans ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
### maven ###
target/
*.war
*.ear
*.zip
*.tar
*.tar.gz
# logs #
logs
# temp ignore
*.log
*.cache
*.diff
*.patch
*.tmp
*.java~
*.properties~
*.xml~
# system ignore
.DS_Store
Thumbs.db
Servers
.metadata
upload
gen_code
# 变更记录
## 发行版本
## [0.0.1-RC1] - 2019-01-23
### 初始化项目
- `mica-bom` 依赖 bom。
- `mica-core` mica 核心工具集。
- `mica-captcha` mica 验证码。
- `mica-launcher` mica 启动器。
- `mica-log4j2` log4j2 配置。
- `mica-boot` spring boot 扩展。
- `mica-boot-test` 更加方便测试。
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (c) 2019-2029, Dreamlu 卢春梦 (596392912@qq.com & www.dreamlu.net).
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License.
“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.
An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.
A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”.
The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.
The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:
a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:
a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license document.
c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.
1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.
e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.
## mica(云母)
`Mica`,Spring Cloud 微服务开发核心包,基于 `Spring boot 2.x`,暂不支持 `webflux`
想要了解更多可加入【如梦技术】QQ群:`479710041`
![犬夜叉-云母](docs/img/mica-001.jpeg)
## 模块划分
### mica-core
- 常用工具包,基于 `Spring-core` 扩展增强
### mica-launcher
- 项目启动器
- 启动信息打印
- 系统环境处理
- spi 扩展
### mica-boot
- 异步配置
- 异常处理
- swagger配置
- jackson配置
- 文件上传配置
- 请求日志
- `url` 版本号处理
### mica-boot-test
- 方便 mica-boot 测试。
### mica-log4j2
- mica log4j配置,异步日志。
### mica-captcha
- 验证码,支持 `webflux``serlvet`
## 文档
文档编写中,敬请期待...
## 协议
![LGPL v3](docs/img/lgplv3-147x51.png)
## 用户权益
允许以引入不改源码的形式免费用于学习、毕设、公司项目、私活等。
特殊情况修改代码,但仍然想闭源需经过作者同意。
参考请注明:参考自 mica:https://github.com/lets-mica/mica
`注意`:若禁止条款被发现有权追讨19999的授权费。
## 授权用户
- `pigx` 宇宙最强微服务(架构师必备):https://pig4cloud.com/#/
- `SpringBlade` 完整的线上解决方案(系统生产必备):https://gitee.com/smallc/SpringBlade
## mica-pro
对微服务的扩展和增强,欢迎加入`如梦技术 VIP`一起探讨:https://git.dreamlu.net
## 鸣谢
感谢 `如梦技术VIP群` 小伙伴们的支持。
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
maven { url "http://repo.spring.io/plugins-release" }
}
dependencies {
classpath "io.spring.gradle:dependency-management-plugin:1.0.4.RELEASE"
}
}
ext {
javaVersion = JavaVersion.VERSION_1_8
springBootVersion = "2.1.2.RELEASE"
springCloudVersion = "Greenwich.RELEASE"
micaAutoVersion = "1.0.0"
protostuffVersion = "1.6.0"
disruptorVersion = "3.4.2"
swaggerVersion = "2.9.2"
lombokVersion = "1.18.4"
findbugsVersion = "3.0.2"
googleAutoServiceVersion = "1.0-rc4"
}
configure(subprojects) {
group = GROUPID
version = VERSION
apply plugin: "java-library"
apply plugin: "maven"
apply plugin: "io.spring.dependency-management"
apply from: "${rootProject.projectDir}/gradle/publish-maven.gradle"
apply from: "${rootProject.projectDir}/gradle/quality.gradle"
}
configure(subprojects - project(":mica-bom")) {
sourceCompatibility = "$javaVersion"
targetCompatibility = "$javaVersion"
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
repositories {
mavenLocal()
maven { url "https://repo.spring.io/libs-release" }
maven { url "https://repo.spring.io/milestone" }
maven { url "http://maven.aliyun.com/nexus/content/groups/public" }
mavenCentral()
}
dependencies {
compileOnly "org.slf4j:slf4j-api"
compileOnly "javax.servlet:javax.servlet-api"
compileOnly "org.springframework:spring-web"
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion"
// swagger 暂时有问题 https://github.com/springfox/springfox/issues/2763
// annotationProcessor "org.springframework:spring-context-indexer"
// JSR-305 only used for non-required meta-annotations
compileOnly "com.google.code.findbugs:jsr305:$findbugsVersion"
testCompileOnly "com.google.code.findbugs:jsr305:$findbugsVersion"
testCompileOnly "org.projectlombok:lombok:$lombokVersion"
testCompileOnly "org.springframework:spring-test"
testImplementation "junit:junit"
}
dependencyManagement {
imports {
mavenBom "org.springframework.boot:spring-boot-dependencies:$springBootVersion"
mavenBom "org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion"
}
}
compileJava.dependsOn(processResources)
}
此差异由.gitattributes 抑制。
此差异由.gitattributes 抑制。
VERSION=0.0.1-RC1
GROUPID=net.dreamlu
NEXUS_OSS_USER_NAME=***
NEXUS_OSS_PASS_WORD=***
REPOSITORY_URL_SNAPSHOT=https://oss.sonatype.org/content/repositories/snapshots/
REPOSITORY_URL_RELEASE=https://oss.sonatype.org/service/local/staging/deploy/maven2/
signing.keyId=D73A4CFE
signing.password=sonatype
signing.secretKeyRingFile=/Users/lcm/.gnupg/secring.gpg
apply plugin: 'signing'
apply plugin: 'maven-publish'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
jar {
into("META-INF/maven/$project.group/$project.name") {
from { generatePomFileForMavenJavaPublication }
rename ".*", "pom.xml"
}
}
task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
javadoc {
options {
encoding "UTF-8"
charSet 'UTF-8'
author true
version true
failOnError false
links "http://docs.oracle.com/javase/8/docs/api"
}
}
task javadocJar(type: Jar) {
archiveClassifier.set('javadoc')
from 'build/docs/javadoc'
}
artifacts {
archives sourcesJar
archives javadocJar
}
uploadArchives {
repositories.mavenDeployer {
pom.version = "${VERSION}"
pom.artifactId = "$project.name"
pom.groupId = "$project.group"
signing {
sign configurations.archives
}
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: pom.version.endsWith('SNAPSHOT')
? REPOSITORY_URL_SNAPSHOT : REPOSITORY_URL_RELEASE) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
pom.project {
name = 'mica'
packaging = 'jar'
description = 'An enhanced toolkit of Spring cloud to simplify development.'
url = 'https://github.com/lets-mica/mica'
scm {
connection = 'scm:github.com/lets-mica/mica'
developerConnection = 'scm:git@github.com/lets-mica/mica'
url = 'https://github.com/lets-mica/mica'
}
licenses {
license {
name = 'GNU LESSER GENERAL PUBLIC LICENSE'
url = 'https://www.gnu.org/licenses/lgpl-3.0.en.html'
}
}
developers {
developer {
name = 'Dreamlu'
email = 'qq596392912@gmail.com'
}
}
}
pom.withXml {
def root = asNode()
root.dependencies.'*'.findAll {
def d = it
d.scope.text() == 'runtime' && project.configurations
.findByName("implementation").allDependencies.find { dep ->
dep.name == it.artifactId.text()
}.each() {
d.scope*.value = 'compile'
d.appendNode('optional', true)
}
}
}
}
}
def getRepositoryUsername() {
return hasProperty('NEXUS_OSS_USER_NAME') ? NEXUS_OSS_USER_NAME : ""
}
def getRepositoryPassword() {
return hasProperty('NEXUS_OSS_PASS_WORD') ? NEXUS_OSS_PASS_WORD : ""
}
// TODO L.cm spotbugs 目前不能输出 html,跟 lombok 插件有冲突
apply plugin: "findbugs"
findbugs {
toolVersion = '3.0.1'
findbugsTest.enabled = false
sourceSets = [sourceSets.main]
ignoreFailures = true
reportsDir = file("$project.buildDir/findbugsReports")
effort = "max"
showProgress = true
reportLevel = "high"
excludeFilter = file("$rootProject.projectDir/gradle/quality/findbugs/excludeFilter.xml")
}
tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true
}
}
<FindBugsFilter>
<!--
Allow a class to hold or return mutable objects. While this has obvious risks, it is much too
common a pattern to treat as a bug.
-->
<Match>
<Bug code="EI, EI2"/>
</Match>
<!-- Ignore "UrF: Unread public/protected field (URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD)" since it is mostly false positives -->
<Match>
<Bug code="UrF" />
</Match>
<!-- Ignore "NM_SAME_SIMPLE_NAME_AS_SUPERCLASS: shadows the simple name of the superclass" -->
<!--<Match>-->
<!--<Bug pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS" />-->
<!--</Match>-->
<!--&lt;!&ndash; Ignore "NM_SAME_SIMPLE_NAME_AS_INTERFACE: shadows the simple name of implemented interface" &ndash;&gt;-->
<!--<Match>-->
<!--<Bug pattern="NM_SAME_SIMPLE_NAME_AS_INTERFACE" />-->
<!--</Match>-->
<Match>
<Class name="~net\.dreamlu\.mica\.config\.SpringUtils.*" />
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD" />
</Match>
<Match>
<Class name="~net\.dreamlu\.mica\.log\.LogPrintStream.*" />
<Bug pattern="DM_DEFAULT_ENCODING" />
</Match>
</FindBugsFilter>
此差异由.gitattributes 抑制。
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.