You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Zoran Regvart (JIRA)" <ji...@codehaus.org> on 2011/07/19 14:57:42 UTC

[jira] Created: (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
----------------------------------------------------------------------------------------------------------------------------

                 Key: MCOMPILER-157
                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
             Project: Maven 2.x Compiler Plugin
          Issue Type: Bug
    Affects Versions: 2.3.2
         Environment: Java 6
            Reporter: Zoran Regvart
         Attachments: maven-compiler-plugin-add-compileSourceRoots.patch, test-case.zip

Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.

Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.

thanks,

Zoran

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Posted by "Gleb Frank (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MCOMPILER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gleb Frank updated MCOMPILER-157:
---------------------------------

    Attachment: maven-compiler-plugin-addToSourcePathAsWell.patch

For that matter, why not also add the generated sources directory to the sourcepath as well, so that it gets compiled in the same run? The attached patch (maven-compiler-plugin-addToSourcePathAsWell.patch) builds on the original one to do that.
                
> Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-157
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>         Environment: Java 6
>            Reporter: Zoran Regvart
>         Attachments: maven-compiler-plugin-add-compileSourceRoots.patch, maven-compiler-plugin-addToSourcePathAsWell.patch, TestCase2.zip, test-case.zip
>
>
> Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.
> Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.
> thanks,
> Zoran

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Posted by "Martin Franklin (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=308374#comment-308374 ] 

Martin Franklin commented on MCOMPILER-157:
-------------------------------------------

I managed to get this working using the helper plugin in combination with a second invocation of the compiler.

Let compiler run normally and generate the annotation processor output.

Then invoke the help plugin at the process-classes lifecycle stage, followed by the compiler again.

Note that the order is important, so that the build-helper gets invoked before the compiler.


<plugins>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.7</version>
				<executions>
					<execution>
						<id>add-source</id>
						<phase>process-classes</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>target/generated-sources/annotations</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<executions>
					<execution>
						<id>add-source</id>
						<phase>process-classes</phase>
						<goals>
							<goal>compile</goal>
						</goals>

					</execution>
				</executions>
			</plugin>
		</plugins>
                
> Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-157
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>         Environment: Java 6
>            Reporter: Zoran Regvart
>             Fix For: 2.6
>
>         Attachments: maven-compiler-plugin-add-compileSourceRoots.patch, maven-compiler-plugin-addToSourcePathAsWell.patch, TestCase2.zip, test-case.zip
>
>
> Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.
> Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.
> thanks,
> Zoran

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Posted by "Jérôme Verstrynge (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MCOMPILER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jérôme Verstrynge updated MCOMPILER-157:
----------------------------------------

    Attachment: TestCase2.zip

> Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-157
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>         Environment: Java 6
>            Reporter: Zoran Regvart
>         Attachments: maven-compiler-plugin-add-compileSourceRoots.patch, TestCase2.zip, test-case.zip
>
>
> Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.
> Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.
> thanks,
> Zoran

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Posted by "Jérôme Verstrynge (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=275227#comment-275227 ] 

Jérôme Verstrynge commented on MCOMPILER-157:
---------------------------------------------

Sorry, I meant 2.3.2 release.

> Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-157
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>         Environment: Java 6
>            Reporter: Zoran Regvart
>         Attachments: maven-compiler-plugin-add-compileSourceRoots.patch, test-case.zip
>
>
> Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.
> Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.
> thanks,
> Zoran

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Posted by "Zoran Regvart (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=273630#comment-273630 ] 

Zoran Regvart commented on MCOMPILER-157:
-----------------------------------------

One obvious workaround would be using build helper plugin to add the target/generated-sources/annotations to source path, like:

{{
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.7</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>target/generated-sources/annotations</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
}}

> Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-157
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>         Environment: Java 6
>            Reporter: Zoran Regvart
>         Attachments: maven-compiler-plugin-add-compileSourceRoots.patch, test-case.zip
>
>
> Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.
> Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.
> thanks,
> Zoran

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MCOMPILER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Lamy updated MCOMPILER-157:
-----------------------------------

    Fix Version/s:     (was: 3.0)
                   3.1
    
> Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-157
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>         Environment: Java 6
>            Reporter: Zoran Regvart
>             Fix For: 3.1
>
>         Attachments: failing-test-example.zip, maven-compiler-plugin-add-compileSourceRoots.patch, maven-compiler-plugin-addToSourcePathAsWell.patch, TestCase2.zip, test-case.zip
>
>
> Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.
> Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.
> thanks,
> Zoran

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Posted by "Zoran Regvart (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=313563#comment-313563 ] 

Zoran Regvart commented on MCOMPILER-157:
-----------------------------------------

Olivier, so the two projects that I'll upload are example of a failing situation. The awkwardly named  compiler-plugin-simple-annotation-processor is an annotation processor that will generate a .txt file in the with the same directory structure as the annotated class, that is a class annotated with @SimpleAnnotation. The other project is compiler-plugin-annotation-test that has a compile dependency on the former, and a test that checks if the .txt file was indeed created.

If you were to do it on command line using standard java tools you would first compile the sources with javac (including compiler-plugin-simple-annotation-processor.jar and junit.jar) at this point javac would detect the annotation processor and it would create the .txt file (in current directory if no -s option was given). Then you would use java org.junit.runner.JUnitCore org.apache.maven.plugin.AnnotationProcessorTest with classpath pointing to the output of javac (that would include the generated .txt file).

With maven project directory structure and conventions, i.e. source output of annotation processors is target/generated-sources/[test-]annotations, and the fact that current maven compiler plugin does not forward the target/generated-sources/[test-]annotations to compileSourceRoots fails the test. The build helper workaround mentioned above helps, but I think that proper solution is for maven compiler plugin to include the sources it generated (via annotation processors) in classpath for other plugins to have.

This is very similar to my original use case - in which I was generating resources (AspectJ inter type declarations) to be considered by the another plugin after maven compiler plugin (AspectJ maven plugin), that needs these generated resources in classpath. But I imagine that there are other use cases for this as well.

I don't know it this is what you were thinking by a failing test, but I hope it helps.

Zoran
                
> Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-157
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>         Environment: Java 6
>            Reporter: Zoran Regvart
>             Fix For: 3.0
>
>         Attachments: failing-test-example.zip, maven-compiler-plugin-add-compileSourceRoots.patch, maven-compiler-plugin-addToSourcePathAsWell.patch, TestCase2.zip, test-case.zip
>
>
> Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.
> Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.
> thanks,
> Zoran

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Posted by "Jérôme Verstrynge (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=275222#comment-275222 ] 

Jérôme Verstrynge commented on MCOMPILER-157:
---------------------------------------------

To be more precise, when I apply the workaround to the provided test case, it works. Yet, in my application, it does not work. The only difference is that I generate a java file where only a .aj file is generated in the test case.

> Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-157
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>         Environment: Java 6
>            Reporter: Zoran Regvart
>         Attachments: maven-compiler-plugin-add-compileSourceRoots.patch, test-case.zip
>
>
> Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.
> Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.
> thanks,
> Zoran

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Posted by "Jérôme Verstrynge (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=275219#comment-275219 ] 

Jérôme Verstrynge commented on MCOMPILER-157:
---------------------------------------------

Hi, I have tried to above workaround, but it does not work.

Here is the link to the StackOverflow question I created earlier today: http://stackoverflow.com/questions/6975298/generated-code-not-taken-into-account-in-maven-compile-process.

> Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-157
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>         Environment: Java 6
>            Reporter: Zoran Regvart
>         Attachments: maven-compiler-plugin-add-compileSourceRoots.patch, test-case.zip
>
>
> Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.
> Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.
> thanks,
> Zoran

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Posted by "Jesse Glick (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=299062#comment-299062 ] 

Jesse Glick commented on MCOMPILER-157:
---------------------------------------

maven-compiler-plugin-addToSourcePathAsWell.patch should not be necessary to my knowledge; 269-generated sources already get compiled in the same run.
                
> Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-157
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>         Environment: Java 6
>            Reporter: Zoran Regvart
>         Attachments: maven-compiler-plugin-add-compileSourceRoots.patch, maven-compiler-plugin-addToSourcePathAsWell.patch, TestCase2.zip, test-case.zip
>
>
> Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.
> Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.
> thanks,
> Zoran

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=313381#comment-313381 ] 

Olivier Lamy commented on MCOMPILER-157:
----------------------------------------

is there any way to have a failing test case ?  
                
> Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-157
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>         Environment: Java 6
>            Reporter: Zoran Regvart
>             Fix For: 3.0
>
>         Attachments: maven-compiler-plugin-add-compileSourceRoots.patch, maven-compiler-plugin-addToSourcePathAsWell.patch, TestCase2.zip, test-case.zip
>
>
> Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.
> Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.
> thanks,
> Zoran

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MCOMPILER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Lamy updated MCOMPILER-157:
-----------------------------------

    Fix Version/s: 2.5
    
> Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-157
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>         Environment: Java 6
>            Reporter: Zoran Regvart
>             Fix For: 2.5
>
>         Attachments: maven-compiler-plugin-add-compileSourceRoots.patch, maven-compiler-plugin-addToSourcePathAsWell.patch, TestCase2.zip, test-case.zip
>
>
> Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.
> Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.
> thanks,
> Zoran

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Posted by "Jérôme Verstrynge (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=275226#comment-275226 ] 

Jérôme Verstrynge commented on MCOMPILER-157:
---------------------------------------------

I have performed some tests and here are my results:

i) I have checked-out maven-compiler-plugin from the 2.3.3 release locally
ii) I have applied the patch provided by Zoran
iii) I confirm that the issue he reported is solved with this patch (and it does not break existing tests)
iv) However, when generating a java file instead of an aspectj file, the java file is not taken into account in the compiling process (it is not part of the generated .jar)

I am posting another test case to illustrate my point. Keep in mind that I am new to annotation processing, so I may miss something obvious. 

> Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-157
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>         Environment: Java 6
>            Reporter: Zoran Regvart
>         Attachments: maven-compiler-plugin-add-compileSourceRoots.patch, test-case.zip
>
>
> Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.
> Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.
> thanks,
> Zoran

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Posted by "Zoran Regvart (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MCOMPILER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zoran Regvart updated MCOMPILER-157:
------------------------------------

    Attachment: failing-test-example.zip

The failing test example
                
> Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-157
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>         Environment: Java 6
>            Reporter: Zoran Regvart
>             Fix For: 3.0
>
>         Attachments: failing-test-example.zip, maven-compiler-plugin-add-compileSourceRoots.patch, maven-compiler-plugin-addToSourcePathAsWell.patch, TestCase2.zip, test-case.zip
>
>
> Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.
> Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.
> thanks,
> Zoran

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Posted by "Zoran Regvart (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=273630#comment-273630 ] 

Zoran Regvart edited comment on MCOMPILER-157 at 7/19/11 8:25 AM:
------------------------------------------------------------------

One obvious workaround would be using build helper plugin to add the target/generated-sources/annotations to source path, like:

{noformat} 
<build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.7</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>target/generated-sources/annotations</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
{noformat}

      was (Author: zregvart):
    One obvious workaround would be using build helper plugin to add the target/generated-sources/annotations to source path, like:

{{
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.7</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>target/generated-sources/annotations</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
}}
  
> Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-157
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>         Environment: Java 6
>            Reporter: Zoran Regvart
>         Attachments: maven-compiler-plugin-add-compileSourceRoots.patch, test-case.zip
>
>
> Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.
> Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.
> thanks,
> Zoran

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MCOMPILER-157) Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files

Posted by "Martin Franklin (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MCOMPILER-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=308375#comment-308375 ] 

Martin Franklin commented on MCOMPILER-157:
-------------------------------------------

Should also state I upgraded to the compiler version 2.5.1 and am using maven 3.0.4
                
> Maven Compiler Plugin should add to compileSourceRoots for next plugins to consider as source directory for generated files 
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-157
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-157
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>         Environment: Java 6
>            Reporter: Zoran Regvart
>             Fix For: 2.6
>
>         Attachments: maven-compiler-plugin-add-compileSourceRoots.patch, maven-compiler-plugin-addToSourcePathAsWell.patch, TestCase2.zip, test-case.zip
>
>
> Maven Compiler Plugin by relying on javac by default, on Java 6 platform includes annotation processors in it's processing, these in end could generate sources that are placed by default in target/generated-sources/annotations. The later should be added to compileSourceRoots so that next plugin in execution would consider those sources.
> Please, see the attached test case and consider the attached patch in the next release of maven-compiler-plugin.
> thanks,
> Zoran

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira