手记

关于FastDFS蛋疼的集群和负载均衡(九)之创建FastDFS的Maven项目

Interesting things

刚才把我搭建的FastDFS给主管看了。跟主管和我沟通后,主管跟我说,我搭建的FastDFS下载好像达不到负载均衡。我也很纳闷,空说无凭,现在来实战FastDFS。

What did you do today

  • 首先进入https://github.com/happyfish100/fastdfs-client-java,下载fastdfs-client-java员阿姆,版本号是1.27-SNAPSHOT

  • 使用maven从源码进行安装。

    mvn clean intall

  • 在target目录下生成了fastdfs-client-java-1.27-SNAPSHOT.java

  • 构建fastdfs-client-java-1.27-SNAPSHOT.java

    mvn install:install-file -DgroupId=org.csource -DartifactId=fastdfs-client-java -Dversion=1.27-SNAPSHOT -Dpackaging=jar -Dfile=fastdfs-client-java-1.27-SNAPSHOT.jar

  • 创建Maven项目,pom.xml中添加以下依赖。

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.test.failure.ignore>true</maven.test.failure.ignore>
        <maven.test.skip>true</maven.test.skip>
        <junit.version>4.12</junit.version>
        <fastdfs.version>1.27-SNAPSHOT</fastdfs.version>
        <guava.version>21.0</guava.version>
        <apache.commons.lang.version>3.7</apache.commons.lang.version>
        <apache.commons.io.version>2.5</apache.commons.io.version>
    </properties>
    <dependencies>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>${apache.commons.io.version}</version>
    </dependency>
    
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${apache.commons.lang.version}</version>
    </dependency>
    
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
    </dependency>
    
    <dependency>
        <groupId>org.csource</groupId>
        <artifactId>fastdfs-client-java</artifactId>
        <version>${fastdfs.version}</version>
    </dependency>
    
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava.version}</version>
    </dependency>
    
    </dependencies>

Summary

下一篇继续FastDFS.

2人推荐
随时随地看视频
慕课网APP