Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
caopu16
whatsmars
提交
bf668cfc
W
whatsmars
项目概览
caopu16
/
whatsmars
与 Fork 源项目一致
Fork自
武汉红喜 / whatsmars
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
whatsmars
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
bf668cfc
编写于
7月 01, 2020
作者:
武汉红喜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
脚手架优化
上级
2d968c2a
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
155 addition
and
18 deletion
+155
-18
whatsmars-archetypes/dubbo-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
.../src/main/resources/META-INF/maven/archetype-metadata.xml
+44
-4
whatsmars-archetypes/dubbo-archetype/src/main/resources/archetype-resources/__rootArtifactId__-api/pom.xml
...ources/archetype-resources/__rootArtifactId__-api/pom.xml
+2
-2
whatsmars-archetypes/dubbo-archetype/src/main/resources/archetype-resources/__rootArtifactId__-api/src/main/java/api/__artifactIdCamelCase__Service.java
...api/src/main/java/api/__artifactIdCamelCase__Service.java
+6
-0
whatsmars-archetypes/dubbo-archetype/src/main/resources/archetype-resources/__rootArtifactId__-service/pom.xml
...es/archetype-resources/__rootArtifactId__-service/pom.xml
+9
-3
whatsmars-archetypes/dubbo-archetype/src/main/resources/archetype-resources/__rootArtifactId__-service/src/main/java/Application.java
...__rootArtifactId__-service/src/main/java/Application.java
+1
-1
whatsmars-archetypes/dubbo-archetype/src/main/resources/archetype-resources/__rootArtifactId__-service/src/main/java/service/impl/__artifactIdCamelCase__ServiceImpl.java
...java/service/impl/__artifactIdCamelCase__ServiceImpl.java
+13
-0
whatsmars-archetypes/dubbo-archetype/src/main/resources/archetype-resources/__rootArtifactId__-service/src/main/resources/application.yml
...otArtifactId__-service/src/main/resources/application.yml
+0
-0
whatsmars-archetypes/generate.sh
whatsmars-archetypes/generate.sh
+46
-0
whatsmars-archetypes/web-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
.../src/main/resources/META-INF/maven/archetype-metadata.xml
+24
-4
whatsmars-archetypes/web-archetype/src/main/resources/archetype-resources/pom.xml
...-archetype/src/main/resources/archetype-resources/pom.xml
+6
-0
whatsmars-archetypes/web-archetype/src/main/resources/archetype-resources/src/main/java/Application.java
...ources/archetype-resources/src/main/java/Application.java
+1
-1
whatsmars-archetypes/web-archetype/src/main/resources/archetype-resources/src/main/java/controller/GreetingController.java
...esources/src/main/java/controller/GreetingController.java
+2
-2
whatsmars-archetypes/web-archetype/src/main/resources/archetype-resources/src/main/java/model/Greeting.java
...ces/archetype-resources/src/main/java/model/Greeting.java
+1
-1
未找到文件。
whatsmars-archetypes/dubbo-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
浏览文件 @
bf668cfc
...
...
@@ -2,20 +2,60 @@
<archetype-descriptor
name=
"standard"
>
<requiredProperties>
<requiredProperty
key=
"package"
>
<defaultValue>
${groupId}
</defaultValue>
</requiredProperty>
<requiredProperty
key=
"artifactIdCamelCase"
>
<defaultValue>
${artifactId.replaceAll("^a|-a", "A").replaceAll("^b|-b", "B").replaceAll("^c|-c", "C").replaceAll("^d|-d", "D").replaceAll("^e|-e", "E").replaceAll("^f|-f", "F").replaceAll("^g|-g", "G").replaceAll("^h|-h", "H").replaceAll("^i|-i", "I").replaceAll("^j|-j", "J").replaceAll("^k|-k", "K").replaceAll("^l|-l", "L").replaceAll("^m|-m", "M").replaceAll("^n|-n", "N").replaceAll("^o|-o", "O").replaceAll("^p|-p", "P").replaceAll("^q|-q", "Q").replaceAll("^r|-r", "R").replaceAll("^s|-s", "S").replaceAll("^t|-t", "T").replaceAll("^u|-u", "U").replaceAll("^v|-v", "V").replaceAll("^w|-w", "W").replaceAll("^x|-x", "X").replaceAll("^y|-y", "Y").replaceAll("^z|-z", "Z")}
</defaultValue>
</requiredProperty>
<requiredProperty
key=
"artifactIdPackage"
>
<defaultValue>
${artifactId.replace("-",".")}
</defaultValue>
<requiredProperty
key=
"includeActuator"
>
<defaultValue>
false
</defaultValue>
</requiredProperty>
</requiredProperties>
<modules>
<module
id=
"${rootArtifactId}-api"
name=
"${rootArtifactId}-api"
dir=
"__rootArtifactId__-api"
>
</module>
<module
id=
"${rootArtifactId}-service"
name=
"${rootArtifactId}-service"
dir=
"__rootArtifactId__-service"
>
</module>
</modules>
<fileSets>
<fileSet
filtered=
"true"
>
<directory></directory>
<fileSet
filtered=
"true"
encoding=
"UTF-8"
packaged=
"true"
>
<directory>
__rootArtifactId__-api/src/main/java
</directory>
<includes>
<include>
**/*
</include>
</includes>
</fileSet>
<fileSet
filtered=
"true"
encoding=
"UTF-8"
packaged=
"true"
>
<directory>
__rootArtifactId__-api/src/test/java
</directory>
<includes>
<include>
**/*
</include>
</includes>
</fileSet>
<fileSet
filtered=
"true"
encoding=
"UTF-8"
packaged=
"true"
>
<directory>
__rootArtifactId__-service/src/main/java
</directory>
<includes>
<include>
**/*
</include>
</includes>
</fileSet>
<fileSet
filtered=
"true"
encoding=
"UTF-8"
packaged=
"true"
>
<directory>
__rootArtifactId__-service/src/test/java
</directory>
<includes>
<include>
**/*
</include>
</includes>
</fileSet>
<fileSet
filtered=
"true"
encoding=
"UTF-8"
>
<directory
/>
<includes>
<include>
**/.gitignore
</include>
<include>
**/log4j2.xml
</include>
<include>
**/*.yaml
</include>
<include>
**/*.yml
</include>
</includes>
</fileSet>
</fileSets>
</archetype-descriptor>
whatsmars-archetypes/dubbo-archetype/src/main/resources/archetype-resources/__
a
rtifactId__-api/pom.xml
→
whatsmars-archetypes/dubbo-archetype/src/main/resources/archetype-resources/__
rootA
rtifactId__-api/pom.xml
浏览文件 @
bf668cfc
...
...
@@ -4,11 +4,11 @@
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<groupId>
${groupId}
</groupId>
<artifactId>
${
a
rtifactId}
</artifactId>
<artifactId>
${
rootA
rtifactId}
</artifactId>
<version>
${version}
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
${artifactId}
-api
</artifactId>
<artifactId>
${artifactId}
</artifactId>
</project>
\ No newline at end of file
whatsmars-archetypes/dubbo-archetype/src/main/resources/archetype-resources/__
artifactId__-api/src/main/java/org/hongxi/__artifactIdPackage__/api/Demo
Service.java
→
whatsmars-archetypes/dubbo-archetype/src/main/resources/archetype-resources/__
rootArtifactId__-api/src/main/java/api/__artifactIdCamelCase__
Service.java
浏览文件 @
bf668cfc
package
org.hongxi.
$
{
artifactIdP
ackage
}.
api
;
package
${
p
ackage
}.
api
;
public
interface
Demo
Service
{
public
interface
${
artifactIdCamelCase
}
Service
{
String
hello
(
String
name
);
}
whatsmars-archetypes/dubbo-archetype/src/main/resources/archetype-resources/__
a
rtifactId__-service/pom.xml
→
whatsmars-archetypes/dubbo-archetype/src/main/resources/archetype-resources/__
rootA
rtifactId__-service/pom.xml
浏览文件 @
bf668cfc
...
...
@@ -3,12 +3,12 @@
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<groupId>
${groupId}
</groupId>
<artifactId>
${
a
rtifactId}
</artifactId>
<artifactId>
${
rootA
rtifactId}
</artifactId>
<version>
${version}
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
${artifactId}
-service
</artifactId>
<artifactId>
${artifactId}
</artifactId>
<dependencies>
<dependency>
...
...
@@ -20,10 +20,16 @@
<artifactId>
dubbo-spring-boot-starter
</artifactId>
<version>
Rocket.S8
</version>
</dependency>
#if (${includeActuator} == 'true' || ${includeActuator} == 'Y' || ${includeActuator} == 'y')
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
#end
<dependency>
<groupId>
${groupId}
</groupId>
<artifactId>
${
a
rtifactId}-api
</artifactId>
<artifactId>
${
rootA
rtifactId}-api
</artifactId>
<version>
${version}
</version>
</dependency>
</dependencies>
...
...
whatsmars-archetypes/
web-archetype/src/main/resources/archetype-resources/src/main/java/org/hongxi/__artifactIdPackage__
/Application.java
→
whatsmars-archetypes/
dubbo-archetype/src/main/resources/archetype-resources/__rootArtifactId__-service/src/main/java
/Application.java
浏览文件 @
bf668cfc
package
org.hongxi.
$
{
artifactIdP
ackage
};
package
${
p
ackage
};
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
...
...
whatsmars-archetypes/dubbo-archetype/src/main/resources/archetype-resources/__
artifactId__-service/src/main/java/org/hongxi/__artifactIdPackage__/service/impl/Demo
ServiceImpl.java
→
whatsmars-archetypes/dubbo-archetype/src/main/resources/archetype-resources/__
rootArtifactId__-service/src/main/java/service/impl/__artifactIdCamelCase__
ServiceImpl.java
浏览文件 @
bf668cfc
package
org.hongxi.
$
{
artifactIdP
ackage
}.
service
.
impl
;
package
${
p
ackage
}.
service
.
impl
;
import
org.apache.dubbo.config.annotation.Service
;
import
org.hongxi.
$
{
artifactIdP
ackage
}.
api
.
DemoService
;
import
${
p
ackage
}.
api
.
DemoService
;
@Service
public
class
DemoServiceImpl
implements
Demo
Service
{
public
class
${
artifactIdCamelCase
}
ServiceImpl
implements
$
{
artifactIdCamelCase
}
Service
{
@Override
public
String
hello
(
String
name
)
{
...
...
whatsmars-archetypes/dubbo-archetype/src/main/resources/archetype-resources/__
a
rtifactId__-service/src/main/resources/application.yml
→
whatsmars-archetypes/dubbo-archetype/src/main/resources/archetype-resources/__
rootA
rtifactId__-service/src/main/resources/application.yml
浏览文件 @
bf668cfc
文件已移动
whatsmars-archetypes/generate.sh
0 → 100644
浏览文件 @
bf668cfc
#!/bin/bash
type
=
${
1
}
groupId
=
${
2
}
artifactId
=
${
3
}
package
=
${
4
}
includeActuator
=
${
5
}
if
[
-z
"
$type
"
]
;
then
echo
"you must enter project type: web or dubbo"
exit
0
fi
if
[
-z
"
$groupId
"
]
;
then
echo
"you must enter groupId"
exit
0
fi
if
[
-z
"
$artifactId
"
]
;
then
echo
"you must enter artifactId"
exit
0
fi
rm
-rf
${
artifactId
}
rm
-f
${
artifactId
}
.tar
mvn archetype:generate
\
-DarchetypeCatalog
=
internal
\
-DarchetypeGroupId
=
org.hongxi
\
-DarchetypeArtifactId
=
${
type
}
-archetype
\
-DarchetypeVersion
=
Rocket.S8
\
-DgroupId
=
${
groupId
}
\
-DartifactId
=
${
artifactId
}
\
-Dversion
=
1.0.0-SNAPSHOT
\
-Dpackage
=
${
package
}
\
-DincludeActuator
=
${
includeActuator
}
\
-DinteractiveMode
=
false
tar
-zcvf
${
artifactId
}
.tar
${
artifactId
}
rm
-rf
${
artifactId
}
time
=
$(
date
"+%Y-%m-%d %H:%M:%S"
)
echo
"
${
time
}
create project
${
artifactId
}
successfully"
>>
generate-project.log
# 可用java调用此脚本生成工程,上传至某个地方,然后下载
\ No newline at end of file
whatsmars-archetypes/web-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
浏览文件 @
bf668cfc
...
...
@@ -2,20 +2,40 @@
<archetype-descriptor
name=
"standard"
>
<requiredProperties>
<requiredProperty
key=
"package"
>
<defaultValue>
${groupId}
</defaultValue>
</requiredProperty>
<requiredProperty
key=
"artifactIdCamelCase"
>
<defaultValue>
${artifactId.replaceAll("^a|-a", "A").replaceAll("^b|-b", "B").replaceAll("^c|-c", "C").replaceAll("^d|-d", "D").replaceAll("^e|-e", "E").replaceAll("^f|-f", "F").replaceAll("^g|-g", "G").replaceAll("^h|-h", "H").replaceAll("^i|-i", "I").replaceAll("^j|-j", "J").replaceAll("^k|-k", "K").replaceAll("^l|-l", "L").replaceAll("^m|-m", "M").replaceAll("^n|-n", "N").replaceAll("^o|-o", "O").replaceAll("^p|-p", "P").replaceAll("^q|-q", "Q").replaceAll("^r|-r", "R").replaceAll("^s|-s", "S").replaceAll("^t|-t", "T").replaceAll("^u|-u", "U").replaceAll("^v|-v", "V").replaceAll("^w|-w", "W").replaceAll("^x|-x", "X").replaceAll("^y|-y", "Y").replaceAll("^z|-z", "Z")}
</defaultValue>
</requiredProperty>
<requiredProperty
key=
"artifactIdPackage"
>
<defaultValue>
${artifactId.replace("-",".")}
</defaultValue>
<requiredProperty
key=
"includeActuator"
>
<defaultValue>
false
</defaultValue>
</requiredProperty>
</requiredProperties>
<fileSets>
<fileSet
filtered=
"true"
>
<directory></directory>
<fileSet
filtered=
"true"
encoding=
"UTF-8"
packaged=
"true"
>
<directory>
src/main/java
</directory>
<includes>
<include>
**/*
</include>
</includes>
</fileSet>
<fileSet
filtered=
"true"
encoding=
"UTF-8"
packaged=
"true"
>
<directory>
src/test/java
</directory>
<includes>
<include>
**/*
</include>
</includes>
</fileSet>
<fileSet
filtered=
"true"
encoding=
"UTF-8"
>
<directory
/>
<includes>
<include>
**/*.sh
</include>
<include>
**/.gitignore
</include>
<include>
**/*.xml
</include>
<include>
**/*.yaml
</include>
<include>
**/*.yml
</include>
</includes>
</fileSet>
</fileSets>
</archetype-descriptor>
whatsmars-archetypes/web-archetype/src/main/resources/archetype-resources/pom.xml
浏览文件 @
bf668cfc
...
...
@@ -29,6 +29,12 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-log4j2
</artifactId>
</dependency>
#if (${includeActuator} == 'true' || ${includeActuator} == 'Y' || ${includeActuator} == 'y')
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
#end
</dependencies>
<build>
...
...
whatsmars-archetypes/
dubbo-archetype/src/main/resources/archetype-resources/__artifactId__-service/src/main/java/org/hongxi/__artifactIdPackage__
/Application.java
→
whatsmars-archetypes/
web-archetype/src/main/resources/archetype-resources/src/main/java
/Application.java
浏览文件 @
bf668cfc
package
org.hongxi.
$
{
artifactIdP
ackage
};
package
${
p
ackage
};
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
...
...
whatsmars-archetypes/web-archetype/src/main/resources/archetype-resources/src/main/java/
org/hongxi/__artifactIdPackage__/
controller/GreetingController.java
→
whatsmars-archetypes/web-archetype/src/main/resources/archetype-resources/src/main/java/controller/GreetingController.java
浏览文件 @
bf668cfc
package
org.hongxi.
$
{
artifactIdP
ackage
}.
controller
;
package
${
p
ackage
}.
controller
;
import
com.hongxi.
$
{
artifactIdP
ackage
}.
model
.
Greeting
;
import
${
p
ackage
}.
model
.
Greeting
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
whatsmars-archetypes/web-archetype/src/main/resources/archetype-resources/src/main/java/
org/hongxi/__artifactIdPackage__/
model/Greeting.java
→
whatsmars-archetypes/web-archetype/src/main/resources/archetype-resources/src/main/java/model/Greeting.java
浏览文件 @
bf668cfc
package
org.hongxi.
$
{
artifactIdP
ackage
}.
model
;
package
${
p
ackage
}.
model
;
public
class
Greeting
{
private
long
id
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录