problems with 'mvn deploy wagon:upload' when invoked from jenkins

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

problems with 'mvn deploy wagon:upload' when invoked from jenkins

Sampath.Rajagopal

I have ftp configured using vsftp in linux x86_64 (vm) environment, running

Red Hat Enterprise Linux Server release 6.2 (Santiago)

 

POM.xml as follows –

<distributionManagement>

                <repository>

                        <id>ftp-repository</id>

                        <name>Repository</name>

                        <url>ftp://192.123.456.789/repository/</url>

                </repository>

 

</distributionManagement>

 

<groupId>org.codehaus.mojo</groupId>

     <artifactId>wagon-maven-plugin</artifactId>

     <version>1.0-beta-3</version>

     <configuration>

          <fromDir>${project.build.directory}</fromDir>

           <includes>*.war</includes>

           <url>ftp://192.123.456.789/</url>                                          

           <toDir>repository</toDir>

           <serverId>ftp-repository</serverId>

     </configuration>

 

 

My settings.xml has user id, passwd and the server id.

 

When I do ‘mvn deploy wagon:upload’ with my user id from the command line, it works.

When I run the same command from Jenkins, it does not work and ends up with the following error –

 

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project v-a-sample-main: Failed to retrieve remote metadata v.a.sample.main:v-a-sample-main:1.0-SNAPSHOT/maven-metadata.xml: Could not transfer metadata v.a.sample.main:v-a-sample-main:1.0-SNAPSHOT/maven-metadata.xml from/to a-samples-ftp-repository (ftp://192.123.345.567/repository/): NullPointerException -> [Help 1]

[ERROR]

 

Why is the ‘deploy wagon:upload’ command not working from Jenkins gui. ? any suggestions

 

Reply | Threaded
Open this post in threaded view
|

Re: problems with 'mvn deploy wagon:upload' when invoked from jenkins

Tim Pizey-2
Hi Sampath,

There is a possibility that Jenkins is using Maven3 and you are using
maven2 outside of Jenkins.

cheers
Tim

On 2 April 2012 07:50,  wrote:

> I have ftp configured using vsftp in linux x86_64 (vm) environment, running
>
> Red Hat Enterprise Linux Server release 6.2 (Santiago)
>
>
>
> POM.xml as follows –
>
> <distributionManagement>
>
>                 <repository>
>
>                         <id>ftp-repository</id>
>
>                         <name>Repository</name>
>
>                         <url>ftp://192.123.456.789/repository/</url>
>
>                 </repository>
>
>
>
> </distributionManagement>
>
>
>
> <groupId>org.codehaus.mojo</groupId>
>
>      <artifactId>wagon-maven-plugin</artifactId>
>
>      <version>1.0-beta-3</version>
>
>      <configuration>
>
>           <fromDir>${project.build.directory}</fromDir>
>
>            <includes>*.war</includes>
>
>
> <url>ftp://192.123.456.789/</url>
>
>            <toDir>repository</toDir>
>
>            <serverId>ftp-repository</serverId>
>
>      </configuration>
>
>
>
>
>
> My settings.xml has user id, passwd and the server id.
>
>
>
> When I do ‘mvn deploy wagon:upload’ with my user id from the command line,
> it works.
>
> When I run the same command from Jenkins, it does not work and ends up with
> the following error –
>
>
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on
> project v-a-sample-main: Failed to retrieve remote metadata
> v.a.sample.main:v-a-sample-main:1.0-SNAPSHOT/maven-metadata.xml: Could not
> transfer metadata
> v.a.sample.main:v-a-sample-main:1.0-SNAPSHOT/maven-metadata.xml from/to
> a-samples-ftp-repository (ftp://192.123.345.567/repository/):
> NullPointerException -> [Help 1]
>
> [ERROR]
>
>
>
> Why is the ‘deploy wagon:upload’ command not working from Jenkins gui. ? any
> suggestions
>
>



--
Tim Pizey - http://pizey.net/~timp
Reply | Threaded
Open this post in threaded view
|

RE: problems with 'mvn deploy wagon:upload' when invoked from jenkins

Sampath.Rajagopal
RE: problems with 'mvn deploy wagon:upload' when invoked from jenkins

Tim, we are using apache-maven/3.0.3 both within and outside of Jenkins.

Is there a plug-in (of a particular version) that I am missing ? Please advise.

Not sure if anyone has run into this problem - why maven goals (configured for ftp) don’t work from within Jenkins ?

thanks

-----Original Message-----
From: [hidden email] [[hidden email]] On Behalf Of Tim Pizey
Sent: Monday, April 02, 2012 1:13 AM
To: [hidden email]
Subject: Re: problems with 'mvn deploy wagon:upload' when invoked from jenkins

Hi Sampath,

There is a possibility that Jenkins is using Maven3 and you are using

maven2 outside of Jenkins.

cheers

Tim

On 2 April 2012 07:50,  wrote:

> I have ftp configured using vsftp in linux x86_64 (vm) environment, running

>

> Red Hat Enterprise Linux Server release 6.2 (Santiago)

>

>

>

> POM.xml as follows –

>

> <distributionManagement>

>

>                 <repository>

>

>                         <id>ftp-repository</id>

>

>                         <name>Repository</name>

>

>                         <url>ftp://192.123.456.789/repository/</url>

>

>                 </repository>

>

>

>

> </distributionManagement>

>

>

>

> <groupId>org.codehaus.mojo</groupId>

>

>      <artifactId>wagon-maven-plugin</artifactId>

>

>      <version>1.0-beta-3</version>

>

>      <configuration>

>

>           <fromDir>${project.build.directory}</fromDir>

>

>            <includes>*.war</includes>

>

>

> <url>ftp://192.123.456.789/</url>

>

>            <toDir>repository</toDir>

>

>            <serverId>ftp-repository</serverId>

>

>      </configuration>

>

>

>

>

>

> My settings.xml has user id, passwd and the server id.

>

>

>

> When I do ‘mvn deploy wagon:upload’ with my user id from the command line,

> it works.

>

> When I run the same command from Jenkins, it does not work and ends up with

> the following error –

>

>

>

> [ERROR] Failed to execute goal

> org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on

> project v-a-sample-main: Failed to retrieve remote metadata

> v.a.sample.main:v-a-sample-main:1.0-SNAPSHOT/maven-metadata.xml: Could not

> transfer metadata

> v.a.sample.main:v-a-sample-main:1.0-SNAPSHOT/maven-metadata.xml from/to

> a-samples-ftp-repository (ftp://192.123.345.567/repository/):

> NullPointerException -> [Help 1]

>

> [ERROR]

>

>

>

> Why is the ‘deploy wagon:upload’ command not working from Jenkins gui. ? any

> suggestions

>

>



--

Tim Pizey - http://pizey.net/~timp

Reply | Threaded
Open this post in threaded view
|

Re: problems with 'mvn deploy wagon:upload' when invoked from jenkins

Tim Pizey-2
Hi Sampath,

try to su to the jenkins user, cd to the work directory:

sudo su jenkins
cd ~/jobs/jourJob/workspace
mvn deploy

If you get the same error as within the gui,
which I think you will, then I think the problem wil be that you have
not authorised the jenkins user to access that resource.

cheers
Tim

--
Tim Pizey - http://pizey.net/~timp