---------- Forwarded message ----------
From: Aleksei Valikov <valikov_at_gmx.net>
Date: Wed, Feb 2, 2011 at 11:01 AM
Subject: Re: maven-jaxb2-plugin problem
To: Aliaksandr Mikhailau <aliaksandr.mikhailau_at_gmail.com>
Hi,
> I used maven-jaxb2-plugin version 0.7.5 and I have a problem. I want to
> generate sources from two different schemas to two different packages. I try
> to use config above:
>
> <plugin>
> <groupId>org.jvnet.jaxb2.maven2</groupId>
> <artifactId>maven-jaxb2-plugin</artifactId>
> <version>0.7.5</version>
> <executions>
> <execution>
> <id>exec1</id>
> <goals>
> <goal>generate</goal>
> </goals>
> <configuration>
> <schemaIncludes>
> <include>first.xsd</include>
> </schemaIncludes>
>
> <generateDirectory>src/main/generated-sources/xjc</generateDirectory>
> <generatePackage>com.package1</generatePackage>
> </configuration>
> </execution>
> <execution>
> <id>exec2</id>
> <goals>
> <goal>generate</goal>
> </goals>
> <configuration>
> <schemaIncludes>
> <include>second.xsd</include>
> </schemaIncludes>
>
> <generateDirectory>src/main/generated-sources/xjc</generateDirectory>
> <generatePackage>com.package2</generatePackage>
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> But configuration inside <execution> tag has no affect. After execution all
> generated sources are inside target/generated-sources/xjc directory with
> package name equals shcema namespace.
>
> Can I generate sources from two different schemas to two different not
> default generated packages?
* Please post mvn -X log.
* You can use binding files to specify target package names - you
won't need several executions then.
See here for instance:
http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/docs/1.5/tutorial/doc/JAXBUsing4.html
Bye,
/lexi