You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2022/01/14 21:12:32 UTC

[maven-surefire] 01/01: IntelliJ IDEA can recognize classifiers only if artifacts of project modules have another version

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

tibordigana pushed a commit to branch jira-1972-2
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git

commit 9f28e74121feab9a4974a45c9b2551f68f5e6a2f
Author: Tibor Digaňa <ti...@apache.org>
AuthorDate: Fri Jan 14 21:58:11 2022 +0100

    IntelliJ IDEA can recognize classifiers only if artifacts of project modules have another version
---
 pom.xml                       |  5 +++++
 surefire-shared-utils/pom.xml | 33 ++++++++++++++++++++++++++++++++-
 2 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 0c3bb23..63de6c6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -689,6 +689,11 @@
 
   <profiles>
     <profile>
+        <!-- First, install the project without tests -> mvn install -DskipTests
+        This is a workaround for IntelliJ IDEA, see https://youtrack.jetbrains.com/issue/IDEA-148573
+        IDEA is able to recognize external artifacts with classifiers. But IDEA expects modules and their artifacts
+        without classifier. If the version differs from project, the idea would understand it as external artifact.
+        -->
         <id>ide-development</id>
         <properties>
             <surefire-shared-utils.version>3-SNAPSHOT</surefire-shared-utils.version>
diff --git a/surefire-shared-utils/pom.xml b/surefire-shared-utils/pom.xml
index a068e50..8a301eb 100644
--- a/surefire-shared-utils/pom.xml
+++ b/surefire-shared-utils/pom.xml
@@ -104,5 +104,36 @@
             </plugin>
         </plugins>
     </build>
-
+    <profiles>
+        <profile>
+            <!-- First, install the project without tests -> mvn install -DskipTests
+            This is a workaround for IntelliJ IDEA, see https://youtrack.jetbrains.com/issue/IDEA-148573
+            IDEA is able to recognize external artifacts with classifiers. But IDEA expects modules and their artifacts
+            without classifier. If the version differs from project, the idea would understand it as external artifact.
+            -->
+            <id>ide-development</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-install-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>install-devel-jar</id>
+                                <phase>install</phase>
+                                <goals>
+                                    <goal>install-file</goal>
+                                </goals>
+                                <configuration>
+                                    <artifactId>surefire-shared-utils</artifactId>
+                                    <version>3-SNAPSHOT</version>
+                                    <classifier>shaded</classifier>
+                                    <file>target/${project.build.finalName}-shaded.jar</file>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>