【问题标题】:Problem uploading with maven-wagon-plugin使用 maven-wagon-plugin 上传问题
【发布时间】:2011-03-30 23:05:01
【问题描述】:

当我在调用release:perform 目标时尝试让 wagon 插件在site-deploy 生命周期内上传文件时遇到了一个奇怪的问题。 当我调用mvn site-deploy 时,似乎 wagon 正确上传了文件,但它只是响应

没有什么要上传的

当调用mvn release:perform 时,它应该调用文档中所述的阶段site site-deploy

这是 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 告诉我正确的目标已经开始:

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

但是 wagon 没有上传任何东西:

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

有没有人发现我的问题导致 maven 在调用 site-deploy 时按预期工作但在执行 release:perform 时失败?

【问题讨论】:

    标签: java maven maven-wagon-plugin


    【解决方案1】:

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

    底层 wagon 协议仅用于与 Maven 存储库通信,而不是与任意目录通信。如果你推送的东西没有 repo 模式的文件和目录,插件将决定它没有什么可做的。

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

    【讨论】:

    • 那你用什么上传文件呢?
    • antrun 运行 ant scp 任务。
    • 我无法评论其他旅行车供应商,但对于 WebDAV,它可以按预期工作。
    【解决方案2】:

    我遇到了同样的问题,直到我发现“includes”标签必须包含“/*”才能递归地包含文件和子目录。 见that blog post的cmets

    <includes>*/**</includes>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-25
      • 1970-01-01
      • 1970-01-01
      • 2011-05-30
      • 2011-09-12
      • 2011-05-21
      • 2020-05-11
      • 1970-01-01
      相关资源
      最近更新 更多