First, the source code download
Recently due to demand, need to carry out openfire plug-in development, so need to openfire the source of the deployment, the current OpenFire stable version is 3.9.3, the official http://www.igniterealtime.org/downloads /index.jsp, download page
You can also download the latest 3.10beta version of the source code on GitHub: Https://github.com/igniterealtime/openfire
Second, import eclipse
Go to the build/eclipse directory of the downloaded source code, copy all files and folders under it to the build ancestor directory (possibly named OpenFire), and modify the file Classpath and project separately . Classpath,. Project(may not be directly modified under Windows, you can copy the two files from other out-of-the-box eclipse projects, and then modify their contents to replace them), such as:
The modified effect and directory structure are as follows:
Then import the eclipse directly
There will be a red exclamation mark, or an error, the effect
Here's a step-by-step solution, right-click on some jar dependencies for your project, such as:
The red X shows the missing jar, downloads the corresponding jar on the web, and imports it into the corresponding directory.
After adding some of the required jar packages, after recompiling the refresh, we find that some errors are reported:
Step by step follow up, found some classes can not find, originally also missing some jar package:
Search through the Internet to find, need org.eclipse.jetty.spdy.server.http package, in the Build/lib/merge directory with the Spdy field of the jar package, and then decisively added to the build path
Add, and then compile the refresh, found just where the error has finally disappeared, but still have errors, found missing jetty-servlets package, such as.
Then the first to find the Build/lib/merge directory, also found that the jar package, and then introduced the jar package, and then recompile the refresh, found in some directory plugins there are errors:
After searching, found that the missing Jsr311-api, and then download the jar from the web copy to the Build/lib/merge directory, and then add to the build path, compiled after the discovery or error:
Find the corresponding solution found, is missing jersey-bundle package caused, so download the package and then compile, found that the project finally did not error, a significant step forward.
Iii. Ant Compilation Project
The project will be able to start using ant to compile the project without an error, the steps are as follows:
- Open Eclipse's Ant view and select the project's build.xml file
Navigate to this view
Add the project under the Build.xml file
- Run the build file for the OpenFire XMPP server
Expand OpenFire XMPP Server, select Openfire[default], right-click, run as->ant build
Expand
Run
- Configuration after compilation is complete
Wait a little while, no accident, the console will compile the successful information:
And after the OpenFire project is refreshed, the target and work two directories will be more than one:
- Configure the main class to run
Select the item and add the Eclipse toolbar:
Add a Run item
Select Main Class
- Configuring parameters for a Run
Select the Arguments tab and fill in the VM arguments
-dopenfirehome= "${workspace_loc:openfire}/target/openfire"
Be careful not to lose the front line. If your project name is not OPENFIRE_SRC, change it to your project name.
That is:-dopenfirehome= "${workspace_loc:" Project name "}/target/openfire"
Then select the Classpath tab select User-entries–> Select the advanced...–> on the right to select Add Folder
Add src/i18n separately to determine
Select the advanced...–> on the right to select Add Folder
Build/lib/dist OK
Select the advanced...–> on the right to select Add Folder
Src/resources/jar OK
As follows:
- Run successfully
After configuring the above parameters to run, the Eclipse console will appear with some information on the run:
And then it's done!!!
Browse Volume Access: http://localhost:9090 is ready for some configuration.
Iv. Note
Some of the missing jar packages in the project can be downloaded on the web, recommended for download with Maven, and a jar package for download URLs: http://mvnrepository.com
Some of the dependent jar packages can be downloaded from here: http://download.csdn.net/detail/haunghui6579/8521567
If there is a problem, can e-mail contact:[email protected]
Openfire3.10beta version of the source code on Eclipse deployment compilation