I am trying to following this tutorial https://sites.google.com/site/smooksorg/documentation/documentation-smooks-1-1-x/examples/example---edi-to-xml but I am getting in the following error:
[
^]
Failed to locate jar file for EDI Mapping Model URN 'org.milyn.edi.unedifact:d03b-mapping:1.7.1.0'. Jar must be available on classpath.
This is my code snippet:
public class Main {
protected static String runSmooksTransform() throws IOException, SAXException, SmooksException {
Smooks smooks = new Smooks();
smooks.setReaderConfig(new UNEdifactReaderConfigurator("urn:org.milyn.edi.unedifact:d03b-mapping:1.7.1.0"));
try {
StringWriter writer = new StringWriter();
smooks.filterSource(new StreamSource(new FileInputStream("to-xml/apis.txt")), new StreamResult(writer));
return writer.toString();
} finally {
smooks.close();
}
}
public static void main(String[] args) throws IOException, SAXException, SmooksException {
System.out.println("\n\n==============Message In==============");
System.out.println(readInputMessage());
System.out.println("======================================\n");
String messageOut = Main.runSmooksTransform();
System.out.println("==============Message Out=============");
System.out.println(messageOut);
System.out.println("======================================\n\n");
}
private static String readInputMessage() throws IOException {
return StreamUtils.readStreamAsString(new FileInputStream("to-xml/apis.txt"));
}
}
and this is my pom xml file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
="" xsi:schemalocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelversion>4.0.0
<parent>
<groupid>org.milyn
<artifactid>unedifact-examples
<version>1.5-SNAPSHOT
<name>Milyn Smooks Example - UN/EDIFACT - To XML
<artifactid>milyn-smooks-example-unedifact-to-xml
<dependencies>
<dependency>
<groupid>org.milyn
<artifactid>milyn-smooks-edi
<version>1.7.1
<dependency>
<groupid>org.milyn.edi.unedifact
<artifactid>d03b-mapping
<version>1.7.1.0
What I have tried:
What exactly do am I? I don't know where I went wrong? I would be glad if you help.