Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1086325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:47:57+00:00 2026-05-16T22:47:57+00:00

I have a Java Annotation Processor that extends from AbstractProcessor . I have two

  • 0

I have a Java Annotation Processor that extends from AbstractProcessor.

I have two supported options, addResDir and verbose, and I am trying to set them like this:

-AaddResDir=src/main/webapp -Averbose=true

I have also tried this:

-AaddResDir=src/main/webapp,verbose=true

While a single parameter works, e.g.

-AaddResDir=src/main/webapp

I can’t get the multiple parameters to work and I can’t find any relevant docs. Do I need to parse the parameters manually in APT?

The only thing I have is the output of javac -help:

-Akey[=value]   Options to pass to annotation processors

EDIT

It turns out to be a maven problem, after all. Here is my maven config:

<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>
        <optimize>true</optimize>
        <debug>true</debug>
        <compilerArgument>-AaddResDir=src/main/webapp -Averbose=true</compilerArgument>
    </configuration>
</plugin>

Unfortunately, maven sends the argument to Javac as a single string in the args array, while it should of course be two Strings. The Map Version <compilerAguments> is no help either, because

<Averbose>true</Averbose>
<AaddResDir>src/main/webapp</AResDir>

generates the output:

[... , -Averbose, true, -AaddResDir, src/main/webapp]

While javac requires the syntax

[... , -Averbose=true, -AaddResDir=src/main/webapp ]

and

<Averbose=true />
<AaddResDir=src/main/webapp />

is invalid XML.

(See Mapping Maps from the Guide to Configuring Maven Plugins)

And I am afraid there is no way to change this, argh.


EDIT:

I have now filed a bug report.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:47:57+00:00Added an answer on May 16, 2026 at 10:47 pm

    There is no real answer as of yet.

    The bug is filed: MCOMPILER-135

    and I have submitted three different patches, the last of which introduces a variable of type Properties:

    <additionalCompilerArguments>
        <property> <name>-Akey=value</name> </property>
        <property> <name>-verbose</name> </property>
        <property> <name>-Xmaxerrs</name> <value>1000</value> </property>
    </additionalCompilerArguments>
    

    This solution is the most flexible one because it supports many different parameter syntax formats.

    (If the existing parameter <compilerArguments> were also of type Properties my problem would be solved)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Java-Annotation that return a double value: @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface DoubleValue
I have set up an annotation that will be used to keep track of
Im trying use a Java annotation in a Groovy class but have trouble to
I have written a java annotation that looks like this: @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) // can
I have java script code to set some of the properties of ajax controls.
I have Java Map (out of Strings and Ints) objects that I want to
I already have Java code to display and process data from a database. I
In my source tree have Java code which is automatically generated from XSD files.
I have the following Java annotation on a class (it's for a myBatis plugin):
I'm using java 6 annotation processing api. I have followed the following excellent tutorial

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.