Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Alex Porras
RE: rjb seems can not load maven related rjb [ reply ]  
2013-01-07 23:13
xiao,

You would have to write some code to parse the pom.xml file and extract the dependency jars, so you can then pass them as part of the classpath to the RJB "load" method. Maybe with Nokogiri?

HTH,

Alex

By: arton Tajima
RE: rjb seems can not load maven related rjb [ reply ]  
2012-12-18 11:35
I have no interest about maven and know nothing.
But I can suggest that you may gather any jars paths using Ruby script prior require rjb or loading rjb.
So you may pass the jars list as rjb::load argument.


By: xiao li
rjb seems can not load maven related rjb [ reply ]  
2012-12-18 07:56
#ruby code
Rjb::load(classpath = '.../../../BasicJLib/target/BasicJLib-1.0-SNAPSHOT.jar', jvmargs=[])
MMail=Rjb::import('com.hulu.ap.basic.util.Mail') #Mail class is implemented on BasicJLib-1.0-SNAPSHOT.jar

#throws exceptions when running
in `import': javax/mail/MessagingException (NoClassDefFoundError)

#trouble shooting
javax/mail is envolved in BasicJLib project's pom file, not in default JRE. Here is a part of BasicJLib project's pom file:
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.4</version>
</dependency>

So, I guess if a java class is not in default JRE, we should import it manually, otherwise it will throw the above exception.

However, in my project, many jars are envolved through maven pom.xml method, not from disk path. If I still want to use maven environment, how can I solve this problem?