[ 
https://issues.apache.org/jira/browse/MCOMPILER-538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17732911#comment-17732911
 ] 

ASF GitHub Bot commented on MCOMPILER-538:
------------------------------------------

mensinda opened a new pull request, #191:
URL: https://github.com/apache/maven-compiler-plugin/pull/191

   Fix for [MCOMPILER-538](https://issues.apache.org/jira/browse/MCOMPILER-538).
   
   The `generatedSourcesPath` will still be added to the *maven* project paths.
   
   ---
   
   Following this checklist to help us incorporate your 
   contribution quickly and easily:
   
    - [x] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/MCOMPILER) filed 
          for the change (usually before you start working on it).  Trivial 
changes like typos do not 
          require a JIRA issue.  Your pull request should address just this 
issue, without 
          pulling in other changes.
    - [x] Each commit in the pull request should have a meaningful subject line 
and body.
    - [x] Format the pull request title like `[MCOMPILER-XXX] - Fixes bug in 
ApproximateQuantiles`,
          where you replace `MCOMPILER-XXX` with the appropriate JIRA issue. 
Best practice
          is to use the JIRA issue title in the pull request title and in the 
first line of the 
          commit message.
    - [x] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
    - [x] Run `mvn clean verify` to make sure basic checks pass. A more 
thorough check will 
          be performed on your pull request automatically.
    - [x] You have run the integration tests successfully (`mvn -Prun-its clean 
verify`).
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License 
Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under 
   the [Apache License Version 2.0, January 
2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [x] I hereby declare this contribution to be licenced under the [Apache 
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [x] In any other case, please file an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   




> Do not add target/generated-sources/annotations to the source roots
> -------------------------------------------------------------------
>
>                 Key: MCOMPILER-538
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-538
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>            Reporter: Daniel Mensinger
>            Priority: Major
>
> Adding the generated source root ({{target/generated-sources/annotations}}) 
> is not required for javac. Additionally adding the generated source root 
> results in compilation errors with annotation processors generating code 
> unless the generated-sources dir is cleaned.
> Specifically, the following steps result in compilation errors:
>  # run {{mvn clean}}
>  # Modify a source file that is consumed by the annotation processor so that 
> there is a compilation error, but the annotation processor still runs (add or 
> remove a parameter in a method call).
>  # run {{mvn compile}} --> the generated file exists but there is no class 
> file for the source file.
>  # Fix the "bug" from step 2
>  # run {{mvn compile}} again --> compilation should succeed, but it fails.
> ----
> Example code: 
> [https://github.com/mensinda/quarkus-stuff/tree/annotationProcessingTest]
> Use the {{annotationProcessingTest}} branch!
> For step 2 this change can be used:
> {code:java}
> diff --git a/code/src/main/java/bar/MyAnnotatedClass.java 
> b/code/src/main/java/bar/MyAnnotatedClass.java
> index bbfef7a..a303924 100644
> --- a/code/src/main/java/bar/MyAnnotatedClass.java
> +++ b/code/src/main/java/bar/MyAnnotatedClass.java
> @@ -4,7 +4,7 @@ import foo.MyAnnotation;
>  @MyAnnotation
>  public class MyAnnotatedClass {
> -    MyGeneratedClass generatedClass = new MyGeneratedClass();
> +    MyGeneratedClass generatedClass = new MyGeneratedClass(false);
>      // foo
> {code}
>  
> To see that *not* adding {{target/generated-sources/annotations}} helps run 
> {{mvn -X compile}} and copy the {{Command line options:}}. Then run {{javac}} 
> manually, but remove the {{target/generated-sources/annotations}} from the 
> {{-sourcepath}} list, but *not* the {{-s}} parameter.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to