Hudson reports sucess on a failed incremental maven build

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

Hudson reports sucess on a failed incremental maven build

Ulli Hafner-2
Hi,

I configured Hudson to build my project as a freestyle maven project.
When I'm using the mvn build command 'install' without a previous
workspace
clean then Hudson reports a successfull build, even if the build fails
(Hudson seems to find some test results of previous builds). When
running
The job with 'mvn clean install' then everything works as expected,
Hudson now correctly shows a failure.

Is it not possible to run incremental builds without cleaning the
workspace?

Best regards, Ulli

***************************
Logfile tail without clean:
***************************
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

[...]

5 required artifacts are missing.

for artifact:
  com.avaloq.adt:com.avaloq.adt.sqlplus:source-plugin:1.1.0-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)


[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2 minutes 50 seconds
[INFO] Finished at: Fri Jul 13 14:07:08 CEST 2007
[INFO] Final Memory: 10M/21M
[INFO]
------------------------------------------------------------------------
Recording test results
finished: SUCCESS

************************
Logfile tail with clean:
************************
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 21 seconds
[INFO] Finished at: Fri Jul 13 13:46:48 CEST 2007
[INFO] Final Memory: 7M/20M
[INFO]
------------------------------------------------------------------------
Recording test results
Test reports were found but none of them are new. Did tests run?
Sending e-mails to: [hidden email]
finished: FAILURE

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Hudson reports sucess on a failed incremental maven build

Kohsuke Kawaguchi
Administrator
Hafner Ullrich wrote:

> Hi,
>
> I configured Hudson to build my project as a freestyle maven project.
> When I'm using the mvn build command 'install' without a previous
> workspace
> clean then Hudson reports a successfull build, even if the build fails
> (Hudson seems to find some test results of previous builds). When
> running
> The job with 'mvn clean install' then everything works as expected,
> Hudson now correctly shows a failure.
>
> Is it not possible to run incremental builds without cleaning the
> workspace?
It seems to me that this is exit code related. If Maven returns non-zero
exit code, Hudson should notice that and cause the build to fail right
away. Your record indicates that Hudson is getting exit code 0.

Is this on Windows? In the past there has been a problem passing around
exit code in Windows batch files.

If you look at the end of the report with 'clean', the reason it's
failing is because Hudson failed to find test reports, not because
Hudson noticed that Maven failed.

> Recording test results
> Test reports were found but none of them are new. Did tests run?
> Sending e-mails to: [hidden email]
> finished: FAILURE

Finally, you said it's "freestyle maven project" --- do you mean a
freestyle project or a native m2 project?

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Hudson reports sucess on a failed incremental maven build

Ulli Hafner-2
> It seems to me that this is exit code related. If Maven
> returns non-zero exit code, Hudson should notice that and
> cause the build to fail right away. Your record indicates
> that Hudson is getting exit code 0.
>
> Is this on Windows? In the past there has been a problem
> passing around exit code in Windows batch files.

Yes, I'm running the build on Windows. I already had some problems
with maven regarding the exit status of the build bat file.
Is there a workaround for this problem? The mvn.bat file is
distributed with the maven 2.0.7 zip file?

[...]
> Finally, you said it's "freestyle maven project" --- do you
> mean a freestyle project or a native m2 project?

Yes, I'm running the build as a freestyle project. Should I better
use the native m2 mode?

Ulli

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Hudson reports sucess on a failed incremental maven build

Tom Huybrechts
The mvn.bat file in 2.0.7 has a known issue on Windows regarding exit codes.
Attaching a working mvn.bat replacement...

On 7/13/07, Hafner Ullrich <[hidden email]> wrote:

> > It seems to me that this is exit code related. If Maven
> > returns non-zero exit code, Hudson should notice that and
> > cause the build to fail right away. Your record indicates
> > that Hudson is getting exit code 0.
> >
> > Is this on Windows? In the past there has been a problem
> > passing around exit code in Windows batch files.
>
> Yes, I'm running the build on Windows. I already had some problems
> with maven regarding the exit status of the build bat file.
> Is there a workaround for this problem? The mvn.bat file is
> distributed with the maven 2.0.7 zip file?
>
> [...]
> > Finally, you said it's "freestyle maven project" --- do you
> > mean a freestyle project or a native m2 project?
>
> Yes, I'm running the build as a freestyle project. Should I better
> use the native m2 mode?
>
> Ulli
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

mvn.bat.txt (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Hudson reports sucess on a failed incremental maven build

Ulli Hafner-2
Hi Tom,

Now everything runs as expected.

Thanks! Ulli

> -----Original Message-----
> From: Tom Huybrechts [mailto:[hidden email]]
> Sent: Friday, July 13, 2007 4:36 PM
> To: [hidden email]
> Subject: Re: Hudson reports sucess on a failed incremental maven build
>
> The mvn.bat file in 2.0.7 has a known issue on Windows
> regarding exit codes.
> Attaching a working mvn.bat replacement...
>
> On 7/13/07, Hafner Ullrich <[hidden email]> wrote:
> > > It seems to me that this is exit code related. If Maven returns
> > > non-zero exit code, Hudson should notice that and cause
> the build to
> > > fail right away. Your record indicates that Hudson is
> getting exit
> > > code 0.
> > >
> > > Is this on Windows? In the past there has been a problem passing
> > > around exit code in Windows batch files.
> >
> > Yes, I'm running the build on Windows. I already had some problems
> > with maven regarding the exit status of the build bat file.
> > Is there a workaround for this problem? The mvn.bat file is
> > distributed with the maven 2.0.7 zip file?
> >
> > [...]
> > > Finally, you said it's "freestyle maven project" --- do
> you mean a
> > > freestyle project or a native m2 project?
> >
> > Yes, I'm running the build as a freestyle project. Should I
> better use
> > the native m2 mode?
> >
> > Ulli
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]