IM即时聊天系统-Openfire爬坑之路二 运行源码

工具和源码

  • 编辑器工具是IDEA ,
  • 管理构建工具Maven,
  • openfire源码4.6.0-SNAPSHOT

将项目导入IDEA

建项目用IDEA打开后需要进行一下配置:

步骤:

Run -> Edit Configurations... -> Add Application

填一下值

Name: Openfire
Use classpath of module: starter
Main class: org.jivesoftware.openfire.starter.ServerStarter
VM options (adapt accordingly):将以下代码,替换你的项目地址,填入

-DopenfireHome="换成你项目文件的目录\distribution\target\distribution-base" 
-Xverify:none
-server
-Dlog4j.configurationFile="换成你项目文件的目录\distribution\target\distribution-base\lib\log4j2.xml"
-Dopenfire.lib.dir="换成你项目文件的目录\distribution\target\distribution-base\lib"
-Dfile.encoding=UTF-8

结果如下图:

openfire idea运行配置.png

构建

在Terminal终端运行以下代码:

./mvnw verify

如果值改了主模块,那么只需要运行:

./mvnw verify -pl distribution -am 

将项目导入后,很多依赖的插件和库,下载不了,报红
解决方案,以下两种:

  1. 在有报红的pom文件中添加阿里云的maven仓库

    
        central
        aliyun maven
        http://maven.aliyun.com/nexus/content/groups/public/
        default
        
        
            true
        
        
        
            false
        
    

  1. maven 手动下载命令


    举个栗子:maven-assembly-plugin
mvn dependency:get -DremoteRepositories=https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-assembly-plugin
-DgroupId=org.apache.maven.plugins
-DartifactId=maven-assembly-plugin
-Dversion=3.2.0

你可能感兴趣的:(IM即时聊天系统-Openfire爬坑之路二 运行源码)