You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/01/17 20:21:11 UTC

[GitHub] [maven-surefire] slawekjaranowski commented on a change in pull request #443: [SUREFIRE-1972] Use current version of surefire-shared-utils

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



##########
File path: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireDependencyResolver.java
##########
@@ -61,20 +62,21 @@
 {
     static final String PROVIDER_GROUP_ID = "org.apache.maven.surefire";
 
-    private static final String[] PROVIDER_CLASSPATH_ORDER = {
-        "surefire-junit3",
-        "surefire-junit4",
-        "surefire-junit47",
-        "surefire-testng",
-        "surefire-junit-platform",
-        "surefire-api",
-        "surefire-logger-api",
-        "surefire-shared-utils",
-        "common-java5",
-        "common-junit3",
-        "common-junit4",
-        "common-junit48",
-        "common-testng-utils"
+    private static final String[][] PROVIDER_CLASSPATH_ORDER = {
+        // groupId, artifactId [, classifier]
+        {"org.apache.maven.surefire", "surefire-junit3"},
+        {"org.apache.maven.surefire", "surefire-junit4"},
+        {"org.apache.maven.surefire", "surefire-junit47"},
+        {"org.apache.maven.surefire", "surefire-testng"},
+        {"org.apache.maven.surefire", "surefire-junit-platform"},
+        {"org.apache.maven.surefire", "surefire-api"},
+        {"org.apache.maven.surefire", "surefire-logger-api"},
+        {"org.apache.maven.surefire", "surefire-shared-utils"},
+        {"org.apache.maven.surefire", "common-java5"},
+        {"org.apache.maven.surefire", "common-junit3"},
+        {"org.apache.maven.surefire", "common-junit4"},
+        {"org.apache.maven.surefire", "common-junit48"},
+        {"org.apache.maven.surefire", "common-testng-utils"}

Review comment:
       Is it related to subject of PR?

##########
File path: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireDependencyResolver.java
##########
@@ -221,13 +223,18 @@ private ArtifactResolutionResult resolveArtifact( Artifact artifact, List<Artifa
     private static Set<Artifact> orderProviderArtifacts( Set<Artifact> providerArtifacts )
     {
         Set<Artifact> orderedProviderArtifacts = new LinkedHashSet<>();
-        for ( String order : PROVIDER_CLASSPATH_ORDER )
+        for ( String[] coordinates : PROVIDER_CLASSPATH_ORDER )
         {
             Iterator<Artifact> providerArtifactsIt = providerArtifacts.iterator();
             while ( providerArtifactsIt.hasNext() )
             {
+                String groupId = coordinates[0];
+                String artifactId = coordinates[1];
+                String classifier = coordinates.length == 3 ? coordinates[2] : null;

Review comment:
       iterate by static `PROVIDER_CLASSPATH_ORDER`, I don't see items with classifier ... 

##########
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:
       I suppose that nobody will not install project with special profile ...
   
   

##########
File path: pom.xml
##########
@@ -687,7 +688,17 @@
   </reporting>
 
   <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>
+        </properties>
+    </profile>

Review comment:
       I suppose that nobody will not install project with special profile ...




-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org