我要评分
获取效率
正确性
完整性
易理解

Development Settings

In this document, the Maven development environment is used as an example. You are advised to develop offload applications based on Maven.

  1. Install the JAR package of HAF in the local Maven environment.
    1. Download BoostKit-haf_1.3.0.zip based on Obtaining Software and decompress it to the current directory.

    2. Go to the BoostKit-haf_1.3.0 directory and decompress haf-1.3.0.tar.gz to the current directory.

    3. Go to the haf-1.3.0 directory and decompress haf-host-1.3.0.tar.gz to the current directory.

    4. Open CMD, go to the haf-host-1.3.0\lib\jar directory, and install haf-1.3.0.jar in the local Maven environment.
      mvn install:install-file -Dfile=haf-1.3.0.jar -DgroupId=com.huawei -DartifactId=haf -Dversion=1.3.0 -Dpackaging=jar -DgeneratePom=true -DcreateChecksum=true

      Add Maven to environment variables in advance.

  2. Add the HAF dependencies to the project.

    Add the dependencies to the POM file of the project.

    <dependency>
    	<groupId>com.huawei</groupId>
    	<artifactId>haf</artifactId>
    	<version>1.3.0</version>
    </dependency>
    <dependency>
    	<groupId>ch.qos.logback</groupId>
    	<artifactId>logback-core</artifactId>
    	<version>1.2.3</version>
    </dependency>
    <dependency>
    	<groupId>ch.qos.logback</groupId>
    	<artifactId>logback-classic</artifactId>
    	<version>1.2.3</version>
    </dependency>
    <dependency>
    	<groupId>de.ruedigermoeller</groupId>
    	<artifactId>fst</artifactId>
    	<version>2.56</version>
    </dependency>
  3. Enable build-time annotation.
    Add build-time annotation processing to the POM file of the project. The build-time annotation processor generates related pushdown invoking code for each different annotation.
    <build>
    	<plugins>
    		<plugin>
    			<artifactId>maven-compiler-plugin</artifactId>
    			<version>3.8.1</version>
    			<configuration>
    				<annotationProcessors>
    					<annotationProcessor>
    						com.huawei.haf.process.HafProcessor
    					</annotationProcessor>
    				</annotationProcessors>
    			</configuration>
    		</plugin>
    	</plugins>
    </build>