wyona / yanel

http://www.yanel.org
Apache License 2.0
10 stars 5 forks source link

Upgrade to MOXy 2.3.0 #2

Closed baszero closed 12 years ago

baszero commented 12 years ago

Request: Yanel currently has a dependency to the JAXB Implementation MOXy v2.1.2, which does not support CDATA element values.

I just successfully tested with version 2.3.0 and the new annotation works great.

So would it be possible that Yanel is upgrading to the new version? Would be awesome! Thanks.

Prepared files, JAR and POM:

https://github.com/baszero/zgmaven/tree/master/snapshots/org/eclipse/persistence/org.eclipse.persistence.antlr/2.3.0 https://github.com/baszero/zgmaven/tree/master/snapshots/org/eclipse/persistence/org.eclipse.persistence.asm/2.3.0 https://github.com/baszero/zgmaven/tree/master/snapshots/org/eclipse/persistence/org.eclipse.persistence.core/2.3.0 https://github.com/baszero/zgmaven/tree/master/snapshots/org/eclipse/persistence/org.eclipse.persistence.moxy/2.3.0

Code examples:

Data Object:

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name=DialogMessage.ROOTNAME, namespace="XYZ")
public class DialogMessage {

    @XmlTransient
    public static final String ROOTNAME = "dialog";

    @XmlElement(name="content-html", namespace="XYZ")
    @XmlCDATA
    private String contentHTML = null;

    public String getContentHTML() {
        return contentHTML;
    }

    public void setContentHTML(String contentHTML) {
        this.contentHTML = contentHTML;
    }

}

in the package folder where the data object is: package-info-java:

@javax.xml.bind.annotation.XmlSchema( 
    namespace = "XYZ", 
    xmlns = {@javax.xml.bind.annotation.XmlNs(prefix = "z", namespaceURI ="XYZ")},  
    elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) 
package com.xyz; 

and the jaxb.properties file to enable MOXy:

javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
michaelwechner commented 12 years ago

Hi Balz

Where did you get the jars from?

Do you think it would make sense to get it from

http://maven.glassfish.org/content/repositories/eclipselink/org/eclipse/persistence/org.eclipse.persistence.core/2.3.0/

Thanks

Michael

michaelwechner commented 12 years ago

It seems that the glassfish repository already has a stable 2.3.2 release available:

http://maven.glassfish.org/content/repositories/eclipselink/org/eclipse/persistence/org.eclipse.persistence.moxy/

Would it make sense to use 2.3.2?

Thanks

michaelwechner commented 12 years ago

I have now added the glassfish repository to

src/build/dependencies.xml

and changed the version to 2.3.0.

Please git pull and give it a try.

Thanks

baszero commented 12 years ago

Hi Michael, I have tested it with 2.3.0, so I would assume that 2.3.2 is certainly also working. You can set 2.3.2 and I will test it as soon as I can.

Thanks!

michaelwechner commented 12 years ago

I have upgraded it now to 2.3.2