简体   繁体   English

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

[英]Error when deploying site of a maven multi module project with FTP

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: 当我启动mvn site:deploy ,基本模块的部署工作正常,但无法在FTP服务器上创建模块站点的目录:

[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. 令人惊讶的是,deploy命令不会创建它。 Do you how to force this directory creation? 你是如何强制创建这个目录的? Is it a bug in the wagon-ftp plugin? 这是wagon-ftp插件中的错误吗?

FYI, here is my POM: 仅供参考,这是我的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: 我选择将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>

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. 我的settings.xml很好。

You should not launch the site:deploy goal, but rather the site-deploy Maven lifecycle phase eg like that 您不应该启动站点:部署目标,而是启动站点部署Maven生命周期阶段,例如那样

mvn clean install site-deploy

and also make sure that the latest version of your wagon transport is used (2.2). 并确保使用最新版本的货车运输 (2.2)。

Also for javadoc plugin you should configure it as reporting plugin under the configuration of the maven site plugin. 另外,对于javadoc插件,您应该在maven站点插件的配置下将其配置为报告插件。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM