Mojo schemagen maven plugin wrongly generates class -


good morning everyone, i'm trying use mojo jaxb2 maven plugin in application, whenever schema gets created properly, in same folder generates whole classes (as .class). reason maven/compiler creating output classes in /schemas/ folder. point output *.xsd files used in other projects. here excerpt pom:

<plugins>             <plugin>                 <groupid>org.codehaus.mojo</groupid>                 <artifactid>jaxb2-maven-plugin</artifactid>                 <version>1.5</version>                 <executions>                     <execution>                         <phase>generate-resources</phase>                         <id>schemagen</id>                         <goals>                             <goal>schemagen</goal>                         </goals>                         <configuration>                             <includes>                                 <include>com/delagelanden/rijee6/domain/*.java</include>                             </includes>                             <outputdirectory>${project.build.directory}/schemas</outputdirectory>                              <verbose>true</verbose>                         </configuration>                     </execution>                 </executions>             </plugin>         </plugins> 

someone asked same question here [1] , seems open issue.

the solution found use 'copy-resources' goal maven-resources-plugin [2] including .xsd files.

        <plugin>             <groupid>org.codehaus.mojo</groupid>             <artifactid>jaxb2-maven-plugin</artifactid>             <version>1.5</version>             <executions>                 <execution>                     <id>schemagen</id>                     <goals>                         <goal>schemagen</goal>                     </goals>                 </execution>             </executions>             <configuration>                 <includes>                     <include>**/*.java</include>                 </includes>                 <outputdirectory>${project.build.directory}/generated-resources/schemas</outputdirectory>             </configuration>         </plugin>         <plugin>             <artifactid>maven-resources-plugin</artifactid>             <version>2.6</version>             <executions>                 <execution>                     <id>copy-resources</id>                     <phase>process-resources</phase>                     <goals>                         <goal>copy-resources</goal>                     </goals>                     <configuration>                         <outputdirectory>${project.build.outputdirectory}/meta-inf/schema</outputdirectory>                         <resources>                             <resource>                                 <directory>${project.build.directory}/generated-resources/schemas</directory>                                 <includes>                                     <include>**/*.xsd</include>                                 </includes>                             </resource>                         </resources>                     </configuration>                 </execution>             </executions>         </plugin> 

[1] http://mojo.10943.n7.nabble.com/maven-jaxb2-plugin-schemagen-generating-classes-td40005.html [2] http://maven.apache.org/plugins/maven-resources-plugin/examples/copy-resources.html


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -