ah sorry,

from wagon-maven-plugin, wagon:download can run outside of maven project

-Dan

On Mon, May 24, 2010 at 8:28 PM, Lachlan Deck <[email protected]> wrote:
> I'm not sure I understand your question? My dependencies already contains 
> wagon-maven-plugin but what java classes are you particularly referring to in 
> order to make this work programatically (rather than via a pom execution)?
>
> i.e., to be clearer: I'm writing a mojo, or trying to, that can execute with 
> @requiresProject false etc
>
> On 25/05/2010, at 12:46 PM, Dan Tran wrote:
>
>> is there any reason, you are not using wagon-maven-plugin at MOJO?
>>
>> -Dan
>>
>> On Mon, May 24, 2010 at 6:54 PM, Lachlan Deck <[email protected]> wrote:
>>> Hi there,
>>>
>>> I'm trying to get a very simple utility working which downloads a zip file 
>>> for subsequent use.
>>>
>>> I can successfully do this via an execution in the pom[1] but can't seem to 
>>> get it working programatically (which I need to be able to run the mojo 
>>> independently).
>>>
>>> In order to create a stand alone utility that could run outside a project 
>>> (mvn some.groupId:project-id:downloadzip ...) I seem to be missing 
>>> something. i.e., when I've got the mojo with @requiresProject false  the 
>>> 'settings' and 'wagonManager' in AbstractMojo aren't initialised.
>>>
>>> Thus when I call createWagon(serverId, url) I get a NullPointerException:
>>> org.apache.maven.plugin.MojoExecutionException: Unable to create a Wagon 
>>> instance for scp://foo.bar.net/
>>>        at 
>>> org.codehaus.mojo.wagon.AbstractWagonMojo.createWagon(AbstractWagonMojo:83)
>>>        <...>
>>> Caused by: java.lang.NullPointerException
>>>        at 
>>> org.apache.maven.artifact.manager.DefaultWagonManager.getWagon(DefaultWagonManager.java:143)
>>>        at 
>>> org.apache.maven.artifact.manager.DefaultWagonManager.getWagon(DefaultWagonManager.java:128)
>>>        at 
>>> org.codehaus.mojo.wagon.shared.WagonUtils.createWagon(AbstractWagonMojo:53)
>>>        at 
>>> org.codehaus.mojo.wagon.AbstractWagonMojo.createWagon(AbstractWagonMojo:79)
>>>        ... 21 more
>>>
>>> Essentially, how do I utilise the scp wagon programatically?
>>> - if the mojo is running outside a project, how do @component annotated 
>>> fields (like Settings or WagonManager) get populated?
>>> etc
>>>
>>> Thanks!
>>>
>>> with regards,
>>> --
>>>
>>> Lachlan Deck
>>>
>>> [1]
>>> <build>
>>>        ...
>>>        <extensions>
>>>                <extension>
>>>                        <groupId>org.apache.maven.wagon</groupId>
>>>                        <artifactId>wagon-ssh</artifactId>
>>>                        <version>1.0-beta-6</version>
>>>                </extension>
>>>        </extensions>
>>>        <plugins>
>>>                ...
>>>                <plugin>
>>>                        <groupId>org.codehaus.mojo</groupId>
>>>                        <artifactId>wagon-maven-download</artifactId>
>>>                        <version>1.0-beta-3</version>
>>>                        <executions>
>>>                                <execution>
>>>                                        <id>foo</id>
>>>                                        <phase>verify</phase>
>>>                                        <goals>
>>>                                                <goal>download</goal>
>>>                                        </goals>
>>>                                        <configuration>
>>>                                                <serverId>bar</serverId>
>>>                                                <url>scp://bar.foo.net/</url>
>>>                                                <fromDir>/some/dir/</fromDir>
>>>                                                
>>> <includes>myzip.zip</includes>
>>>                                                <toDir>/tmp</toDir>
>>>                                        </configuration>
>>>                                </execution>
>>>                        </executions>
>>>                </plugin>
>>>        </plugins>
>>> </build>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>
> with regards,
> --
>
> Lachlan Deck
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to