gitgabrio commented on code in PR #3881:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3881#discussion_r2030922878


##########
kogito-maven-plugin/src/main/java/org/kie/kogito/maven/plugin/util/MojoUtil.java:
##########
@@ -107,6 +107,25 @@ private static KieModuleModel getDependencyKieModel(final 
File jar) throws IOExc
         return null;
     }
 
+    public static boolean hasClassOnClasspath(final MavenProject project, 
String className) {
+        try {
+            Set<Artifact> elements = project.getArtifacts();
+            URL[] urls = new URL[elements.size()];
+
+            int i = 0;
+            for (Artifact artifact : elements) {
+                urls[i] = artifact.getFile().toURI().toURL();
+                i++;
+            }
+            try (URLClassLoader cl = new URLClassLoader(urls)) {

Review Comment:
   @yesamer 
   I was referring to the second part of this method.
   The first part collects all the `Artifact` to `URL[]`, and I agree it is 
maven specific.
   But the second part (ClassloaderInstantiation and load class) it is not, and 
I think it will be used also from Gradle: am I clear ? Does this make sense ?
   My idea is to move as much as possible code to this common library



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to