質問

Mavenプロジェクトで自分の注釈プロセッサで注釈を処理しようとしています。 org.bsc.mavenを使用:maven-processor-pluginは成功しましたが、多くの問題がありました。私が比較できる私の使用シナリオに匹敵するデモプロジェクトがあるのだろうか。

役に立ちましたか?

解決

驚くべきことに、必要なのは、注釈プロセッサでプロジェクトに依存することです。

dp4jmaventest DP4Jアノテーションプロセッサのサンプルプロジェクトです。

私の問題は、同じ注釈処理プロジェクト内のクラスで注釈を処理しようとすることでした。解決策は、2つのフェーズでコンパイルすることです。

</configuration>
            <executions>
                <execution>
                    <id>default-compile</id>
                    <configuration>
                        <compilerArgument>-proc:none</compilerArgument>
                        <includes>
                            <include>com/dp4j/**</include>
                            <include>com/dp4j/processors/core/**</include>
                            <include>com/dp4j/processors/**</include>
                        </includes>
                    </configuration>
                </execution>
                <execution>
                    <id>compile-everything-else</id>
                    <phase>compile</phase>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
<!--http://cdivilly.wordpress.com/2010/03/16/maven-and-jsr-269-annotation-processors/-->

DP4J Mavenプロジェクト ワーキング例プロジェクトです。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top