Import a plugin project

Updated at 1712627212000
Let's say you have downloaded the source code of the ezyblog project here and you want to import the project into IntelliJ, you can follow these steps.

Preparation

  1. Make sure you have installed ezyplatform without using Docker beforehand.
  2. Ensure that you have installed ezyplatform sdk beforehand.
  3. Make sure you have built the necessary libraries and set up environment variables. If not, you can refer to this article.

Install the necessary plugins.

  1. Unzip the source code zip file you just downloaded, for example ezyblog-0.0.1-sources.zip, and you will receive the ezyblog folder.
  2. Find the module.properties file to check for dependencies. For ezyblog, you can find the file at ezyblog/module.properties. You will see a list of dependencies:
# Other properties
project_name=EzyBlog
dependencies=ezyarticle
  1. Now start ezyplatform, access the admin interface, and add the ezyarticle plugin if you don't know how to add a plugin, you can refer to this article.
  2. After adding the plugin, go back to the ezyblog folder, open the terminal, and run the command bash export.sh on Linux or export.bat on Windows. You may encounter the following error:
[ERROR] Failed to execute goal on project ezyblog-theme: Could not resolve dependencies for project org.youngmonkeys:ezyblog-theme:jar:0.0.1: The following artifacts could not be resolved: org.youngmonkeys:ezyarticle-sdk:jar:0.0.1, org.youngmonkeys:ezyarticle-web-plugin:jar:0.0.1: Could not find artifact org.youngmonkeys:ezyarticle-sdk:jar:0.0.1 at specified path /xxx/ezyplatform/web/plugins/ezyarticle/lib/ezyarticle-sdk-0.0.1.jar

This is because of the difference in the ezyarticle version between the source code and ezyplatform. Find the folder ezyplatform/admin/plugins/ezyarticle/lib, and you will see the actual version of ezyarticle:

Screenshot 2024-03-20 at 16.01.57.png

For example, mine is 0.0.5. Then open the ezyblog/pom.xml file and change the version of ezyarticle to 0.0.5 as follows:

   <properties>
    <!--suppress UnresolvedMavenProperty -->
    <ezyplatform.home>${env.EZYPLATFORM_HOME}</ezyplatform.home>
    <ezyarticle.version>0.0.5</ezyarticle.version>
</properties>

Now go back to the terminal of the ezyblog directory you previously opened and run the command bash export.sh on Linux or export.bat on Windows, and you will see no more errors. However, if you encounter a java.lang.NullPointerException error, download the latest ezyplatform-sdk version.

  1. Now restart ezyplatform.
  2. In the admin interface, find the ezyblog theme and activate it.
  3. Restart admin, and then start the web.
  4. Access http://localhost:8080, if you see the ezyblog interface displayed, the installation was successful.
  5. Now turn off admin and web, and import ezyblog into IntelliJ.
  6. Rebuild ezyblog by double-clicking on "install" on the right side of IntelliJ.
Screenshot 2024-03-20 at 21.14.10.png

If you encounter build errors, it may be related to IntelliJ not recognizing the EZYPLATFORM_HOME environment variable. You can refer to this article for troubleshooting.

  1. You can run the EzyBlogThemeStartupTest class to initialize the ezyblog theme from IntelliJ.