我正在尝试使用maven-jaxb2 plugin
. 但是每次构建后几秒钟,类都会从target/generated-resources
文件夹中删除(但它们仍在target/classes/...
文件夹中)
这是我的 pom 中的插件定义:
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.8.1</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<cleanPackageDirectories>true</cleanPackageDirectories>
<generatePackage>gen.name.integrationimpl.imdb.types</generatePackage>
<schemaDirectory>${basedir}/src/main/resources</schemaDirectory>
<args>
<param>-npa</param>
</args>
<removeOldOutput>true</removeOldOutput>
<includeSchemas>
<includeSchema>**/*.xsd</includeSchema>
</includeSchemas>
</configuration>
<dependencies>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.5-b10</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.6</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
<version>1.0-2</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-resource</id>
<phase>generate-resources</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/main/resources</directory>
<targetPath>resources-target</targetPath>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
我的xsd应该是对的。
我不知道出了什么问题。我之前做过几次,但从来没有这个问题。
感谢您的帮助