使用maven-wagon-plugin上传问题 [英] Problem uploading with maven-wagon-plugin

查看:278
本文介绍了使用maven-wagon-plugin上传问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在调用版本时尝试让wagon插件在 site-deploy 生命周期中上传文件时,我遇到了一个奇怪的问题:执行目标。
看来wagon在我调用 mvn site-deploy 时正确上传文件,但它只是用

Im having a strange problem when im trying to let the wagon plugin upload files during the site-deploy lifecycle when i'm invoking the release:perform goal. It seems wagon uploads the files correctly when im invoking mvn site-deploy but it just responds with


无需上传

Nothing to upload

调用 mvn release时:执行应该按照文档中的说明调用 site site-deploy 阶段。

when calling mvn release:perform which is supposed to invoke the phases site site-deploy as stated in the documentation.

这是wagon的插件配置。

this is the plugin config for wagon.

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>wagon-maven-plugin</artifactId>
            <version>1.0-beta-3</version>
            <executions>
                <execution>
                    <id>upload-jars</id>
                    <phase>deploy site-deploy</phase>
                    <goals>
                        <goal>upload</goal>
                    </goals>
                    <configuration>
                        <fromDir>target/checkout/target</fromDir>
                        <includes>*.jar</includes>
                        <url>scpexe://nohost.com</url>
                        <toDir>/var/www/projects/test</toDir>
                        <serverId>server - projects</serverId>
                    </configuration>
                </execution>
            </executions>
        </plugin>

maven告诉我正确的目标已经开始:

maven tells me the right goals were started:

[INFO] Executing goals 'deploy site-deploy'...
[INFO] [INFO] Scanning for projects...

但是旅行车没有上传任何东西:

but wagon doesn't upload anything:

[INFO] [INFO] --- wagon-maven-plugin:1.0-beta-3:upload (default) @ exp4j ---
[INFO] [INFO] Nothing to upload.
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD SUCCESS

在调用 site-deploy 但在执行发布时失败:执行

推荐答案

这个插件没有你认为它做的。相信我,我去过那里。

This plugin does not do what you think it does. Trust me, I've been there.

底层旅行车协议仅用于与Maven存储库交谈,而非任意目录。如果你推送的东西没有repo模式中的文件和目录,那么插件将决定它没有任何东西可以做。

The underlying wagon protocol is only intended for talking to Maven Repositories, not arbitrary directories. If the stuff you are pushing doesn't have files and directories in the pattern of a repo, the plugin will decide that there's nothing for it to do.

我花了几个小时以及小时和小时,并阅读代码,并得出结论,这个插件不是用于将任意文件推送到任意位置,实际上不能用于此目的。

I spent hours and hours and hours on this, and read the code, and reached the conclusion that this plugin is not intended to be useful for pushing arbitrary files to arbitrary places, and in fact does not work for that purpose.

这篇关于使用maven-wagon-plugin上传问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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