Skip to content

Commit 0a56ce8

Browse files
author
litongjava
committed
add profiles
1 parent 93764b1 commit 0a56ce8

File tree

1 file changed

+76
-14
lines changed
  • docs/zh/01_tio-boot 简介

1 file changed

+76
-14
lines changed

docs/zh/01_tio-boot 简介/02.md

+76-14
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,70 @@ The package is distributed through Maven Central.
1414
If you are developing with Java 8, please use the following dependency:
1515

1616
```xml
17-
<properties>
18-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19-
<java.version>1.8</java.version>
20-
<maven.compiler.source>${java.version}</maven.compiler.source>
21-
<maven.compiler.target>${java.version}</maven.compiler.target>
22-
<tio-boot.version>1.3.8</tio-boot.version>
23-
</properties>
24-
<dependencies>
25-
<dependency>
26-
<groupId>com.litongjava</groupId>
27-
<artifactId>tio-boot</artifactId>
28-
<version>${tio-boot.version}</version>
29-
</dependency>
30-
</dependencies>
17+
<properties>
18+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19+
<java.version>1.8</java.version>
20+
<maven.compiler.source>${java.version}</maven.compiler.source>
21+
<maven.compiler.target>${java.version}</maven.compiler.target>
22+
<tio-boot.version>1.3.8</tio-boot.version>
23+
</properties>
24+
<dependencies>
25+
<dependency>
26+
<groupId>com.litongjava</groupId>
27+
<artifactId>tio-boot</artifactId>
28+
<version>${tio-boot.version}</version>
29+
</dependency>
30+
</dependencies>
31+
32+
<profiles>
33+
<!-- 开发环境 -->
34+
<profile>
35+
<id>development</id>
36+
<activation>
37+
<activeByDefault>true</activeByDefault>
38+
</activation>
39+
<dependencies>
40+
<dependency>
41+
<groupId>ch.qos.logback</groupId>
42+
<artifactId>logback-classic</artifactId>
43+
<version>1.2.3</version>
44+
</dependency>
45+
</dependencies>
46+
</profile>
47+
48+
<!-- 生产环境 -->
49+
<profile>
50+
<id>production</id>
51+
<dependencies>
52+
<dependency>
53+
<groupId>ch.qos.logback</groupId>
54+
<artifactId>logback-classic</artifactId>
55+
<version>1.2.3</version>
56+
</dependency>
57+
</dependencies>
58+
<build>
59+
<plugins>
60+
<plugin>
61+
<groupId>org.springframework.boot</groupId>
62+
<artifactId>spring-boot-maven-plugin</artifactId>
63+
<version>2.7.4</version>
64+
<configuration>
65+
<mainClass>${main.class}</mainClass>
66+
<excludeGroupIds>org.projectlombok</excludeGroupIds>
67+
</configuration>
68+
<!-- 设置执行目标 -->
69+
<executions>
70+
<execution>
71+
<goals>
72+
<goal>repackage</goal>
73+
</goals>
74+
</execution>
75+
</executions>
76+
</plugin>
77+
</plugins>
78+
</build>
79+
</profile>
80+
</profiles>
3181
```
3282

3383
#### 编写代码
@@ -67,3 +117,15 @@ public class IndexController {
67117
```
68118

69119
访问测试 http://localhost/,显示 index
120+
121+
### 打包
122+
123+
```
124+
mvn clean package -DskipTests -Pproduction
125+
```
126+
127+
### 启动
128+
129+
```
130+
java -jar target\**.jar
131+
```

0 commit comments

Comments
 (0)