使用 FTP 部署 Maven 多模块项目的站点时出错
我有一个多模块项目。当我启动 mvn site:deploy 时,基本模块的部署工作正常,但无法在 FTP 服务器上创建模块站点的目录:
[INFO] Error uploading site
Embedded error: Required directory: '/myremoteftprepository/myproject-mymodule' is missing
当我手动创建丢失的目录时,它工作正常,但我想避免这种情况。令人惊讶的是部署命令没有创建它。你知道如何强制创建这个目录吗?这是 wagon-ftp 插件中的错误吗?
仅供参考,这是我的 POM:
<build>
<extensions>
<!-- Enabling the use of FTP -->
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>1.0</version>
</extension>
</extensions>
</build>
我选择包含 javadoc:
<reporting>
<plugins>
<!-- include javadoc in the site -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<configuration>
<show>public</show>
</configuration>
</plugin>
</plugins>
</reporting>
并且
<distributionManagement>
<site>
<id>site</id>
<name>maven site</name>
<url>ftp://ftp.blabla.org/myremoteftprepository</url>
</site>
</distributionManagement>
我的 settings.xml 很好。
I have a multi module project. When I launch mvn site:deploy
, the deployment of the base module works fine, but it fails to create the directory of the module sites on the FTP server:
[INFO] Error uploading site
Embedded error: Required directory: '/myremoteftprepository/myproject-mymodule' is missing
When I create the missing directory by hand, it works fine, but I would like to avoid that. It is surprising that the deploy command do not create it. Do you how to force this directory creation? Is it a bug in the wagon-ftp plugin?
FYI, here is my POM:
<build>
<extensions>
<!-- Enabling the use of FTP -->
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>1.0</version>
</extension>
</extensions>
</build>
I have chosen to include the javadoc with:
<reporting>
<plugins>
<!-- include javadoc in the site -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<configuration>
<show>public</show>
</configuration>
</plugin>
</plugins>
</reporting>
and
<distributionManagement>
<site>
<id>site</id>
<name>maven site</name>
<url>ftp://ftp.blabla.org/myremoteftprepository</url>
</site>
</distributionManagement>
and my settings.xml is good.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用最新版本的 wagon-ftp (2.2),它可以工作。
With the most recent version of wagon-ftp (2.2), it works.
您不应该启动 site:deploy 目标,而应该启动 site-deploy Maven 生命周期阶段,例如这样
,并确保 您的货车运输的最新版本使用 (2.2)。
另外,对于 javadoc 插件,您应该在 Maven 站点插件的配置下将其配置为报告插件。
You should not launch the site:deploy goal, but rather the site-deploy Maven lifecycle phase e.g. like that
and also make sure that the latest version of your wagon transport is used (2.2).
Also for javadoc plugin you should configure it as reporting plugin under the configuration of the maven site plugin.