Introduction of Ark Biz

Updated at:

This topic describes the directory structure of Ark Biz and how to use sofa-ark-maven-plugin plug-ins to package and publish Ark Biz.

Package and publish Ark Biz

Both the Ark Biz package and the Ark package are packaged and generated using the sofa-ark-maven-plugin plug-in. By default, when you configure the plug-in, only Ark packages are packaged and published. Ark Biz is packaged and published only when the configuration parameter is attach to true, as follows:

<build>
    <plugin>
        <groupId>com.alipay.sofa</groupId>
        <artifactId>sofa-ark-maven-plugin</artifactId>
        <version>${sofa.ark.version}</version>
        <executions>
            <execution>
                <id>default-cli</id>
                <goals>
                    <goal>repackage</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <attach>false</attach>
        </configuration>
    </plugin>
</build>

Differences between Ark Biz and Ark packages

  • Ark Biz is the organizational unit of all resources for engineering applications, which contains all the resources needed to start the application. For more information, see the Ark Biz content format described below.

  • The Ark package produced by the engineering application is a Fat JAR that is started by using the java -jar command and runs in the SOFAArk container. It contains not only the Ark Biz that corresponds to the application project, but also the Ark Container and the Ark Plugin that the application depends on.

In most cases, you only need to publish an Ark package. However, SOFAArk allows you to run multiple Ark Biz packages. If you want the Ark Biz packages of your application to be directly used as JAR packages by other applications, you must package and publish the Ark Biz packages.

Ark-Biz typical directory structure

.
├── META-INF
│ ├── MANIFEST.MF
│ ├── maven
│ │ └ ── me.qlong.tech
│ │ └ ── sofa-boot-demo3-web
│ │ ├── pom.properties
│ │ └── pom.xml
│ └ ── sofa-boot-demo3
│ └ ── sofa-boot-demo3-web.xml
├── com
│ └── alipay
│ └── sofa
│ └── ark
│ └── biz
│ └── mark
├── config
│ ├── application-dev.properties
│ ├── application-test.properties
│ └── application.properties
├── lib
│ ├── spring-beans-4.3.4.RELEASE.jar
│ ├── spring-boot-1.4.2.RELEASE.jar
│ ├── spring-boot-autoconfigure-1.4.2.RELEASE.jar
│ ├── spring-boot-devtools-1.4.2.RELEASE.jar
│ ├── spring-boot-starter-1.4.2.RELEASE.jar
│ ├── spring-boot-starter-logging-1.4.2.RELEASE.jar
│ ├── spring-boot-starter-tomcat-1.4.2.RELEASE.jar
│ ├── spring-boot-starter-web-1.4.2.RELEASE.jar
│ ├── spring-context-4.3.4.RELEASE.jar
│ ├── spring-core-4.3.4.RELEASE.jar
│ ├── spring-expression-4.3.4.RELEASE.jar
│ ├── spring-web-4.3.4.RELEASE.jar
│ ├──...
│ ├──...
│ ├──...
│ └ ── velocity-1.7.jar
├── logback-spring.xml
├── me
│ └── qlong
│ └── tech
│ └──SOFABootWebSpringApplication.class
└──static
    └── index.html 

The files and directories related to the directory structure are described as follows:

Ordinary Java projects or Spring Boot Core or Web projects can be packaged into Ark Biz. Ark Biz does not have a fixed directory format. It just adds two directory files based on the original JAR package structure:

  • com/alipay/sofa/ark/biz/mark: Marker file that indicates that the JAR package is an Ark Biz file generated by sofa-ark-maven-plugin packaging.

  • lib/: The lib directory stores the three-party dependencies of engineering applications.