Discussion:
Maven jaxb2 plugin encoding issue
zhaoyi
2010-07-09 02:36:22 UTC
Permalink
I set up jaxb2 plugin in my maven. It will generate code first then compile
the code. My problem is that when jaxb2 generate the code, it will generate
a commend line in the source code "// Generated on: 2010...". The time line
include Chinese character for that I am using a Chinese version OS. When
maven begins to build the source code, I will get an error that maven
doesn't map UTF-8 character. How can I change the generated time character
on jaxb2 plugin?

thanks.
--
View this message in context: http://maven.40175.n5.nabble.com/Maven-jaxb2-plugin-encoding-issue-tp1045281p1045281.html
Sent from the Maven - Users mailing list archive at Nabble.com.
Dan Tran
2010-07-09 03:00:33 UTC
Permalink
file an jira issue with sample maven project , and provide a fix if
you can. jaxb2 plugin developer can work on it later.


-D
Post by zhaoyi
I set up jaxb2 plugin in my maven. It will generate code first then compile
the code. My problem is that when jaxb2 generate the code, it will generate
a commend line in the source code "// Generated on: 2010...". The time line
include Chinese character for that I am using a Chinese version OS. When
maven begins to build the source code, I will get an error that maven
doesn't map UTF-8 character. How can I change the generated time character
on jaxb2 plugin?
thanks.
--
View this message in context: http://maven.40175.n5.nabble.com/Maven-jaxb2-plugin-encoding-issue-tp1045281p1045281.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
zhaoyi
2010-07-09 05:52:36 UTC
Permalink
Does maven have a configuration for encoding or Calendar?
--
View this message in context: http://maven.40175.n5.nabble.com/Maven-jaxb2-plugin-encoding-issue-tp1045281p1045298.html
Sent from the Maven - Users mailing list archive at Nabble.com.
Thomas Markus
2010-07-09 06:12:20 UTC
Permalink
Hi,

try to deactivate the header.

<configuration>
<arguments>-no-header</arguments>
...

regards
thomas
Post by zhaoyi
I set up jaxb2 plugin in my maven. It will generate code first then compile
the code. My problem is that when jaxb2 generate the code, it will generate
a commend line in the source code "// Generated on: 2010...". The time line
include Chinese character for that I am using a Chinese version OS. When
maven begins to build the source code, I will get an error that maven
doesn't map UTF-8 character. How can I change the generated time character
on jaxb2 plugin?
thanks.
zhaoyi
2010-07-09 06:35:00 UTC
Permalink
Below is our configuration. The -no-header doesn't solve the problem.

<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.7.1</version>
<executions>
<execution>
<id>generate-jaxb</id>
<phase>generate-test-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<generatePackage>com.example.ipo.jaxb</generatePackage>

<generateDirectory>${project.build.directory}/jaxb-source</generateDirectory>

<schemaDirectory>${basedir}/src/test/resources</schemaDirectory>
<schemaIncludes>
<include>ipo.xsd</include>
</schemaIncludes>
<arguments>-no-header</arguments>
</configuration>
</plugin>
--
View this message in context: http://maven.40175.n5.nabble.com/Maven-jaxb2-plugin-encoding-issue-tp1045281p1045317.html
Sent from the Maven - Users mailing list archive at Nabble.com.
Olivier Lamy
2010-07-09 06:45:58 UTC
Permalink
Hi,
Afaik the plugin org.jvnet.jaxb2.maven2:maven-jaxb2-plugin is not
maintained here.

We can answer for the plugin [1] : org.codehaus.mojo:jaxb2-maven-plugin

So try with this one if you have the same issue.


[1] http://mojo.codehaus.org/jaxb2-maven-plugin/
Post by zhaoyi
Below is our configuration. The -no-header doesn't solve the problem.
<plugin>
               <groupId>org.jvnet.jaxb2.maven2</groupId>
               <artifactId>maven-jaxb2-plugin</artifactId>
               <version>0.7.1</version>
               <executions>
                   <execution>
                       <id>generate-jaxb</id>
                       <phase>generate-test-sources</phase>
                       <goals>
                           <goal>generate</goal>
                       </goals>
                   </execution>
               </executions>
               <configuration>
                   <generatePackage>com.example.ipo.jaxb</generatePackage>
<generateDirectory>${project.build.directory}/jaxb-source</generateDirectory>
<schemaDirectory>${basedir}/src/test/resources</schemaDirectory>
                   <schemaIncludes>
                       <include>ipo.xsd</include>
                   </schemaIncludes>
                   <arguments>-no-header</arguments>
               </configuration>
           </plugin>
--
View this message in context: http://maven.40175.n5.nabble.com/Maven-jaxb2-plugin-encoding-issue-tp1045281p1045317.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
--
Olivier
http://twitter.com/olamy
http://fr.linkedin.com/in/olamy
http://www.viadeo.com/fr/profile/olivier.lamy7
Thomas Markus
2010-07-09 06:49:30 UTC
Permalink
Hi,

we use
<plugin>
<!-- http://mojo.codehaus.org/jaxb2-maven-plugin/xjc-mojo.html -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>jaxb2-maven-plugin-run</id>
<phase>generate-sources</phase>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
<packageName>....</packageName>
</configuration>
</execution>
</executions>
</plugin>

thomas
Post by zhaoyi
Below is our configuration. The -no-header doesn't solve the problem.
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.7.1</version>
<executions>
<execution>
<id>generate-jaxb</id>
<phase>generate-test-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<generatePackage>com.example.ipo.jaxb</generatePackage>
<generateDirectory>${project.build.directory}/jaxb-source</generateDirectory>
<schemaDirectory>${basedir}/src/test/resources</schemaDirectory>
<schemaIncludes>
<include>ipo.xsd</include>
</schemaIncludes>
<arguments>-no-header</arguments>
</configuration>
</plugin>
Loading...