JAVA源码编译Jpress
JAVA源码编译Jpress

JAVA源码编译Jpress

#提前安装JDK(本次使用的是ORACLE8)
[root@ubuntu2004 ~]#apt -y install maven
[root@ubuntu2004 jpress]#vim /etc/maven/settings.xml 
    <mirror>
    <id>nexus-aliyun</id>
    <mirrorOf>*</mirrorOf>
    <name>Nexus aliyun</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    </mirror>

[root@ubuntu2004 ~]#git clone https://github.com/JPressProjects/jpress.git
正克隆到 'jpress'...
remote: Enumerating objects: 109349, done.
remote: Counting objects: 100% (15891/15891), done.
remote: Compressing objects: 100% (5397/5397), done.
remote: Total 109349 (delta 5753), reused 15738 (delta 5615), pack-reused 93458
接收对象中: 100% (109349/109349), 298.15 MiB | 17.40 MiB/s, 完成.
处理 delta 中: 100% (43810/43810), 完成.
正在更新文件: 100% (1957/1957), 完成.

[root@ubuntu2004 ~]#ls
apache-tomcat-9.0.65.tar.gz  Heap.class  Heap.java  HeapOom2.class  HeapOom2.java  install_jdk_tomcat.sh  jdk-8u341-linux-x64.tar.gz  jpress  snap
[root@ubuntu2004 ~]#cd jpress/

[root@ubuntu2004 jpress]#mvn clean install package -Dmaven.test.skip=true
...
[INFO] Total time:  04:05 min
[INFO] Finished at: 2022-09-26T20:32:43+08:00
[INFO] ------------------------------------------------------------------------
[root@ubuntu2004 jpress]#cp starter-tomcat/target/starter-tomcat-5.0.war /usr/local/tomcat/webapps/jpress.war
[root@ubuntu2004 jpress]#ls /usr/local/tomcat/webapps/
docs/         examples/     host-manager/ jpress/       jpress.war    manager/      ROOT/   

二进制安装maven

#先安装好JDK
[root@ubuntu2004 ~]#wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
[root@ubuntu2004 ~]#tar xf apache-maven-3.6.3-bin.tar.gz -C /usr/local/
[root@ubuntu2004 ~]#ln -s /usr/local/apache-maven-3.6.3/ /usr/local/maven
[root@ubuntu2004 ~]#echo 'PATH=/usr/local/maven/bin:$PATH' > /etc/profile.d/maven.sh
[root@ubuntu2004 ~]#echo 'export MAVEN_HOME=/usr/local/maven' >> /etc/profile.d/maven.sh
[root@ubuntu2004 ~]#. /etc/profile.d/maven.sh
[root@ubuntu2004 ~]#mvn -v
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/maven
Java version: 1.8.0_341, vendor: Oracle Corporation, runtime: /usr/local/jdk1.8.0_341/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-124-generic", arch: "amd64", family: "unix"
[root@ubuntu2004 ~]#vim /usr/local/maven/conf/settings.xml