[
https://issues.apache.org/jira/browse/MCOMPILER-454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17411741#comment-17411741
]
Lorenzo Bettini commented on MCOMPILER-454:
-------------------------------------------
Robert, sorry I wasn't clear with "sometimes": I did NOT mean I was using an
IDE, I was doing everything from the command line. By "sometimes" I meant that
the behavior is not deterministic. If I try to do the same operation, that is
removing the file starting from the same initial situation (after a first
compilation), the compiler does not always detect the changes. Sometimes it
does, sometimes it does not.
If you want I can do some more experiments, and if you please point me to the
code that actually checks whether code has to be recompiled I'll be more than
happy to dig further.
If you think it's not worthwhile since the problem only happens sometimes, I
have no problem with that either: I never use Maven for incremental compilation
(for that I definitely use an IDE) and I'm using Maven for building in CI
systems, where I always start from a clean environment. I only did some
experiments with incremental compilation and I soon found this wrong
non-deterministic behavior.
> The compiler plugin does not always detect removed Java files
> -------------------------------------------------------------
>
> Key: MCOMPILER-454
> URL: https://issues.apache.org/jira/browse/MCOMPILER-454
> Project: Maven Compiler Plugin
> Issue Type: Bug
> Affects Versions: 3.8.1
> Reporter: Lorenzo Bettini
> Assignee: Robert Scholte
> Priority: Major
> Attachments: example.zip
>
>
> I'm doing some experiments with a very simple Maven project (see the
> attachment) where I set the maven-compiler-plugin to the latest version 3.8.1
> to see whether the compiler effectively detects the removal of a Java file
> and correctly recompiles the sources (and tests). In the project, there are
> two Java sources App.java and App2.java.
> I run `mvn test-compile`
> then I remove the App2.java file
> I run again `mvn test-compile`
> sometimes the removed Java file is detected and the sources and tests are
> recompiled (the old App2.class is also removed of course). Sometimes, this
> does not happen ("Nothing to compile - all classes are up to date").
> I'm afraid I don't understand when this works correctly and when it does not.
> But it consistently happens: sometimes the right behavior, sometimes the
> wrong one.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)