使用 FTP 部署 Maven 多模块项目的站点时出错

发布于 2024-12-06 06:44:08 字数 1549 浏览 0 评论 0原文

我有一个多模块项目。当我启动 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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

落在眉间の轻吻 2024-12-13 06:44:08

使用最新版本的 wagon-ftp (2.2),它可以工作。

With the most recent version of wagon-ftp (2.2), it works.

任谁 2024-12-13 06:44:08

您不应该启动 site:deploy 目标,而应该启动 site-deploy Maven 生命周期阶段,例如这样

mvn clean install site-deploy

,并确保 您的货车运输的最新版本使用 (2.2)。

另外,对于 javadoc 插件,您应该在 Maven 站点插件的配置下将其配置为报告插件。

You should not launch the site:deploy goal, but rather the site-deploy Maven lifecycle phase e.g. like that

mvn clean install site-deploy

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文