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/25 22:55:52 UTC

Need help with a dependency problem...

Hello,
Due to a restructuring in a maven project, I am experiencing problems with
the following POM. I have two classes in the maven project below:
com.jeanbaptistemartin.annotations.MethodLevelAnnotation (an annotation)
com.jeanbaptistemartin.annotations.TestAnnotationsProcessor (my annotation
processor)

Here is what I get when I do a build:

*Compiling 2 source files to
/home/julien/NetBeansProjects/jbm-annotation-processor/target/classes
------------------------------------------------------------------------
[ERROR]BUILD FAILURE
------------------------------------------------------------------------
Compilation failure
error: Annotation processor
'com.jeanbaptistemartin.annotations.TestAnnotationsProcessor' not found
*
Can anyone please help?

Thanks in advance,
J.

<?xml version="1.0" encoding="UTF-8"?>
<project    xmlns="http://maven.apache.org/POM/4.0.0"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.jeanbaptistemartin</groupId>
    <artifactId>jbm-annotation-processor</artifactId>
    <packaging>jar</packaging>
    <version>1.0</version>
    <name>jbm-annotation-processor</name>
    <url>http://maven.apache.org</url>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <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.annotations.TestAnnotationsProcessor</processor>
                    </compilerArguments>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

Re: Need help with a dependency problem...

Posted by Julien Martin <ba...@gmail.com>.
thanks a lot for your input Andreas and Antonio.

2010/11/26 Andreas M <an...@gmail.com>

>
> Now, I'm no export on annotation processors, but don't you have to have it
> compiled before you can add it to the compiler arguments? In this, you say
> to the compiler that it should use the class it's compiling as a processor
> as well. That can't go well, can it?
> /Andreas
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Need-help-with-a-dependency-problem-tp3280645p3280922.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Need help with a dependency problem...

Posted by Andreas M <an...@gmail.com>.
Now, I'm no export on annotation processors, but don't you have to have it
compiled before you can add it to the compiler arguments? In this, you say
to the compiler that it should use the class it's compiling as a processor
as well. That can't go well, can it?
/Andreas
-- 
View this message in context: http://maven.40175.n5.nabble.com/Need-help-with-a-dependency-problem-tp3280645p3280922.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Need help with a dependency problem...

Posted by Antonio Petrelli <an...@gmail.com>.
2010/11/25 Julien Martin <ba...@gmail.com>:
>            <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.annotations.TestAnnotationsProcessor</processor>
>                    </compilerArguments>
>                </configuration>
>            </plugin>

You cannot use a not-compiled processor when compiling the processor itself.
You said that you have two classes in this project. Do you mean that
you have *only* these two classes?
If yes, remove the processor parameter. Otherwise, move these two
classes to a separate project and include it as a dependency.

Antonio

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