[英]Could not find or load main class error when adding maven dependency
I got a Maven project which is exported into a JAR and works fine.我有一个 Maven 项目,它被导出到一个 JAR 中并且工作正常。 As soon as I add Maven dependency (not using any class etc, just imported)一旦我添加了 Maven 依赖项(不使用任何类等,只是导入)
<dependency>
<groupId>technology.tabula</groupId>
<artifactId>tabula</artifactId>
<version>1.0.5</version>
</dependency>
the exported JAR throws the following error:导出的 JAR 会引发以下错误:
Error: Could not find or load main class main.MyMain
Any tips how to solve this problem?任何提示如何解决这个问题? I have to use this Lib, but the error already occurs when it's only imported, not used.我必须使用这个 Lib,但是当它只导入而不使用时就已经发生了错误。
pom.xml pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>my.group</groupId>
<artifactId>my-art</artifactId>
<version>1.0</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>com.dropbox.core</groupId>
<artifactId>dropbox-core-sdk</artifactId>
<version>3.1.5</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.10</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.13.1</version>
</dependency>
<!--<dependency>-->
<!--<groupId>technology.tabula</groupId>-->
<!--<artifactId>tabula</artifactId>-->
<!--<version>1.0.5</version>-->
<!--</dependency>-->
</dependencies>
</project>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.