Maven 2.x Compiler Plugin

compiler smarts

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: 2.4
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

there are probably other ways we can make the compiler stale check smarter. List them out here if you think of them.

1) if a snapshot was resolved to a newer version, rebuild everything.

Activity

Hide
Brian Fox added a comment -

2) if a parent version changes, rebuild everything

Show
Brian Fox added a comment - 2) if a parent version changes, rebuild everything
Hide
Christian Goetze added a comment -

3) Track inventory. If files are removed, remove associated class files and force jar repacking/

4) Track timestamps. If file timestamp changes (e.g. to an older version), rebuild.

5) Track hash signatures for source files. Recompute signature if file timestamp changes, rebuild only if signature changes.

6) Track hash signatures for class files. Repack jars only if hash signatures change.

Show
Christian Goetze added a comment - 3) Track inventory. If files are removed, remove associated class files and force jar repacking/ 4) Track timestamps. If file timestamp changes (e.g. to an older version), rebuild. 5) Track hash signatures for source files. Recompute signature if file timestamp changes, rebuild only if signature changes. 6) Track hash signatures for class files. Repack jars only if hash signatures change.
Hide
Michael Tamm added a comment -

(Re-)Use the depend task from Ant

Show
Michael Tamm added a comment - (Re-)Use the depend task from Ant
Hide
Andreas Christoforides added a comment -

I think the priority of this issue should be higher.

In the case of a file deletion the file is not removed and still packaged. In the case of a rename, both file versions are packaged. In my experience when developers see these problems they start doing clean builds every time making the build time several times slower. Imagine making a single file change and rebuilding everything from scratch. It is issues like this that makes users get the perception that Maven is slow.

These is not a problem only with the Maven compiler plugin because I believe it also happens with the resources plugin.

Show
Andreas Christoforides added a comment - I think the priority of this issue should be higher. In the case of a file deletion the file is not removed and still packaged. In the case of a rename, both file versions are packaged. In my experience when developers see these problems they start doing clean builds every time making the build time several times slower. Imagine making a single file change and rebuilding everything from scratch. It is issues like this that makes users get the perception that Maven is slow. These is not a problem only with the Maven compiler plugin because I believe it also happens with the resources plugin.
Hide
Narendra added a comment -

I have following directory for java source code
--lion
--com
test1 --> contains pom.xml and java source code with package com.test1
test2 -> contains pom.cml and java source code with pakage com.test2
when compiler plugin compiles it does directory scanning and compiles only java code that are modified from previous build. But In above directory structure case it recompiles the all source code in subsequent builds. How to overcome this ? I found that it is because of basedirectory do not follow maven standard direcotry layout. Please advise.

Show
Narendra added a comment - I have following directory for java source code --lion --com test1 --> contains pom.xml and java source code with package com.test1 test2 -> contains pom.cml and java source code with pakage com.test2 when compiler plugin compiles it does directory scanning and compiles only java code that are modified from previous build. But In above directory structure case it recompiles the all source code in subsequent builds. How to overcome this ? I found that it is because of basedirectory do not follow maven standard direcotry layout. Please advise.

People

Vote (6)
Watch (3)

Dates

  • Created:
    Updated: