如何解决如何将依赖项包含到 JAR 文件 (Maven) 中
我已经尝试了在这里遇到的与此主题相关的所有解决方案,但仍然无法找到解决方案。
在 Eclipse (Spring Boot + Maven) 中运行我的项目时,一切运行顺利。我能够从 API 调用中看到一些 JSON 数据。我的目标是在 CloudFoundry 上部署这个项目,但我经常收到 ClassNotFound 错误 (Java)。下面是我的 POM 文件。
我尝试导出为 Runnable JAR 并通过命令行运行该 jar,但我也收到 NoClassFound 错误。
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.intel</groupId>
<artifactId>EDM</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>EDM</name>
<description>EDM Library</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Mentor Dependencies -->
<dependency>
<groupId>com.mentor.datafusion.oi</groupId>
<artifactId>com.mentor.datafusion.oi</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.mentor.dms.ui</groupId>
<artifactId>com.mentor.dms.ui</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.mentor.dms.xml.importexport</groupId>
<artifactId>com.mentor.dms.xml.importexport</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>dfo</groupId>
<artifactId>dfo</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>dfutils</groupId>
<artifactId>dfutils</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.mentor.datafusion.dfo.is3</groupId>
<artifactId>com.mentor.datafusion.dfo.is3</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.mentor.is3.edm.login.api</groupId>
<artifactId>com.mentor.is3.edm.login.api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.mentor.datafusion.dfo.is3.api</groupId>
<artifactId>com.mentor.datafusion.dfo.is3.api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>apache-logging-log4j</groupId>
<artifactId>apache-logging-log4j</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<classifier>spring-boot</classifier>
<mainClass>com.intel.EDM.EdmApplication</mainClass>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。