<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to load ivy class to class loader on maven plugin</title><link>https://answers.axonivy.com/questions/3163/how-to-load-ivy-class-to-class-loader-on-maven-plugin</link><description>&lt;p&gt;Hi ivyteam&lt;/p&gt;
&lt;p&gt;I'm building a maven plugin to scanning java class in ivy project to generate some business documentation (by reading the annotation in classes). It's seem to work well with java class. &lt;/p&gt;
&lt;p&gt;There is only one problem with some classes which belong to ivy, for example a java class that extends from &lt;code&gt;ch.ivyteam.ivy.scripting.objects.CompositeObject&lt;/code&gt; or a class that references from another class from other ivy project, in maven plugin it could not load those classes like that then throw NoClassDefFoundException, I guess that because &lt;code&gt;CompositeObject&lt;/code&gt; does not available on current class loader yet. &lt;/p&gt;
&lt;p&gt;My question is: How could i resolve those ivy dependencies to load those class? how &lt;code&gt;project-build-plugin&lt;/code&gt; can compile them or is there any solutions?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/3163/how-to-load-ivy-class-to-class-loader-on-maven-plugin" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 03 Apr 2018 04:41:03 -0400</lastBuildDate><item><title>Comment by Reguel Wermelinger on Reguel Wermelinger's answer</title><link>https://answers.axonivy.com/questions/3163/how-to-load-ivy-class-to-class-loader-on-maven-plugin#3172</link><description>&lt;p&gt;Cool that the property works for you. To get the dependencies from the project (iarJars) you could re-use another goal/property. The &lt;code&gt;ivy-test-properties&lt;/code&gt; goal (&lt;a href="https://axonivy.github.io/project-build-plugin/release/7.1/ivy-test-properties-mojo.html)"&gt;https://axonivy.github.io/project-build-plugin/release/7.1/ivy-test-properties-mojo.html)&lt;/a&gt; sets the maven property &lt;code&gt;${ivy.project.iar.classpath}&lt;/code&gt; - it should contain exactly what you are asking for...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Tue, 03 Apr 2018 04:41:03 -0400</pubDate><guid>https://answers.axonivy.com/questions/3163/how-to-load-ivy-class-to-class-loader-on-maven-plugin#3172</guid></item><item><title>Comment by trungdv on Reguel Wermelinger's answer</title><link>https://answers.axonivy.com/questions/3163/how-to-load-ivy-class-to-class-loader-on-maven-plugin#3166</link><description>&lt;p&gt;Thanks &lt;a href="https://answers.axonivy.com/users/17/reguel-wermelinger"&gt;&lt;a href="https://answers.axonivy.com/users/17/reguel-wermelinger"&gt;@Reguel&lt;/a&gt;&lt;/a&gt; Werme... ♦♦
I can load classes now. it works perfectly for all ivy classes. Just need to load more jar file that &lt;code&gt;project-build-plugin&lt;/code&gt; has put to &lt;code&gt;target\ivyBuildApp\iarJars&lt;/code&gt; and now everything is working. Thanks again for your hint.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">trungdv</dc:creator><pubDate>Fri, 30 Mar 2018 05:42:38 -0400</pubDate><guid>https://answers.axonivy.com/questions/3163/how-to-load-ivy-class-to-class-loader-on-maven-plugin#3166</guid></item><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/3163/how-to-load-ivy-class-to-class-loader-on-maven-plugin/3164</link><description>&lt;p&gt;The &lt;code&gt;project-build-plugin&lt;/code&gt; comes with an optional goal that will write the JARs of the axon.ivy engine classpath to a maven property: &lt;a href="https://axonivy.github.io/project-build-plugin/release/7.1/share-engine-core-classpath-mojo.html"&gt;https://axonivy.github.io/project-build-plugin/release/7.1/share-engine-core-classpath-mojo.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Just bind its execution to a phase that runs before your annotation scanning. And then configure the property &lt;code&gt;${ivy.engine.core.classpath}&lt;/code&gt; as additionalClasspath on your annotation scanning plugin.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Thu, 29 Mar 2018 11:28:04 -0400</pubDate><guid>https://answers.axonivy.com/questions/3163/how-to-load-ivy-class-to-class-loader-on-maven-plugin/3164</guid></item></channel></rss>