maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Bentmann (JIRA)" <>
Subject [jira] Closed: (MNG-5039) Maven does not properly track class files to be included in jar/test breaking incremental build
Date Fri, 11 Mar 2011 17:02:22 GMT


Benjamin Bentmann closed MNG-5039.

    Resolution: Duplicate
      Assignee: Benjamin Bentmann

> Maven does not properly track class files to be included in jar/test breaking incremental
> -----------------------------------------------------------------------------------------------
>                 Key: MNG-5039
>                 URL:
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Plugins and Lifecycle
>    Affects Versions: 2.2.1, 3.0
>            Reporter: Emil Sit
>            Assignee: Benjamin Bentmann
>            Priority: Critical
> When files in the source tree (either src/main or src/test) are renamed or removed, the
class files resulting from their prior compilation remain in the corresponding target/ directories.
 It seems that surefire and package plugins simply grab everything from target/ and as a result,
incremental builds are not correct.  For example,
> * If you remove a test source file and the test will continue to run. This is bad esp
when the test is failing; packaging will fail even though it should not.
> * If you remove/rename a source file and the class file will continue to be in the jar.
 This may cause tests to succeed even though they should not.  (And if you share the jar,
this will affect downstream non-test dependencies.)
> I wrote up a test suite for the second case and put it up at
To run it ...
>    git clone git://
>    cd java-build-test
>    sh
> (It does rely on git to automate the rename/delete actions though so a tar of the sources
won't work.)
> In addition to Maven, it tests Gradle (which works) and Buildr (which behaves the same
as Maven).
> While incremental builds are not the recommendation for official deliverables, this does
make Maven appear extremely unreliable to developers who never know after syncing whether
they will have to do a clean build or if an incremental one is correct.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message