Problem uploading with maven-wagon-plugin
Asked Answered
M

2

6

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

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

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 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

Does anyone spot my problem that causes maven to work as expected when invoking site-deploy but failing when doing a release:perform ?

Melodious answered 30/3, 2011 at 23:5 Comment(0)
B
6

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

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.

Bridges answered 30/3, 2011 at 23:13 Comment(3)
what are you using for uploading files then?Melodious
antrun to run the ant scp task.Bridges
I can't comment about other wagon-providers, but for WebDAV it works as expected.Krummhorn
M
3

I had the same issue until I've found at that the "includes" tag must contains "/*" to recursively include files and subdirectories. See comments of that blog post

<includes>*/**</includes>
Maybe answered 13/12, 2013 at 8:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.