JAXB用のMavenプラグインを使用して、XMLスキーマドキュメントからクラスを生成しています。私のPOMには次のものが含まれています
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<goals>
<goal>xjc</goal>
</goals>
<phase>generate-sources</phase>
</execution>
</executions>
<configuration>
<clearOutputDir>false</clearOutputDir>
<outputDirectory>src/main/java</outputDirectory>
<schemaDirectory>src/main/webapp/schemas</schemaDirectory>
<includeSchema>**/*.xsd</includeSchema>
<bindingDirectory>src/main/resources/bindings</bindingDirectory>
<enableIntrospection>false</enableIntrospection>
</configuration>
</plugin>
JPA 2のEclipselink仕様を使用しています。JAXBがスキーマに従ってクラスを生成する場合、次のアノテーションは含まれていません。
@Entity
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
現時点では、Mavenでクリーンコンパイルを実行するたびに手動でこれらを追加しています。JAXBプラグインに、クラスの生成時に含まれるこれらのアノテーションでクラスファイルにアノテーションを付ける方法があるかどうか疑問に思っていますか?