ASF GitHub Bot commented on FLINK-8847:

GitHub user zentol opened a pull request:


     [FLINK-8847][build] Prevent unnecessary recompilation

    ## What is the purpose of the change
    This PR contains 2 changes to prevent the `maven-compiler-plugin` from 
recompiling a module that doesn't require it.
    The `maven-compiler-plugin` will now always create `.class` files for 
`package-info.java` files. Previously this was only done if the `.java` file 
contained annotations.
    Having a `.java` file without a corresponding `.class` file throws of the 
`maven-compiler-plugin` stale source detection, as described in 
    Additionally, `useIncrementalCompilation` is set to false which actually 
enables incremental compilation, as described in 
    ## Brief change log
    * create `.class` files for all `package-info.java` files
    * set `useIncrementalCompilation` to false which actually enables 
incremental compilation
    ## Verifying this change
    Pick any module that contains a  `package-info.java` file (like 
`flink-optimizer`) and run `mvn package <speed options>` twice. The plugin 
should not recompile the module.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zentol/flink 8847

Alternatively you can review and apply these changes as the patch at:


To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #5644
commit 293795b5e5f57dba07e985be9e46ba2534e91eac
Author: zentol <chesnay@...>
Date:   2018-03-06T09:45:25Z

    [FLINK-8847][build] Always generate .class files for package-info.java

commit 92d17feab6cd604fd2bd2be96d6ed35485c13b80
Author: zentol <chesnay@...>
Date:   2018-03-06T10:04:42Z

    [hotfix][build] Enable incremental compilation


> Modules containing package-info.java are always recompiled
> ----------------------------------------------------------
>                 Key: FLINK-8847
>                 URL: https://issues.apache.org/jira/browse/FLINK-8847
>             Project: Flink
>          Issue Type: Bug
>          Components: Build System
>    Affects Versions: 1.3.2, 1.5.0, 1.4.1
>            Reporter: Chesnay Schepler
>            Assignee: Chesnay Schepler
>            Priority: Minor
>             Fix For: 1.5.0, 1.4.3
> All modules that contain a {{package-info.java}} file (that do not contain 
> annotations which applies to *all* instances in Flink) will always be 
> recompiled by the {{maven-compiler-plugin}}.
> To detect modified files the compiler compares timestamps of the source and 
> .class file. In the case of {{package-info.java}} no .class file is created 
> if it doesn't contain annotations, which the compiler interprets as a missing 
> .class file.
> We can add {{-Xpkginfo:always}} to the compiler configuration to force the 
> generation of these files to prevent this from happening.

This message was sent by Atlassian JIRA

Reply via email to