Question

I am trying to generate some classes with the maven-jaxb2 plugin. But a few seconds after every build the classes are deleted out of the target/generated-resources folder (but they are still in the target/classes/... folder)

Here is the plugindefinition from my 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>

my xsd should be right.

I have no idea what is going wrong. I did it a few times before, but had never this problem.

thanks for your help

Was it helpful?

Solution

for those who are interested in it: I solved it temporary by removing the

<removeOldOutput>true</removeOldOutput>

tag.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top