我的Maven项目遇到困难。当我在Eclipse中编译它时,它可以正常工作,但是当我通过cmd对其进行编译并尝试在其中运行时,我得到一个错误:线程“ main”中的异常java.lang.NoClassDefFoundError:org / apache / commons / io / FileUtils。我的POM文件:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.bootclasspath>C:\Program
Files\Java\jdk1.8.0_211\jre\lib\rt.jar${path.separator}C:\Program
Files\Java\jdk1.8.0_211\jre\lib\jsse.jar${path.separator}C:\Program
Files\Java\jdk1.8.0_211\jre\lib\jce.jar</maven.compiler.bootclasspath>
</properties>
<groupId>si.posta</groupId>
<artifactId>espremnica</artifactId>
<version>1.0.0</version>
<dependencies>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>wsdltoJava</id>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlUrls>
<wsdlUrl>https://tsteportal.posta.si/Services/eSpremnica.Provider/WCF/eOddaja.svc?wsdl</wsdlUrl>
</wsdlUrls>
<vmArgs>
<vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
</vmArgs>
<keep>true</keep>
<packageName>si.posta.espremnica.generated</packageName>
<sourceDestDir>${basedir}/src/main/java/generated</sourceDestDir>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>si.posta.espremnica.client.Client</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
有人可以建议我在哪里出错了,或者我在这里没有包括什么?