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 6239065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:19:48+00:00 2026-05-24T11:19:48+00:00

I have a maven project generating a new class from an annotation processor during

  • 0

I have a maven project generating a new class from an annotation processor during a compile process. The class is successfully generated in /target/generated-sources/annotations/, but it is not compiled into the .jar. Why?

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.2</version>
    <configuration>
        <source>${project.build.source}</source>
        <target>${project.build.target}</target>
        <encoding>${project.build.sourceEncoding}</encoding>
        <compilerArgument>-Xlint</compilerArgument>
        <annotationProcessors>
                <annotationProcessor>net.preprocessing.MyAnnotationProcessor</annotationProcessor>
        </annotationProcessors>
    </configuration>
</plugin>

EDIT

This seems to be a known bug. If anyone has an operational workaround, it is welcome.

EDIT 2

I have performed some tests yesterday, but the suggested workaround in the ticket does not work. I have provided a test case. If anyone has insight on how to solve this issue, it is welcome. Keep in mind that I am a newbie at annotation processing, so there might be something obvious I am missing.

  • 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-24T11:19:49+00:00Added an answer on May 24, 2026 at 11:19 am

    I would suggest using the maven-processor-plugin instead of an ‘annotationProcessor’ argument which you pass to the maven compiler.

    From what I’ve read there seem to be some issues with the compilerArgumens, those are solved when you use the maven-processor-plugin.

    Here you can find more info about the maven-processor-plugin: http://maven-annotation-plugin.googlecode.com/svn/docs/usage.html

    Here is an example of how the processor plugin replaces compilerArguments (the example uses Hibernate Metamodel Generator, but this will look about the same for all kinds of annotation processors…): http://relation.to/Bloggers/HibernateStaticMetamodelGeneratorAnnotationProcessor

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

Sidebar

Related Questions

I have a hierarchical maven project, from which I am trying to build a
I have a Maven project that uses the jaxb2-maven-plugin to compile some xsd files.
I have a maven project with the following packages (for illustration only): Root: src/main/java
I have a multi-module maven project with an installer sub-project. The installer will be
Suppose I have the following directory layout in a Maven project: src/ |-- main
I have a small command line utility project that I'm using Maven to manage.
I have a project I'm building with maven and I need to generate a
I have a maven project A that use hibernate-annotations 3.4.0.GA which use the slf4j-api
I have a Maven project that consists of several modules. I have a single
I have a maven project where I am using the assembly plugin. I typically

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.