8

maven-jaxb-schemagen-pluginJava7で使おうとすると

<groupId>com.sun.tools.jxc.maven2</groupId>
<artifactId>maven-jaxb-schemagen-plugin</artifactId>
<version>1.2</version>

エラーが発生します:

[ERROR] Failed to execute goal com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate (default) on project TopologyProvisionerDom: Execution default of goal com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate failed: A required class was missing while executing com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate: com/sun/mirror/apt/AnnotationProcessorFactory

AnnotationProcessorFactoryJava 7で削除/非推奨になっているようですが?このプラグインを使用してjaxbschemagenを動作させることは可能ですか?JDK 7を使用するときにJAXBソースコードからスキーマ生成を取得するための代替アプローチはありますか?

4

3 に答える 3

9

org.codehaus.mojo:jaxb2-maven-plugin代わりにを使用してみましたか?

于 2011-12-13T17:38:06.083 に答える
7

これがどのように機能するかです (このプロファイルを に追加しますpom.xml):

<profile>
    <id>jdk7-fix</id>
    <activation>
        <file><exists>${java.home}/../lib/tools.jar</exists></file>
    </activation>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.sun.tools.jxc.maven2</groupId>
                    <artifactId>maven-jaxb-schemagen-plugin</artifactId>
                    <dependencies>
                        <dependency>
                            <groupId>com.sun</groupId>
                            <artifactId>tools</artifactId>
                            <version>1.7</version>
                            <scope>system</scope>
                            <systemPath>${java.home}/../lib/tools.jar</systemPath>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</profile>
于 2012-08-02T15:22:07.930 に答える