You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by et...@apache.org on 2021/03/26 17:01:27 UTC

[storm] branch master updated: [STORM-3744] Change pom.xml so that shaded classes are visible within IntelliJ IDE (#3380)

This is an automated email from the ASF dual-hosted git repository.

ethanli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/storm.git


The following commit(s) were added to refs/heads/master by this push:
     new 3b48efc  [STORM-3744] Change pom.xml so that shaded classes are visible within IntelliJ IDE (#3380)
3b48efc is described below

commit 3b48efc15aff240c2dc883d503362d3f20db2692
Author: Bipin Prasad <bi...@yahoo.com>
AuthorDate: Fri Mar 26 11:57:12 2021 -0500

    [STORM-3744] Change pom.xml so that shaded classes are visible within IntelliJ IDE (#3380)
---
 storm-shaded-deps/pom.xml | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/storm-shaded-deps/pom.xml b/storm-shaded-deps/pom.xml
index 186e0fe..af0e752 100644
--- a/storm-shaded-deps/pom.xml
+++ b/storm-shaded-deps/pom.xml
@@ -297,6 +297,43 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-pmd-plugin</artifactId>
             </plugin>
+            <plugin>
+                <!--
+                Purpose of build-helper-maven-plugin is to ensure that IntelliJ sees shaded classes.
+                When navigating over to java classes in storm-client module, the shaded imported classes will
+                show as resolved instead of unknown.
+                The artifact specified below is created when this module (storm-shaded-deps) is built.
+                But is also used to resolve classes in IntelliJ.
+                "phase" is set to "none" - with this setting, the artifact jar will not be uploaded to repo
+                when running standalone "mvn install" command.
+
+                (DO NOT DO THIS) If "phase" is changed to "package"  then standalone "mvn install" command will upload
+                this very same artifact as storm-shaded-deps-${project.version}-optional.jar - which is not desired.
+
+                build-helper-maven-plugin can be removed completely with no effect on the "mvn clean" and "mvn install",
+                which is handled by maven-shade-plugin.
+                -->
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>workaround-makeItVisibleOnIntellij</id>
+                        <phase>none</phase>
+                        <goals>
+                            <goal>attach-artifact</goal>
+                        </goals>
+                        <configuration>
+                            <artifacts>
+                                <artifact>
+                                    <file>${project.build.directory}/${project.build.finalName}.jar</file>
+                                    <type>jar</type>
+                                    <classifier>optional</classifier>
+                                </artifact>
+                            </artifacts>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 </project>