Issue Details (XML | Word | Printable)

Key: MPSITE-23
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Oscar Picasso
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Maven 1.x Site Plugin

Rsync fail

Created: 15/Feb/05 05:58 PM   Updated: 19/Feb/05 08:29 PM   Resolved: 19/Feb/05 08:29 PM
Return to search
Component/s: plugin
Affects Version/s: 1.6
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Text File patch.txt (0.6 kB)

Environment:
OS: linux redhat 8.0
Java: 1.5


 Description  « Hide

On site:rsyncdeploy, get the following:
[exec] building file list ... done
[exec] link_stat target/docs/* : No such file or directory
[exec] wrote 25 bytes read 20 bytes 90.00 bytes/sec
[exec] rsync error: some files could not be transferred (code 23) at main.c(620)
[exec] total size is 0 speedup is 0.00
[exec] [ERROR] Result: 23
BUILD SUCCESSFUL

In plugin.jelly I have added some <echo/> to see what could happen:
<echo>${maven.rsync.executable}</echo>
<echo>"-avz ${rsyncArgs} ${relativeDocsDest}/* ${siteUsername}@${siteAddress}:${siteDirectory}"</echo>

I used the output to launch the command from the shell command line and it works fine.

I also added <exec dir="." executable="pwd"/> to check it the directory was correct and it was.

So it seems that all the parameters to execute the rsync are good but the command failed when used from the plugin.



Brett Porter added a comment - 15/Feb/05 06:05 PM

It looks like target/docs is empty. Did you run site first?


Oscar Picasso added a comment - 15/Feb/05 10:23 PM

I did run site and targets/docs was not empty.

I've with both java 1.5.0 and java 1.4.2 and got the same error.

It's weird because the plugin seem to use the right command.

I added the following to the site:rsync goal.
...
<!-- added -->
<echo>"${maven.rsync.executable}"</echo>
<echo>"-avz ${rsyncArgs} ${relativeDocsDest}/* ${siteUsername}@${siteAddress}:${siteDirectory}"</echo>
<exec dir="." executable="pwd"/>
<!-- end added -->
<exec dir="." executable="${maven.rsync.executable}">
<arg line="-avz ${rsyncArgs} ${relativeDocsDest}/* ${siteUsername}@${siteAddress}:${siteDirectory}"/>
</exec>
...

The output gave:
site:rsyncdeploy:
[echo] "rsync"
[echo] "-avz target/docs/* oscar@freedom:/tmp/site-test"
[exec] /home/oscar/workspace/db-je
...

From the output above I copied and paste to make the following command from the /home/oscar/workspace/db-je directory:

rsync -avz target/docs/* oscar@freedom:/tmp/site-test

It worked perfectly.

By the way, what does exec do? Just calling one of the Runtime.exec() method?


Brett Porter added a comment - 17/Feb/05 06:43 PM

most strange...

exec is the Ant <exec task, which in essence does just Runtime.exec.

Can you run maven with the -X option? Around the exec command, it should give more details about what is run.

Thanks.


Oscar Picasso added a comment - 18/Feb/05 09:03 AM

I found a solution. I works at least on my configuration.

It seems that passing arguments with a wildcard doesn't work fine so I just removed the '*' from '${relativeDocsDest}/' in the arg line.

You have to retain the trailing slash though because if you remove it it will copy not only the content of the source directory but also the directory itself.

The new site:rsyncdeploy would be:

<goal name="site:rsyncdeploy"
description="Deploy the generated site using rsync"
prereqs="site:init,site:remote-deploy-init">
<exec dir="." executable="${maven.ssh.executable}">
<arg line="${siteUsername}@${siteAddress} 'mkdir -p ${siteDirectory}'" />
</exec>

<maven:makeRelativePath var="relativeDocsDest" path="${docsDest}" separator="/" basedir="${basedir}" />
<j:if test="${siteClean}">
<echo>Cleaning destination</echo>
<j:set var="rsyncArgs" value="${rsyncArgs} --delete" />
</j:if>
<exec dir="." executable="${maven.rsync.executable}">
<arg line="-avz ${rsyncArgs} ${relativeDocsDest}/ ${siteUsername}@${siteAddress}:${siteDirectory}"/>
</exec>
</goal>

As you can see the only difference with the current distribution is the removal of the wildcard.

Oscar


Oscar Picasso added a comment - 18/Feb/05 10:37 PM

I wanted to submit a patch the proper way but the cvs layout is quite confusing.

Found several maven site plugin folders but either empty or only with version 1.5.2 which has not rsync:deploy.

Where is version the plugin site version 1.6 on cvs?


Brett Porter added a comment - 19/Feb/05 01:14 AM

Oscar, it is in Subversion.


Oscar Picasso added a comment - 19/Feb/05 12:26 PM

Resolve the issue on my environment.
Results are consistent with what site:sshdeploy does.


Brett Porter added a comment - 19/Feb/05 08:29 PM

jira is stuck again, need to reopen to close