简体   繁体   English

如何在 spring-boot 多模块 Java 11 项目中添加 Spark 依赖

[英]How to add Spark dependencies in spring-boot multi module Java 11 project

Whenever I am adding a module-info.java in my multi-module project I cannot import my Spark dependencies - everything else seems to be working每当我在我的多模块项目中添加 module-info.java 时,我都无法导入我的 Spark 依赖项 - 其他一切似乎都在工作

<dependency>
    <groupId>org.apache.spark</groupId>
    <artifactId>spark-core_2.12</artifactId>
    <version>3.0.0-preview2</version>
</dependency>
<dependency>
    <groupId>org.apache.spark</groupId>
    <artifactId>spark-sql_2.12</artifactId>
    <version>3.0.0-preview2</version>
</dependency>

intellij 导入包截图

IntelliJ tries to readd Maven Dependency without any result. IntelliJ 尝试读取 Maven 依赖项,但没有任何结果。

My module-info looks like:我的模块信息看起来像:

module common {
    exports [...] 
    requires lombok;
    requires spring.data.jpa;
    requires spring.data.commons;
    requires org.apache.commons.lang3;
    requires spring.context;
    requires spring.web;
    requires spring.security.core;
    requires com.google.common;
    requires org.json;
    requires spring.core;
    requires spring.beans;
    requires com.fasterxml.jackson.core;
    requires com.fasterxml.jackson.databind;
    requires spring.jcl;
    requires spring.webmvc;
    requires mongo.java.driver;
    requires org.hibernate.orm.core;
    requires com.fasterxml.jackson.dataformat.csv;
    requires java.sql;
}

It is not possible to add org.apache.* in my module-info.java either.也不可能在我的 module-info.java 中添加 org.apache.*。

Is it possible that Spark is not ready for Jigsaw modules and Java 9+? Spark 是否可能还没有为 Jigsaw 模块和 Java 9+ 做好准备?

Is it possible that spark is not ready for Jigsaw modules and Java 9+? spark 是否有可能没有为 Jigsaw 模块和 Java 9+ 做好准备?

It does hold true for spark .它确实适用于spark Two straight reasons that I can vouch for are:我可以保证的两个直接原因是:

  1. They do not have an entry for他们没有条目

    Automatic-Module-Name: <module-name>

    in the artifact's MANIFEST.MF file.在工件的MANIFEST.MF文件中。

  2. If you try describing their artifacts using the jar tool如果您尝试使用jar工具描述他们的工件

    jar --describe-module --file=<complete-path>/spark-core_2.12-3.0.0-preview2.jar

    This would fail to derive the module descriptor for a similar reason as mentioned in this answer.由于本答案中提到的类似原因,这将无法派生模块描述符


Few resources that might be useful once you reach here:到达此处后可能有用的资源很少:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Proguard混淆多模块spring-boot项目? - How to obfuscate multi-module spring-boot project with proguard? 多模块 spring-boot 项目上的 Surefire - Surefire on multi-module spring-boot project Spring-Boot 多模块项目加载属性文件 - Spring-Boot multi module project load property-file 如何 spring-boot: 在多模块项目的根 pom.xml 上运行 - how to spring-boot:run on root pom.xml from multi-module project 具有同级项目依赖项的多模块Maven Spring启动项目 - Multi module Maven Spring boot Project with sibling project dependencies 具有n级依赖关系的多模块maven spring启动项目 - multi-module maven spring boot project with n levels of dependencies 如何在不改变原有pom的情况下,在新的spring-boot项目中添加spring-boot jar作为依赖 - How to add a spring-boot jar as a dependency in a new spring-boot project without changing the original pom 常用模型和工具的正确位置,用于使用 spring-boot 的多模块 Maven 项目 - Proper location for common models and utils, for multi-module maven project using spring-boot 带弹簧靴的多模块项目 - Multi module project with spring boot 如何在 spring-boot 项目中向 pom.xml 添加非 spring-boot 依赖 - How to add a non-spring-boot dependency to the pom.xml in a spring-boot project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM