Maven站点部署使用ftp [英] Maven site deploy using ftp

查看:180
本文介绍了Maven站点部署使用ftp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Maven2,并希望使用ftp将生成的站点部署到Web服务器。



我尝试使用:

 < distributionManagement> 
< site>
< id>网站< / id>
< url> ftp:// host / pub /< / url>
< / site>

< / distributionManagement>

问题是获取ftp不支持的错误。
可能是这个基本功能不起作用。



谢谢,



Ronen。

解决方案

我第一次误解你的意图。这里正确的解决方案:



通过ftp-server部署站点

  <项目> 
[...]
< distributionManagement>
< repository>
< id> ftpserver< / id>
< name>某些ftpserver名称< / name>
< url> ftp:// host / pub< / url>
< / repository>
< / distributionManagement>
< build>
< extensions>
<! - 如果您使用maven< 2.1.0 - >
<! - 并且想要复制目录:) - >
<! -
< extension>
< groupId> org.mod4j.patched< / groupId>
< artifactId> wagon-ftp< / artifactId>
< version> 1.0-beta-2-PATCHEDv3-WAGON-148< / version>
< / extension>
- >

<! - 取消注释这个(或下一个)如果你使用maven> = 2.1.0 - >
<! -
< extension>
< groupId> org.mod4j.patched< / groupId>
< artifactId> wagon-ftp< / artifactId>
< version> 1.0-beta-5-PATCHED-v1< / version>
< / extension>
- >
<! - 我想你也可以使用这个而不是 - >
<! - org.mod4j.patched版本,但也许他们修补 - >
<! - 这里太重要了,在apache版本 - >
<! -
< extension>
< groupId> org.apache.maven.wagon< / groupId>
< artifactId> wagon-ftp< / artifactId>
< version> 1.0-beta-5< / version>
< / extension>
- >

<! - 不要取消注释这个,即使你使用maven< 2.1.0。 - >
<! - 除了你不想复制目录 - >
<! - 你知道你也想:-)(你为什么?) - >
<! -
< extension>
< groupId> org.apache.maven.wagon< / groupId>
< artifactId> wagon-ftp< / artifactId>
< version> 1.0-beta-2< / version>
< / extension>
- >
< / extensions>
< / build>
[...]
< / project>

而在您的 settings.xml 中,您将需要

 < settings> 
...
< servers>
< server>
< id> ftpserver< / id>
< username> user< / username>
< password> pass< / password>
< / server>
< / servers>
...
< / settings>


I am using Maven2 and would like to deploy my generated site to a web server using ftp.

i tried to use:

<distributionManagement>
    <site>
        <id>website</id>
        <url>ftp://host/pub/</url>
    </site>

</distributionManagement>

the problem is that get an error that ftp is not supported. could it be that this basic feature doesn't work.

Thanks,

Ronen.

解决方案

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>

这篇关于Maven站点部署使用ftp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆