gpt4 book ai didi

maven - 让 IntelliJ 在多模块 Maven 项目中导入阴影依赖项

转载 作者:行者123 更新时间:2023-12-03 20:41:29 24 4
gpt4 key购买 nike

我有两个模块,组件和应用程序。由于稍后在构建过程中的依赖冲突(谷歌 Protocol Buffer ),组件模块被遮蔽。

<!-- snip from Component's pom.xml -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<relocations>
<relocation>
<pattern>com.google.protobuf</pattern>
<shadedPattern>my.package.protocols.shaded.com.google.protobuf</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>

应用程序依赖于组件模块。但是,Application 中的源文件不能引用 Component 所依赖的着色库。这对于与组件交互至关重要。
     <-- snip from Application's pom.xml -->   
<dependency>
<groupId>my-group</groupId>
<artifactId>component</artifactId>
<version>${project.version}</version>
</dependency>

即使 IntelliJ 找不到导入,Maven 构建工作正常。我错过了什么/做错了什么?

最佳答案

太糟糕了,用JetBrains开票后,这个问题之前已经报过,目前IntelliJ不支持。

  • https://youtrack.jetbrains.com/issue/IDEA-126596
  • https://youtrack.jetbrains.com/issue/IDEA-93855
  • 关于maven - 让 IntelliJ 在多模块 Maven 项目中导入阴影依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30407065/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com