You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Julien Martin <ba...@gmail.com> on 2010/11/24 21:36:48 UTC

Problem with annotations processing and maven compiler plugin

Hello,

I am trying for maven to process my annotation processor.
Here is what I tried:
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <compilerArguments>

<processor>com.jeanbaptistemartin.util.TestAnnotationsProcessor</processor>

<processorpath>${basedir}/src/main/java</processorpath>
                    </compilerArguments>
                </configuration>
            </plugin>

Here is what I get:
Compilation failure
error: Annotation processor
'com.jeanbaptistemartin.util.TestAnnotationsProcessor' not found

Can anyone please help?

Thanks in advance,

Julien.

Re: Problem with annotations processing and maven compiler plugin

Posted by Julien Martin <ba...@gmail.com>.
It works very well.
Thanks to both of you!
J.

2010/11/25 Julien Martin <ba...@gmail.com>

> Thanks Wayne.
> I'll try that and post here according to the results.
> J.
>
> 2010/11/25 Wayne Fay <wa...@gmail.com>
>
> >                        <type>war</type>
>> >                    </dependency>
>> >                </dependencies>
>>
>> A dependency of type war means basically nothing to Javac. You're
>> basically just putting the War file on the classpath and javac doesn't
>> know how to deal with wars (only jars) so it just gets ignored.
>>
>> Try again after you package your annotation processor up in its own
>> jar, and depend on that.
>>
>> Wayne
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>

Re: Problem with annotations processing and maven compiler plugin

Posted by Julien Martin <ba...@gmail.com>.
Thanks Wayne.
I'll try that and post here according to the results.
J.

2010/11/25 Wayne Fay <wa...@gmail.com>

> >                        <type>war</type>
> >                    </dependency>
> >                </dependencies>
>
> A dependency of type war means basically nothing to Javac. You're
> basically just putting the War file on the classpath and javac doesn't
> know how to deal with wars (only jars) so it just gets ignored.
>
> Try again after you package your annotation processor up in its own
> jar, and depend on that.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Problem with annotations processing and maven compiler plugin

Posted by Wayne Fay <wa...@gmail.com>.
>                        <type>war</type>
>                    </dependency>
>                </dependencies>

A dependency of type war means basically nothing to Javac. You're
basically just putting the War file on the classpath and javac doesn't
know how to deal with wars (only jars) so it just gets ignored.

Try again after you package your annotation processor up in its own
jar, and depend on that.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem with annotations processing and maven compiler plugin

Posted by Julien Martin <ba...@gmail.com>.
Benson,

Here is what I have added:
 <dependencies>
                    <dependency>
                        <groupId>com.jeanbaptistemartin</groupId>
                        <artifactId>jeanbaptistemartin</artifactId>
                        <version>1.3</version>
                        <type>war</type>
                    </dependency>
                </dependencies>

Here is what I still get:
Compilation failure
error: Annotation processor
'com.jeanbaptistemartin.util.TestAnnotationsProcessor' not found

Also: when I tried to force the version of the plugin, I get a warning.

Any idea?

J.

2010/11/25 Benson Margulies <bi...@gmail.com>

> <plugin>
>
> ....
>   <dependencies>
>     <dependency>
>       g/a/v of where your annotation processor is
>    </dependency>
>   </dependencies>
>  </plugin>
>
> On Wed, Nov 24, 2010 at 3:43 PM, Julien Martin <ba...@gmail.com> wrote:
> > Thanks Benson,
> > What do you mean? How do I do that?
> > J.
> >
> > 2010/11/24 Benson Margulies <bi...@gmail.com>
> >
> >> A guess: also add it as a dependency to the compiler plugin?
> >>
> >> On Wed, Nov 24, 2010 at 3:36 PM, Julien Martin <ba...@gmail.com>
> wrote:
> >> > Hello,
> >> >
> >> > I am trying for maven to process my annotation processor.
> >> > Here is what I tried:
> >> >            <plugin>
> >> >                <groupId>org.apache.maven.plugins</groupId>
> >> >                <artifactId>maven-compiler-plugin</artifactId>
> >> >                <configuration>
> >> >                    <source>1.6</source>
> >> >                    <target>1.6</target>
> >> >                    <compilerArguments>
> >> >
> >> >
> >>
> <processor>com.jeanbaptistemartin.util.TestAnnotationsProcessor</processor>
> >> >
> >> > <processorpath>${basedir}/src/main/java</processorpath>
> >> >                    </compilerArguments>
> >> >                </configuration>
> >> >            </plugin>
> >> >
> >> > Here is what I get:
> >> > Compilation failure
> >> > error: Annotation processor
> >> > 'com.jeanbaptistemartin.util.TestAnnotationsProcessor' not found
> >> >
> >> > Can anyone please help?
> >> >
> >> > Thanks in advance,
> >> >
> >> > Julien.
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Problem with annotations processing and maven compiler plugin

Posted by Benson Margulies <bi...@gmail.com>.
<plugin>

....
   <dependencies>
     <dependency>
       g/a/v of where your annotation processor is
    </dependency>
   </dependencies>
  </plugin>

On Wed, Nov 24, 2010 at 3:43 PM, Julien Martin <ba...@gmail.com> wrote:
> Thanks Benson,
> What do you mean? How do I do that?
> J.
>
> 2010/11/24 Benson Margulies <bi...@gmail.com>
>
>> A guess: also add it as a dependency to the compiler plugin?
>>
>> On Wed, Nov 24, 2010 at 3:36 PM, Julien Martin <ba...@gmail.com> wrote:
>> > Hello,
>> >
>> > I am trying for maven to process my annotation processor.
>> > Here is what I tried:
>> >            <plugin>
>> >                <groupId>org.apache.maven.plugins</groupId>
>> >                <artifactId>maven-compiler-plugin</artifactId>
>> >                <configuration>
>> >                    <source>1.6</source>
>> >                    <target>1.6</target>
>> >                    <compilerArguments>
>> >
>> >
>> <processor>com.jeanbaptistemartin.util.TestAnnotationsProcessor</processor>
>> >
>> > <processorpath>${basedir}/src/main/java</processorpath>
>> >                    </compilerArguments>
>> >                </configuration>
>> >            </plugin>
>> >
>> > Here is what I get:
>> > Compilation failure
>> > error: Annotation processor
>> > 'com.jeanbaptistemartin.util.TestAnnotationsProcessor' not found
>> >
>> > Can anyone please help?
>> >
>> > Thanks in advance,
>> >
>> > Julien.
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem with annotations processing and maven compiler plugin

Posted by Julien Martin <ba...@gmail.com>.
Thanks Benson,
What do you mean? How do I do that?
J.

2010/11/24 Benson Margulies <bi...@gmail.com>

> A guess: also add it as a dependency to the compiler plugin?
>
> On Wed, Nov 24, 2010 at 3:36 PM, Julien Martin <ba...@gmail.com> wrote:
> > Hello,
> >
> > I am trying for maven to process my annotation processor.
> > Here is what I tried:
> >            <plugin>
> >                <groupId>org.apache.maven.plugins</groupId>
> >                <artifactId>maven-compiler-plugin</artifactId>
> >                <configuration>
> >                    <source>1.6</source>
> >                    <target>1.6</target>
> >                    <compilerArguments>
> >
> >
> <processor>com.jeanbaptistemartin.util.TestAnnotationsProcessor</processor>
> >
> > <processorpath>${basedir}/src/main/java</processorpath>
> >                    </compilerArguments>
> >                </configuration>
> >            </plugin>
> >
> > Here is what I get:
> > Compilation failure
> > error: Annotation processor
> > 'com.jeanbaptistemartin.util.TestAnnotationsProcessor' not found
> >
> > Can anyone please help?
> >
> > Thanks in advance,
> >
> > Julien.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Problem with annotations processing and maven compiler plugin

Posted by Benson Margulies <bi...@gmail.com>.
A guess: also add it as a dependency to the compiler plugin?

On Wed, Nov 24, 2010 at 3:36 PM, Julien Martin <ba...@gmail.com> wrote:
> Hello,
>
> I am trying for maven to process my annotation processor.
> Here is what I tried:
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-compiler-plugin</artifactId>
>                <configuration>
>                    <source>1.6</source>
>                    <target>1.6</target>
>                    <compilerArguments>
>
> <processor>com.jeanbaptistemartin.util.TestAnnotationsProcessor</processor>
>
> <processorpath>${basedir}/src/main/java</processorpath>
>                    </compilerArguments>
>                </configuration>
>            </plugin>
>
> Here is what I get:
> Compilation failure
> error: Annotation processor
> 'com.jeanbaptistemartin.util.TestAnnotationsProcessor' not found
>
> Can anyone please help?
>
> Thanks in advance,
>
> Julien.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org