Thursday, March 11, 2010

Solving Maven Deploy/Release Problem: Unsupported Protocol: 'dav': Cannot find wagon which supports the requested protocol: dav

Are you getting the following error while using Maven and Release/Deploy Plugin on a WebDAV repository?
[INFO] [INFO] [deploy:deploy {execution: default-deploy}]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] BUILD ERROR
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Error deploying artifact: Unsupported Protocol: 'dav': Cannot find wagon which supports the requested protocol: dav
[INFO]
[INFO] Component descriptor cannot be found in the component repository: org.apache.maven.wagon.Wagondav.
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] For more information, run Maven with the -e switch
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 7 seconds
[INFO] [INFO] Finished at: Fri Mar 12 01:01:37 WIT 2010
[INFO] [INFO] Final Memory: 20M/74M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Maven execution failed, exit code: '1'

[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Maven execution failed, exit code: '1'
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Maven execution failed, exit code: '1'
    at org.apache.maven.plugins.release.PerformReleaseMojo.execute(PerformReleaseMojo.java:133)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    ... 17 more
Caused by: org.apache.maven.shared.release.ReleaseExecutionException: Maven execution failed, exit code: '1'
    at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:89)
    at org.apache.maven.shared.release.phase.RunPerformGoalsPhase.execute(RunPerformGoalsPhase.java:67)
    at org.apache.maven.shared.release.DefaultReleaseManager.perform(DefaultReleaseManager.java:334)
    at org.apache.maven.shared.release.DefaultReleaseManager.perform(DefaultReleaseManager.java:282)
    at org.apache.maven.shared.release.DefaultReleaseManager.perform(DefaultReleaseManager.java:262)
    at org.apache.maven.plugins.release.PerformReleaseMojo.execute(PerformReleaseMojo.java:129)
    ... 19 more
Caused by: org.apache.maven.shared.release.exec.MavenExecutorException: Maven execution failed, exit code: '1'
    at org.apache.maven.shared.release.exec.InvokerMavenExecutor.executeGoals(InvokerMavenExecutor.java:375)
    at org.apache.maven.shared.release.exec.InvokerMavenExecutor.executeGoals(InvokerMavenExecutor.java:393)
    at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:81)
    ... 24 more

Cause


If you have an old version of Maven, this is a known problem as the DAV wagon was not built in. Upgrade to the latest Maven version first (Maven 2.2.1 and later).

If you have a newer version of Maven, you might be using Debian or Ubuntu, which contains an incomplete version of Maven, that doesn't include the DAV wagon (wagon-webdav-jackrabbit).

Solution


Add this to your POM :
    <build>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-webdav-jackrabbit</artifactId>
                <version>1.0-beta-6</version>
            </extension>
        </extensions>
    </build>
Tip: For Maven Release Plugin, you might want to use version 2.0.
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.0</version>
            </plugin>
        </plugins>
    </build>
In multi-module project, theoretically you just need to put this in the super POM. But I haven't checked it, it may not work on child modules. If so, add the "extension" part on all POMs that require deploying to a WebDAV repository server.

For in-depth information about Maven, get Apache Maven 2 Effective Implementation book.

7 comments:

Trevor said...

Thanks for the tip. Strangely, it works for "mvn deploy" but not "mvn release:perform". This is on Ubuntu 9.10 (Karmic Koala) with Maven 2.2.1 and Sun Java 1.6.0_20.

mwflipper said...

For using mvn release:perform I have uninstall the ubuntu package maven2 and download maven2 from http://maven.apache.org/

Anonymous said...

I just wish that I could find time to visit the campus so that I could see the exhibition; I think that’s an exciting one! www.hobsonavocats.com |

www.zeusportclub.com |

www.worldatendoftricks.com |

www.edgecliffautomotive.com |

www.marcellusshalebusinessplan.com |

www.snteducationaltrust.com |

www.educationtransaction.com |

www.twins4fashion.com |

www.surfing-fitness.com |

www.eastcoastpassivehouse.com |

coach factore outlet said...

Here we play with all sorts of influences - coach factory outlet of desired shapes tiffany jewelry to prioritize the tiffany and co manner in which I go about finding what I need," the coach factory outlet tells Ecouterre.More than 1,000 runners began the race.Not just in true religion jeans, but also in making sure you stay happy until the cheap jerseys rain every day. Hey, $350 is way less than those coach outlet. For those unfamiliar, the coach factory online (only the first coach factory count toward the rankings this year) in coach outlet online carry all their own alexander wang shoes for a daily water ration and michael kors outlet tent to sleep under;The coach factory outlet is yours, but coach factory outlet is to just be yourself and be coach outlet store online.The sleek ensemble came on show through sac burberry. Choose from brands like Bernardo, michael kors outlet and others.which saw everything he could to shake off that 'alexander wang bags' image, just got the treatment from the michael kors himself, marc by marc jacobs outlet department. the company was coach factory outlet online that it can really tell that you're turned on, so michael kors should definitely be saved for the bedroom.which has seen him take on projects from labels like michael kors outlet online, to things like designing boats.

Anonymous said...

This post is one of the most important post that I've ever got to read in my life. The significance of this post on my life is huge.onlinesignsupplies.co.uk |

tartanarmymessageboard.co.uk |

mikestoanelighting.co.uk |

workplace-wellness.co.uk |

thumbswood.co.uk |

oldfieldrealty.co.uk |

utilitysearches.co.uk |

bizzybooker.co.uk |

restaurantrecruit.co.uk |

vetequip.co.uk |

Eric Simmons said...

Great and Useful Article.

Online Java Course

Java Online Training

Java Course Online

J2EE training

online J2EE training

Best Recommended books for Spring framework

Java Interview Questions








Java Training Institutes in Chennai

Java Training in Chennai

J2EE Training in Chennai

java j2ee training institutes in chennai

Java Course in Chennai

Getit said...

Totally superb post. Download Zapya for PC, Zapya free download, Zapya download, Zapya apk to share files and folders

Post a Comment

 
Copyright 2009 Spring vs Java EE Web Dev. Powered by Blogger Blogger Templates create by Deluxe Templates. WP by Masterplan