Hi ivyteam

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.

There is only one problem with some classes which belong to ivy, for example a java class that extends from ch.ivyteam.ivy.scripting.objects.CompositeObject 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 CompositeObject does not available on current class loader yet.

My question is: How could i resolve those ivy dependencies to load those class? how project-build-plugin can compile them or is there any solutions?

Thanks

asked 29.03 at 11:01

trungdv's gravatar image

trungdv
450648798
accept rate: 55%


The project-build-plugin comes with an optional goal that will write the JARs of the axon.ivy engine classpath to a maven property: https://axonivy.github.io/project-build-plugin/release/7.1/share-engine-core-classpath-mojo.html

Just bind its execution to a phase that runs before your annotation scanning. And then configure the property ${ivy.engine.core.classpath} as additionalClasspath on your annotation scanning plugin.

link

answered 29.03 at 11:28

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
7.1k11344
accept rate: 70%

edited 29.03 at 11:29

Thanks @Reguel Werme... ♦♦ I can load classes now. it works perfectly for all ivy classes. Just need to load more jar file that project-build-plugin has put to target\ivyBuildApp\iarJars and now everything is working. Thanks again for your hint.

(30.03 at 05:42) trungdv trungdv's gravatar image

Cool that the property works for you. To get the dependencies from the project (iarJars) you could re-use another goal/property. The ivy-test-properties goal (https://axonivy.github.io/project-build-plugin/release/7.1/ivy-test-properties-mojo.html) sets the maven property ${ivy.project.iar.classpath} - it should contain exactly what you are asking for...

(03.04 at 04:41) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×95
×1

Asked: 29.03 at 11:01

Seen: 144 times

Last updated: 03.04 at 04:41