Maven – Getting IntelliJ to import shaded dependencies in a multi-module maven project

intellij-ideamaven

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?

Best Solution

Too bad, after opening a ticket with JetBrains, this problem has been previously reported and is currently not supported in IntelliJ.