# 安装idea

jetbrains官网 (opens new window) 下载对应操作系统的版本并安装

# 配置maven仓库

进入maven安装目录找到.m2目录下的settings.xml文件,并修改,大致内容如下:

点击查看settings.xml内容
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
    <server>
    	<id>sei</id>
    	<username>demo</username>
    	<password>demo</password>
    </server>
  </servers>
  <mirrors>
    <mirror>
	    <id>alimaven</id>
	    <name>aliyun maven</name>
	    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
	    <mirrorOf>central</mirrorOf>
	  </mirror>
	  <mirror>
        <id>sei</id>
        <mirrorOf>*</mirrorOf>
        <url>http://202.202.43.5:82/repository/sei-group/</url>
    </mirror>
  </mirrors>
</settings>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

# 创建springboot项目

按照网上教程创建spring Initializr项目

# 配置项目pom.xml

更改pom.xml,大致内容如下:

点击查看pom.xml内容
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>sei-cloud</groupId>
        <artifactId>sei-cloud-starter-parent</artifactId>
        <version>4.0.0</version>
        <relativePath/>
    </parent>

    <groupId>sei-cloud</groupId>
    <artifactId>demo</artifactId>
    <version>1.0.0</version>
    <name>demo</name>

    <properties>
        <skipTests>true</skipTests>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>sei-cloud</groupId>
            <artifactId>app</artifactId>
        </dependency>
    </dependencies>

    <distributionManagement>
        <repository>
            <id>sei</id>
            <name>sei Release Repository</name>
            <url>http://202.202.43.5:82/repository/sei/</url>
        </repository>
        <snapshotRepository>
            <id>sei</id>
            <name>sei Snapshot Repository</name>
            <url>http://202.202.43.5:82/repository/sei-snapshot/</url>
        </snapshotRepository>
    </distributionManagement>

    <!-- 加载的是 第三方项目使用的jar包 -->
    <repositories>
        <repository>
            <id>sei</id>
            <name>sei Release Repository</name>
            <url>http://202.202.43.5:82/repository/sei-group/</url>
        </repository>
    </repositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

<!--        打包为springBoot服务包 -->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <fork>true</fork>
                    <includeSystemScope>true</includeSystemScope>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <charset>UTF-8</charset>
                    <docencoding>UTF-8</docencoding>
                    <attach>true</attach>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <finalName>demo</finalName>
    </build>
</project>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117

# 配置项目资源文件

找到idea环境的External Libraries中找到sei-cloud:app:4.0.0包,打开该包下的app-4.0.0.jar文件,拷贝其下的config目录、i18n目录、templates目录和logback-spring.xml文件到您项目的src/main/resources目录下,并根据你的环境更改配置文件内容。

config
i18n
templates
logback-spring.xml
1
2
3
4

各目录文件主要作用功能为:
(1) config目录下是系统需要的各项组件配置文件,根据自己项目情况更改其中的选项
(2) i18n目录下为国际化翻译文件,根据您项目的情况可能需要扩充
(3) templates目录下为找回口令时发给用户的邮件模板,根据项目情况更改
(4) logback-spring.xml为日志配置文件,根据项目需要更改

# 配置数据源

数据库配置文件为application-datasource-sqldb.yml,根据您数据库情况需更改连接ip、端口、用户名及密码等

# 创建数据库

系统启动时可自己创建需要的数据库,将sei.cloud.database-update选项设置为true,系统启动时就会自动检查并创建数据库,当版本升级后系统也会自动检测并更新数据库表结构为新版本的表结构。

sei:
  cloud:
    database-update: true #创建或更新数据库表结构(建议生产系统关闭)
1
2
3