Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding problem with maven-jaxb2-plugin #32

Open
andersonsoares opened this issue Oct 5, 2016 · 1 comment
Open

encoding problem with maven-jaxb2-plugin #32

andersonsoares opened this issue Oct 5, 2016 · 1 comment

Comments

@andersonsoares
Copy link

andersonsoares commented Oct 5, 2016

Hi, iam testing those projects from http://confluence.highsource.org/display/HJ3/Downloads to generate some java files from xsd.

I got it working with maven-hyperjaxb3-plugin, generating UTF-8 files like i wanted, but it didnt with maven-jaxb2-plugin and hyperjaxb3-ejb-plugin . I got encoding issues with those plugins. I tried to set tag into pom.xml but didnt work.

  • Basic project template for Hibernate MAVEN (only that generated utf-8 java files)
  • Purchase order initial sample for Hibernate MAVEN (got encoding issue)
  • Purchase order build with maven-jaxb2-plugin MAVEN (got encoding issue)

Any tips about it?

Also, i realize that the source code generated with those projects are differents.
For example:

//Advogado
<xs:element name="advogado" type="nsS:Pessoa"/>

//Pessoa

<xs:complexType name="Pessoa">
        <xs:annotation>
            <xs:appinfo>
                <hj:entity xmlns:hj="http://hyperjaxb3.jvnet.org/ejb/schemas/customizations">
                    <orm:sequence-generator name="Generator_PESSOA" sequence-name="SEQ_PESSOA" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"/>
                </hj:entity>
            </xs:appinfo>
        </xs:annotation>
        <xs:sequence>
...

with maven-hyperjaxb3-plugin generates this:

....
@Entity(name = "Advogado")
@Table(name = "ADVOGADO")
@Inheritance(strategy = InheritanceType.JOINED)
public class Advogado
....

with maven-jaxb2-plugin and hyperjaxb3-ejb-plugin generates this:

...
@Entity(name = "Advogado")
@Table(name = "ADVOGADO",schema="selodig")
@Inheritance(strategy = InheritanceType.JOINED)
@SequenceGenerator(name = "Generator_ADVOGADO", sequenceName = "seq_advogado")
public class Advogado
...

so, whats happening?

Thanks

@highsource
Copy link
Owner

I would appreciate if questions were asked separately.

First of all, I'm not actively developing this project anymore, be aware of that.

Next, I'd definitely drop the maven-hypejaxb3-plugin. It just configures around maven-jaxb2-plugin, that's not enough added value from my POV. So better stick with maven-jaxb2-plugin/hyperjaxb3-ejb-plugin combo, you have better chances for updates then.

Next, when analyzing Maven problems it's always good to have mvn -X clean install log, both std as well as err.

You report differences between maven-hypejaxb3-plugin and maven-jaxb2-plugin/hyperjaxb3-ejb-plugin combo. I'd prefer not to analyze these for the following reasons:

  • There's actually no point doing this. Assume we'll find out why exactly these differences appear. What next? That won't help to fix the actual problem.
  • As I said maven-hypejaxb3-plugin is actually the same as maven-jaxb2-plugin/hyperjaxb3-ejb-plugin combo, just pre-configured. Differences are possible due to possibly different versions of the used dependencies and/or differences in configs.

Encoding: set project.build.sourceEncoding, see this. Alternatively just set encoding configuration property in maven-jaxb2-plugin (it uses project.build.sourceEncoding by default). I don't know why is this different, I don't see any relevant settings in templates vs. other projects.

Different code generated - I'd first think about different versions but that's hard to tell. Do you actually have a problem with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants