Maven site deploy using ftp

杀马特。学长 韩版系。学妹 提交于 2019-12-05 02:27:41

As I misinterpreted your intention the first time. Here the right solution:

Deploy site via ftp-server

<project>
  [...]
  <distributionManagement>
    <repository>
      <id>ftpserver</id>
      <name>some ftpserver name</name>
      <url>ftp://host/pub</url>
    </repository>
  </distributionManagement>
  <build>
    <extensions>
      <!-- uncomment this one if you use maven < 2.1.0 -->
      <!-- and want to copy directories too :) -->
      <!--
      <extension>
        <groupId>org.mod4j.patched</groupId>
        <artifactId>wagon-ftp</artifactId>
        <version>1.0-beta-2-PATCHEDv3-WAGON-148</version>
      </extension>
      -->

      <!-- uncomment this one (or next) if you use maven >= 2.1.0  -->
      <!--
      <extension>
        <groupId>org.mod4j.patched</groupId>
        <artifactId>wagon-ftp</artifactId>
        <version>1.0-beta-5-PATCHED-v1</version>
      </extension>
      -->
      <!-- i guess you could also use this one instead of the -->
      <!-- org.mod4j.patched version too, but maybe they patched -->
      <!-- something substantial here too in regrad to the apache version -->
      <!--
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-ftp</artifactId>
        <version>1.0-beta-5</version>
      </extension>
      -->

      <!-- don't uncomment this one, even if you use maven < 2.1.0. -->
      <!-- except the you don't want to be able to copy directories -->
      <!-- and you know you want too :-) (why would you?) -->
      <!--
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-ftp</artifactId>
        <version>1.0-beta-2</version>
      </extension>
      -->
    </extensions>
  </build>
  [...]
</project>

And in your settings.xml you will need

<settings>
  ...
  <servers>
    <server>
      <id>ftpserver</id>
      <username>user</username>
      <password>pass</password>
    </server>
  </servers>
  ...
</settings>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!