ZrLog是使用 Java 开发的博客/CMS程序,具有简约,易用,组件化,内存占用低等特点。自带 Markdown 编辑器,让更多的精力放在写作上
https://gitee.com/94fzb/zrlog
vim /etc/profile.d/java.sh
export JAVA_HOME=/usr/local/jdk
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.$CLASSPATH:$JAVA_HOME/lib
[root@iZ6we1ar56ovnqhhxxq917Z ~]# java -version
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
tar xf apache-tomcat-9.0.22.tar.gz -C /opt/
cd /opt/
ln -s apache-tomcat-9.0.22 tomcat
清空tomcat/webapps目录下内容,上传war包到webapps目录
cp zrlog.war /opt/tomcat/webapps/ROOT.war
create database zrlog character set utf8 collate utf8_general_ci;
grant all on zrlog.* to 'zrlog'@'192.168.1.%' identified by '123456';
http://host:port/zrlog/install
apache-maven-3.6.1-bin.tar.gz
vim /etc/profile.d/maven.sh
export MAVEN_HOME=/usr/local/maven
export PATH="$MAVEN_HOME/bin:$PATH"
vim /usr/local/maven/conf/settings.xml
<mirrors>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
mvn package
mvn clean
~/.m2/repository/
create database zrlog character set utf8 collate utf8_general_ci;
grant all on zrlog.* to 'zrlog'@'127.0.0.1' identified by '123456';
mysql -h 127.0.0.1 -uzrlog -p123456
git clone https://gitee.com/94fzb/zrlog.git
vim web/src/main/webapp/WEB-INF/db.properties
password=123456
jdbcUrl=jdbc:mysql://127.0.0.1:3306/zrlog?characterEncoding=UTF-8&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=GMT
user=zrlog
driverClass=com.mysql.cj.jdbc.Driver
zrlog/service/src/main/resources/init-table-structure.sql
rm web/src/main/webapp/WEB-INF/install.lock
mvn package
报错
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project web: There are test failures.
修改pom.xml
vim /opt/zrlog/pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
继续打包
...
[INFO] Building war: /opt/zrlog/web/target/../../target/zrlog-2.1.0.war
...
/opt/zrlog/target/zrlog-2.1.0.war
cp zrlog-2.1.0.war /opt/tomcat/webapps/ROOT.war
http://ip:8080