0

I have a spring boot project which have a model class called Message.java and have a jaxb.properties file in the same package where Message.java is situated. This works fine.

But is there a way where i can place my jaxb.properties file in META-INF or resources folder. I tried placing under /META-INF folder but isn't working.

Placing .properties file in a package consisting of only model classes looks unstructured.

Can anyone suggest on this how to achieve this.

Pramod Rawate
  • 31
  • 1
  • 4
  • Why do you need ad jaxb.properties? Can you show the content? – Simon Martinelli Jun 04 '20 at 08:50
  • I am using jaxb.properties to bind jaxb.properties. The jaxb.properties content is as follow:- **javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory** If i don't use jaxb.proeprties file then the @XMLPath annotation over a java property isn't working. Ex:- I have a java property as shown below: **@XmlPath("FICdtrf/GrpHdr/MsgId/text()")** **String msg_Id;** Then the XML generated without jaxb.properties file will be:- **202** Hence using jaxv.properties will produce XML as follows:- **202** – Pramod Rawate Jun 05 '20 at 05:31
  • I see. It's by convention that the jaxb.properties are in the same place as the corresponding class. You could remove it but then you have to set the class name when doing marshalling or unmarshalling – Simon Martinelli Jun 05 '20 at 05:59

0 Answers0