Tibor17 commented on a change in pull request #443:
URL: https://github.com/apache/maven-surefire/pull/443#discussion_r786201450



##########
File path: surefire-shared-utils/pom.xml
##########
@@ -100,5 +102,35 @@
             </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>

Review comment:
       Because this version is not used in deployment or elsewhere. Basically 
the number also does not matter ;-)
   The only reason why this section is here is the fact that Intellij IDEA and 
maybe Eclipse too, is not able to work with Shaded Jar in module 
`surefire-shared-utils`. So the IDEA is not able to load the shaded jar even if 
Maven attached it to the POM. So  this is only the trick that we can enable 
this profile `ide-development` and identical Jar is loaded by IDEA from local 
repo and then we do not have the red lines in the code. Of course Maven build 
does not need it because Maven can work with shaded and attached Jar. But IDEA 
has this problem, pity.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to