I have two modules, Component and Application. The Component module is shaded due to a dependency conflict (google protocol buffers) later in the build process.
<!-- 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>
The Application depends on the Component module. However, source files in the Application cannot reference the shaded library that the Component depends on. This is critical for interacting with the Component.
<-- snip from Application's pom.xml -->
<dependency>
<groupId>my-group</groupId>
<artifactId>component</artifactId>
<version>${project.version}</version>
</dependency>
Even though the import can't be found by IntelliJ, the Maven build works fine. What am I missing/doing-wrong?
Too bad, after opening a ticket with JetBrains, this problem has been previously reported and is currently not supported in IntelliJ.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With