You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Sean Patrick Floyd (JIRA)" <ji...@codehaus.org> on 2010/09/13 17:14:33 UTC

[jira] Created: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Passing multiple parameters to Java 6 annotation processors with javac does not work
------------------------------------------------------------------------------------

                 Key: MCOMPILER-135
                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
             Project: Maven 2.x Compiler Plugin
          Issue Type: Bug
    Affects Versions: 2.3.1
         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
            Reporter: Sean Patrick Floyd


I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,

Here's my setup.

{code:xml} 
<plugin>
    <inherited>true</inherited>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.1</version>
    <configuration>
        <source>1.6</source>
        <target>1.6</target>
        <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
    </configuration>
</plugin>
{code} 

Javac needs the parameters added as separate Strings
{code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
but the Compiler Plugin generates this code:
{code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
which Javac will parse as
{code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}

The map version "<compilerArguments>" is of no help either, because this
{code}<Averbose>true</Averbose>
<AaddResDir>src/main/webapp</AResDir>{code}
will generate the output
{code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}

while this
{code}<Averbose=true />
<AaddResDir=src/main/webapp />{code}

is not well-formed XML.

Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Sean Patrick Floyd (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235159#action_235159 ] 

Sean Patrick Floyd edited comment on MCOMPILER-135 at 9/14/10 1:57 AM:
-----------------------------------------------------------------------

Per: yes, I thought of that also, but it would be an ugly option. For one thing: it would not allow me to debug the annotation processor using mvndebug compile (not without lots of additional configuration anyway)

      was (Author: seanizer):
    Per: yes, I thought of that also, but it would be an ugly option. For one thing: it would not allow me to debug the annotation processor (not without lots of additional configuration anyway)
  
> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Sean Patrick Floyd (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Patrick Floyd updated MCOMPILER-135:
-----------------------------------------

    Attachment: AbstractCompilerMojo.java.2.patch

Here is a second patch that introduces a new map-based parameter

{code}<annotationProcessorArguments>
    <key1>value</key1>
    <key2>value2</key2>
</annotationProcessorArguments>{code}.

This would probably be better as it couldn't break existing functionality

> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Pascal Thivent (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235095#action_235095 ] 

Pascal Thivent edited comment on MCOMPILER-135 at 9/13/10 12:04 PM:
--------------------------------------------------------------------

Looks similar to MCOMPILER-130

      was (Author: pthivent):
    Looks like http://jira.codehaus.org/browse/MCOMPILER-130
  
> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

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

Robert Scholte closed MCOMPILER-135.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.4

Fixed in [rev. 1162905|http://svn.apache.org/viewvc?rev=1162905&view=rev] with an integration-test.
After reading all comments I believe it is not necessary to add a new parameter. It is just another compilerArgument, where the key and value are separated by an '='-sign.


> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>            Assignee: Robert Scholte
>             Fix For: 2.4
>
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.3.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

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

        

[jira] Commented: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Sean Patrick Floyd (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235159#action_235159 ] 

Sean Patrick Floyd commented on MCOMPILER-135:
----------------------------------------------

Per: yes, I thought of that also, but it would be an ugly option. For one thing: it would not allow me to debug the annotation processor (not without lots of additional configuration anyway)

> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Sean Patrick Floyd (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235208#action_235208 ] 

Sean Patrick Floyd commented on MCOMPILER-135:
----------------------------------------------

OK now I see what you mean. What a mess. Maybe it would be best to introduce an array parameter, as an array is what's passed to the compiler anyway. That way we could catch all kinds of arguments. Something like this:
{code}
<arguments>
    <argument>-Xmaxerrs</argument>
    <argument>100</argument>
    <argument>-Akey1=value1</argument>
    <argument>-Akey2=value2</argument>
</arguments>
{code}

(Inspired by [exec:java|http://mojo.codehaus.org/exec-maven-plugin/usage.html])

> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Per Hedman (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235204#action_235204 ] 

Per Hedman commented on MCOMPILER-135:
--------------------------------------

Sean Patrick: I understand what you mean, but I was thinking of 
{code}
javac -X
{code}

{code}
-Xlint                     Enable recommended warnings
  -Xlint:{all,deprecation,unchecked,fallthrough,path,serial,finally,-deprecation,-unchecked,-fallthrough,-path,-serial,-finally}Enable or disable specific warnings
  -Xbootclasspath/p:<path>   Prepend to the bootstrap class path
  -Xbootclasspath/a:<path>   Append to the bootstrap class path
  -Xbootclasspath:<path>     Override location of bootstrap class files
  -Djava.ext.dirs=<dirs>     Override location of installed extensions
  -Djava.endorsed.dirs=<dirs>Override location of endorsed standards path
  -Xmaxerrs <number>         Set the maximum number of errors to print
  -Xmaxwarns <number>        Set the maximum number of warnings to print
  -Xstdout <filename>        Redirect standard output
{code}
And then you could get support for more exotic arguments for the compiler, and not just the javac compiler arguments. 

> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Pascal Thivent (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235095#action_235095 ] 

Pascal Thivent edited comment on MCOMPILER-135 at 9/13/10 12:16 PM:
--------------------------------------------------------------------

Looks similar to MCOMPILER-130 (but the map syntax won't help indeed).

      was (Author: pthivent):
    Looks similar to MCOMPILER-130
  
> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Per Hedman (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235169#action_235169 ] 

Per Hedman edited comment on MCOMPILER-135 at 9/14/10 4:09 AM:
---------------------------------------------------------------

Missed that, then maybe:

{code:xml}
<compilerArgumentKeyValue>
<key1>value1</key1>
<key2>value2</key2>
<compilerArgumentKeyValue>
{code}

that could internally map it to: 

{code}
"-key1=value1", "-key2=value2"
{code}

That wouldn't break any old functionality and still not be specific to the annotation processor...


      was (Author: phh):
    A missed that...
Then maybe:

{code:xml}
<compilerArgumentKeyValue>
<key1>value1</key1>
<key2>value2</key2>
<compilerArgumentKeyValue>
{code}

that could internally map it to: 

{code}
"-key1=value1", "-key2=value2"
{code}

That wouldn't break any old functionality and still not be specific to the annotation processor...

  
> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Sean Patrick Floyd (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Patrick Floyd updated MCOMPILER-135:
-----------------------------------------

    Attachment: AbstractCompilerMojo.java.patch

Here is a Patch for org.apache.maven.plugin.AbstractCompilerMojo that enables the following code:

{code}<compilerArguments>
    <AaddResDir>src/main/webapp</AaddResDir>
    <Averbose>true</Averbose>
</compilerArguments>{code}

There should probably be a check whether source version is at least 1.6 and compiler id is javac, though.


> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Sean Patrick Floyd (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235168#action_235168 ] 

Sean Patrick Floyd commented on MCOMPILER-135:
----------------------------------------------

Per: That functionality already exists:{code}<compilerArguments>
 <key1>value1</key1>
 <key2>value2</key2>
<compilerArguments>{code}

But as I wrote above, this is internally mapped to ["-key1", "value1", "-key2", "value2"] instead of ["-key1=value1", "-key2=value2"], which is the format needed for apt parameters. Most other compiler arguments need the other syntax, though.

So there's basically two ways to handle this: either check the existing map for parameters starting with a capital A (and risk breaking functionality where some compiler relies on a parameter starting with a capital A) or add a new variable that's dedicated to apt parameters (I have submitted two patches to cover these two approaches)

> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Per Hedman (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235166#action_235166 ] 

Per Hedman edited comment on MCOMPILER-135 at 9/14/10 3:34 AM:
---------------------------------------------------------------

That could work very well. I would like to propose a version that looks something like this:

{code:xml}
<compilerArgumentMap>
 <key1>value1</key1>
 <key2>value2</key2>
<compilerArgumentMap>
{code}

would even work with other compilers than javac, and is none-version specific.



      was (Author: phh):
    That could work very well. I would like to propose a version that looks something like this:

{code:xml}
<compilerArgumentMap>
 <key1>value1</key1>
 <key2>value2</key1>
<compilerArgumentMap>
{code}

would even work with other compilers than javac, and is none-version specific.


  
> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Sean Patrick Floyd (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235179#action_235179 ] 

Sean Patrick Floyd commented on MCOMPILER-135:
----------------------------------------------

Per, for [MCOMPILER-130], the existing functionality works (using the map version). It's probably just a question of updating documentation. For my problem no workaround exists (apart from using fork). And introducing a new map that would solve both of our problems would be a strange hack, because the parameters need to be assembled in different ways. The plugin would need to know about the -A notation anyway, so why not make it explicit?

Of course it would be more elegant to send a map to the individual compilers and let them assemble the parameters themselves, but that would require a complete re-write.

> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Sean Patrick Floyd (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235198#action_235198 ] 

Sean Patrick Floyd commented on MCOMPILER-135:
----------------------------------------------

Per: have a look at {code}javac -help{code}

{noformat}
Usage: javac <options> <source files>
where possible options include:
  -g                         Generate all debugging info
  -g:none                    Generate no debugging info
  -g:{lines,vars,source}     Generate only some debugging info
  -nowarn                    Generate no warnings
  -verbose                   Output messages about what the compiler is doing
  -deprecation               Output source locations where deprecated APIs are used
  -classpath <path>          Specify where to find user class files and annotation processors
  -cp <path>                 Specify where to find user class files and annotation processors
  -sourcepath <path>         Specify where to find input source files
  -bootclasspath <path>      Override location of bootstrap class files
  -extdirs <dirs>            Override location of installed extensions
  -endorseddirs <dirs>       Override location of endorsed standards path
  -proc:{none,only}          Control whether annotation processing and/or compilation is done.
  -processor <class1>[,<class2>,<class3>...]Names of the annotation processors to run; bypasses default discovery process
  -processorpath <path>      Specify where to find annotation processors
  -d <directory>             Specify where to place generated class files
  -s <directory>             Specify where to place generated source files
  -implicit:{none,class}     Specify whether or not to generate class files for implicitly referenced files
  -encoding <encoding>       Specify character encoding used by source files
  -source <release>          Provide source compatibility with specified release
  -target <release>          Generate class files for specific VM version
  -version                   Version information
  -help                      Print a synopsis of standard options
  -Akey[=value]              Options to pass to annotation processors
  -X                         Print a synopsis of nonstandard options
  -J<flag>                   Pass <flag> directly to the runtime system
{noformat} 

You can see that almost all parameters are either of the form "-parameter" or "-parameter value" (your example "-verbose=true" throws an error, the usage is "-verbose"). There are only a few exceptions to this rule, and -Akey=value is one of them. Some of the other exceptions are already handled (like [proc:|http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#proc]).

> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Per Hedman (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235176#action_235176 ] 

Per Hedman commented on MCOMPILER-135:
--------------------------------------

The KeyValue version could fix other problems with the compiler-plugin, [MCOMPILER-130], and still not be annotation specific, or even compiler-specific. IMHO

> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Per Hedman (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235218#action_235218 ] 

Per Hedman commented on MCOMPILER-135:
--------------------------------------

This third patch seems flexible and interesting. I will run some basic scenarios through the patch and see if there is anything that we have missed...

> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.3.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Per Hedman (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235166#action_235166 ] 

Per Hedman edited comment on MCOMPILER-135 at 9/14/10 3:34 AM:
---------------------------------------------------------------

That could work very well. I would like to propose a version that looks something like this:

{code:xml}
<compilerArgumentMap>
 <key1>value1</key1>
 <key2>value2</key1>
<compilerArgumentMap>
{code}

would even work with other compilers than javac, and is none-version specific.



      was (Author: phh):
    That could work very well. I would like to propose a version that looks something like this:

{code:xml}
<compilerArgumentMap>
 <key1>value1</key1>
 <key2>value2</key1>
<compilerArgumentMap>
{code:xml}

would even work with other compilers than javac, and is none-version specific.


  
> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Sean Patrick Floyd (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235173#action_235173 ] 

Sean Patrick Floyd commented on MCOMPILER-135:
----------------------------------------------

Milos, exactly. And Per: what's wrong with having annotation processing specific parameters? We already have the following two:

http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#annotationProcessors
http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#proc

And I think it makes sense to separate different types of functionality

> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Sean Patrick Floyd (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235168#action_235168 ] 

Sean Patrick Floyd edited comment on MCOMPILER-135 at 9/14/10 3:55 AM:
-----------------------------------------------------------------------

Per: That functionality already exists:{code}<compilerArguments>
 <key1>value1</key1>
 <key2>value2</key2>
<compilerArguments>{code}

But as I wrote above, this is internally mapped to {code}["-key1", "value1", "-key2", "value2"]{code} instead of {code}["-key1=value1", "-key2=value2"]{code}, which is the format needed for apt parameters. Most other compiler arguments need the other syntax, though.

So there's basically two ways to handle this: either check the existing map for parameters starting with a capital A (and risk breaking functionality where some compiler relies on a parameter starting with a capital A) or add a new variable that's dedicated to apt parameters (I have submitted two patches to cover these two approaches)

      was (Author: seanizer):
    Per: That functionality already exists:{code}<compilerArguments>
 <key1>value1</key1>
 <key2>value2</key2>
<compilerArguments>{code}

But as I wrote above, this is internally mapped to ["-key1", "value1", "-key2", "value2"] instead of ["-key1=value1", "-key2=value2"], which is the format needed for apt parameters. Most other compiler arguments need the other syntax, though.

So there's basically two ways to handle this: either check the existing map for parameters starting with a capital A (and risk breaking functionality where some compiler relies on a parameter starting with a capital A) or add a new variable that's dedicated to apt parameters (I have submitted two patches to cover these two approaches)
  
> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

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

Jesse Glick commented on MCOMPILER-135:
---------------------------------------

By the way, {{-Akey=value}} notation is one of the standard options (not {{-X...}}) that all command-line Java compilers (as of JSR 269) are expected to interpret, not just javac, so it is quite appropriate for a mojo supporting multiple compilers to have dedicated knowledge of this syntax.

> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.3.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Per Hedman (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235166#action_235166 ] 

Per Hedman commented on MCOMPILER-135:
--------------------------------------

That could work very well. I would like to propose a version that looks something like this:

{code:xml}
<compilerArgumentMap>
 <key1>value1</key1>
 <key2>value2</key1>
<compilerArgumentMap>
{code:xml}

would even work with other compilers than javac, and is none-version specific.



> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Sean Patrick Floyd (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Patrick Floyd updated MCOMPILER-135:
-----------------------------------------

    Attachment: AbstractCompilerMojo.java.3.patch

This third patch uses a Properties object.

Usage:
{code}
<additionalCompilerArguments>
    <property> <name>-Akey=value</name> </property>
    <property> <name>-verbose</name> </property>
    <property> <name>-Xmaxerrs</name> <value>1000</value> </property>
</additionalCompilerArguments> 
{code}

This is the most flexible approach and it should be able to support almost all kinds of parameters.

> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.3.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Pascal Thivent (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235095#action_235095 ] 

Pascal Thivent commented on MCOMPILER-135:
------------------------------------------

Looks like http://jira.codehaus.org/browse/MCOMPILER-130

> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Milos Kleint (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235172#action_235172 ] 

Milos Kleint commented on MCOMPILER-135:
----------------------------------------

from the usability point of view it's confusing to have both <compilerArguments> and <compilerArgumentKeyValue> as plugin parameters.. I would be inclined to define annotation processing specific parameter, than it's more clear which one to use in the given scenario..

> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Per Hedman (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235169#action_235169 ] 

Per Hedman commented on MCOMPILER-135:
--------------------------------------

A missed that...
Then maybe:

{code:xml}
<compilerArgumentKeyValue>
<key1>value1</key1>
<key2>value2</key2>
<compilerArgumentKeyValue>
{code}

that could internally map it to: 

{code}
"-key1=value1", "-key2=value2"
{code}

That wouldn't break any old functionality and still not be specific to the annotation processor...


> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Per Hedman (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235180#action_235180 ] 

Per Hedman commented on MCOMPILER-135:
--------------------------------------

??The plugin would need to know about the -A notation anyway, so why not make it explicit???

Sean Patrick, why does the plugin need to know the -A notation? Isn't it just an argument like "-verbose=true", but with "-Averbose=true" that's sent to the compiler, or what am I missing?

Is this the correct forum for these kinds of questions? Or should this be discussed in another venue? _newbie codehaus:er_

> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.2.patch, AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MCOMPILER-135) Passing multiple parameters to Java 6 annotation processors with javac does not work

Posted by "Per Hedman (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MCOMPILER-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235125#action_235125 ] 

Per Hedman commented on MCOMPILER-135:
--------------------------------------

I believe that this workaround could work, add this to the configuration:
<fork>true</fork>
and change this:
<compilerArgument>-AaddResDir=src/main/webapp" "-Averbose=true</compilerArgument>
but I can't confirm right now. I only have 1.5 at home.

It's related to [MCOMPILER-130|http://jira.codehaus.org/browse/MCOMPILER-130]



> Passing multiple parameters to Java 6 annotation processors with javac does not work
> ------------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-135
>                 URL: http://jira.codehaus.org/browse/MCOMPILER-135
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: JDK 1.6, Maven 2.2.1, Maven-Compiler-Plugin 2.3.1, Windows
>            Reporter: Sean Patrick Floyd
>         Attachments: AbstractCompilerMojo.java.patch
>
>
> I have an annotation processor that supports multiple parameters and I have found that there is no way to set more than one of them at any given time from the Maven Compiler Plugin,
> Here's my setup.
> {code:xml} 
> <plugin>
>     <inherited>true</inherited>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <version>2.3.1</version>
>     <configuration>
>         <source>1.6</source>
>         <target>1.6</target>
>         <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
>     </configuration>
> </plugin>
> {code} 
> Javac needs the parameters added as separate Strings
> {code}[ ... , "-AaddResDir=src/main/webapp", "-Averbose=true"]{code}
> but the Compiler Plugin generates this code:
> {code}[ ... , "-AaddResDir=src/main/webapp -Averbose=true"]{code}
> which Javac will parse as
> {code}key:"addResDir" value="src/main/webapp -Averbose=true"{code}
> The map version "<compilerArguments>" is of no help either, because this
> {code}<Averbose>true</Averbose>
> <AaddResDir>src/main/webapp</AResDir>{code}
> will generate the output
> {code}[... , "-Averbose", "true", "-AaddResDir", "src/main/webapp"]{code}
> while this
> {code}<Averbose=true />
> <AaddResDir=src/main/webapp />{code}
> is not well-formed XML.
> Stepping through the compiler argument generation with the debugger I have not found a way to post-process the arguments, so please add a way to support multiple APT parameters because this is a major show-stopper.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira