Updated on 2022-09-14 GMT+08:00

Packaging IntelliJ IDEA Code

Scenario

Export a JAR package using IntelliJ IDEA and specify the name of the JAR package, for example, storm-examples.jar.

Procedure

  1. In IntelliJ IDEA, configure the Artifacts information for the project before the JAR package is generated.

    1. Enter IntelliJ IDEA and choose File > Project Structure.
    2. On the Project Structure page, select Artifacts, click the plus sign (+), and choose JAR > Empty.
      Figure 1 Adding Artifacts
    3. Set the name, type, and output path of the JAR package based on site requirements.
      Figure 2 Configuring basic information
    4. Choose 'storm-examples' , right-click Put into Output Root, and click Apply.
      Figure 3 Put into Output Root
    5. Click OK to complete the configuration.

  2. Generate the JAR package.

    1. Enter IntelliJ IDEA and choose Build > Build Artifacts....
      Figure 4 Build Artifacts
    2. In the displayed interface, choose storm-examples:jar > Build to generate the JAR package.
      Figure 5 Build
    3. If log similar to the following is displayed in event logs, the JAR package is successfully generated. Obtain the JAR package from the Output directory configured shown in Figure 2.
      14:37 Compilation completed successfully in 25 s 991 ms