Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem uploading with maven-wagon-plugin

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 ?

like image 201
fasseg Avatar asked Mar 30 '11 23:03

fasseg


2 Answers

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.

like image 155
bmargulies Avatar answered Oct 15 '22 08:10

bmargulies


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>
like image 3
Motofix Avatar answered Oct 15 '22 09:10

Motofix