This is a similar question as the one here, which is unfortunately unresolved yet.
If you want to debug the code, here is the GitHub repo.
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.8.5</version>
</dependency>
As I answered here
The default maven plugin doesn't build a fat jar with dependencies.
To build a jar bundled with its dependencies so that we can execute it with java -jar
, we can use maven-assembly-plugin, which packages the jar with the name xxx-jar-with-dependencies.jar
.
Here is a sample pom.xml
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.example.yourMain</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Now you should be able to run your jar with
java -jar xxx-jar-with-dependencies.jar